-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fix ffi import external utxo from faucet #3956
fix: fix ffi import external utxo from faucet #3956
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
base_layer/wallet_ffi/src/lib.rs
Outdated
ptr::swap(error_out, &mut error as *mut c_int); | ||
return 0; | ||
} | ||
let mut updated_features = if features.is_null() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong. It should error
base_layer/wallet_ffi/src/lib.rs
Outdated
// On the blockchain, 'V0' of the output features encode and decode without the recovery byte, whereas 'V1' onwards | ||
// adds it in, however, for the wallet, the recovery byte must be consistent with the value commitment to be | ||
// accepted in the wallet irrespective if it is 'V0' or 'V1' | ||
let recovery_byte = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be calculated. It should be imported as provided
base_layer/wallet_ffi/src/lib.rs
Outdated
return 0; | ||
}, | ||
}; | ||
updated_features.set_recovery_byte(recovery_byte); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you change the data here, the hash will change
- Fixed importing external UTXOs via the FFI; changed the philosophy about having inconsistent recovery byte data in the wallet database. - Renamed import UTXO methods to be more descriptive - Added a unit test to test importing external UTXOs via the FFI
2338cbd
to
c1ffe63
Compare
Changed the philosophy about having inconsistent recovery byte data in the wallet database |
Description
Note: The FFI import UTXO method was renamed; this is a breaking change on the FFI interface.
Motivation and Context
See above
How Has This Been Tested?
Added a new unit test that test the import UTXO interface