Conversation
ea66d36 to
443a165
Compare
3c3ebfc to
10c2b54
Compare
tvpeter
left a comment
There was a problem hiding this comment.
Thank you for working on this. Waiting for this PR to update reserves feature on bdk-cli. Thank you.
| let expected = r#"cHNidP8BAH4BAAAAAmw1RvG4UzfnSafpx62EPTyha6VslP0Er7n3TxjEpeBeAAAAAAD/////2johM0znoXIXT1lg+ySrvGrtq1IGXPJzpfi/emkV9iIAAAAAAP////8BUMMAAAAAAAAZdqkUn3/QltN+0sDj9/DPySS+70/862iIrAAAAAAAAQEKAAAAAAAAAAABUQEHAAABAR9QwwAAAAAAABYAFOzlJlcQU9qGRUyeBmd56vnRUC5qIgYDKwVYB4vsOGlKhJM9ZZMD4lddrn6RaFkRRUEVv9ZEh+ME7OUmVwAA"#; | ||
| let expected = r#"cHNidP8BAH4BAAAAAmw1RvG4UzfnSafpx62EPTyha6VslP0Er7n3TxjEpeBeAAAAAAD/////MQvsP2eDTCk3vWfQJ50IOFWLwuTHPsnYikR1hosdK0sAAAAAAP3///8BUMMAAAAAAAAZdqkUn3/QltN+0sDj9/DPySS+70/862iIrAAAAAAAAQEKAAAAAAAAAAABUQEHAAABAR9QwwAAAAAAABYAFOzlJlcQU9qGRUyeBmd56vnRUC5qIgYDKwVYB4vsOGlKhJM9ZZMD4lddrn6RaFkRRUEVv9ZEh+ME7OUmVwAA"#; | ||
|
|
||
| assert_eq!(psbt_b64, expected); |
There was a problem hiding this comment.
This is failing because the Psbt produced is version 2 while the expected Psbt value you supplied is version 1. This is coming from here. Every other data is the same.


|
You should start with Otherwise ACK |
7c55933 to
e4b104d
Compare
|
tACK e4b104d |
|
Looks like you need to take the WASM CI job out for this PR too or you can rebase it after merging #38 is merged. |
|
@notmandatory I rebased on master after merging the other branch. So, everything should be fine. |
There was a problem hiding this comment.
Great job on this pr @ulrichard
Ran all the tests and they pass.

| pub trait ProofOfReserves { | ||
| /// Create a proof for all spendable UTXOs in a wallet | ||
| fn create_proof(&self, message: &str) -> Result<PSBT, ProofError>; | ||
| fn create_proof(&mut self, message: &str) -> Result<Psbt, ProofError>; |
There was a problem hiding this comment.
Running cargo clippy --all-features --all-targets -- -D warnings on newer Clippy versions produces a result_large_err error:
error: the `Err`-variant returned from this function is very large
--> src/reserves.rs:89
|
89 | TxExtraction(ExtractTxError),
| ---------------------------- the largest variant contains at least 192 bytes
This causes performance issues as every Result<T, ProofError> reserves 192+ bytes on the stack, even for successful operations. The error doesn't appear in CI, likely due to using an older Clippy version.
Proposed Solution: Box the large variant:
TxExtraction(Box<ExtractTxError>),| max_block_height: Option<u32>, | ||
| ) -> Result<u64, ProofError>; | ||
| max_block_height: Option<usize>, | ||
| ) -> Result<Amount, ProofError>; |
There was a problem hiding this comment.
Running cargo clippy --all-features --all-targets -- -D warnings on newer Clippy versions produces result_large_err error here likewise
| outpoints: Vec<(OutPoint, TxOut)>, | ||
| ) -> Result<u64, ProofError> { | ||
| let tx = psbt.clone().extract_tx(); | ||
| ) -> Result<Amount, ProofError> { |
There was a problem hiding this comment.
Running cargo clippy --all-features --all-targets -- -D warnings on newer Clippy versions produces result_large_err error here likewise
I adapted the signature counts in the tests to make the tests pass.
In the old version there was a flag remove_partial_sigs in SignOptions.
I removed the test tampered_proof_sighash_tx because the expected error was not thrown, and apparently doesn't exist any more.