def test_in3_config(self): conf_kovan = in3.Config() conf_kovan.chainId = str(in3.Chain.KOVAN) self.in3_client.in3.config(in3_config=conf_kovan) block_kovan = self.in3_client.eth.block_number() conf_main = in3.Config() conf_main.chainId = str(in3.Chain.MAINNET) self.in3_client.in3.config(in3_config=conf_main) block_main = self.in3_client.eth.block_number() self.assertNotEqual(block_kovan, block_main)
def test_reach_kovan(self): kovan_cfg = in3.Config() kovan_cfg.chainId = in3.Chain.KOVAN.value['chain_id'] self.client.in3.config(kovan_cfg) bl = self.client.eth.block_number() self.assertIsNotNone(bl)
def test_reach_goerli(self): goerli_cfg = in3.Config() goerli_cfg.chainId = str(in3.Chain.GOERLI) self.client.in3.config(goerli_cfg) bl = self.client.eth.block_number() self.assertIsNotNone(bl)
def test_reach_kovan_hardcoded(self): kovan_cfg = in3.Config() kovan_cfg.chainId = "0x2a" self.client.in3.config(kovan_cfg) bl = self.client.eth.block_number() self.assertIsNotNone(bl)
def test_reach_kovan_built_in(self): kovan_cfg = in3.Config() kovan_cfg.chainId = str(in3.Chain.KOVAN) self.client.in3.config(kovan_cfg) bl = self.client.eth.block_number() self.assertIsNotNone(bl)
def test_reach_main(self): main_net_cfg = in3.Config() main_net_cfg.chainId = str(in3.Chain.MAINNET) self.client.in3.config(main_net_cfg) nl = self.client.in3.node_list() self.assertIsNotNone(nl) ns = self.client.in3.node_stats() self.assertIsNotNone(ns) bl2 = self.client.eth.block_number() self.assertIsNotNone(bl2)
def setUp(self): conf = in3.Config() conf.chainId = str(in3.Chain.KOVAN) self.in3_client = in3.Client(in3_config=conf)
import in3 import time conf = in3.Config() conf.chainId = str(in3.Chain.KOVAN) eth = in3.Client(in3_config=conf).eth filter = eth.new_block_filter() count = 0 while (count < 10): changes = eth.get_filter_changes(filter) time.sleep(10) print(changes) count += 1 print(">>>")