简体   繁体   中英

Ethereumjs-vm, run-transaction-complete example not printing storage

Running the example mentioned in the title, there is no output after the "---Storage---" line. According to my understanding, there should be a null_radix stored at the created address. (running gives no exceptions) please correct me if I'm wrong!

[update]

At the following part of the example at the runTx function I've noticed that we refresh the createdAddress variable at every transaction even though it doesn't register a new contract. Therefore it leaves us with the loss of our contract's address and the readStorage function won't print any output.

I've fixed it by checking the createdAddress property for null before saving the value.

if (returns.createdAddress) {
  createdAddress = results.createdAddress
  console.log('address created: ' + createdAddress.toString('hex'))
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM