Skip to content

Commit

Permalink
test: add test for estimatesmartfee
Browse files Browse the repository at this point in the history
  • Loading branch information
emjshrx committed Jun 25, 2023
1 parent 890302a commit d1335d3
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions test/node-rpc-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ describe('RPC', function() {
const {genesis} = node.network;
let entry = await node.chain.getEntry(genesis.hash.reverse());

// Get current chain tip and chain height
// Get current chain tip and chain height
const chainHeight = node.chain.tip.height + 1;
const chainTip = util.revHex(node.chain.tip.hash);

Expand Down Expand Up @@ -542,16 +542,25 @@ describe('RPC', function() {
});

describe('utilities', function() {
// 0-in, 2-out
const rawTX1 =
'0100000000024e61bc00000000001976a914fbdd46898a6d70a682cbd34420cc' +
'f0b6bb64493788acf67e4929010000001976a9141b002b6fc0f457bf8d092722' +
'510fce9f37f0423b88ac00000000';


it('should decoderawtransaction', async () => {
// 0-in, 2-out
const rawTX1 =
'0100000000024e61bc00000000001976a914fbdd46898a6d70a682cbd34420cc' +
'f0b6bb64493788acf67e4929010000001976a9141b002b6fc0f457bf8d092722' +
'510fce9f37f0423b88ac00000000';
const result = await nclient.execute('decoderawtransaction', [rawTX1]);
assert.strictEqual(result.vin.length, 0);
assert.strictEqual(result.vout.length, 2);
});

it('should estimate fee rate', async () => {
const result = await nclient.execute('estimatesmartfee', [6]);
assert.deepStrictEqual(result, {
blocks: 6,
feerate: -1,
});
});

});
});

0 comments on commit d1335d3

Please sign in to comment.