Expose latest_checkpoint in Wallet implementation#761
Expose latest_checkpoint in Wallet implementation#761thunderbiscuit merged 1 commit intobitcoindevkit:masterfrom
Conversation
b5d81bf to
ed9a8bf
Compare
|
Not sure if the println added to test |
thunderbiscuit
left a comment
There was a problem hiding this comment.
Looks good! One little comment and I think it's good to go.
| fn from(block_id: BdkBlockId) -> Self { | ||
| BlockId { | ||
| height: block_id.height, | ||
| hash: block_id.hash.to_string(), |
There was a problem hiding this comment.
Here I think you can use the new BlockHash type if you strong-type the hash field in the BlockId type.
There was a problem hiding this comment.
When I attempt to update hash type to BlockHash, I get an error at compile.
the trait uniffi::Lower<UniFfiTag> is not implemented for bitcoin::BlockHash
Assuming BlockHash works, I will need to deal with the other places using hash of BlockId type I have identified just 1 place so far. (FYI)
There was a problem hiding this comment.
Ok it works. Issue was that I did not add the Arc around the BlockHash. My bad!
ed9a8bf to
3cf40d7
Compare
|
I noticed a test is expecting String for BlockHash (hence the failing test even). Its the binding test. I will update it. |
There was a problem hiding this comment.
Just one last little thing!
As for the tests, you can actually remove the blockId variables from the tests. They were intended to test the bindings generation for bitcoin-ffi and bdk-ffi (as per the comments), but now we only use bdk-ffi so you can just keep the network enum and the tests will do what we need them to do. Just to be clear this is what I mean:
// Swift
let network = Network.testnet// Kotlin
val network = Network.TESTNET# Python
class TestBdk(unittest.TestCase):
def test_some_enum(self):
network = Network.TESTNET
if __name__=='__main__':
unittest.main()| fn from(block_id: BdkBlockId) -> Self { | ||
| BlockId { | ||
| height: block_id.height, | ||
| hash: Arc::from(BlockHash(block_id.hash)), |
There was a problem hiding this comment.
I think here you should use Arc::new() instead of Arc::from().
There was a problem hiding this comment.
Yes. I noticed. Thanks!
3cf40d7 to
34aa59f
Compare
Changelog notice
Checklists
All Submissions:
cargo fmtandcargo clippybefore committingNew Features: