Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

chore(repo): Cleanup deadcode. #950

Closed
wants to merge 2 commits into from
Closed
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
26 changes: 0 additions & 26 deletions cosmos/x/evm/types/constants.go

This file was deleted.

5 changes: 5 additions & 0 deletions cosmos/x/evm/types/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
package types

const (
// Module keys.
ModuleName = "evm"
StoreKey = ModuleName

// StateDB keys.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StateDB + data storage/access pattern keys

CodeKeyPrefix byte = iota
BalanceKeyPrefix
StorageKeyPrefix
Expand Down
25 changes: 0 additions & 25 deletions cosmos/x/evm/types/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,6 @@ func NewFromTransaction(tx *coretypes.Transaction) *WrappedEthereumTransaction {
}
}

// GetSigners returns the address(es) that must sign over the transaction.
func (etr *WrappedEthereumTransaction) GetSigners() []sdk.AccAddress {
sender, err := etr.GetSender()
if err != nil {
return nil
}
return []sdk.AccAddress{sdk.AccAddress(sender.Bytes())}
}

// AsTransaction extracts the transaction as an `coretypes.Transaction`.
func (etr *WrappedEthereumTransaction) AsTransaction() *coretypes.Transaction {
tx := new(coretypes.Transaction)
Expand All @@ -86,29 +77,13 @@ func (etr *WrappedEthereumTransaction) GetSender() (common.Address, error) {
return signer.Sender(tx)
}

// GetSender extracts the sender address from the signature values using the latest signer for the given chainID.
func (etr *WrappedEthereumTransaction) GetPubKey() ([]byte, error) {
tx := etr.AsTransaction()
signer := coretypes.LatestSignerForChainID(tx.ChainId())
return signer.PubKey(tx)
}

// GetSender extracts the sender address from the signature values using the latest signer for the given chainID.
func (etr *WrappedEthereumTransaction) GetSignature() ([]byte, error) {
tx := etr.AsTransaction()
signer := coretypes.LatestSignerForChainID(tx.ChainId())
return signer.Signature(tx)
}

// GetGas returns the gas limit of the transaction.
func (etr *WrappedEthereumTransaction) GetGas() uint64 {
var tx *coretypes.Transaction
if tx = etr.AsTransaction(); tx == nil {
return 0
}
return tx.Gas()
}

// GetGasPrice returns the gas price of the transaction.
func (etr *WrappedEthereumTransaction) ValidateBasic() error {
// Ensure the transaction is signed properly
Expand Down
8 changes: 0 additions & 8 deletions cosmos/x/evm/types/tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ package types_test
import (
"math/big"

sdk "github.com/cosmos/cosmos-sdk/types"

"pkg.berachain.dev/polaris/cosmos/x/evm/types"
coretypes "pkg.berachain.dev/polaris/eth/core/types"
"pkg.berachain.dev/polaris/eth/crypto"
Expand Down Expand Up @@ -58,9 +56,6 @@ var _ = Describe("WrappedEthereumTransaction", func() {

It("should return the correct signer", func() {
Expect(etr.GetSender()).To(Equal(address))
Expect(etr.GetSigners()).To(Equal([]sdk.AccAddress{address.Bytes()}))
_, err := etr.GetSignature()
Expect(err).ToNot(HaveOccurred())
})
})

Expand All @@ -82,9 +77,6 @@ var _ = Describe("WrappedEthereumTransaction", func() {

It("should return the correct signer", func() {
Expect(etr.GetSender()).To(Equal(address))
Expect(etr.GetSigners()).To(Equal([]sdk.AccAddress{address.Bytes()}))
_, err := etr.GetSignature()
Expect(err).ToNot(HaveOccurred())
})
})
})
Loading