Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nits #52

Merged
merged 3 commits into from
Mar 11, 2022
Merged

Nits #52

Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
"time"

"github.com/ava-labs/subnet-evm/eth"
"github.com/ava-labs/subnet-evm/vmerrs"

"github.com/ava-labs/subnet-evm/accounts/abi"
"github.com/ava-labs/subnet-evm/accounts/abi/bind"
Expand Down Expand Up @@ -604,7 +605,7 @@ func (b *SimulatedBackend) EstimateGas(ctx context.Context, call interfaces.Call
return 0, err
}
if failed {
if result != nil && result.Err != vm.ErrOutOfGas {
if result != nil && result.Err != vmerrs.ErrOutOfGas {
if len(result.Revert()) > 0 {
return 0, newRevertError(result)
}
Expand Down
5 changes: 3 additions & 2 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
"github.com/ava-labs/subnet-evm/core/types"
"github.com/ava-labs/subnet-evm/core/vm"
"github.com/ava-labs/subnet-evm/params"
"github.com/ava-labs/subnet-evm/vmerrs"
"github.com/ethereum/go-ethereum/common"
)

Expand Down Expand Up @@ -118,7 +119,7 @@ func (result *ExecutionResult) Return() []byte {
// Revert returns the concrete revert reason if the execution is aborted by `REVERT`
// opcode. Note the reason can be nil if no data supplied with revert opcode.
func (result *ExecutionResult) Revert() []byte {
if result.Err != vm.ErrExecutionReverted {
if result.Err != vmerrs.ErrExecutionReverted {
return nil
}
return common.CopyBytes(result.ReturnData)
Expand Down Expand Up @@ -243,7 +244,7 @@ func (st *StateTransition) preCheck() error {
}
// Make sure the sender is not prohibited
if vm.IsProhibited(st.msg.From()) {
return fmt.Errorf("%w: address %v", vm.ErrAddrProhibited, st.msg.From())
return fmt.Errorf("%w: address %v", vmerrs.ErrAddrProhibited, st.msg.From())
}
}
// Make sure that transaction gasFeeCap is greater than the baseFee (post london)
Expand Down
Loading