Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_estimatefee.py
Show All 22 Lines | def run_test(self): | ||||
diff_relay_fee_node = self.nodes[1] | diff_relay_fee_node = self.nodes[1] | ||||
diff_tx_fee_node = self.nodes[2] | diff_tx_fee_node = self.nodes[2] | ||||
for i in range(5): | for i in range(5): | ||||
self.nodes[0].generate(1) | self.nodes[0].generate(1) | ||||
# estimatefee is 0.00001 by default, regardless of block contents | # estimatefee is 0.00001 by default, regardless of block contents | ||||
assert_equal(default_node.estimatefee(), Decimal('0.00001')) | assert_equal(default_node.estimatefee(), Decimal('0.00001')) | ||||
# estimatefee may be different for nodes that set it in their config | # estimatefee may be different for nodes that set it in their | ||||
# config | |||||
assert_equal(diff_relay_fee_node.estimatefee(), Decimal('0.001')) | assert_equal(diff_relay_fee_node.estimatefee(), Decimal('0.001')) | ||||
# Check the reasonableness of settxfee | # Check the reasonableness of settxfee | ||||
assert_raises_rpc_error(-8, "txfee cannot be less than min relay tx fee", | assert_raises_rpc_error(-8, "txfee cannot be less than min relay tx fee", | ||||
diff_tx_fee_node.settxfee, Decimal('0.000005')) | diff_tx_fee_node.settxfee, Decimal('0.000005')) | ||||
assert_raises_rpc_error(-8, "txfee cannot be less than wallet min fee", | assert_raises_rpc_error(-8, "txfee cannot be less than wallet min fee", | ||||
diff_tx_fee_node.settxfee, Decimal('0.000015')) | diff_tx_fee_node.settxfee, Decimal('0.000015')) | ||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
EstimateFeeTest().main() | EstimateFeeTest().main() |