babylonlabs-io / finality-gadget

Other
4 stars 1 forks source link

bitcoin rpc query and setup btc test infra #3

Open bap2pecs opened 1 month ago

bap2pecs commented 1 month ago

@lesterli cloned issue babylonchain/babylon-finality-gadget#41 on 2024-07-03:

Summary

https://github.com/babylonchain/babylon-da-sdk/pull/39#pullrequestreview-2155202342

Gai: Just wanted to understand the context. Why not use btc client like https://github.com/babylonchain/staking-indexer/blob/51d98f1dbafda2fbbe550599c83331b549d26a6c/btcclient/client.go#L23?

https://github.com/babylonchain/finality-provider/pull/483#discussion_r1667869280

Runchao: besides mocking BTC node, one can also leverage the https://github.com/btcsuite/btcd/tree/master/integration/rpctest package for testing things against an almost real BTC node. But this can be done in the future.

Tasks

  • [x] refactor bitcoin rpc query using this

  • [x] rewrite btc tests to not depend on ankr RPC

  • [x] decide whether we should leverage the rpctest or bitcoind package for testing things against an almost real BTC node. finalise the design with the Babylon team

  • [x] rewrite the tests using the btc test infra

  • [x] add more btcclient tests for some edge cases

  • [ ] remove mock btc client and get rid of mock btc client in FP e2e test

bap2pecs commented 1 month ago

@parketh commented on 2024-07-04:

now updated Bitcoin rpc to use btcclient with this commit