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

EVM State Transfer changes #11

Merged
merged 1 commit into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions plugin/evm/export_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"context"
"errors"
"fmt"
"github.com/ava-labs/coreth/core/vm"

Check failure on line 10 in plugin/evm/export_tx.go

View workflow job for this annotation

GitHub Actions / Lint

File is not `goimports`-ed (goimports)
"math/big"

"github.com/ava-labs/coreth/core/state"
"github.com/ava-labs/coreth/params"

"github.com/ava-labs/avalanchego/chains/atomic"
Expand Down Expand Up @@ -369,7 +369,7 @@
}

// EVMStateTransfer executes the state update from the atomic export transaction
func (utx *UnsignedExportTx) EVMStateTransfer(ctx *snow.Context, state *state.StateDB) error {
func (utx *UnsignedExportTx) EVMStateTransfer(ctx *snow.Context, state vm.StateDB) error {
addrs := map[[20]byte]uint64{}
for _, from := range utx.Ins {
if from.AssetID == ctx.AVAXAssetID {
Expand Down
4 changes: 2 additions & 2 deletions plugin/evm/import_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"context"
"errors"
"fmt"
"github.com/ava-labs/coreth/core/vm"

Check failure on line 10 in plugin/evm/import_tx.go

View workflow job for this annotation

GitHub Actions / Lint

File is not `goimports`-ed (goimports)
"math/big"
"slices"

"github.com/ava-labs/coreth/core/state"
"github.com/ava-labs/coreth/params"

"github.com/ava-labs/avalanchego/chains/atomic"
Expand Down Expand Up @@ -428,7 +428,7 @@

// EVMStateTransfer performs the state transfer to increase the balances of
// accounts accordingly with the imported EVMOutputs
func (utx *UnsignedImportTx) EVMStateTransfer(ctx *snow.Context, state *state.StateDB) error {
func (utx *UnsignedImportTx) EVMStateTransfer(ctx *snow.Context, state vm.StateDB) error {
for _, to := range utx.Outs {
if to.AssetID == ctx.AVAXAssetID {
log.Debug("crosschain", "src", utx.SourceChain, "addr", to.Address, "amount", to.Amount, "assetID", "AVAX")
Expand Down
4 changes: 2 additions & 2 deletions plugin/evm/test_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package evm

import (
"github.com/ava-labs/coreth/core/vm"

Check failure on line 7 in plugin/evm/test_tx.go

View workflow job for this annotation

GitHub Actions / Lint

File is not `goimports`-ed (goimports)
"math/big"
"math/rand"

Expand All @@ -16,7 +17,6 @@
"github.com/ava-labs/avalanchego/snow"
"github.com/ava-labs/avalanchego/utils/set"
"github.com/ava-labs/avalanchego/utils/wrappers"
"github.com/ava-labs/coreth/core/state"
"github.com/ava-labs/coreth/params"
)

Expand Down Expand Up @@ -71,7 +71,7 @@
}

// EVMStateTransfer implements the UnsignedAtomicTx interface
func (t *TestUnsignedTx) EVMStateTransfer(ctx *snow.Context, state *state.StateDB) error {
func (t *TestUnsignedTx) EVMStateTransfer(ctx *snow.Context, state vm.StateDB) error {
return t.EVMStateTransferV
}

Expand Down
4 changes: 2 additions & 2 deletions plugin/evm/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (
"bytes"
"errors"
"fmt"
"github.com/ava-labs/coreth/core/vm"
"math/big"
"sort"

"github.com/ethereum/go-ethereum/common"

"github.com/ava-labs/coreth/core/state"
"github.com/ava-labs/coreth/params"

"github.com/ava-labs/avalanchego/chains/atomic"
Expand Down Expand Up @@ -130,7 +130,7 @@ type UnsignedAtomicTx interface {
// The set of atomic requests must be returned in a consistent order.
AtomicOps() (ids.ID, *atomic.Requests, error)

EVMStateTransfer(ctx *snow.Context, state *state.StateDB) error
EVMStateTransfer(ctx *snow.Context, state vm.StateDB) error
}

// Tx is a signed transaction
Expand Down
Loading