session_id = int(session_content[0]) from uiputils.ethtools import AbiEncoder import random testnumber = random.randint(0, 100) tx = JsonRPC.eth_send_transaction({ 'from': dapp_x.info['http://127.0.0.1:8545']['address'], 'to': "0x7c7b26fa65e091f7b9f23db77ad5f714f1dae5ea", "data": "0x67eb4a3c" + AbiEncoder.encodes([testnumber], ['uint']), "gas": hex(7999999) }) dapp_x.unlockself('http://127.0.0.1:8545') console_logger.info('genuineValue set: {0}\n response: {1}'.format( testnumber, JsonRPC.send(tx, HTTP_HEADER, 'http://127.0.0.1:8545'))) for idx, [u, v] in enumerate(user_table): # assert tx_intent is on ISC # Part_A # inited ############################################################################################## # compute on_chain_tx tx = tx_intents.intents[idx].jsonize() console_logger.info( 'on chain transaction computed index: {0}, content: {1}'.format( idx, tx)) # compute attestation
# beiyong 0x92a875bff412aea7fab74daa1cba3f7b94415ac9 # beiyong 0x211939ec400c7391d45e97f4b547e0dbfb8905ee nsb_addr = Web3.toChecksumAddress("0x15055c5173c91957ea49552bdee55487e3c2ac43") # ("0x076122c56613fc1e3ae97d715ca7cb6a35a934c6") nsb_abi_dir = '../contract/solidity/nsb/nsb.abi' nsb_bytecode_dir = '../contract/solidity/nsb/nsb.bin' nsb_db_dir = "../nsb/actiondata" tx = { "from": Web3.toChecksumAddress(baser.info['http://127.0.0.1:8545']['address']), "gas": hex(400000) } if __name__ == '__main__': baser.unlockself() nsbt = EthNetStatusBlockchain( baser.info['http://127.0.0.1:8545']['address'], 'http://127.0.0.1:8545', nsb_addr, nsb_abi_dir, "", tx, nsb_bytecode_dir=nsb_bytecode_dir) nsb = nsbt.handle print(nsb.funcs()) handle = ServiceStart.startweb3('http://127.0.0.1:8545') print( HexBytes(handle.eth.getStorageAt(nsb_addr, slicelocation(10, 0, 1))).hex()) # print(nsb.funct('getOwner', tx))