def test_set_value(v=119000): call('testSetValue', (v,)) n = eosapi.N('evm') itr = rodb.find_i256(n, n, n, 0) assert itr >= 0 value = rodb.get_i256(itr) print(value) assert value == v
def test_call(): src_file = 'callee.sol' main_class = '<stdin>:Callee' account = 'callee' if not eosapi.get_account(account): print('account not exist, create it.') r = eosapi.create_account2('eosio', account, initeos.key1, initeos.key2) assert r abs_src_file = os.path.join(os.path.dirname(__file__), src_file) last_update = eosapi.get_code_update_time_ms(account) modify_time = os.path.getmtime(abs_src_file)*1000 if last_update < modify_time: contract_abi, bin = compile(src_file, main_class) deploy(account, bin) call('testCall', ('0x00000000000000000000000041a3152800000000', 120)) n = eosapi.N(account) itr = rodb.find_i256(n, n, n, 0) assert itr >= 0 assert rodb.get_i256(itr) == 120