You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
718 B
24 lines
718 B
11 years ago
|
var assert = require('assert')
|
||
|
var networks = require('../src/networks')
|
||
|
var Transaction = require('../src/transaction')
|
||
|
|
||
|
var fixtureTxes = require('./fixtures/mainnet_tx')
|
||
|
var fixtureTx1Hex = fixtureTxes.prevTx
|
||
|
var fixtureTxBigHex = fixtureTxes.bigTx
|
||
|
|
||
|
describe('bitcoin', function() {
|
||
|
describe('estimateFee', function() {
|
||
|
var estimateFee = networks.bitcoin.estimateFee
|
||
|
|
||
|
it('works for fixture tx 1', function() {
|
||
|
var tx = Transaction.fromHex(fixtureTx1Hex)
|
||
|
assert.equal(estimateFee(tx.toBuffer().length), 10000)
|
||
|
})
|
||
|
|
||
|
it('works for fixture big tx', function() {
|
||
|
var tx = Transaction.fromHex(fixtureTxBigHex)
|
||
|
assert.equal(estimateFee(tx.toBuffer().length), 30000)
|
||
|
})
|
||
|
})
|
||
|
})
|