Skip to content

Commit

Permalink
test: test estimatefee rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
ismaelsadeeq committed Nov 11, 2024
1 parent af2b328 commit defbe13
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/functional/rpc_estimatefee.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ def run_test(self):
# missing required params
assert_raises_rpc_error(-1, "estimatesmartfee", self.nodes[0].estimatesmartfee)
assert_raises_rpc_error(-1, "estimaterawfee", self.nodes[0].estimaterawfee)
assert_raises_rpc_error(-1, "estimatefee", self.nodes[0].estimatefee)

# wrong type for conf_target
assert_raises_rpc_error(-3, "JSON value of type string is not of expected type number", self.nodes[0].estimatesmartfee, 'foo')
assert_raises_rpc_error(-3, "JSON value of type string is not of expected type number", self.nodes[0].estimaterawfee, 'foo')
assert_raises_rpc_error(-3, "JSON value of type string is not of expected type number", self.nodes[0].estimatefee, 'foo')

# wrong type for estimatesmartfee(estimate_mode)
assert_raises_rpc_error(-3, "JSON value of type number is not of expected type string", self.nodes[0].estimatesmartfee, 1, 1)
Expand All @@ -35,6 +37,7 @@ def run_test(self):
# extra params
assert_raises_rpc_error(-1, "estimatesmartfee", self.nodes[0].estimatesmartfee, 1, 'ECONOMICAL', 1)
assert_raises_rpc_error(-1, "estimaterawfee", self.nodes[0].estimaterawfee, 1, 1, 1)
assert_raises_rpc_error(-1, "estimatefee", self.nodes[0].estimatefee, 1, 1)

# max value of 1008 per src/policy/fees.h
assert_raises_rpc_error(-8, "Invalid conf_target, must be between 1 and 1008", self.nodes[0].estimaterawfee, 1009)
Expand All @@ -50,6 +53,8 @@ def run_test(self):
self.nodes[0].estimaterawfee(1, None)
self.nodes[0].estimaterawfee(1, 1)

self.nodes[0].estimatefee(1)


if __name__ == '__main__':
EstimateFeeTest(__file__).main()

0 comments on commit defbe13

Please sign in to comment.