From 45ca79cf46327054a84c5bed38705c58e1e1bc22 Mon Sep 17 00:00:00 2001 From: lash Date: Thu, 8 Jun 2023 16:55:48 +0100 Subject: [PATCH] Add seal set part of interface test --- python/eth_seal/unittest/interface.py | 20 +++++++++++++++++++- python/setup.cfg | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/python/eth_seal/unittest/interface.py b/python/eth_seal/unittest/interface.py index 29809ea..64d90ba 100644 --- a/python/eth_seal/unittest/interface.py +++ b/python/eth_seal/unittest/interface.py @@ -12,10 +12,28 @@ class TestEthSealInterface: self.max_seal_state = 0 - def test_supply(self): + def test_default_seal(self): if self.max_seal_state == 0: return c = EthSeal(self.chain_spec) o = c.max_seal_state(self.address, sender_address=self.accounts[0]) r = self.rpc.do(o) self.assertEqual(self.max_seal_state, int(r, 16)) + + + def test_seal_set(self): + if self.set_method == None: + return + if self.max_seal_state == 0: + return + + (tx_hash, o) = self.set_method(self.contracts['seal'], self.accounts[0], self.max_seal_state) + self.rpc.do(o) + o = receipt(tx_hash) + r = self.rpc.do(o) + self.assertEqual(r['status'], 1) + + c = EthSeal(self.chain_spec) + o = c.max_seal_state(self.address, sender_address=self.accounts[0]) + r = self.rpc.do(o) + self.assertEqual(self.max_seal_state, int(r, 16)) diff --git a/python/setup.cfg b/python/setup.cfg index 2afb6d0..a57e151 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = cic-contracts -version = 0.3.5 +version = 0.3.6 description = CIC network smart contract interfaces author = Louis Holbrook author_email = dev@holbrook.no