diff --git a/cosmos/x/evm/types/constants.go b/cosmos/x/evm/types/constants.go deleted file mode 100644 index 9eb9c2cde..000000000 --- a/cosmos/x/evm/types/constants.go +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -// -// Copyright (C) 2023, Berachain Foundation. All rights reserved. -// Use of this software is govered by the Business Source License included -// in the LICENSE file of this repository and at www.mariadb.com/bsl11. -// -// ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WILL AUTOMATICALLY -// TERMINATE YOUR RIGHTS UNDER THIS LICENSE FOR THE CURRENT AND ALL OTHER -// VERSIONS OF THE LICENSED WORK. -// -// THIS LICENSE DOES NOT GRANT YOU ANY RIGHT IN ANY TRADEMARK OR LOGO OF -// LICENSOR OR ITS AFFILIATES (PROVIDED THAT YOU MAY USE A TRADEMARK OR LOGO OF -// LICENSOR AS EXPRESSLY REQUIRED BY THIS LICENSE). -// -// TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON -// AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, -// EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND -// TITLE. - -package types - -const ( - StoreKey = "evm" - ModuleName = "evm" -) diff --git a/cosmos/x/evm/types/keys.go b/cosmos/x/evm/types/keys.go index 9c593119d..2e6e693d8 100644 --- a/cosmos/x/evm/types/keys.go +++ b/cosmos/x/evm/types/keys.go @@ -21,6 +21,11 @@ package types const ( + // Module keys. + ModuleName = "evm" + StoreKey = ModuleName + + // StateDB keys. CodeKeyPrefix byte = iota BalanceKeyPrefix StorageKeyPrefix diff --git a/cosmos/x/evm/types/tx.go b/cosmos/x/evm/types/tx.go index 4976fc32c..bdc870970 100644 --- a/cosmos/x/evm/types/tx.go +++ b/cosmos/x/evm/types/tx.go @@ -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) @@ -86,13 +77,6 @@ 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() @@ -100,15 +84,6 @@ func (etr *WrappedEthereumTransaction) GetSignature() ([]byte, error) { 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 diff --git a/cosmos/x/evm/types/tx_test.go b/cosmos/x/evm/types/tx_test.go index 13a287aa2..bfaf2906b 100644 --- a/cosmos/x/evm/types/tx_test.go +++ b/cosmos/x/evm/types/tx_test.go @@ -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" @@ -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()) }) }) @@ -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()) }) }) })