cic-internal-integration/apps/cic-eth/tests/test_chainlib.py

52 lines
1000 B
Python
Raw Permalink Normal View History

# standard imports
import logging
# external imports
2021-03-16 15:35:22 +01:00
from chainlib.connection import RPCConnection
from chainlib.eth.gas import (
balance,
price,
)
from chainlib.eth.tx import (
count_pending,
count_confirmed,
)
from chainlib.eth.sign import (
sign_message,
)
logg = logging.getLogger(__name__)
def test_init_eth_tester(
2021-03-16 15:35:22 +01:00
default_chain_spec,
eth_accounts,
init_eth_tester,
2021-03-16 15:35:22 +01:00
eth_rpc,
):
2021-03-16 15:35:22 +01:00
conn = RPCConnection.connect(default_chain_spec, 'default')
o = balance(eth_accounts[0])
conn.do(o)
o = price()
conn.do(o)
2021-03-16 15:35:22 +01:00
o = count_pending(eth_accounts[0])
conn.do(o)
2021-03-16 15:35:22 +01:00
o = count_confirmed(eth_accounts[0])
conn.do(o)
def test_signer(
2021-03-16 15:35:22 +01:00
default_chain_spec,
init_eth_tester,
2021-03-16 15:35:22 +01:00
eth_rpc,
eth_accounts,
):
2021-03-16 15:35:22 +01:00
o = sign_message(eth_accounts[0], '0x2a')
conn = RPCConnection.connect(default_chain_spec, 'signer')
r = conn.do(o)