Skip to content

Latest commit

 

History

History
96 lines (73 loc) · 2.74 KB

wallet-exercises.adoc

File metadata and controls

96 lines (73 loc) · 2.74 KB

Exercises

  1. Modify a wallet RPC

    • ❏ Create a descriptor wallet

    • ❏ Generate coins to yourself

    • ❏ Remove the "dummy" parameter from the getbalance Wallet RPC

    • ❏ Ensure that the rpc_help.py functional test passes (but ignore other test failures), fixing any errors

      Tip
      run test/functional/rpc_help.py to just run a single test
    • ❏ Check that the rpc call getbalance 3 true true passes with the dummy parameter removed

  1. IsMine

    • ❏ Create a descriptor wallet

    • ❏ Generate coins to yourself

    • ❏ Send coins to yourself in a transaction and generate a block to confirm

    • ❏ Modify the wallet’s IsMine() logic to always return false

    • ❏ Generate a new block and try to send coins to yourself in a transaction again

    • Observe the changes

  2. Coin Selection

    • ❏ Create a descriptor wallet

    • ❏ Generate 200 blocks to yourself

    • ❏ Call listunspent and then send a large amount (e.g. 600 BTC) to yourself and observe how many inputs were used

    • ❏ Add a new preferred coin selection algorithm to the wallet that uses all UTXOs in the wallet and optionally remove the other algorithms.

    • ❏ Redo the send and confirm that this time it will select all inputs in the wallet for the transaction

  3. Adding a new RPC

    • ❏ Add a new RPC which when called will simply return to the user a random UTXO from the wallet in the form

      {
        "txid": <txid>,
        "vout": <vout>
      }