Repository navigation
Rename config-helpers to config_helpers_sv2 and remove of unused roles-logic-sv2 - #1812
Conversation
|
Pretty weird, some how unit tests are failing: An additional suffix is getting added. |
|
I'm testing it locally and it happens only if we remove But at the same time there's no real usage of |
Exactly, and there is no use of it |
|
make sure it's covered on (just a reminder, I don't know why the test is failing) |
|
the tests were written for assertions on error messages that are generated with
when when we remove but the tests were written for assertions on error messages that are generated with one potential solution is to adapt the assertions for the error messages: diff --git a/roles/roles-utils/config-helpers/src/coinbase_output/mod.rs b/roles/roles-utils/config-helpers/src/coinbase_output/mod.rs
index a4f72b9b..3a8797be 100644
--- a/roles/roles-utils/config-helpers/src/coinbase_output/mod.rs
+++ b/roles/roles-utils/config-helpers/src/coinbase_output/mod.rs
@@ -187,7 +187,7 @@ mod tests {
CoinbaseOutput::from_descriptor("addr(1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN3)#5v55uzec")
.unwrap_err()
.to_string(),
- "Bitcoin address: base58 error",
+ "Bitcoin address: base58 error: incorrect checksum: base58 checksum 0x6c7615f4 does not match expected 0x6b7615f4",
);
assert_eq!(
CoinbaseOutput::from_descriptor(
@@ -195,14 +195,14 @@ mod tests {
)
.unwrap_err()
.to_string(),
- "Bitcoin address: base58 error",
+ "Bitcoin address: base58 error: decode: invalid base58 character 0x30",
);
// Flagrantly bad stuff -- should probably PR these upstream to rust-miniscript.
assert_eq!(
CoinbaseOutput::from_descriptor("addr()")
.unwrap_err()
.to_string(),
- "Bitcoin address: base58 error",
+ "Bitcoin address: base58 error: too short: base58 decoded data was not long enough, must be at least 4 byte: 0",
);
assert_eq!(
CoinbaseOutput::from_descriptor("addr(It's a mad mad world!?! 🙃)")
@@ -221,7 +221,7 @@ mod tests {
CoinbaseOutput::from_descriptor("addr(It's a mad mad world!?!)#hmeprl29")
.unwrap_err()
.to_string(),
- "Bitcoin address: base58 error",
+ "Bitcoin address: base58 error: decode: invalid base58 character 0x49",
);
assert_eq!(
CoinbaseOutput::from_descriptor("addr(It's a mad mad world!?!)#🙃🙃🙃🙃🙃🙃")
@@ -293,7 +293,7 @@ mod tests {
CoinbaseOutput::from_descriptor("raw(0)")
.unwrap_err()
.to_string(),
- "Decoding hex-formatted script: odd length, failed to create bytes from hex",
+ "Decoding hex-formatted script: odd length, failed to create bytes from hex: odd hex string length 1",
);
assert_eq!(
CoinbaseOutput::from_descriptor("raw(0,1)")another simpler (and more future-proof) approach is to simply not try to assert for error messages we can simply assert that an error ocurred, and adapt the error messages into comments to give context to developers in the future so instead of doing: just do: |
… and update dependencies accordingly.
eb3b7c6 to
6799aef
Compare
Replace brittle error message checks with general error assertions to handle hex-conservative version differences (v0.2.1 vs v0.3.0).
6799aef to
df346c0
Compare
There was a problem hiding this comment.
ACK. This hex stuff was pretty subtle.
Closes #1811