Skip to content

Commit

Permalink
chore: Remove legacystatedb
Browse files Browse the repository at this point in the history
  • Loading branch information
drklee3 committed Apr 17, 2024
1 parent 2518023 commit 27b7bf7
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 1,226 deletions.
29 changes: 0 additions & 29 deletions x/evm/keeper/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/ethereum/go-ethereum/common"
ethermint "github.com/evmos/ethermint/types"
"github.com/evmos/ethermint/x/evm/legacystatedb"
"github.com/evmos/ethermint/x/evm/statedb"
"github.com/evmos/ethermint/x/evm/types"
)
Expand All @@ -51,23 +50,6 @@ func (k *Keeper) GetAccount(ctx sdk.Context, addr common.Address) *statedb.Accou
return acct
}

func (k *Keeper) GetAccountLegacy(ctx sdk.Context, addr common.Address) *legacystatedb.Account {
acct := k.GetAccountWithoutBalance(ctx, addr)
if acct == nil {
return nil
}

bal := k.GetBalance(ctx, addr)

legacyAcct := &legacystatedb.Account{
Nonce: acct.Nonce,
Balance: bal,
CodeHash: acct.CodeHash,
}

return legacyAcct
}

// GetState loads contract state from database, implements `statedb.Keeper` interface.
func (k *Keeper) GetState(ctx sdk.Context, addr common.Address, key common.Hash) common.Hash {
store := prefix.NewStore(ctx.KVStore(k.storeKey), types.AddressStoragePrefix(addr))
Expand Down Expand Up @@ -138,17 +120,6 @@ func (k *Keeper) SetBalance(ctx sdk.Context, addr common.Address, amount *big.In
return nil
}

func (k *Keeper) SetAccountLegacy(ctx sdk.Context, addr common.Address, account legacystatedb.Account) error {
if err := k.SetAccount(ctx, addr, statedb.Account{
Nonce: account.Nonce,
CodeHash: account.CodeHash,
}); err != nil {
return err
}

return k.SetBalance(ctx, addr, account.Balance)
}

// SetAccount updates nonce/balance/codeHash together.
func (k *Keeper) SetAccount(ctx sdk.Context, addr common.Address, account statedb.Account) error {
// update account
Expand Down
118 changes: 0 additions & 118 deletions x/evm/legacystatedb/access_list.go

This file was deleted.

62 changes: 0 additions & 62 deletions x/evm/legacystatedb/config.go

This file was deleted.

48 changes: 0 additions & 48 deletions x/evm/legacystatedb/interfaces.go

This file was deleted.

Loading

0 comments on commit 27b7bf7

Please sign in to comment.