forked from Conflux-Chain/conflux-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtx_replace_test.py
25 lines (19 loc) · 900 Bytes
/
tx_replace_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from test_framework.contracts import ConfluxTestFramework, RpcClient
from test_framework.util import assert_equal, wait_until
import jsonrpcclient
from conflux.config import default_config
from conflux.utils import priv_to_addr
from test_framework.blocktools import encode_hex_0x
class TxReplaceTest(ConfluxTestFramework):
def set_test_params(self):
self.num_nodes = 1
def run_test(self):
self.genesis_key = default_config["GENESIS_PRI_KEY"]
self.genesis_addr = encode_hex_0x(priv_to_addr(self.genesis_key))
self.client = RpcClient(self.nodes[0])
tx = self.client.new_tx(receiver=self.genesis_addr, gas_price=20, nonce=0)
self.client.send_tx(tx, False)
tx2 = self.client.new_tx(receiver=self.genesis_addr, gas_price=21, nonce=0)
self.client.send_tx(tx2, False)
if __name__ == "__main__":
TxReplaceTest().main()