File tree 2 files changed +10
-2
lines changed
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -583,6 +583,14 @@ export default class EEI {
583
583
return this . _state . accountIsEmpty ( address )
584
584
}
585
585
586
+ /**
587
+ * Returns true if account exists in the state trie (it can be empty). Returns false if the account is `null`.
588
+ * @param address - Address of account
589
+ */
590
+ async accountExists ( address : Buffer ) : Promise < boolean > {
591
+ return this . _state . accountExists ( address )
592
+ }
593
+
586
594
private _getReturnCode ( results : EVMResult ) {
587
595
// This preserves the previous logic, but seems to contradict the EEI spec
588
596
// https://github.com/ewasm/design/blob/38eeded28765f3e193e12881ea72a6ab807a3371/eth_interface.md
Original file line number Diff line number Diff line change @@ -676,10 +676,10 @@ export const handlers: { [k: string]: OpHandler } = {
676
676
if ( runState . _common . gteHardfork ( 'spuriousDragon' ) ) {
677
677
// We are at or after Spurious Dragon
678
678
// Call new account gas: account is DEAD and we transfer nonzero value
679
- if ( ( await runState . stateManager . accountIsEmpty ( toAddressBuf ) ) && ! value . isZero ( ) ) {
679
+ if ( ( await runState . eei . isAccountEmpty ( toAddressBuf ) ) && ! value . isZero ( ) ) {
680
680
runState . eei . useGas ( new BN ( runState . _common . param ( 'gasPrices' , 'callNewAccount' ) ) )
681
681
}
682
- } else if ( ! ( await runState . stateManager . accountExists ( toAddressBuf ) ) ) {
682
+ } else if ( ! ( await runState . eei . accountExists ( toAddressBuf ) ) ) {
683
683
// We are before Spurious Dragon and the account does not exist.
684
684
// Call new account gas: account does not exist (it is not in the state trie, not even as an "empty" account)
685
685
runState . eei . useGas ( new BN ( runState . _common . param ( 'gasPrices' , 'callNewAccount' ) ) )
You can’t perform that action at this time.
0 commit comments