all, deps: bump go-ethereum version (#5)

* evm, rpc: access lists, JSON-RPC and transaction updates (wip)

* ante, evm, rpc: update signature verification

* evm: msg server and tests updates

* evm: tests (wip)

* evm: fix cdc and params

* evm: cleanup state transition

* fix nil cases

* lint
This commit is contained in:
Federico Kunze
2021-05-10 12:34:00 -04:00
committed by GitHub
parent 7877ae597c
commit 117342b1b3
45 changed files with 2508 additions and 2196 deletions
+1
View File
@@ -46,6 +46,7 @@ func formatKeyToHash(key string) string {
return ethkey.Hex()
}
// nolint: deadcode
func cosmosAddressFromArg(addr string) (sdk.AccAddress, error) {
if strings.HasPrefix(addr, sdk.GetConfig().GetBech32AccountAddrPrefix()) {
// Check to see if address is Cosmos bech32 formatted
+3 -5
View File
@@ -89,9 +89,7 @@ func getEthTransactionByHash(clientCtx client.Context, hashHex string) ([]byte,
}
height := uint64(tx.Height)
res, err := rpctypes.NewTransaction(ethTx, common.BytesToHash(tx.Tx.Hash()), blockHash, height, uint64(tx.Index))
if err != nil {
return nil, err
}
return json.Marshal(res)
rpcTx := rpctypes.NewTransaction(ethTx.AsTransaction(), blockHash, height, uint64(tx.Index))
return json.Marshal(rpcTx)
}
File diff suppressed because one or more lines are too long
+14 -12
View File
@@ -35,6 +35,7 @@ type EvmTestSuite struct {
handler sdk.Handler
app *app.EthermintApp
codec codec.BinaryMarshaler
chainID *big.Int
privKey *ethsecp256k1.PrivKey
from ethcmn.Address
@@ -48,6 +49,7 @@ func (suite *EvmTestSuite) SetupTest() {
suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{Height: 1, ChainID: "ethermint-888", Time: time.Now().UTC()})
suite.handler = evm.NewHandler(suite.app.EvmKeeper)
suite.codec = suite.app.AppCodec()
suite.chainID = big.NewInt(888)
privKey, err := ethsecp256k1.GenerateKey()
suite.Require().NoError(err)
@@ -78,7 +80,7 @@ func (suite *EvmTestSuite) TestHandleMsgEthereumTx() {
"passed",
func() {
suite.app.EvmKeeper.SetBalance(suite.ctx, suite.from, big.NewInt(100))
tx = types.NewMsgEthereumTx(0, &suite.from, big.NewInt(100), 0, big.NewInt(10000), nil)
tx = types.NewMsgEthereumTx(suite.chainID, 0, &suite.from, big.NewInt(100), 0, big.NewInt(10000), nil, nil)
// parse context chain ID to big.Int
chainID, err := ethermint.ParseChainID(suite.ctx.ChainID())
@@ -93,7 +95,7 @@ func (suite *EvmTestSuite) TestHandleMsgEthereumTx() {
{
"insufficient balance",
func() {
tx = types.NewMsgEthereumTxContract(0, big.NewInt(100), 0, big.NewInt(10000), nil)
tx = types.NewMsgEthereumTxContract(suite.chainID, 0, big.NewInt(100), 0, big.NewInt(10000), nil, nil)
// parse context chain ID to big.Int
chainID, err := ethermint.ParseChainID(suite.ctx.ChainID())
@@ -108,7 +110,7 @@ func (suite *EvmTestSuite) TestHandleMsgEthereumTx() {
{
"tx encoding failed",
func() {
tx = types.NewMsgEthereumTxContract(0, big.NewInt(100), 0, big.NewInt(10000), nil)
tx = types.NewMsgEthereumTxContract(suite.chainID, 0, big.NewInt(100), 0, big.NewInt(10000), nil, nil)
},
false,
},
@@ -122,7 +124,7 @@ func (suite *EvmTestSuite) TestHandleMsgEthereumTx() {
{
"VerifySig failed",
func() {
tx = types.NewMsgEthereumTxContract(0, big.NewInt(100), 0, big.NewInt(10000), nil)
tx = types.NewMsgEthereumTxContract(suite.chainID, 0, big.NewInt(100), 0, big.NewInt(10000), nil, nil)
},
false,
},
@@ -175,7 +177,7 @@ func (suite *EvmTestSuite) TestHandlerLogs() {
suite.Require().NoError(err, "failed to create key")
bytecode := common.FromHex("0x6080604052348015600f57600080fd5b5060117f775a94827b8fd9b519d36cd827093c664f93347070a554f65e4a6f56cd73889860405160405180910390a2603580604b6000396000f3fe6080604052600080fdfea165627a7a723058206cab665f0f557620554bb45adf266708d2bd349b8a4314bdff205ee8440e3c240029")
tx := types.NewMsgEthereumTx(1, nil, big.NewInt(0), gasLimit, gasPrice, bytecode)
tx := types.NewMsgEthereumTx(suite.chainID, 1, nil, big.NewInt(0), gasLimit, gasPrice, bytecode, nil)
err = tx.Sign(big.NewInt(888), priv.ToECDSA())
suite.Require().NoError(err)
@@ -207,7 +209,7 @@ func (suite *EvmTestSuite) TestQueryTxLogs() {
// send contract deployment transaction with an event in the constructor
bytecode := common.FromHex("0x6080604052348015600f57600080fd5b5060117f775a94827b8fd9b519d36cd827093c664f93347070a554f65e4a6f56cd73889860405160405180910390a2603580604b6000396000f3fe6080604052600080fdfea165627a7a723058206cab665f0f557620554bb45adf266708d2bd349b8a4314bdff205ee8440e3c240029")
tx := types.NewMsgEthereumTx(1, nil, big.NewInt(0), gasLimit, gasPrice, bytecode)
tx := types.NewMsgEthereumTx(suite.chainID, 1, nil, big.NewInt(0), gasLimit, gasPrice, bytecode, nil)
err = tx.Sign(big.NewInt(888), priv.ToECDSA())
suite.Require().NoError(err)
@@ -293,7 +295,7 @@ func (suite *EvmTestSuite) TestDeployAndCallContract() {
suite.Require().NoError(err, "failed to create key")
bytecode := common.FromHex("0x608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a73560405160405180910390a36102c4806100dc6000396000f3fe608060405234801561001057600080fd5b5060043610610053576000357c010000000000000000000000000000000000000000000000000000000090048063893d20e814610058578063a6f9dae1146100a2575b600080fd5b6100606100e6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100e4600480360360208110156100b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061010f565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43616c6c6572206973206e6f74206f776e65720000000000000000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a73560405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505056fea265627a7a72315820f397f2733a89198bc7fed0764083694c5b828791f39ebcbc9e414bccef14b48064736f6c63430005100032")
tx := types.NewMsgEthereumTx(1, nil, big.NewInt(0), gasLimit, gasPrice, bytecode)
tx := types.NewMsgEthereumTx(suite.chainID, 1, nil, big.NewInt(0), gasLimit, gasPrice, bytecode, nil)
tx.Sign(big.NewInt(888), priv.ToECDSA())
suite.Require().NoError(err)
@@ -310,7 +312,7 @@ func (suite *EvmTestSuite) TestDeployAndCallContract() {
storeAddr := "0xa6f9dae10000000000000000000000006a82e4a67715c8412a9114fbd2cbaefbc8181424"
bytecode = common.FromHex(storeAddr)
tx = types.NewMsgEthereumTx(2, &receiver, big.NewInt(0), gasLimit, gasPrice, bytecode)
tx = types.NewMsgEthereumTx(suite.chainID, 2, &receiver, big.NewInt(0), gasLimit, gasPrice, bytecode, nil)
tx.Sign(big.NewInt(888), priv.ToECDSA())
suite.Require().NoError(err)
@@ -322,7 +324,7 @@ func (suite *EvmTestSuite) TestDeployAndCallContract() {
// query - getOwner
bytecode = common.FromHex("0x893d20e8")
tx = types.NewMsgEthereumTx(2, &receiver, big.NewInt(0), gasLimit, gasPrice, bytecode)
tx = types.NewMsgEthereumTx(suite.chainID, 2, &receiver, big.NewInt(0), gasLimit, gasPrice, bytecode, nil)
tx.Sign(big.NewInt(888), priv.ToECDSA())
suite.Require().NoError(err)
@@ -347,7 +349,7 @@ func (suite *EvmTestSuite) TestSendTransaction() {
suite.app.EvmKeeper.SetBalance(suite.ctx, ethcrypto.PubkeyToAddress(*pub), big.NewInt(100))
// send simple value transfer with gasLimit=21000
tx := types.NewMsgEthereumTx(1, &ethcmn.Address{0x1}, big.NewInt(1), gasLimit, gasPrice, nil)
tx := types.NewMsgEthereumTx(suite.chainID, 1, &ethcmn.Address{0x1}, big.NewInt(1), gasLimit, gasPrice, nil, nil)
err = tx.Sign(big.NewInt(888), priv.ToECDSA())
suite.Require().NoError(err)
@@ -420,7 +422,7 @@ func (suite *EvmTestSuite) TestOutOfGasWhenDeployContract() {
suite.Require().NoError(err, "failed to create key")
bytecode := common.FromHex("0x608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a73560405160405180910390a36102c4806100dc6000396000f3fe608060405234801561001057600080fd5b5060043610610053576000357c010000000000000000000000000000000000000000000000000000000090048063893d20e814610058578063a6f9dae1146100a2575b600080fd5b6100606100e6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100e4600480360360208110156100b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061010f565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43616c6c6572206973206e6f74206f776e65720000000000000000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a73560405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505056fea265627a7a72315820f397f2733a89198bc7fed0764083694c5b828791f39ebcbc9e414bccef14b48064736f6c63430005100032")
tx := types.NewMsgEthereumTx(1, nil, big.NewInt(0), gasLimit, gasPrice, bytecode)
tx := types.NewMsgEthereumTx(suite.chainID, 1, nil, big.NewInt(0), gasLimit, gasPrice, bytecode, nil)
tx.Sign(big.NewInt(888), priv.ToECDSA())
suite.Require().NoError(err)
@@ -450,7 +452,7 @@ func (suite *EvmTestSuite) TestErrorWhenDeployContract() {
bytecode := common.FromHex("0xa6f9dae10000000000000000000000006a82e4a67715c8412a9114fbd2cbaefbc8181424")
tx := types.NewMsgEthereumTx(1, nil, big.NewInt(0), gasLimit, gasPrice, bytecode)
tx := types.NewMsgEthereumTx(suite.chainID, 1, nil, big.NewInt(0), gasLimit, gasPrice, bytecode, nil)
tx.Sign(big.NewInt(888), priv.ToECDSA())
suite.Require().NoError(err)
+21 -18
View File
@@ -7,9 +7,10 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
sdk "github.com/cosmos/cosmos-sdk/types"
tmtypes "github.com/tendermint/tendermint/types"
sdk "github.com/cosmos/cosmos-sdk/types"
ethcmn "github.com/ethereum/go-ethereum/common"
ethermint "github.com/cosmos/ethermint/types"
@@ -229,7 +230,6 @@ func (k Keeper) TxReceiptsByBlockHeight(c context.Context, req *types.QueryTxRec
// TxReceiptsByBlockHash implements the Query/TxReceiptsByBlockHash gRPC method
func (k Keeper) TxReceiptsByBlockHash(c context.Context, req *types.QueryTxReceiptsByBlockHashRequest) (*types.QueryTxReceiptsByBlockHashResponse, error) {
if req == nil {
return nil, status.Error(codes.InvalidArgument, "empty request")
}
@@ -276,7 +276,6 @@ func (k Keeper) BlockLogs(c context.Context, req *types.QueryBlockLogsRequest) (
// BlockBloom implements the Query/BlockBloom gRPC method
func (k Keeper) BlockBloom(c context.Context, req *types.QueryBlockBloomRequest) (*types.QueryBlockBloomResponse, error) {
if req == nil {
return nil, status.Error(codes.InvalidArgument, "empty request")
}
@@ -302,7 +301,6 @@ func (k Keeper) BlockBloom(c context.Context, req *types.QueryBlockBloomRequest)
// Params implements the Query/Params gRPC method
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
if req == nil {
return nil, status.Error(codes.InvalidArgument, "empty request")
}
@@ -326,7 +324,7 @@ func (k Keeper) StaticCall(c context.Context, req *types.QueryStaticCallRequest)
// parse the chainID from a string to a base-10 integer
chainIDEpoch, err := ethermint.ParseChainID(ctx.ChainID())
if err != nil {
return nil, err
return nil, status.Error(codes.Internal, err.Error())
}
txHash := tmtypes.Tx(ctx.TxBytes()).Hash()
@@ -341,28 +339,33 @@ func (k Keeper) StaticCall(c context.Context, req *types.QueryStaticCallRequest)
so := k.GetOrNewStateObject(ctx, *recipient)
sender := ethcmn.HexToAddress("0xaDd00275E3d9d213654Ce5223f0FADE8b106b707")
msg := types.NewMsgEthereumTx(
chainIDEpoch, so.Nonce(), recipient, big.NewInt(0), 100000000, big.NewInt(0), req.Input, nil,
)
msg.From = sender.Hex()
ethMsg, err := msg.AsMessage()
if err != nil {
return nil, status.Error(codes.Internal, err.Error())
}
st := &types.StateTransition{
AccountNonce: so.Nonce(),
Price: new(big.Int).SetBytes(big.NewInt(0).Bytes()),
GasLimit: 100000000,
Recipient: recipient,
Amount: new(big.Int).SetBytes(big.NewInt(0).Bytes()),
Payload: req.Input,
Csdb: k.CommitStateDB.WithContext(ctx),
ChainID: chainIDEpoch,
TxHash: &ethHash,
Sender: sender,
Simulate: ctx.IsCheckTx(),
Message: ethMsg,
Csdb: k.CommitStateDB.WithContext(ctx),
ChainID: chainIDEpoch,
TxHash: &ethHash,
Simulate: ctx.IsCheckTx(),
}
config, found := k.GetChainConfig(ctx)
if !found {
return nil, types.ErrChainConfigNotFound
return nil, status.Error(codes.Internal, types.ErrChainConfigNotFound.Error())
}
ret, err := st.StaticCall(ctx, config)
if err != nil {
return nil, err
return nil, status.Error(codes.Internal, err.Error())
}
return &types.QueryStaticCallResponse{Data: ret}, nil
+22 -237
View File
@@ -2,17 +2,16 @@ package keeper
import (
"context"
"math/big"
"errors"
"github.com/pkg/errors"
log "github.com/xlab/suplog"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/ethereum/go-ethereum/common"
ethcmn "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/vm"
tmtypes "github.com/tendermint/tendermint/types"
ethermint "github.com/cosmos/ethermint/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/ethermint/x/evm/types"
)
@@ -21,50 +20,29 @@ var _ types.MsgServer = &Keeper{}
func (k *Keeper) EthereumTx(goCtx context.Context, msg *types.MsgEthereumTx) (*types.MsgEthereumTxResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
// parse the chainID from a string to a base-10 integer
chainIDEpoch, err := ethermint.ParseChainID(ctx.ChainID())
ethMsg, err := msg.AsMessage()
if err != nil {
return nil, err
return nil, sdkerrors.Wrap(sdkerrors.ErrorInvalidSigner, err.Error())
}
// Verify signature and retrieve sender address
var homesteadErr error
sender, eip155Err := msg.VerifySig(chainIDEpoch)
if eip155Err != nil {
sender, homesteadErr = msg.VerifySigHomestead()
if homesteadErr != nil {
log.WithFields(log.Fields{
"eip155_err": eip155Err.Error(),
"homestead_err": homesteadErr.Error(),
}).Warningln("failed to verify signatures with EIP155 and Homestead signers")
return nil, errors.New("no valid signatures")
}
config, found := k.GetChainConfig(ctx)
if !found {
return nil, types.ErrChainConfigNotFound
}
sender := ethMsg.From()
txHash := tmtypes.Tx(ctx.TxBytes()).Hash()
ethHash := ethcmn.BytesToHash(txHash)
blockHash, _ := k.GetBlockHashFromHeight(ctx, ctx.BlockHeight())
ethBlockHash := ethcmn.BytesToHash(blockHash)
var recipient *ethcmn.Address
if len(msg.Data.Recipient) > 0 {
addr := ethcmn.BytesToAddress(msg.Data.Recipient)
recipient = &addr
}
st := &types.StateTransition{
AccountNonce: msg.Data.AccountNonce,
Price: new(big.Int).SetBytes(msg.Data.Price),
GasLimit: msg.Data.GasLimit,
Recipient: recipient,
Amount: new(big.Int).SetBytes(msg.Data.Amount),
Payload: msg.Data.Payload,
Csdb: k.CommitStateDB.WithContext(ctx),
ChainID: chainIDEpoch,
TxHash: &ethHash,
Sender: sender,
Simulate: ctx.IsCheckTx(),
Message: ethMsg,
Csdb: k.CommitStateDB.WithContext(ctx),
ChainID: msg.ChainID(),
TxHash: &ethHash,
Simulate: ctx.IsCheckTx(),
}
// since the txCount is used by the stateDB, and a simulated tx is run only on the node it's submitted to,
@@ -76,14 +54,9 @@ func (k *Keeper) EthereumTx(goCtx context.Context, msg *types.MsgEthereumTx) (*t
k.TxCount++
}
config, found := k.GetChainConfig(ctx)
if !found {
return nil, types.ErrChainConfigNotFound
}
executionResult, err := st.TransitionDb(ctx, config)
if err != nil {
if err.Error() == "execution reverted" && executionResult != nil {
if errors.Is(err, vm.ErrExecutionReverted) && executionResult != nil {
// keep the execution result for revert reason
executionResult.Response.Reverted = true
@@ -150,7 +123,7 @@ func (k *Keeper) EthereumTx(goCtx context.Context, msg *types.MsgEthereumTx) (*t
ctx.EventManager().EmitEvents(sdk.Events{
sdk.NewEvent(
types.EventTypeEthereumTx,
sdk.NewAttribute(sdk.AttributeKeyAmount, st.Amount.String()),
sdk.NewAttribute(sdk.AttributeKeyAmount, st.Message.Value().String()),
sdk.NewAttribute(types.AttributeKeyTxHash, ethcmn.BytesToHash(txHash).Hex()),
),
sdk.NewEvent(
@@ -160,196 +133,8 @@ func (k *Keeper) EthereumTx(goCtx context.Context, msg *types.MsgEthereumTx) (*t
),
})
if len(msg.Data.Recipient) > 0 {
ethAddr := ethcmn.BytesToAddress(msg.Data.Recipient)
ctx.EventManager().EmitEvent(
sdk.NewEvent(
types.EventTypeEthereumTx,
sdk.NewAttribute(types.AttributeKeyRecipient, ethAddr.Hex()),
),
)
}
return executionResult.Response, nil
}
func (k *Keeper) SendInternalEthereumTx(
ctx sdk.Context,
payload []byte,
senderAddress common.Address,
recipientAddress common.Address,
) (*types.MsgEthereumTxResponse, error) {
accAddress := sdk.AccAddress(senderAddress.Bytes())
acc := k.accountKeeper.GetAccount(ctx, accAddress)
if acc == nil {
acc = k.accountKeeper.NewAccountWithAddress(ctx, accAddress)
k.accountKeeper.SetAccount(ctx, acc)
}
ethAccount, ok := acc.(*ethermint.EthAccount)
if !ok {
return nil, errors.New("could not cast account to EthAccount")
}
if err := ethAccount.SetSequence(ethAccount.GetSequence() + 1); err != nil {
return nil, errors.New("failed to set acc sequence")
}
k.accountKeeper.SetAccount(ctx, ethAccount)
res, err := k.InternalEthereumTx(sdk.WrapSDKContext(ctx), senderAddress, &types.TxData{
AccountNonce: ethAccount.GetSequence(),
Recipient: recipientAddress.Bytes(),
Amount: big.NewInt(0).Bytes(),
Price: big.NewInt(0).Bytes(),
GasLimit: 10000000, // TODO: don't hardcode, maybe set a limit?
Payload: payload,
})
if err != nil {
err = errors.Wrapf(err, "failed to execute InternalEthereumTx at contract %s", recipientAddress.Hex())
return nil, err
}
return res, nil
}
func (k *Keeper) InternalEthereumTx(
goCtx context.Context,
sender common.Address,
tx *types.TxData,
) (*types.MsgEthereumTxResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
// parse the chainID from a string to a base-10 integer
chainIDEpoch, err := ethermint.ParseChainID(ctx.ChainID())
if err != nil {
return nil, err
}
// true Ethereum tx hash based on its data
ethHash := (&types.MsgEthereumTx{
Data: tx,
}).RLPSignBytes(chainIDEpoch)
var recipient *ethcmn.Address
if len(tx.Recipient) > 0 {
addr := ethcmn.BytesToAddress(tx.Recipient)
recipient = &addr
}
st := &types.StateTransition{
AccountNonce: tx.AccountNonce,
Price: new(big.Int).SetBytes(tx.Price),
GasLimit: tx.GasLimit,
Recipient: recipient,
Amount: new(big.Int).SetBytes(tx.Amount),
Payload: tx.Payload,
Csdb: k.CommitStateDB.WithContext(ctx),
ChainID: chainIDEpoch,
TxHash: &ethHash,
Sender: sender,
Simulate: ctx.IsCheckTx(),
}
// since the txCount is used by the stateDB, and a simulated tx is run only on the node it's submitted to,
// then this will cause the txCount/stateDB of the node that ran the simulated tx to be different than the
// other nodes, causing a consensus error
if !st.Simulate {
// Prepare db for logs
hash, _ := k.GetBlockHashFromHeight(ctx, ctx.BlockHeight())
k.Prepare(ctx, ethHash, ethcmn.BytesToHash(hash), k.TxCount)
k.TxCount++
}
config, found := k.GetChainConfig(ctx)
if !found {
return nil, types.ErrChainConfigNotFound
}
executionResult, err := st.TransitionDb(ctx, config)
if err != nil {
if err.Error() == "execution reverted" && executionResult != nil {
// keep the execution result for revert reason
executionResult.Response.Reverted = true
if !st.Simulate {
blockHash, _ := k.GetBlockHashFromHeight(ctx, ctx.BlockHeight())
k.SetTxReceiptToHash(ctx, ethHash, &types.TxReceipt{
Hash: ethHash.Bytes(),
From: sender.Bytes(),
Data: tx,
BlockHeight: uint64(ctx.BlockHeight()),
BlockHash: blockHash,
Result: &types.TxResult{
ContractAddress: executionResult.Response.ContractAddress,
Bloom: executionResult.Response.Bloom,
TxLogs: executionResult.Response.TxLogs,
Ret: executionResult.Response.Ret,
Reverted: executionResult.Response.Reverted,
GasUsed: executionResult.GasInfo.GasConsumed,
},
})
}
return executionResult.Response, err
}
return nil, err
}
blockHash, _ := k.GetBlockHashFromHeight(ctx, ctx.BlockHeight())
k.SetTxReceiptToHash(ctx, ethHash, &types.TxReceipt{
Hash: ethHash.Bytes(),
From: sender.Bytes(),
Data: tx,
Index: uint64(st.Csdb.TxIndex()),
BlockHeight: uint64(ctx.BlockHeight()),
BlockHash: blockHash,
Result: &types.TxResult{
ContractAddress: executionResult.Response.ContractAddress,
Bloom: executionResult.Response.Bloom,
TxLogs: executionResult.Response.TxLogs,
Ret: executionResult.Response.Ret,
Reverted: executionResult.Response.Reverted,
GasUsed: executionResult.GasInfo.GasConsumed,
},
})
k.AddTxHashToBlock(ctx, ctx.BlockHeight(), ethHash)
if !st.Simulate {
// update block bloom filter
k.Bloom.Or(k.Bloom, executionResult.Bloom)
// update transaction logs in KVStore
err = k.SetLogs(ctx, ethHash, executionResult.Logs)
if err != nil {
panic(err)
}
for _, ethLog := range executionResult.Logs {
k.LogsCache[ethLog.Address] = append(k.LogsCache[ethLog.Address], ethLog)
}
}
// emit events
ctx.EventManager().EmitEvents(sdk.Events{
sdk.NewEvent(
types.EventTypeEthereumTx,
sdk.NewAttribute(sdk.AttributeKeyAmount, st.Amount.String()),
sdk.NewAttribute(types.AttributeKeyTxHash, ethHash.Hex()),
),
sdk.NewEvent(
sdk.EventTypeMessage,
sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory),
sdk.NewAttribute(sdk.AttributeKeySender, sender.String()),
),
})
if len(tx.Recipient) > 0 {
ethAddr := ethcmn.BytesToAddress(tx.Recipient)
if len(msg.Data.To) > 0 {
ethAddr := ethcmn.BytesToAddress(msg.Data.To)
ctx.EventManager().EmitEvent(
sdk.NewEvent(
types.EventTypeEthereumTx,
+49
View File
@@ -2,6 +2,8 @@ package types
import (
"github.com/ethereum/go-ethereum/common"
ethcmn "github.com/ethereum/go-ethereum/common"
ethtypes "github.com/ethereum/go-ethereum/core/types"
)
// accessList is copied from go-ethereum
@@ -132,3 +134,50 @@ func (al *accessList) DeleteSlot(address common.Address, slot common.Hash) {
func (al *accessList) DeleteAddress(address common.Address) {
delete(al.addresses, address)
}
// NewAccessList creates a new protobuf-compatible AccessList from an ethereum
// core AccessList type
func NewAccessList(ethAccessList *ethtypes.AccessList) *AccessList {
if ethAccessList == nil {
return nil
}
var tuples []AccessTuple
for _, tuple := range *ethAccessList {
storageKeys := make([]string, len(tuple.StorageKeys))
for i := range tuple.StorageKeys {
storageKeys[i] = tuple.StorageKeys[i].String()
}
tuples = append(tuples, AccessTuple{
Address: tuple.Address.String(),
StorageKeys: storageKeys,
})
}
return &AccessList{
Tuples: tuples,
}
}
// ToEthAccessList is an utility function to convert the protobuf compatible
// AccessList to eth core AccessList from go-ethereum
func (al AccessList) ToEthAccessList() *ethtypes.AccessList {
var accessList ethtypes.AccessList
for _, tuple := range al.Tuples {
storageKeys := make([]ethcmn.Hash, len(tuple.StorageKeys))
for i := range tuple.StorageKeys {
storageKeys[i] = ethcmn.HexToHash(tuple.StorageKeys[i])
}
accessList = append(accessList, ethtypes.AccessTuple{
Address: ethcmn.HexToAddress(tuple.Address),
StorageKeys: storageKeys,
})
}
return &accessList
}
+10 -5
View File
@@ -29,8 +29,9 @@ func (cc ChainConfig) EthereumConfig(chainID *big.Int) *params.ChainConfig {
IstanbulBlock: getBlockValue(cc.IstanbulBlock),
MuirGlacierBlock: getBlockValue(cc.MuirGlacierBlock),
//TODO(xlab): after upgrading ethereum to newer version, this should be set to YoloV2Block
YoloV2Block: getBlockValue(cc.YoloV2Block),
EWASMBlock: getBlockValue(cc.EWASMBlock),
YoloV3Block: getBlockValue(cc.YoloV3Block),
EWASMBlock: getBlockValue(cc.EWASMBlock),
CatalystBlock: getBlockValue(cc.CatalystBlock),
}
}
@@ -49,8 +50,9 @@ func DefaultChainConfig() ChainConfig {
PetersburgBlock: sdk.ZeroInt(),
IstanbulBlock: sdk.NewInt(-1),
MuirGlacierBlock: sdk.NewInt(-1),
YoloV2Block: sdk.NewInt(-1),
YoloV3Block: sdk.NewInt(-1),
EWASMBlock: sdk.NewInt(-1),
CatalystBlock: sdk.NewInt(-1),
}
}
@@ -98,12 +100,15 @@ func (cc ChainConfig) Validate() error {
if err := validateBlock(cc.MuirGlacierBlock); err != nil {
return sdkerrors.Wrap(err, "muirGlacierBlock")
}
if err := validateBlock(cc.YoloV2Block); err != nil {
return sdkerrors.Wrap(err, "yoloV2Block")
if err := validateBlock(cc.YoloV3Block); err != nil {
return sdkerrors.Wrap(err, "yoloV3Block")
}
if err := validateBlock(cc.EWASMBlock); err != nil {
return sdkerrors.Wrap(err, "eWASMBlock")
}
if err := validateBlock(cc.CatalystBlock); err != nil {
return sdkerrors.Wrap(err, "calalystBlock")
}
return nil
}
+25 -4
View File
@@ -33,8 +33,9 @@ func TestChainConfigValidate(t *testing.T) {
PetersburgBlock: sdk.OneInt(),
IstanbulBlock: sdk.OneInt(),
MuirGlacierBlock: sdk.OneInt(),
YoloV2Block: sdk.OneInt(),
YoloV3Block: sdk.OneInt(),
EWASMBlock: sdk.OneInt(),
CatalystBlock: sdk.OneInt(),
},
false,
},
@@ -189,7 +190,7 @@ func TestChainConfigValidate(t *testing.T) {
PetersburgBlock: sdk.OneInt(),
IstanbulBlock: sdk.OneInt(),
MuirGlacierBlock: sdk.OneInt(),
YoloV2Block: sdk.Int{},
YoloV3Block: sdk.Int{},
},
true,
},
@@ -207,11 +208,31 @@ func TestChainConfigValidate(t *testing.T) {
PetersburgBlock: sdk.OneInt(),
IstanbulBlock: sdk.OneInt(),
MuirGlacierBlock: sdk.OneInt(),
YoloV2Block: sdk.OneInt(),
YoloV3Block: sdk.OneInt(),
EWASMBlock: sdk.Int{},
},
true,
},
{
"invalid CatalystBlock",
ChainConfig{
HomesteadBlock: sdk.OneInt(),
DAOForkBlock: sdk.OneInt(),
EIP150Block: sdk.OneInt(),
EIP150Hash: defaultEIP150Hash,
EIP155Block: sdk.OneInt(),
EIP158Block: sdk.OneInt(),
ByzantiumBlock: sdk.OneInt(),
ConstantinopleBlock: sdk.OneInt(),
PetersburgBlock: sdk.OneInt(),
IstanbulBlock: sdk.OneInt(),
MuirGlacierBlock: sdk.OneInt(),
YoloV3Block: sdk.OneInt(),
EWASMBlock: sdk.OneInt(),
CatalystBlock: sdk.Int{},
},
true,
},
}
for _, tc := range testCases {
@@ -226,7 +247,7 @@ func TestChainConfigValidate(t *testing.T) {
}
func TestChainConfig_String(t *testing.T) {
configStr := `homestead_block:"0" dao_fork_block:"0" dao_fork_support:true eip150_block:"0" eip150_hash:"0x0000000000000000000000000000000000000000000000000000000000000000" eip155_block:"0" eip158_block:"0" byzantium_block:"0" constantinople_block:"0" petersburg_block:"0" istanbul_block:"-1" muir_glacier_block:"-1" yolo_v2_block:"-1" ewasm_block:"-1" `
configStr := `homestead_block:"0" dao_fork_block:"0" dao_fork_support:true eip150_block:"0" eip150_hash:"0x0000000000000000000000000000000000000000000000000000000000000000" eip155_block:"0" eip158_block:"0" byzantium_block:"0" constantinople_block:"0" petersburg_block:"0" istanbul_block:"-1" muir_glacier_block:"-1" yolo_v3_block:"-1" ewasm_block:"-1" catalyst_block:"-1" `
config := DefaultChainConfig()
require.Equal(t, configStr, config.String())
}
+4 -6
View File
@@ -17,15 +17,13 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
(*sdk.Msg)(nil),
&MsgEthereumTx{},
)
registry.RegisterInterface("injective.evm.v1alpha1.ExtensionOptionsEthereumTx", (*ExtensionOptionsEthereumTxI)(nil))
registry.RegisterImplementations(
registry.RegisterInterface(
"ethermint.evm.v1alpha1.ExtensionOptionsEthereumTx",
(*ExtensionOptionsEthereumTxI)(nil),
&ExtensionOptionsEthereumTx{},
)
registry.RegisterInterface("injective.evm.v1alpha1.ExtensionOptionsWeb3Tx", (*ExtensionOptionsWeb3TxI)(nil))
registry.RegisterImplementations(
registry.RegisterInterface(
"ethermint.evm.v1alpha1.ExtensionOptionsWeb3Tx",
(*ExtensionOptionsWeb3TxI)(nil),
&ExtensionOptionsWeb3Tx{},
)
+796 -252
View File
File diff suppressed because it is too large Load Diff
+42 -37
View File
@@ -1,5 +1,5 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: injective/evm/v1beta1/genesis.proto
// source: ethermint/evm/v1alpha1/genesis.proto
package types
@@ -38,7 +38,7 @@ func (m *GenesisState) Reset() { *m = GenesisState{} }
func (m *GenesisState) String() string { return proto.CompactTextString(m) }
func (*GenesisState) ProtoMessage() {}
func (*GenesisState) Descriptor() ([]byte, []int) {
return fileDescriptor_edebcfd612cffc8a, []int{0}
return fileDescriptor_8205a12b97b89a87, []int{0}
}
func (m *GenesisState) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -111,7 +111,7 @@ func (m *GenesisAccount) Reset() { *m = GenesisAccount{} }
func (m *GenesisAccount) String() string { return proto.CompactTextString(m) }
func (*GenesisAccount) ProtoMessage() {}
func (*GenesisAccount) Descriptor() ([]byte, []int) {
return fileDescriptor_edebcfd612cffc8a, []int{1}
return fileDescriptor_8205a12b97b89a87, []int{1}
}
func (m *GenesisAccount) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -162,43 +162,42 @@ func (m *GenesisAccount) GetStorage() Storage {
}
func init() {
proto.RegisterType((*GenesisState)(nil), "injective.evm.v1beta1.GenesisState")
proto.RegisterType((*GenesisAccount)(nil), "injective.evm.v1beta1.GenesisAccount")
proto.RegisterType((*GenesisState)(nil), "ethermint.evm.v1alpha1.GenesisState")
proto.RegisterType((*GenesisAccount)(nil), "ethermint.evm.v1alpha1.GenesisAccount")
}
func init() {
proto.RegisterFile("injective/evm/v1beta1/genesis.proto", fileDescriptor_edebcfd612cffc8a)
proto.RegisterFile("ethermint/evm/v1alpha1/genesis.proto", fileDescriptor_8205a12b97b89a87)
}
var fileDescriptor_edebcfd612cffc8a = []byte{
// 420 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xc1, 0x8e, 0xd2, 0x40,
0x18, 0xc7, 0xdb, 0x85, 0x6c, 0x77, 0x87, 0x8d, 0x9b, 0x8c, 0x1a, 0x1b, 0xd4, 0x96, 0xd4, 0x68,
0xb8, 0xd8, 0x06, 0xbc, 0xe9, 0xc9, 0x72, 0x20, 0x24, 0x1c, 0x4c, 0xf1, 0xc4, 0x85, 0x4c, 0xa7,
0xe3, 0x50, 0x43, 0x3b, 0xa4, 0x33, 0x34,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0x2b,
0x96, 0x11, 0x38, 0x05, 0x37, 0x62, 0xcd, 0x67, 0x0b, 0x46, 0xb9, 0xd9, 0x54, 0x5f, 0xfa, 0xa6,
0x26, 0xfe, 0x39, 0x43, 0x29, 0x47, 0x58, 0xc4, 0x2c, 0x1d, 0x33, 0xca, 0xfd, 0x67, 0x65, 0xc1,
0xfb, 0xa2, 0x60, 0x65, 0x71, 0x02, 0x43, 0xac, 0xb9, 0x24, 0x9c, 0x6f, 0x3a, 0x78, 0xf4, 0x70,
0x3e, 0xd0, 0x04, 0x06, 0x8a, 0xa2, 0x8c, 0x70, 0x39, 0x57, 0xbd, 0x7b, 0x1b, 0x54, 0x57, 0x08,
0x41, 0x13, 0xb3, 0x88, 0xa8, 0x09, 0xdd, 0x06, 0xea, 0x0c, 0x87, 0xc0, 0xe0, 0x82, 0x65, 0x88,
0x12, 0xb3, 0xa1, 0xba, 0xbd, 0xa8, 0xe9, 0xa6, 0xfe, 0x9a, 0x7f, 0x2f, 0x1b, 0xfd, 0xf8, 0x6d,
0x1b, 0x93, 0x22, 0x14, 0x54, 0x69, 0x1f, 0x6f, 0x0f, 0x96, 0xbe, 0x3b, 0x58, 0xfa, 0x9f, 0x83,
0xa5, 0x7f, 0x3f, 0x5a, 0xda, 0xee, 0x68, 0x69, 0xbf, 0x8e, 0x96, 0x36, 0x1d, 0xd1, 0x58, 0xcc,
0x57, 0xa1, 0x8b, 0x59, 0xe2, 0x8d, 0x2a, 0xf7, 0x18, 0x85, 0xdc, 0x3b, 0xbd, 0xf4, 0x16, 0xb3,
0x8c, 0x9c, 0x5f, 0xe5, 0xec, 0xbd, 0x84, 0x45, 0xab, 0x05, 0xe1, 0x6a, 0xa3, 0xc4, 0x66, 0x49,
0x78, 0x78, 0xad, 0x96, 0xe9, 0xdd, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xed, 0x3b, 0xae, 0x70,
0xc1, 0x02, 0x00, 0x00,
var fileDescriptor_8205a12b97b89a87 = []byte{
// 405 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xb1, 0x8e, 0xda, 0x30,
0x18, 0xc7, 0x13, 0x40, 0x04, 0x0c, 0x2a, 0x92, 0x5b, 0xb5, 0x11, 0x55, 0x03, 0x4a, 0xab, 0xc2,
0x94, 0x08, 0xba, 0x55, 0x5d, 0x08, 0x43, 0x19, 0x3a, 0x54, 0xa1, 0x53, 0x3b, 0x20, 0x63, 0x5c,
0x27, 0x12, 0x89, 0xa3, 0xd8, 0x20, 0x78, 0x83, 0x1b, 0xef, 0x39, 0xee, 0x49, 0x18, 0x19, 0x99,
0xb8, 0x13, 0xbc, 0xc1, 0x3d, 0xc1, 0x29, 0x4e, 0x02, 0x77, 0xd2, 0x65, 0x73, 0xa4, 0xdf, 0xff,
0xe7, 0x7f, 0x3e, 0x7f, 0xe0, 0x0b, 0x11, 0x1e, 0x89, 0x03, 0x3f, 0x14, 0x36, 0x59, 0x07, 0xf6,
0x7a, 0x80, 0x96, 0x91, 0x87, 0x06, 0x36, 0x25, 0x21, 0xe1, 0x3e, 0xb7, 0xa2, 0x98, 0x09, 0x06,
0xdf, 0x5f, 0x28, 0x8b, 0xac, 0x03, 0x2b, 0xa7, 0xda, 0xef, 0x28, 0xa3, 0x4c, 0x22, 0x76, 0x72,
0x4a, 0xe9, 0x76, 0xb7, 0xc0, 0x99, 0x44, 0x25, 0x61, 0x1e, 0x4a, 0xa0, 0xf9, 0x33, 0xbd, 0x61,
0x2a, 0x90, 0x20, 0x70, 0x02, 0x6a, 0x08, 0x63, 0xb6, 0x0a, 0x05, 0xd7, 0xd5, 0x6e, 0xb9, 0xdf,
0x18, 0x7e, 0xb5, 0x5e, 0xbf, 0xd3, 0xca, 0x72, 0xa3, 0x14, 0x77, 0x2a, 0xbb, 0x63, 0x47, 0x71,
0x2f, 0x69, 0x88, 0x41, 0x13, 0x7b, 0xc8, 0x0f, 0x67,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0x2d, 0xcc, 0x02, 0x1b, 0x33, 0x1e, 0x30, 0x6e, 0x5f, 0x77, 0x66, 0x23, 0xb7, 0x46, 0x6c,
0x23, 0xc2, 0xe7, 0x55, 0xb9, 0x2f, 0xdf, 0x9e, 0x02, 0x00, 0x00, 0xff, 0xff, 0xf3, 0x74, 0xbc,
0x46, 0xa7, 0x02, 0x00, 0x00,
}
func (m *GenesisState) Marshal() (dAtA []byte, err error) {
@@ -557,7 +556,10 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthGenesis
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthGenesis
}
if (iNdEx + skippy) > l {
@@ -705,7 +707,10 @@ func (m *GenesisAccount) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthGenesis
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthGenesis
}
if (iNdEx + skippy) > l {
+114 -126
View File
@@ -10,6 +10,7 @@ import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
ethcmn "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
ethtypes "github.com/ethereum/go-ethereum/core/types"
ethcrypto "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/rlp"
@@ -20,8 +21,6 @@ var (
_ sdk.Tx = &MsgEthereumTx{}
)
var big8 = big.NewInt(8)
// message type and route constants
const (
// TypeMsgEthereumTx defines the type string of an Ethereum transaction
@@ -30,26 +29,27 @@ const (
// NewMsgEthereumTx returns a reference to a new Ethereum transaction message.
func NewMsgEthereumTx(
nonce uint64, to *ethcmn.Address, amount *big.Int,
gasLimit uint64, gasPrice *big.Int, payload []byte,
chainID *big.Int, nonce uint64, to *ethcmn.Address, amount *big.Int,
gasLimit uint64, gasPrice *big.Int, input []byte, accesses *ethtypes.AccessList,
) *MsgEthereumTx {
return newMsgEthereumTx(nonce, to, amount, gasLimit, gasPrice, payload)
return newMsgEthereumTx(chainID, nonce, to, amount, gasLimit, gasPrice, input, accesses)
}
// NewMsgEthereumTxContract returns a reference to a new Ethereum transaction
// message designated for contract creation.
func NewMsgEthereumTxContract(
nonce uint64, amount *big.Int, gasLimit uint64, gasPrice *big.Int, payload []byte,
chainID *big.Int, nonce uint64, amount *big.Int,
gasLimit uint64, gasPrice *big.Int, input []byte, accesses *ethtypes.AccessList,
) *MsgEthereumTx {
return newMsgEthereumTx(nonce, nil, amount, gasLimit, gasPrice, payload)
return newMsgEthereumTx(chainID, nonce, nil, amount, gasLimit, gasPrice, input, accesses)
}
func newMsgEthereumTx(
nonce uint64, to *ethcmn.Address, amount *big.Int, // nolint: interfacer
gasLimit uint64, gasPrice *big.Int, payload []byte,
chainID *big.Int, nonce uint64, to *ethcmn.Address, amount *big.Int,
gasLimit uint64, gasPrice *big.Int, input []byte, accesses *ethtypes.AccessList,
) *MsgEthereumTx {
if len(payload) > 0 {
payload = ethcmn.CopyBytes(payload)
if len(input) > 0 {
input = ethcmn.CopyBytes(input)
}
var toBz []byte
@@ -57,23 +57,30 @@ func newMsgEthereumTx(
toBz = to.Bytes()
}
var chainIDBz []byte
if chainID != nil {
chainIDBz = chainID.Bytes()
}
txData := &TxData{
AccountNonce: nonce,
Recipient: toBz,
Payload: payload,
GasLimit: gasLimit,
Amount: []byte{},
Price: []byte{},
V: []byte{},
R: []byte{},
S: []byte{},
ChainID: chainIDBz,
Nonce: nonce,
To: toBz,
Input: input,
GasLimit: gasLimit,
Amount: []byte{},
GasPrice: []byte{},
Accesses: NewAccessList(accesses),
V: []byte{},
R: []byte{},
S: []byte{},
}
if amount != nil {
txData.Amount = amount.Bytes()
}
if gasPrice != nil {
txData.Price = gasPrice.Bytes()
txData.GasPrice = gasPrice.Bytes()
}
return &MsgEthereumTx{Data: txData}
@@ -88,11 +95,7 @@ func (msg MsgEthereumTx) Type() string { return TypeMsgEthereumTx }
// ValidateBasic implements the sdk.Msg interface. It performs basic validation
// checks of a Transaction. If returns an error if validation fails.
func (msg MsgEthereumTx) ValidateBasic() error {
gasPrice := new(big.Int).SetBytes(msg.Data.Price)
// if gasPrice.Sign() == 0 {
// return sdkerrors.Wrapf(ErrInvalidValue, "gas price cannot be 0")
// }
gasPrice := new(big.Int).SetBytes(msg.Data.GasPrice)
if gasPrice.Sign() == -1 {
return sdkerrors.Wrapf(ErrInvalidValue, "gas price cannot be negative %s", gasPrice)
}
@@ -109,11 +112,11 @@ func (msg MsgEthereumTx) ValidateBasic() error {
// To returns the recipient address of the transaction. It returns nil if the
// transaction is a contract creation.
func (msg MsgEthereumTx) To() *ethcmn.Address {
if len(msg.Data.Recipient) == 0 {
if len(msg.Data.To) == 0 {
return nil
}
recipient := ethcmn.BytesToAddress(msg.Data.Recipient)
recipient := ethcmn.BytesToAddress(msg.Data.To)
return &recipient
}
@@ -127,11 +130,12 @@ func (msg *MsgEthereumTx) GetMsgs() []sdk.Msg {
//
// NOTE: This method panics if 'VerifySig' hasn't been called first.
func (msg MsgEthereumTx) GetSigners() []sdk.AccAddress {
sender := msg.GetFrom()
if sender.Empty() {
if IsZeroAddress(msg.From) {
panic("must use 'VerifySig' with a chain ID to get the signer")
}
return []sdk.AccAddress{sender}
signer := sdk.AccAddress(ethcmn.HexToAddress(msg.From).Bytes())
return []sdk.AccAddress{signer}
}
// GetSignBytes returns the Amino bytes of an Ethereum transaction message used
@@ -146,16 +150,20 @@ func (msg MsgEthereumTx) GetSignBytes() []byte {
// RLPSignBytes returns the RLP hash of an Ethereum transaction message with a
// given chainID used for signing.
func (msg MsgEthereumTx) RLPSignBytes(chainID *big.Int) ethcmn.Hash {
var accessList *ethtypes.AccessList
if msg.Data.Accesses != nil {
accessList = msg.Data.Accesses.ToEthAccessList()
}
return rlpHash([]interface{}{
msg.Data.AccountNonce,
new(big.Int).SetBytes(msg.Data.Price),
new(big.Int).SetBytes(msg.Data.ChainID),
msg.Data.Nonce,
new(big.Int).SetBytes(msg.Data.GasPrice),
msg.Data.GasLimit,
msg.To(),
new(big.Int).SetBytes(msg.Data.Amount),
new(big.Int).SetBytes(msg.Data.Payload),
chainID,
uint(0),
uint(0),
new(big.Int).SetBytes(msg.Data.Input),
accessList,
})
}
@@ -163,12 +171,12 @@ func (msg MsgEthereumTx) RLPSignBytes(chainID *big.Int) ethcmn.Hash {
// a Homestead layout without chainID.
func (msg MsgEthereumTx) RLPSignHomesteadBytes() ethcmn.Hash {
return rlpHash([]interface{}{
msg.Data.AccountNonce,
msg.Data.Price,
msg.Data.Nonce,
msg.Data.GasPrice,
msg.Data.GasLimit,
msg.To(),
msg.Data.Amount,
msg.Data.Payload,
msg.Data.Input,
})
}
@@ -229,77 +237,6 @@ func (msg *MsgEthereumTx) Sign(chainID *big.Int, priv *ecdsa.PrivateKey) error {
return nil
}
// VerifySig attempts to verify a Transaction's signature for a given chainID.
// A derived address is returned upon success or an error if recovery fails.
func (msg *MsgEthereumTx) VerifySig(chainID *big.Int) (ethcmn.Address, error) {
signer := ethtypes.NewEIP155Signer(chainID)
if msg.From != nil {
if msg.From.Signer == nil {
return msg.VerifySigHomestead()
}
// If the signer used to derive from in a previous call is not the same as
// used current, invalidate the cache.
fromSigner := ethtypes.NewEIP155Signer(new(big.Int).SetBytes(msg.From.Signer.chainId))
if signer.Equal(fromSigner) {
return ethcmn.BytesToAddress(msg.From.Address), nil
}
}
// do not allow recovery for transactions with an unprotected chainID
if chainID.Sign() == 0 {
return msg.VerifySigHomestead()
}
v, r, s := msg.RawSignatureValues()
chainIDMul := new(big.Int).Mul(chainID, big.NewInt(2))
V := new(big.Int).Sub(v, chainIDMul)
V.Sub(V, big8)
sigHash := msg.RLPSignBytes(chainID)
sender, err := recoverEthSig(r, s, V, sigHash)
if err != nil {
return ethcmn.Address{}, err
}
msg.From = &SigCache{
Signer: &EIP155Signer{
chainId: chainID.Bytes(),
chainIdMul: new(big.Int).Mul(chainID, big.NewInt(2)).Bytes(),
},
Address: sender.Bytes(),
}
return sender, nil
}
// VerifySigHomestead attempts to verify a Transaction's signature in legacy way (no EIP155).
// A derived address is returned upon success or an error if recovery fails.
func (msg *MsgEthereumTx) VerifySigHomestead() (ethcmn.Address, error) {
// signer := ethtypes.HomesteadSigner{}
if msg.From != nil {
// If the signer used to derive from in a previous call is not the same as
// used current, invalidate the cache.
if msg.From.Signer == nil {
return ethcmn.BytesToAddress(msg.From.Address), nil
}
}
v, r, s := msg.RawSignatureValues()
sigHash := msg.RLPSignHomesteadBytes()
sender, err := recoverEthSig(r, s, v, sigHash)
if err != nil {
return ethcmn.Address{}, err
}
msg.From = &SigCache{
Address: sender.Bytes(),
}
return sender, nil
}
// GetGas implements the GasTx interface. It returns the GasLimit of the transaction.
func (msg MsgEthereumTx) GetGas() uint64 {
return msg.Data.GasLimit
@@ -307,14 +244,14 @@ func (msg MsgEthereumTx) GetGas() uint64 {
// Fee returns gasprice * gaslimit.
func (msg MsgEthereumTx) Fee() *big.Int {
gasPrice := new(big.Int).SetBytes(msg.Data.Price)
gasPrice := new(big.Int).SetBytes(msg.Data.GasPrice)
gasLimit := new(big.Int).SetUint64(msg.Data.GasLimit)
return new(big.Int).Mul(gasPrice, gasLimit)
}
// ChainID returns which chain id this transaction was signed for (if at all)
func (msg *MsgEthereumTx) ChainID() *big.Int {
return deriveChainID(new(big.Int).SetBytes(msg.Data.V))
return new(big.Int).SetBytes(msg.Data.ChainID)
}
// Cost returns amount + gasprice * gaslimit.
@@ -335,22 +272,73 @@ func (msg MsgEthereumTx) RawSignatureValues() (v, r, s *big.Int) {
// GetFrom loads the ethereum sender address from the sigcache and returns an
// sdk.AccAddress from its bytes
func (msg *MsgEthereumTx) GetFrom() sdk.AccAddress {
if msg.From == nil {
if msg.From == "" {
return nil
}
return sdk.AccAddress(msg.From.Address)
return ethcmn.HexToAddress(msg.From).Bytes()
}
// deriveChainID derives the chain id from the given v parameter
func deriveChainID(v *big.Int) *big.Int {
if v.BitLen() <= 64 {
v := v.Uint64()
if v == 27 || v == 28 {
return new(big.Int)
}
return new(big.Int).SetUint64((v - 35) / 2)
}
v = new(big.Int).Sub(v, big.NewInt(35))
return v.Div(v, big.NewInt(2))
func (msg MsgEthereumTx) AsTransaction() *ethtypes.Transaction {
return ethtypes.NewTx(msg.Data.AsEthereumData())
}
func (msg MsgEthereumTx) AsMessage() (core.Message, error) {
if msg.From == "" {
return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "'from' address cannot be empty")
}
from := ethcmn.HexToAddress(msg.From)
var to *ethcmn.Address
if msg.Data.To != nil {
toAddr := ethcmn.BytesToAddress(msg.Data.To)
to = &toAddr
}
var accessList ethtypes.AccessList
if msg.Data.Accesses != nil {
accessList = *msg.Data.Accesses.ToEthAccessList()
}
return ethtypes.NewMessage(
from,
to,
msg.Data.Nonce,
new(big.Int).SetBytes(msg.Data.Amount),
msg.Data.GasLimit,
new(big.Int).SetBytes(msg.Data.GasPrice),
msg.Data.Input,
accessList,
true,
), nil
}
// AsEthereumData returns an AccessListTx transaction data from the proto-formatted
// TxData defined on the Cosmos EVM.
func (data TxData) AsEthereumData() ethtypes.TxData {
var to *ethcmn.Address
if data.To != nil {
toAddr := ethcmn.BytesToAddress(data.To)
to = &toAddr
}
var accessList ethtypes.AccessList
if data.Accesses != nil {
accessList = *data.Accesses.ToEthAccessList()
}
return &ethtypes.AccessListTx{
ChainID: new(big.Int).SetBytes(data.ChainID),
Nonce: data.Nonce,
GasPrice: new(big.Int).SetBytes(data.GasPrice),
Gas: data.GasLimit,
To: to,
Value: new(big.Int).SetBytes(data.Amount),
Data: data.Input,
AccessList: accessList,
V: new(big.Int).SetBytes(data.V),
R: new(big.Int).SetBytes(data.R),
S: new(big.Int).SetBytes(data.S),
}
}
+35 -45
View File
@@ -10,8 +10,6 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/ethermint/crypto/ethsecp256k1"
ethcmn "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/rlp"
)
@@ -19,9 +17,9 @@ import (
func TestMsgEthereumTx(t *testing.T) {
addr := GenerateEthAddress()
msg := NewMsgEthereumTx(0, &addr, nil, 100000, nil, []byte("test"))
msg := NewMsgEthereumTx(nil, 0, &addr, nil, 100000, nil, []byte("test"), nil)
require.NotNil(t, msg)
require.EqualValues(t, msg.Data.Recipient, addr.Bytes())
require.EqualValues(t, msg.Data.To, addr.Bytes())
require.Equal(t, msg.Route(), RouterKey)
require.Equal(t, msg.Type(), TypeMsgEthereumTx)
require.NotNil(t, msg.To())
@@ -29,9 +27,9 @@ func TestMsgEthereumTx(t *testing.T) {
require.Panics(t, func() { msg.GetSigners() })
require.Panics(t, func() { msg.GetSignBytes() })
msg = NewMsgEthereumTxContract(0, nil, 100000, nil, []byte("test"))
msg = NewMsgEthereumTxContract(nil, 0, nil, 100000, nil, []byte("test"), nil)
require.NotNil(t, msg)
require.Nil(t, msg.Data.Recipient)
require.Nil(t, msg.Data.To)
require.Nil(t, msg.To())
}
@@ -49,7 +47,7 @@ func TestMsgEthereumTxValidation(t *testing.T) {
}
for i, tc := range testCases {
msg := NewMsgEthereumTx(0, nil, tc.amount, 0, tc.gasPrice, nil)
msg := NewMsgEthereumTx(nil, 0, nil, tc.amount, 0, tc.gasPrice, nil, nil)
if tc.expectPass {
require.Nil(t, msg.ValidateBasic(), "valid test %d failed: %s", i, tc.msg)
@@ -63,56 +61,48 @@ func TestMsgEthereumTxRLPSignBytes(t *testing.T) {
addr := ethcmn.BytesToAddress([]byte("test_address"))
chainID := big.NewInt(3)
msg := NewMsgEthereumTx(0, &addr, nil, 100000, nil, []byte("test"))
msg := NewMsgEthereumTx(chainID, 0, &addr, nil, 100000, nil, []byte("test"), nil)
hash := msg.RLPSignBytes(chainID)
require.Equal(t, "5BD30E35AD27449390B14C91E6BCFDCAADF8FE44EF33680E3BC200FC0DC083C7", fmt.Sprintf("%X", hash))
}
func TestMsgEthereumTxRLPEncode(t *testing.T) {
addr := ethcmn.BytesToAddress([]byte("test_address"))
msg := NewMsgEthereumTx(0, &addr, nil, 100000, nil, []byte("test"))
expMsg := NewMsgEthereumTx(big.NewInt(1), 0, &addr, nil, 100000, nil, []byte("test"), nil)
raw, err := rlp.EncodeToBytes(&msg)
raw, err := rlp.EncodeToBytes(&expMsg)
require.NoError(t, err)
require.Equal(t, ethcmn.FromHex("E48080830186A0940000000000000000746573745F61646472657373808474657374808080"), raw)
msg := &MsgEthereumTx{}
err = rlp.Decode(bytes.NewReader(raw), &msg)
require.NoError(t, err)
require.Equal(t, expMsg.Data, msg.Data)
}
func TestMsgEthereumTxRLPDecode(t *testing.T) {
var msg MsgEthereumTx
// func TestMsgEthereumTxSig(t *testing.T) {
// chainID := big.NewInt(3)
raw := ethcmn.FromHex("E48080830186A0940000000000000000746573745F61646472657373808474657374808080")
addr := ethcmn.BytesToAddress([]byte("test_address"))
expectedMsg := NewMsgEthereumTx(0, &addr, nil, 100000, nil, []byte("test"))
// priv1, _ := ethsecp256k1.GenerateKey()
// priv2, _ := ethsecp256k1.GenerateKey()
// addr1 := ethcmn.BytesToAddress(priv1.PubKey().Address().Bytes())
// addr2 := ethcmn.BytesToAddress(priv2.PubKey().Address().Bytes())
err := rlp.Decode(bytes.NewReader(raw), &msg)
require.NoError(t, err)
require.Equal(t, expectedMsg.Data, msg.Data)
}
// // require valid signature passes validation
// msg := NewMsgEthereumTx(nil, 0, &addr1, nil, 100000, nil, []byte("test"), nil)
// err := msg.Sign(chainID, priv1.ToECDSA())
// require.Nil(t, err)
func TestMsgEthereumTxSig(t *testing.T) {
chainID := big.NewInt(3)
// signer, err := msg.VerifySig(chainID)
// require.NoError(t, err)
// require.Equal(t, addr1, signer)
// require.NotEqual(t, addr2, signer)
priv1, _ := ethsecp256k1.GenerateKey()
priv2, _ := ethsecp256k1.GenerateKey()
addr1 := ethcmn.BytesToAddress(priv1.PubKey().Address().Bytes())
addr2 := ethcmn.BytesToAddress(priv2.PubKey().Address().Bytes())
// // require invalid chain ID fail validation
// msg = NewMsgEthereumTx(nil, 0, &addr1, nil, 100000, nil, []byte("test"), nil)
// err = msg.Sign(chainID, priv1.ToECDSA())
// require.Nil(t, err)
// require valid signature passes validation
msg := NewMsgEthereumTx(0, &addr1, nil, 100000, nil, []byte("test"))
err := msg.Sign(chainID, priv1.ToECDSA())
require.Nil(t, err)
signer, err := msg.VerifySig(chainID)
require.NoError(t, err)
require.Equal(t, addr1, signer)
require.NotEqual(t, addr2, signer)
// require invalid chain ID fail validation
msg = NewMsgEthereumTx(0, &addr1, nil, 100000, nil, []byte("test"))
err = msg.Sign(chainID, priv1.ToECDSA())
require.Nil(t, err)
signer, err = msg.VerifySig(big.NewInt(4))
require.Error(t, err)
require.Equal(t, ethcmn.Address{}, signer)
}
// signer, err = msg.VerifySig(big.NewInt(4))
// require.Error(t, err)
// require.Equal(t, ethcmn.Address{}, signer)
// }
+4 -3
View File
@@ -7,6 +7,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
"github.com/cosmos/ethermint/types"
"github.com/ethereum/go-ethereum/core/vm"
)
@@ -38,10 +39,10 @@ func NewParams(evmDenom string, enableCreate, enableCall bool, extraEIPs ...int6
// DefaultParams returns default evm parameters
func DefaultParams() Params {
return Params{
EvmDenom: "inj",
EvmDenom: types.AttoPhoton,
EnableCreate: true,
EnableCall: true,
ExtraEIPs: []int64(nil), // TODO: define default values
ExtraEIPs: []int64(nil), // TODO: define default values from: [2929, 2200, 1884, 1344]
}
}
@@ -95,7 +96,7 @@ func validateEIPs(i interface{}) error {
for _, eip := range eips {
if !vm.ValidEip(int(eip)) {
return fmt.Errorf("EIP %d is not activateable", eip)
return fmt.Errorf("EIP %d is not activateable, valid EIPS are: %s", eip, vm.ActivateableEips())
}
}
+1 -1
View File
@@ -61,5 +61,5 @@ func TestParamsValidatePriv(t *testing.T) {
}
func TestParams_String(t *testing.T) {
require.Equal(t, "evm_denom: inj\nenable_create: true\nenable_call: true\nextra_eips: []\n", DefaultParams().String())
require.Equal(t, "evm_denom: aphoton\nenable_create: true\nenable_call: true\nextra_eips: []\n", DefaultParams().String())
}
+263 -184
View File
@@ -1,5 +1,5 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: injective/evm/v1beta1/query.proto
// source: ethermint/evm/v1alpha1/query.proto
package types
@@ -39,7 +39,7 @@ func (m *QueryAccountRequest) Reset() { *m = QueryAccountRequest{} }
func (m *QueryAccountRequest) String() string { return proto.CompactTextString(m) }
func (*QueryAccountRequest) ProtoMessage() {}
func (*QueryAccountRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{0}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{0}
}
func (m *QueryAccountRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -82,7 +82,7 @@ func (m *QueryAccountResponse) Reset() { *m = QueryAccountResponse{} }
func (m *QueryAccountResponse) String() string { return proto.CompactTextString(m) }
func (*QueryAccountResponse) ProtoMessage() {}
func (*QueryAccountResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{1}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{1}
}
func (m *QueryAccountResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -142,7 +142,7 @@ func (m *QueryCosmosAccountRequest) Reset() { *m = QueryCosmosAccountReq
func (m *QueryCosmosAccountRequest) String() string { return proto.CompactTextString(m) }
func (*QueryCosmosAccountRequest) ProtoMessage() {}
func (*QueryCosmosAccountRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{2}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{2}
}
func (m *QueryCosmosAccountRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -185,7 +185,7 @@ func (m *QueryCosmosAccountResponse) Reset() { *m = QueryCosmosAccountRe
func (m *QueryCosmosAccountResponse) String() string { return proto.CompactTextString(m) }
func (*QueryCosmosAccountResponse) ProtoMessage() {}
func (*QueryCosmosAccountResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{3}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{3}
}
func (m *QueryCosmosAccountResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -245,7 +245,7 @@ func (m *QueryBalanceRequest) Reset() { *m = QueryBalanceRequest{} }
func (m *QueryBalanceRequest) String() string { return proto.CompactTextString(m) }
func (*QueryBalanceRequest) ProtoMessage() {}
func (*QueryBalanceRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{4}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{4}
}
func (m *QueryBalanceRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -284,7 +284,7 @@ func (m *QueryBalanceResponse) Reset() { *m = QueryBalanceResponse{} }
func (m *QueryBalanceResponse) String() string { return proto.CompactTextString(m) }
func (*QueryBalanceResponse) ProtoMessage() {}
func (*QueryBalanceResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{5}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{5}
}
func (m *QueryBalanceResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -332,7 +332,7 @@ func (m *QueryStorageRequest) Reset() { *m = QueryStorageRequest{} }
func (m *QueryStorageRequest) String() string { return proto.CompactTextString(m) }
func (*QueryStorageRequest) ProtoMessage() {}
func (*QueryStorageRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{6}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{6}
}
func (m *QueryStorageRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -372,7 +372,7 @@ func (m *QueryStorageResponse) Reset() { *m = QueryStorageResponse{} }
func (m *QueryStorageResponse) String() string { return proto.CompactTextString(m) }
func (*QueryStorageResponse) ProtoMessage() {}
func (*QueryStorageResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{7}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{7}
}
func (m *QueryStorageResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -418,7 +418,7 @@ func (m *QueryCodeRequest) Reset() { *m = QueryCodeRequest{} }
func (m *QueryCodeRequest) String() string { return proto.CompactTextString(m) }
func (*QueryCodeRequest) ProtoMessage() {}
func (*QueryCodeRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{8}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{8}
}
func (m *QueryCodeRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -458,7 +458,7 @@ func (m *QueryCodeResponse) Reset() { *m = QueryCodeResponse{} }
func (m *QueryCodeResponse) String() string { return proto.CompactTextString(m) }
func (*QueryCodeResponse) ProtoMessage() {}
func (*QueryCodeResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{9}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{9}
}
func (m *QueryCodeResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -504,7 +504,7 @@ func (m *QueryTxLogsRequest) Reset() { *m = QueryTxLogsRequest{} }
func (m *QueryTxLogsRequest) String() string { return proto.CompactTextString(m) }
func (*QueryTxLogsRequest) ProtoMessage() {}
func (*QueryTxLogsRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{10}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{10}
}
func (m *QueryTxLogsRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -543,7 +543,7 @@ func (m *QueryTxLogsResponse) Reset() { *m = QueryTxLogsResponse{} }
func (m *QueryTxLogsResponse) String() string { return proto.CompactTextString(m) }
func (*QueryTxLogsResponse) ProtoMessage() {}
func (*QueryTxLogsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{11}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{11}
}
func (m *QueryTxLogsResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -589,7 +589,7 @@ func (m *QueryTxReceiptRequest) Reset() { *m = QueryTxReceiptRequest{} }
func (m *QueryTxReceiptRequest) String() string { return proto.CompactTextString(m) }
func (*QueryTxReceiptRequest) ProtoMessage() {}
func (*QueryTxReceiptRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{12}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{12}
}
func (m *QueryTxReceiptRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -628,7 +628,7 @@ func (m *QueryTxReceiptResponse) Reset() { *m = QueryTxReceiptResponse{}
func (m *QueryTxReceiptResponse) String() string { return proto.CompactTextString(m) }
func (*QueryTxReceiptResponse) ProtoMessage() {}
func (*QueryTxReceiptResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{13}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{13}
}
func (m *QueryTxReceiptResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -674,7 +674,7 @@ func (m *QueryTxReceiptsByBlockHeightRequest) Reset() { *m = QueryTxRece
func (m *QueryTxReceiptsByBlockHeightRequest) String() string { return proto.CompactTextString(m) }
func (*QueryTxReceiptsByBlockHeightRequest) ProtoMessage() {}
func (*QueryTxReceiptsByBlockHeightRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{14}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{14}
}
func (m *QueryTxReceiptsByBlockHeightRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -713,7 +713,7 @@ func (m *QueryTxReceiptsByBlockHeightResponse) Reset() { *m = QueryTxRec
func (m *QueryTxReceiptsByBlockHeightResponse) String() string { return proto.CompactTextString(m) }
func (*QueryTxReceiptsByBlockHeightResponse) ProtoMessage() {}
func (*QueryTxReceiptsByBlockHeightResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{15}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{15}
}
func (m *QueryTxReceiptsByBlockHeightResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -759,7 +759,7 @@ func (m *QueryTxReceiptsByBlockHashRequest) Reset() { *m = QueryTxReceip
func (m *QueryTxReceiptsByBlockHashRequest) String() string { return proto.CompactTextString(m) }
func (*QueryTxReceiptsByBlockHashRequest) ProtoMessage() {}
func (*QueryTxReceiptsByBlockHashRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{16}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{16}
}
func (m *QueryTxReceiptsByBlockHashRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -798,7 +798,7 @@ func (m *QueryTxReceiptsByBlockHashResponse) Reset() { *m = QueryTxRecei
func (m *QueryTxReceiptsByBlockHashResponse) String() string { return proto.CompactTextString(m) }
func (*QueryTxReceiptsByBlockHashResponse) ProtoMessage() {}
func (*QueryTxReceiptsByBlockHashResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{17}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{17}
}
func (m *QueryTxReceiptsByBlockHashResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -844,7 +844,7 @@ func (m *QueryBlockLogsRequest) Reset() { *m = QueryBlockLogsRequest{} }
func (m *QueryBlockLogsRequest) String() string { return proto.CompactTextString(m) }
func (*QueryBlockLogsRequest) ProtoMessage() {}
func (*QueryBlockLogsRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{18}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{18}
}
func (m *QueryBlockLogsRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -883,7 +883,7 @@ func (m *QueryBlockLogsResponse) Reset() { *m = QueryBlockLogsResponse{}
func (m *QueryBlockLogsResponse) String() string { return proto.CompactTextString(m) }
func (*QueryBlockLogsResponse) ProtoMessage() {}
func (*QueryBlockLogsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{19}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{19}
}
func (m *QueryBlockLogsResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -929,7 +929,7 @@ func (m *QueryBlockBloomRequest) Reset() { *m = QueryBlockBloomRequest{}
func (m *QueryBlockBloomRequest) String() string { return proto.CompactTextString(m) }
func (*QueryBlockBloomRequest) ProtoMessage() {}
func (*QueryBlockBloomRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{20}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{20}
}
func (m *QueryBlockBloomRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -976,7 +976,7 @@ func (m *QueryBlockBloomResponse) Reset() { *m = QueryBlockBloomResponse
func (m *QueryBlockBloomResponse) String() string { return proto.CompactTextString(m) }
func (*QueryBlockBloomResponse) ProtoMessage() {}
func (*QueryBlockBloomResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{21}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{21}
}
func (m *QueryBlockBloomResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1020,7 +1020,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} }
func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) }
func (*QueryParamsRequest) ProtoMessage() {}
func (*QueryParamsRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{22}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{22}
}
func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1059,7 +1059,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} }
func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) }
func (*QueryParamsResponse) ProtoMessage() {}
func (*QueryParamsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{23}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{23}
}
func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1107,7 +1107,7 @@ func (m *QueryStaticCallRequest) Reset() { *m = QueryStaticCallRequest{}
func (m *QueryStaticCallRequest) String() string { return proto.CompactTextString(m) }
func (*QueryStaticCallRequest) ProtoMessage() {}
func (*QueryStaticCallRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{24}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{24}
}
func (m *QueryStaticCallRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1159,7 +1159,7 @@ func (m *QueryStaticCallResponse) Reset() { *m = QueryStaticCallResponse
func (m *QueryStaticCallResponse) String() string { return proto.CompactTextString(m) }
func (*QueryStaticCallResponse) ProtoMessage() {}
func (*QueryStaticCallResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_b35cda93d73bda44, []int{25}
return fileDescriptor_8bbc79ec2b6c5cb2, []int{25}
}
func (m *QueryStaticCallResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -1196,112 +1196,113 @@ func (m *QueryStaticCallResponse) GetData() []byte {
}
func init() {
proto.RegisterType((*QueryAccountRequest)(nil), "injective.evm.v1beta1.QueryAccountRequest")
proto.RegisterType((*QueryAccountResponse)(nil), "injective.evm.v1beta1.QueryAccountResponse")
proto.RegisterType((*QueryCosmosAccountRequest)(nil), "injective.evm.v1beta1.QueryCosmosAccountRequest")
proto.RegisterType((*QueryCosmosAccountResponse)(nil), "injective.evm.v1beta1.QueryCosmosAccountResponse")
proto.RegisterType((*QueryBalanceRequest)(nil), "injective.evm.v1beta1.QueryBalanceRequest")
proto.RegisterType((*QueryBalanceResponse)(nil), "injective.evm.v1beta1.QueryBalanceResponse")
proto.RegisterType((*QueryStorageRequest)(nil), "injective.evm.v1beta1.QueryStorageRequest")
proto.RegisterType((*QueryStorageResponse)(nil), "injective.evm.v1beta1.QueryStorageResponse")
proto.RegisterType((*QueryCodeRequest)(nil), "injective.evm.v1beta1.QueryCodeRequest")
proto.RegisterType((*QueryCodeResponse)(nil), "injective.evm.v1beta1.QueryCodeResponse")
proto.RegisterType((*QueryTxLogsRequest)(nil), "injective.evm.v1beta1.QueryTxLogsRequest")
proto.RegisterType((*QueryTxLogsResponse)(nil), "injective.evm.v1beta1.QueryTxLogsResponse")
proto.RegisterType((*QueryTxReceiptRequest)(nil), "injective.evm.v1beta1.QueryTxReceiptRequest")
proto.RegisterType((*QueryTxReceiptResponse)(nil), "injective.evm.v1beta1.QueryTxReceiptResponse")
proto.RegisterType((*QueryTxReceiptsByBlockHeightRequest)(nil), "injective.evm.v1beta1.QueryTxReceiptsByBlockHeightRequest")
proto.RegisterType((*QueryTxReceiptsByBlockHeightResponse)(nil), "injective.evm.v1beta1.QueryTxReceiptsByBlockHeightResponse")
proto.RegisterType((*QueryTxReceiptsByBlockHashRequest)(nil), "injective.evm.v1beta1.QueryTxReceiptsByBlockHashRequest")
proto.RegisterType((*QueryTxReceiptsByBlockHashResponse)(nil), "injective.evm.v1beta1.QueryTxReceiptsByBlockHashResponse")
proto.RegisterType((*QueryBlockLogsRequest)(nil), "injective.evm.v1beta1.QueryBlockLogsRequest")
proto.RegisterType((*QueryBlockLogsResponse)(nil), "injective.evm.v1beta1.QueryBlockLogsResponse")
proto.RegisterType((*QueryBlockBloomRequest)(nil), "injective.evm.v1beta1.QueryBlockBloomRequest")
proto.RegisterType((*QueryBlockBloomResponse)(nil), "injective.evm.v1beta1.QueryBlockBloomResponse")
proto.RegisterType((*QueryParamsRequest)(nil), "injective.evm.v1beta1.QueryParamsRequest")
proto.RegisterType((*QueryParamsResponse)(nil), "injective.evm.v1beta1.QueryParamsResponse")
proto.RegisterType((*QueryStaticCallRequest)(nil), "injective.evm.v1beta1.QueryStaticCallRequest")
proto.RegisterType((*QueryStaticCallResponse)(nil), "injective.evm.v1beta1.QueryStaticCallResponse")
proto.RegisterType((*QueryAccountRequest)(nil), "ethermint.evm.v1alpha1.QueryAccountRequest")
proto.RegisterType((*QueryAccountResponse)(nil), "ethermint.evm.v1alpha1.QueryAccountResponse")
proto.RegisterType((*QueryCosmosAccountRequest)(nil), "ethermint.evm.v1alpha1.QueryCosmosAccountRequest")
proto.RegisterType((*QueryCosmosAccountResponse)(nil), "ethermint.evm.v1alpha1.QueryCosmosAccountResponse")
proto.RegisterType((*QueryBalanceRequest)(nil), "ethermint.evm.v1alpha1.QueryBalanceRequest")
proto.RegisterType((*QueryBalanceResponse)(nil), "ethermint.evm.v1alpha1.QueryBalanceResponse")
proto.RegisterType((*QueryStorageRequest)(nil), "ethermint.evm.v1alpha1.QueryStorageRequest")
proto.RegisterType((*QueryStorageResponse)(nil), "ethermint.evm.v1alpha1.QueryStorageResponse")
proto.RegisterType((*QueryCodeRequest)(nil), "ethermint.evm.v1alpha1.QueryCodeRequest")
proto.RegisterType((*QueryCodeResponse)(nil), "ethermint.evm.v1alpha1.QueryCodeResponse")
proto.RegisterType((*QueryTxLogsRequest)(nil), "ethermint.evm.v1alpha1.QueryTxLogsRequest")
proto.RegisterType((*QueryTxLogsResponse)(nil), "ethermint.evm.v1alpha1.QueryTxLogsResponse")
proto.RegisterType((*QueryTxReceiptRequest)(nil), "ethermint.evm.v1alpha1.QueryTxReceiptRequest")
proto.RegisterType((*QueryTxReceiptResponse)(nil), "ethermint.evm.v1alpha1.QueryTxReceiptResponse")
proto.RegisterType((*QueryTxReceiptsByBlockHeightRequest)(nil), "ethermint.evm.v1alpha1.QueryTxReceiptsByBlockHeightRequest")
proto.RegisterType((*QueryTxReceiptsByBlockHeightResponse)(nil), "ethermint.evm.v1alpha1.QueryTxReceiptsByBlockHeightResponse")
proto.RegisterType((*QueryTxReceiptsByBlockHashRequest)(nil), "ethermint.evm.v1alpha1.QueryTxReceiptsByBlockHashRequest")
proto.RegisterType((*QueryTxReceiptsByBlockHashResponse)(nil), "ethermint.evm.v1alpha1.QueryTxReceiptsByBlockHashResponse")
proto.RegisterType((*QueryBlockLogsRequest)(nil), "ethermint.evm.v1alpha1.QueryBlockLogsRequest")
proto.RegisterType((*QueryBlockLogsResponse)(nil), "ethermint.evm.v1alpha1.QueryBlockLogsResponse")
proto.RegisterType((*QueryBlockBloomRequest)(nil), "ethermint.evm.v1alpha1.QueryBlockBloomRequest")
proto.RegisterType((*QueryBlockBloomResponse)(nil), "ethermint.evm.v1alpha1.QueryBlockBloomResponse")
proto.RegisterType((*QueryParamsRequest)(nil), "ethermint.evm.v1alpha1.QueryParamsRequest")
proto.RegisterType((*QueryParamsResponse)(nil), "ethermint.evm.v1alpha1.QueryParamsResponse")
proto.RegisterType((*QueryStaticCallRequest)(nil), "ethermint.evm.v1alpha1.QueryStaticCallRequest")
proto.RegisterType((*QueryStaticCallResponse)(nil), "ethermint.evm.v1alpha1.QueryStaticCallResponse")
}
func init() { proto.RegisterFile("injective/evm/v1beta1/query.proto", fileDescriptor_b35cda93d73bda44) }
func init() {
proto.RegisterFile("ethermint/evm/v1alpha1/query.proto", fileDescriptor_8bbc79ec2b6c5cb2)
}
var fileDescriptor_b35cda93d73bda44 = []byte{
// 1175 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xc1, 0x6f, 0x1b, 0xc5,
0x17, 0xf6, 0x26, 0x8e, 0x9d, 0xbc, 0x36, 0x3f, 0xe5, 0x37, 0x38, 0x6d, 0x58, 0xa8, 0x93, 0x0e,
0x4d, 0xe3, 0xa6, 0x8d, 0x37, 0x4e, 0x21, 0x90, 0xb4, 0x12, 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0xd1, 0x12, 0xb5, 0xae, 0xcd, 0xa5, 0xa2, 0x74,
0x8f, 0xda, 0x5c, 0x56, 0x33, 0xea, 0x1f, 0xf9, 0xfd, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x86,
0x4f, 0xfe, 0x3c, 0x22, 0x10, 0x00, 0x00,
var fileDescriptor_8bbc79ec2b6c5cb2 = []byte{
// 1157 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4f, 0x6f, 0x1b, 0xc5,
0x1b, 0xf6, 0x26, 0x8e, 0x9d, 0xbc, 0x6d, 0x7e, 0xca, 0x6f, 0x70, 0xd3, 0xb0, 0x45, 0x4e, 0x3a,
0xa5, 0x8d, 0xd3, 0xa4, 0xde, 0xc4, 0x50, 0x4a, 0xd3, 0x56, 0x28, 0xae, 0x54, 0x22, 0x51, 0x21,
0x70, 0xe0, 0xc2, 0xc5, 0x8c, 0xd7, 0x2b, 0xdb, 0xca, 0x7a, 0xc7, 0xf5, 0xae, 0xa3, 0x44, 0x51,
0x2e, 0x1c, 0x10, 0x48, 0x1c, 0x40, 0x1c, 0x40, 0x48, 0x48, 0xfd, 0x08, 0x7c, 0x8c, 0x5e, 0x90,
0x22, 0x71, 0x41, 0x42, 0x42, 0x28, 0xe1, 0xc0, 0xc7, 0x40, 0x33, 0xf3, 0xee, 0x7a, 0x37, 0xf1,
0x7a, 0x37, 0x11, 0xb7, 0x9d, 0xf1, 0xfb, 0xbc, 0xcf, 0xf3, 0xbe, 0xf3, 0xe7, 0x19, 0x03, 0xb5,
0xbc, 0xb6, 0xd5, 0xef, 0x76, 0x1c, 0xcf, 0xb0, 0xf6, 0xba, 0xc6, 0xde, 0x06, 0xb3, 0x7b, 0x6d,
0xb6, 0x61, 0xbc, 0x18, 0x58, 0xfd, 0x83, 0x72, 0xaf, 0xcf, 0x3d, 0x4e, 0xe6, 0x83, 0x98, 0xb2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0, 0x12, 0x29, 0xc6, 0x09, 0x52, 0x2f, 0x07, 0xd9, 0xa8, 0xa1, 0xd7,
0x27, 0x34, 0xea, 0xdc, 0xf3, 0x22, 0xa1, 0x51, 0xe7, 0x1f, 0x11, 0xc9, 0x8d, 0x72, 0x25, 0xa6,
0x6e, 0x32, 0xdb, 0xae, 0x6e, 0xbd, 0x3a, 0x29, 0x6a, 0xc7, 0x27, 0x45, 0xed, 0xaf, 0x93, 0xa2,
0xf6, 0xed, 0x69, 0x31, 0x73, 0x7c, 0x5a, 0xcc, 0xfc, 0x7e, 0x5a, 0xcc, 0x7c, 0xb6, 0xdc, 0xea,
0x78, 0xed, 0x41, 0xa3, 0x6c, 0xf2, 0x2e, 0xba, 0x68, 0x28, 0xdf, 0xbe, 0xcc, 0xe8, 0x1d, 0xf4,
0x2c, 0xb7, 0x91, 0x93, 0x7f, 0xce, 0xdf, 0xfa, 0x37, 0x00, 0x00, 0xff, 0xff, 0x3e, 0xd1, 0xd3,
0x05, 0x30, 0x10, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -1355,7 +1356,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient {
func (c *queryClient) Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error) {
out := new(QueryAccountResponse)
err := c.cc.Invoke(ctx, "/injective.evm.v1beta1.Query/Account", in, out, opts...)
err := c.cc.Invoke(ctx, "/ethermint.evm.v1alpha1.Query/Account", in, out, opts...)
if err != nil {
return nil, err
}
@@ -1364,7 +1365,7 @@ func (c *queryClient) Account(ctx context.Context, in *QueryAccountRequest, opts
func (c *queryClient) CosmosAccount(ctx context.Context, in *QueryCosmosAccountRequest, opts ...grpc.CallOption) (*QueryCosmosAccountResponse, error) {
out := new(QueryCosmosAccountResponse)
err := c.cc.Invoke(ctx, "/injective.evm.v1beta1.Query/CosmosAccount", in, out, opts...)
err := c.cc.Invoke(ctx, "/ethermint.evm.v1alpha1.Query/CosmosAccount", in, out, opts...)
if err != nil {
return nil, err
}
@@ -1373,7 +1374,7 @@ func (c *queryClient) CosmosAccount(ctx context.Context, in *QueryCosmosAccountR
func (c *queryClient) Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error) {
out := new(QueryBalanceResponse)
err := c.cc.Invoke(ctx, "/injective.evm.v1beta1.Query/Balance", in, out, opts...)
err := c.cc.Invoke(ctx, "/ethermint.evm.v1alpha1.Query/Balance", in, out, opts...)
if err != nil {
return nil, err
}
@@ -1382,7 +1383,7 @@ func (c *queryClient) Balance(ctx context.Context, in *QueryBalanceRequest, opts
func (c *queryClient) Storage(ctx context.Context, in *QueryStorageRequest, opts ...grpc.CallOption) (*QueryStorageResponse, error) {
out := new(QueryStorageResponse)
err := c.cc.Invoke(ctx, "/injective.evm.v1beta1.Query/Storage", in, out, opts...)
err := c.cc.Invoke(ctx, "/ethermint.evm.v1alpha1.Query/Storage", in, out, opts...)
if err != nil {
return nil, err
}
@@ -1391,7 +1392,7 @@ func (c *queryClient) Storage(ctx context.Context, in *QueryStorageRequest, opts
func (c *queryClient) Code(ctx context.Context, in *QueryCodeRequest, opts ...grpc.CallOption) (*QueryCodeResponse, error) {
out := new(QueryCodeResponse)
err := c.cc.Invoke(ctx, "/injective.evm.v1beta1.Query/Code", in, out, opts...)
err := c.cc.Invoke(ctx, "/ethermint.evm.v1alpha1.Query/Code", in, out, opts...)
if err != nil {
return nil, err
}
@@ -1400,7 +1401,7 @@ func (c *queryClient) Code(ctx context.Context, in *QueryCodeRequest, opts ...gr
func (c *queryClient) TxLogs(ctx context.Context, in *QueryTxLogsRequest, opts ...grpc.CallOption) (*QueryTxLogsResponse, error) {
out := new(QueryTxLogsResponse)
err := c.cc.Invoke(ctx, "/injective.evm.v1beta1.Query/TxLogs", in, out, opts...)
err := c.cc.Invoke(ctx, "/ethermint.evm.v1alpha1.Query/TxLogs", in, out, opts...)
if err != nil {
return nil, err
}
@@ -1409,7 +1410,7 @@ func (c *queryClient) TxLogs(ctx context.Context, in *QueryTxLogsRequest, opts .
func (c *queryClient) TxReceipt(ctx context.Context, in *QueryTxReceiptRequest, opts ...grpc.CallOption) (*QueryTxReceiptResponse, error) {
out := new(QueryTxReceiptResponse)
err := c.cc.Invoke(ctx, "/injective.evm.v1beta1.Query/TxReceipt", in, out, opts...)
err := c.cc.Invoke(ctx, "/ethermint.evm.v1alpha1.Query/TxReceipt", in, out, opts...)
if err != nil {
return nil, err
}
@@ -1418,7 +1419,7 @@ func (c *queryClient) TxReceipt(ctx context.Context, in *QueryTxReceiptRequest,
func (c *queryClient) TxReceiptsByBlockHeight(ctx context.Context, in *QueryTxReceiptsByBlockHeightRequest, opts ...grpc.CallOption) (*QueryTxReceiptsByBlockHeightResponse, error) {
out := new(QueryTxReceiptsByBlockHeightResponse)
err := c.cc.Invoke(ctx, "/injective.evm.v1beta1.Query/TxReceiptsByBlockHeight", in, out, opts...)
err := c.cc.Invoke(ctx, "/ethermint.evm.v1alpha1.Query/TxReceiptsByBlockHeight", in, out, opts...)
if err != nil {
return nil, err
}
@@ -1427,7 +1428,7 @@ func (c *queryClient) TxReceiptsByBlockHeight(ctx context.Context, in *QueryTxRe
func (c *queryClient) TxReceiptsByBlockHash(ctx context.Context, in *QueryTxReceiptsByBlockHashRequest, opts ...grpc.CallOption) (*QueryTxReceiptsByBlockHashResponse, error) {
out := new(QueryTxReceiptsByBlockHashResponse)
err := c.cc.Invoke(ctx, "/injective.evm.v1beta1.Query/TxReceiptsByBlockHash", in, out, opts...)
err := c.cc.Invoke(ctx, "/ethermint.evm.v1alpha1.Query/TxReceiptsByBlockHash", in, out, opts...)
if err != nil {
return nil, err
}
@@ -1436,7 +1437,7 @@ func (c *queryClient) TxReceiptsByBlockHash(ctx context.Context, in *QueryTxRece
func (c *queryClient) BlockLogs(ctx context.Context, in *QueryBlockLogsRequest, opts ...grpc.CallOption) (*QueryBlockLogsResponse, error) {
out := new(QueryBlockLogsResponse)
err := c.cc.Invoke(ctx, "/injective.evm.v1beta1.Query/BlockLogs", in, out, opts...)
err := c.cc.Invoke(ctx, "/ethermint.evm.v1alpha1.Query/BlockLogs", in, out, opts...)
if err != nil {
return nil, err
}
@@ -1445,7 +1446,7 @@ func (c *queryClient) BlockLogs(ctx context.Context, in *QueryBlockLogsRequest,
func (c *queryClient) BlockBloom(ctx context.Context, in *QueryBlockBloomRequest, opts ...grpc.CallOption) (*QueryBlockBloomResponse, error) {
out := new(QueryBlockBloomResponse)
err := c.cc.Invoke(ctx, "/injective.evm.v1beta1.Query/BlockBloom", in, out, opts...)
err := c.cc.Invoke(ctx, "/ethermint.evm.v1alpha1.Query/BlockBloom", in, out, opts...)
if err != nil {
return nil, err
}
@@ -1454,7 +1455,7 @@ func (c *queryClient) BlockBloom(ctx context.Context, in *QueryBlockBloomRequest
func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
out := new(QueryParamsResponse)
err := c.cc.Invoke(ctx, "/injective.evm.v1beta1.Query/Params", in, out, opts...)
err := c.cc.Invoke(ctx, "/ethermint.evm.v1alpha1.Query/Params", in, out, opts...)
if err != nil {
return nil, err
}
@@ -1463,7 +1464,7 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts .
func (c *queryClient) StaticCall(ctx context.Context, in *QueryStaticCallRequest, opts ...grpc.CallOption) (*QueryStaticCallResponse, error) {
out := new(QueryStaticCallResponse)
err := c.cc.Invoke(ctx, "/injective.evm.v1beta1.Query/StaticCall", in, out, opts...)
err := c.cc.Invoke(ctx, "/ethermint.evm.v1alpha1.Query/StaticCall", in, out, opts...)
if err != nil {
return nil, err
}
@@ -1559,7 +1560,7 @@ func _Query_Account_Handler(srv interface{}, ctx context.Context, dec func(inter
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/injective.evm.v1beta1.Query/Account",
FullMethod: "/ethermint.evm.v1alpha1.Query/Account",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Account(ctx, req.(*QueryAccountRequest))
@@ -1577,7 +1578,7 @@ func _Query_CosmosAccount_Handler(srv interface{}, ctx context.Context, dec func
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/injective.evm.v1beta1.Query/CosmosAccount",
FullMethod: "/ethermint.evm.v1alpha1.Query/CosmosAccount",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).CosmosAccount(ctx, req.(*QueryCosmosAccountRequest))
@@ -1595,7 +1596,7 @@ func _Query_Balance_Handler(srv interface{}, ctx context.Context, dec func(inter
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/injective.evm.v1beta1.Query/Balance",
FullMethod: "/ethermint.evm.v1alpha1.Query/Balance",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Balance(ctx, req.(*QueryBalanceRequest))
@@ -1613,7 +1614,7 @@ func _Query_Storage_Handler(srv interface{}, ctx context.Context, dec func(inter
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/injective.evm.v1beta1.Query/Storage",
FullMethod: "/ethermint.evm.v1alpha1.Query/Storage",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Storage(ctx, req.(*QueryStorageRequest))
@@ -1631,7 +1632,7 @@ func _Query_Code_Handler(srv interface{}, ctx context.Context, dec func(interfac
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/injective.evm.v1beta1.Query/Code",
FullMethod: "/ethermint.evm.v1alpha1.Query/Code",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Code(ctx, req.(*QueryCodeRequest))
@@ -1649,7 +1650,7 @@ func _Query_TxLogs_Handler(srv interface{}, ctx context.Context, dec func(interf
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/injective.evm.v1beta1.Query/TxLogs",
FullMethod: "/ethermint.evm.v1alpha1.Query/TxLogs",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).TxLogs(ctx, req.(*QueryTxLogsRequest))
@@ -1667,7 +1668,7 @@ func _Query_TxReceipt_Handler(srv interface{}, ctx context.Context, dec func(int
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/injective.evm.v1beta1.Query/TxReceipt",
FullMethod: "/ethermint.evm.v1alpha1.Query/TxReceipt",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).TxReceipt(ctx, req.(*QueryTxReceiptRequest))
@@ -1685,7 +1686,7 @@ func _Query_TxReceiptsByBlockHeight_Handler(srv interface{}, ctx context.Context
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/injective.evm.v1beta1.Query/TxReceiptsByBlockHeight",
FullMethod: "/ethermint.evm.v1alpha1.Query/TxReceiptsByBlockHeight",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).TxReceiptsByBlockHeight(ctx, req.(*QueryTxReceiptsByBlockHeightRequest))
@@ -1703,7 +1704,7 @@ func _Query_TxReceiptsByBlockHash_Handler(srv interface{}, ctx context.Context,
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/injective.evm.v1beta1.Query/TxReceiptsByBlockHash",
FullMethod: "/ethermint.evm.v1alpha1.Query/TxReceiptsByBlockHash",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).TxReceiptsByBlockHash(ctx, req.(*QueryTxReceiptsByBlockHashRequest))
@@ -1721,7 +1722,7 @@ func _Query_BlockLogs_Handler(srv interface{}, ctx context.Context, dec func(int
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/injective.evm.v1beta1.Query/BlockLogs",
FullMethod: "/ethermint.evm.v1alpha1.Query/BlockLogs",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).BlockLogs(ctx, req.(*QueryBlockLogsRequest))
@@ -1739,7 +1740,7 @@ func _Query_BlockBloom_Handler(srv interface{}, ctx context.Context, dec func(in
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/injective.evm.v1beta1.Query/BlockBloom",
FullMethod: "/ethermint.evm.v1alpha1.Query/BlockBloom",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).BlockBloom(ctx, req.(*QueryBlockBloomRequest))
@@ -1757,7 +1758,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/injective.evm.v1beta1.Query/Params",
FullMethod: "/ethermint.evm.v1alpha1.Query/Params",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest))
@@ -1775,7 +1776,7 @@ func _Query_StaticCall_Handler(srv interface{}, ctx context.Context, dec func(in
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/injective.evm.v1beta1.Query/StaticCall",
FullMethod: "/ethermint.evm.v1alpha1.Query/StaticCall",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).StaticCall(ctx, req.(*QueryStaticCallRequest))
@@ -1784,7 +1785,7 @@ func _Query_StaticCall_Handler(srv interface{}, ctx context.Context, dec func(in
}
var _Query_serviceDesc = grpc.ServiceDesc{
ServiceName: "injective.evm.v1beta1.Query",
ServiceName: "ethermint.evm.v1alpha1.Query",
HandlerType: (*QueryServer)(nil),
Methods: []grpc.MethodDesc{
{
@@ -1841,7 +1842,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "injective/evm/v1beta1/query.proto",
Metadata: "ethermint/evm/v1alpha1/query.proto",
}
func (m *QueryAccountRequest) Marshal() (dAtA []byte, err error) {
@@ -3128,7 +3129,10 @@ func (m *QueryAccountRequest) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -3263,7 +3267,10 @@ func (m *QueryAccountResponse) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -3345,7 +3352,10 @@ func (m *QueryCosmosAccountRequest) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -3465,7 +3475,10 @@ func (m *QueryCosmosAccountResponse) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -3547,7 +3560,10 @@ func (m *QueryBalanceRequest) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -3629,7 +3645,10 @@ func (m *QueryBalanceResponse) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -3743,7 +3762,10 @@ func (m *QueryStorageRequest) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -3825,7 +3847,10 @@ func (m *QueryStorageResponse) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -3907,7 +3932,10 @@ func (m *QueryCodeRequest) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -3991,7 +4019,10 @@ func (m *QueryCodeResponse) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -4073,7 +4104,10 @@ func (m *QueryTxLogsRequest) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -4157,7 +4191,10 @@ func (m *QueryTxLogsResponse) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -4239,7 +4276,10 @@ func (m *QueryTxReceiptRequest) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -4325,7 +4365,10 @@ func (m *QueryTxReceiptResponse) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -4394,7 +4437,10 @@ func (m *QueryTxReceiptsByBlockHeightRequest) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -4478,7 +4524,10 @@ func (m *QueryTxReceiptsByBlockHeightResponse) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -4560,7 +4609,10 @@ func (m *QueryTxReceiptsByBlockHashRequest) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -4644,7 +4696,10 @@ func (m *QueryTxReceiptsByBlockHashResponse) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -4726,7 +4781,10 @@ func (m *QueryBlockLogsRequest) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -4810,7 +4868,10 @@ func (m *QueryBlockLogsResponse) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -4879,7 +4940,10 @@ func (m *QueryBlockBloomRequest) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -4963,7 +5027,10 @@ func (m *QueryBlockBloomResponse) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -5013,7 +5080,10 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -5096,7 +5166,10 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -5212,7 +5285,10 @@ func (m *QueryStaticCallRequest) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
@@ -5296,7 +5372,10 @@ func (m *QueryStaticCallResponse) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
+14 -14
View File
@@ -1,5 +1,5 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: injective/evm/v1beta1/query.proto
// source: ethermint/evm/v1alpha1/query.proto
/*
Package types is a reverse proxy.
@@ -1254,31 +1254,31 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
}
var (
pattern_Query_Account_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"injective", "evm", "v1beta1", "account", "address"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_Account_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ethermint", "evm", "v1alpha1", "account", "address"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_CosmosAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"injective", "evm", "v1beta1", "cosmos_account", "address"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_CosmosAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ethermint", "evm", "v1alpha1", "cosmos_account", "address"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_Balance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"injective", "evm", "v1beta1", "balances", "address"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_Balance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ethermint", "evm", "v1alpha1", "balances", "address"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_Storage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"injective", "evm", "v1beta1", "storage", "address", "key"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_Storage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"ethermint", "evm", "v1alpha1", "storage", "address", "key"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_Code_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"injective", "evm", "v1beta1", "codes", "address"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_Code_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ethermint", "evm", "v1alpha1", "codes", "address"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_TxLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"injective", "evm", "v1beta1", "tx_logs", "hash"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_TxLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ethermint", "evm", "v1alpha1", "tx_logs", "hash"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_TxReceipt_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"injective", "evm", "v1beta1", "tx_receipt", "hash"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_TxReceipt_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ethermint", "evm", "v1alpha1", "tx_receipt", "hash"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_TxReceiptsByBlockHeight_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"injective", "evm", "v1beta1", "tx_receipts_block", "height"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_TxReceiptsByBlockHeight_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ethermint", "evm", "v1alpha1", "tx_receipts_block", "height"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_TxReceiptsByBlockHash_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"injective", "evm", "v1beta1", "tx_receipts_block_hash", "hash"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_TxReceiptsByBlockHash_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ethermint", "evm", "v1alpha1", "tx_receipts_block_hash", "hash"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_BlockLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"injective", "evm", "v1beta1", "block_logs", "hash"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_BlockLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ethermint", "evm", "v1alpha1", "block_logs", "hash"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_BlockBloom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"injective", "evm", "v1beta1", "block_bloom"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_BlockBloom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ethermint", "evm", "v1alpha1", "block_bloom"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"injective", "evm", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ethermint", "evm", "v1alpha1", "params"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_StaticCall_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"injective", "evm", "v1beta1", "static_call"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_StaticCall_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ethermint", "evm", "v1alpha1", "static_call"}, "", runtime.AssumeColonVerbOpt(true)))
)
var (
+22 -32
View File
@@ -20,17 +20,11 @@ import (
// StateTransition defines data to transitionDB in evm
type StateTransition struct {
// TxData fields
AccountNonce uint64
Price *big.Int
GasLimit uint64
Recipient *common.Address
Amount *big.Int
Payload []byte
Message core.Message
ChainID *big.Int
Csdb *CommitStateDB
TxHash *common.Hash
Sender common.Address
Simulate bool // i.e CheckTx execution
Debug bool // enable EVM debugging
}
@@ -79,7 +73,6 @@ func (st *StateTransition) newEVM(
ctx sdk.Context,
csdb *CommitStateDB,
gasLimit uint64,
gasPrice *big.Int,
config ChainConfig,
extraEIPs []int64,
) *vm.EVM {
@@ -95,10 +88,7 @@ func (st *StateTransition) newEVM(
GasLimit: gasLimit,
}
txCtx := vm.TxContext{
Origin: st.Sender,
GasPrice: gasPrice,
}
txCtx := core.NewEVMTxContext(st.Message)
eips := make([]int, len(extraEIPs))
for i, eip := range extraEIPs {
@@ -124,23 +114,23 @@ func (st *StateTransition) newEVM(
// returning the evm execution result.
// NOTE: State transition checks are run during AnteHandler execution.
func (st *StateTransition) TransitionDb(ctx sdk.Context, config ChainConfig) (resp *ExecutionResult, err error) {
contractCreation := st.Recipient == nil
contractCreation := st.Message.To() == nil
cost, err := core.IntrinsicGas(st.Payload, contractCreation, true, false)
cost, err := core.IntrinsicGas(st.Message.Data(), st.Message.AccessList(), true, false, true)
if err != nil {
err = sdkerrors.Wrap(err, "invalid intrinsic gas for transaction")
return nil, err
}
// This gas limit the the transaction gas limit with intrinsic gas subtracted
gasLimit := st.GasLimit - ctx.GasMeter().GasConsumed()
gasLimit := st.Message.Gas() - ctx.GasMeter().GasConsumed()
csdb := st.Csdb.WithContext(ctx)
if st.Simulate {
// gasLimit is set here because stdTxs incur gaskv charges in the ante handler, but for eth_call
// the cost needs to be the same as an Ethereum transaction sent through the web3 API
consumedGas := ctx.GasMeter().GasConsumed()
gasLimit = st.GasLimit - cost
gasLimit = st.Message.Gas() - cost
if consumedGas < cost {
// If Cosmos standard tx ante handler cost is less than EVM intrinsic cost
// gas must be consumed to match to accurately simulate an Ethereum transaction
@@ -166,19 +156,19 @@ func (st *StateTransition) TransitionDb(ctx sdk.Context, config ChainConfig) (re
return nil, errors.New("min gas price cannot be nil")
}
evm := st.newEVM(ctx, csdb, gasLimit, gasPrice.BigInt(), config, params.ExtraEIPs)
evm := st.newEVM(ctx, csdb, gasLimit, config, params.ExtraEIPs)
var (
ret []byte
leftOverGas uint64
contractAddress common.Address
senderRef = vm.AccountRef(st.Sender)
senderRef = vm.AccountRef(st.Message.From())
)
// Get nonce of account outside of the EVM
currentNonce := csdb.GetNonce(st.Sender)
currentNonce := csdb.GetNonce(st.Message.From())
// Set nonce of sender account before evm state transition for usage in generating Create address
csdb.SetNonce(st.Sender, st.AccountNonce)
csdb.SetNonce(st.Message.From(), st.Message.Nonce())
// create contract or execute call
switch contractCreation {
@@ -187,11 +177,11 @@ func (st *StateTransition) TransitionDb(ctx sdk.Context, config ChainConfig) (re
return nil, ErrCreateDisabled
}
ret, contractAddress, leftOverGas, err = evm.Create(senderRef, st.Payload, gasLimit, st.Amount)
ret, contractAddress, leftOverGas, err = evm.Create(senderRef, st.Message.Data(), gasLimit, st.Message.Value())
if err != nil {
log.WithField("simulate", st.Simulate).
WithField("AccountNonce", st.AccountNonce).
WithField("nonce", st.Message.Nonce()).
WithField("contract", contractAddress.String()).
WithError(err).Warningln("evm contract creation failed")
}
@@ -213,15 +203,15 @@ func (st *StateTransition) TransitionDb(ctx sdk.Context, config ChainConfig) (re
}
// Increment the nonce for the next transaction (just for evm state transition)
csdb.SetNonce(st.Sender, csdb.GetNonce(st.Sender)+1)
csdb.SetNonce(st.Message.From(), csdb.GetNonce(st.Message.From())+1)
ret, leftOverGas, err = evm.Call(senderRef, *st.Recipient, st.Payload, gasLimit, st.Amount)
ret, leftOverGas, err = evm.Call(senderRef, *st.Message.To(), st.Message.Data(), gasLimit, st.Message.Value())
// fmt.Println("EVM CALL!!!", senderRef.Address().Hex(), (*st.Recipient).Hex(), gasLimit)
// fmt.Println("EVM CALL!!!", senderRef.Address().Hex(), (*st.Message.To()).Hex(), gasLimit)
// fmt.Println("EVM CALL RESULT", common.ToHex(ret), leftOverGas, err)
if err != nil {
log.WithField("recipient", st.Recipient.String()).
log.WithField("recipient", st.Message.To().String()).
WithError(err).Debugln("evm call failed")
}
@@ -245,7 +235,7 @@ func (st *StateTransition) TransitionDb(ctx sdk.Context, config ChainConfig) (re
}
// Resets nonce to value pre state transition
csdb.SetNonce(st.Sender, currentNonce)
csdb.SetNonce(st.Message.From(), currentNonce)
// Generate bloom filter to be saved in tx receipt data
bloomInt := big.NewInt(0)
@@ -305,7 +295,7 @@ func (st *StateTransition) TransitionDb(ctx sdk.Context, config ChainConfig) (re
// instead of performing the modifications.
func (st *StateTransition) StaticCall(ctx sdk.Context, config ChainConfig) ([]byte, error) {
// This gas limit the the transaction gas limit with intrinsic gas subtracted
gasLimit := st.GasLimit - ctx.GasMeter().GasConsumed()
gasLimit := st.Message.Gas() - ctx.GasMeter().GasConsumed()
csdb := st.Csdb.WithContext(ctx)
// This gas meter is set up to consume gas from gaskv during evm execution and be ignored
@@ -322,12 +312,12 @@ func (st *StateTransition) StaticCall(ctx sdk.Context, config ChainConfig) ([]by
return []byte{}, errors.New("min gas price cannot be nil")
}
evm := st.newEVM(ctx, csdb, gasLimit, gasPrice.BigInt(), config, params.ExtraEIPs)
senderRef := vm.AccountRef(st.Sender)
evm := st.newEVM(ctx, csdb, gasLimit, config, params.ExtraEIPs)
senderRef := vm.AccountRef(st.Message.From())
ret, _, err := evm.StaticCall(senderRef, *st.Recipient, st.Payload, gasLimit)
ret, _, err := evm.StaticCall(senderRef, *st.Message.To(), st.Message.Data(), gasLimit)
// fmt.Println("EVM STATIC CALL!!!", senderRef.Address().Hex(), (*st.Recipient).Hex(), st.Payload, gasLimit)
// fmt.Println("EVM STATIC CALL!!!", senderRef.Address().Hex(), (*st.Message.To()).Hex(), st.Message.Data(), gasLimit)
// fmt.Println("EVM STATIC CALL RESULT", common.ToHex(ret), leftOverGas, err)
return ret, err
+91 -66
View File
@@ -10,6 +10,7 @@ import (
"github.com/cosmos/ethermint/x/evm/types"
ethcmn "github.com/ethereum/go-ethereum/common"
ethtypes "github.com/ethereum/go-ethereum/core/types"
ethcrypto "github.com/ethereum/go-ethereum/crypto"
)
@@ -36,17 +37,21 @@ func (suite *StateDBTestSuite) TestTransitionDb() {
"passing state transition",
func() {},
types.StateTransition{
AccountNonce: 123,
Price: big.NewInt(10),
GasLimit: 11,
Recipient: &recipient,
Amount: big.NewInt(50),
Payload: []byte("data"),
ChainID: big.NewInt(1),
Csdb: suite.stateDB,
TxHash: &ethcmn.Hash{},
Sender: suite.address,
Simulate: suite.ctx.IsCheckTx(),
Message: ethtypes.NewMessage(
suite.address,
&recipient,
123,
big.NewInt(50),
11,
big.NewInt(10),
[]byte("data"),
nil,
true,
),
ChainID: big.NewInt(1),
Csdb: suite.stateDB,
TxHash: &ethcmn.Hash{},
Simulate: suite.ctx.IsCheckTx(),
},
true,
},
@@ -54,17 +59,21 @@ func (suite *StateDBTestSuite) TestTransitionDb() {
"contract creation",
func() {},
types.StateTransition{
AccountNonce: 123,
Price: big.NewInt(10),
GasLimit: 11,
Recipient: nil,
Amount: big.NewInt(10),
Payload: []byte("data"),
ChainID: big.NewInt(1),
Csdb: suite.stateDB,
TxHash: &ethcmn.Hash{},
Sender: suite.address,
Simulate: true,
Message: ethtypes.NewMessage(
suite.address,
nil,
123,
big.NewInt(50),
11,
big.NewInt(10),
[]byte("data"),
nil,
true,
),
ChainID: big.NewInt(1),
Csdb: suite.stateDB,
TxHash: &ethcmn.Hash{},
Simulate: true,
},
true,
},
@@ -72,17 +81,21 @@ func (suite *StateDBTestSuite) TestTransitionDb() {
"state transition simulation",
func() {},
types.StateTransition{
AccountNonce: 123,
Price: big.NewInt(10),
GasLimit: 11,
Recipient: &recipient,
Amount: big.NewInt(10),
Payload: []byte("data"),
ChainID: big.NewInt(1),
Csdb: suite.stateDB,
TxHash: &ethcmn.Hash{},
Sender: suite.address,
Simulate: true,
Message: ethtypes.NewMessage(
suite.address,
&recipient,
123,
big.NewInt(50),
11,
big.NewInt(10),
[]byte("data"),
nil,
true,
),
ChainID: big.NewInt(1),
Csdb: suite.stateDB,
TxHash: &ethcmn.Hash{},
Simulate: true,
},
true,
},
@@ -90,17 +103,21 @@ func (suite *StateDBTestSuite) TestTransitionDb() {
"fail by sending more than balance",
func() {},
types.StateTransition{
AccountNonce: 123,
Price: big.NewInt(10),
GasLimit: 11,
Recipient: &recipient,
Amount: big.NewInt(500000),
Payload: []byte("data"),
ChainID: big.NewInt(1),
Csdb: suite.stateDB,
TxHash: &ethcmn.Hash{},
Sender: suite.address,
Simulate: suite.ctx.IsCheckTx(),
Message: ethtypes.NewMessage(
suite.address,
&recipient,
123,
big.NewInt(50000000),
11,
big.NewInt(10),
[]byte("data"),
nil,
true,
),
ChainID: big.NewInt(1),
Csdb: suite.stateDB,
TxHash: &ethcmn.Hash{},
Simulate: suite.ctx.IsCheckTx(),
},
false,
},
@@ -108,17 +125,21 @@ func (suite *StateDBTestSuite) TestTransitionDb() {
"failed to Finalize",
func() {},
types.StateTransition{
AccountNonce: 123,
Price: big.NewInt(10),
GasLimit: 11,
Recipient: &recipient,
Amount: big.NewInt(-5000),
Payload: []byte("data"),
ChainID: big.NewInt(1),
Csdb: suite.stateDB,
TxHash: &ethcmn.Hash{},
Sender: suite.address,
Simulate: false,
Message: ethtypes.NewMessage(
suite.address,
&recipient,
123,
big.NewInt(-5000),
11,
big.NewInt(10),
[]byte("data"),
nil,
true,
),
ChainID: big.NewInt(1),
Csdb: suite.stateDB,
TxHash: &ethcmn.Hash{},
Simulate: false,
},
false,
},
@@ -131,17 +152,21 @@ func (suite *StateDBTestSuite) TestTransitionDb() {
suite.ctx = suite.ctx.WithMinGasPrices(invalidGas)
},
types.StateTransition{
AccountNonce: 123,
Price: big.NewInt(10),
GasLimit: 11,
Recipient: &recipient,
Amount: big.NewInt(10),
Payload: []byte("data"),
ChainID: big.NewInt(1),
Csdb: suite.stateDB,
TxHash: &ethcmn.Hash{},
Sender: suite.address,
Simulate: suite.ctx.IsCheckTx(),
Message: ethtypes.NewMessage(
suite.address,
&recipient,
123,
big.NewInt(50),
11,
nil,
[]byte("data"),
nil,
true,
),
ChainID: big.NewInt(1),
Csdb: suite.stateDB,
TxHash: &ethcmn.Hash{},
Simulate: suite.ctx.IsCheckTx(),
},
false,
},
+26
View File
@@ -294,6 +294,32 @@ func (csdb *CommitStateDB) SlotInAccessList(addr ethcmn.Address, slot ethcmn.Has
return csdb.accessList.Contains(addr, slot)
}
// PrepareAccessList handles the preparatory steps for executing a state transition with
// regards to both EIP-2929 and EIP-2930:
//
// - Add sender to access list (2929)
// - Add destination to access list (2929)
// - Add precompiles to access list (2929)
// - Add the contents of the optional tx access list (2930)
//
// This method should only be called if Yolov3/Berlin/2929+2930 is applicable at the current number.
func (csdb *CommitStateDB) PrepareAccessList(sender ethcmn.Address, dst *ethcmn.Address, precompiles []ethcmn.Address, list ethtypes.AccessList) {
csdb.AddAddressToAccessList(sender)
if dst != nil {
csdb.AddAddressToAccessList(*dst)
// If it's a create-tx, the destination will be added inside evm.create
}
for _, addr := range precompiles {
csdb.AddAddressToAccessList(addr)
}
for _, el := range list {
csdb.AddAddressToAccessList(el.Address)
for _, key := range el.StorageKeys {
csdb.AddSlotToAccessList(el.Address, key)
}
}
}
// ----------------------------------------------------------------------------
// Getters
// ----------------------------------------------------------------------------
+123 -509
View File
@@ -1,5 +1,5 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: injective/evm/v1beta1/tx.proto
// source: ethermint/evm/v1alpha1/tx.proto
package types
@@ -31,17 +31,23 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// MsgEthereumTx encapsulates an Ethereum transaction as an SDK message.
type MsgEthereumTx struct {
// inner transaction data
Data *TxData `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
// caches
Size_ float64 `protobuf:"fixed64,2,opt,name=size,proto3" json:"-"`
From *SigCache `protobuf:"bytes,3,opt,name=from,proto3" json:"-"`
// encoded storage size of the transaction
Size_ float64 `protobuf:"fixed64,2,opt,name=size,proto3" json:"-"`
// transaction hash in hex format
Hash string `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty" rlp:"-"`
// ethereum signer address in hex format. This address value is checked against
// the address derived from the signature (V, R, S) using the secp256k1
// elliptic curve
From string `protobuf:"bytes,4,opt,name=from,proto3" json:"from,omitempty"`
}
func (m *MsgEthereumTx) Reset() { *m = MsgEthereumTx{} }
func (m *MsgEthereumTx) String() string { return proto.CompactTextString(m) }
func (*MsgEthereumTx) ProtoMessage() {}
func (*MsgEthereumTx) Descriptor() ([]byte, []int) {
return fileDescriptor_9fd15a427dc5b31e, []int{0}
return fileDescriptor_6a305e80b084ab0e, []int{0}
}
func (m *MsgEthereumTx) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -77,7 +83,7 @@ func (m *ExtensionOptionsEthereumTx) Reset() { *m = ExtensionOptionsEthe
func (m *ExtensionOptionsEthereumTx) String() string { return proto.CompactTextString(m) }
func (*ExtensionOptionsEthereumTx) ProtoMessage() {}
func (*ExtensionOptionsEthereumTx) Descriptor() ([]byte, []int) {
return fileDescriptor_9fd15a427dc5b31e, []int{1}
return fileDescriptor_6a305e80b084ab0e, []int{1}
}
func (m *ExtensionOptionsEthereumTx) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -113,7 +119,7 @@ func (m *ExtensionOptionsWeb3Tx) Reset() { *m = ExtensionOptionsWeb3Tx{}
func (m *ExtensionOptionsWeb3Tx) String() string { return proto.CompactTextString(m) }
func (*ExtensionOptionsWeb3Tx) ProtoMessage() {}
func (*ExtensionOptionsWeb3Tx) Descriptor() ([]byte, []int) {
return fileDescriptor_9fd15a427dc5b31e, []int{2}
return fileDescriptor_6a305e80b084ab0e, []int{2}
}
func (m *ExtensionOptionsWeb3Tx) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -163,7 +169,7 @@ func (m *MsgEthereumTxResponse) Reset() { *m = MsgEthereumTxResponse{} }
func (m *MsgEthereumTxResponse) String() string { return proto.CompactTextString(m) }
func (*MsgEthereumTxResponse) ProtoMessage() {}
func (*MsgEthereumTxResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_9fd15a427dc5b31e, []int{3}
return fileDescriptor_6a305e80b084ab0e, []int{3}
}
func (m *MsgEthereumTxResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -192,134 +198,47 @@ func (m *MsgEthereumTxResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_MsgEthereumTxResponse proto.InternalMessageInfo
// SigCache is used to cache the derived sender and contains the signer used
// to derive it.
type SigCache struct {
Signer *EIP155Signer `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"`
Address []byte `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
}
func (m *SigCache) Reset() { *m = SigCache{} }
func (m *SigCache) String() string { return proto.CompactTextString(m) }
func (*SigCache) ProtoMessage() {}
func (*SigCache) Descriptor() ([]byte, []int) {
return fileDescriptor_9fd15a427dc5b31e, []int{4}
}
func (m *SigCache) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *SigCache) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_SigCache.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *SigCache) XXX_Merge(src proto.Message) {
xxx_messageInfo_SigCache.Merge(m, src)
}
func (m *SigCache) XXX_Size() int {
return m.Size()
}
func (m *SigCache) XXX_DiscardUnknown() {
xxx_messageInfo_SigCache.DiscardUnknown(m)
}
var xxx_messageInfo_SigCache proto.InternalMessageInfo
// EIP155Transaction implements Signer using the EIP155 rules.
type EIP155Signer struct {
chainId []byte `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
chainIdMul []byte `protobuf:"bytes,2,opt,name=chain_id_mul,json=chainIdMul,proto3" json:"chain_id_mul,omitempty"`
}
func (m *EIP155Signer) Reset() { *m = EIP155Signer{} }
func (m *EIP155Signer) String() string { return proto.CompactTextString(m) }
func (*EIP155Signer) ProtoMessage() {}
func (*EIP155Signer) Descriptor() ([]byte, []int) {
return fileDescriptor_9fd15a427dc5b31e, []int{5}
}
func (m *EIP155Signer) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *EIP155Signer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_EIP155Signer.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *EIP155Signer) XXX_Merge(src proto.Message) {
xxx_messageInfo_EIP155Signer.Merge(m, src)
}
func (m *EIP155Signer) XXX_Size() int {
return m.Size()
}
func (m *EIP155Signer) XXX_DiscardUnknown() {
xxx_messageInfo_EIP155Signer.DiscardUnknown(m)
}
var xxx_messageInfo_EIP155Signer proto.InternalMessageInfo
func init() {
proto.RegisterType((*MsgEthereumTx)(nil), "injective.evm.v1beta1.MsgEthereumTx")
proto.RegisterType((*ExtensionOptionsEthereumTx)(nil), "injective.evm.v1beta1.ExtensionOptionsEthereumTx")
proto.RegisterType((*ExtensionOptionsWeb3Tx)(nil), "injective.evm.v1beta1.ExtensionOptionsWeb3Tx")
proto.RegisterType((*MsgEthereumTxResponse)(nil), "injective.evm.v1beta1.MsgEthereumTxResponse")
proto.RegisterType((*SigCache)(nil), "injective.evm.v1beta1.SigCache")
proto.RegisterType((*EIP155Signer)(nil), "injective.evm.v1beta1.EIP155Signer")
proto.RegisterType((*MsgEthereumTx)(nil), "ethermint.evm.v1alpha1.MsgEthereumTx")
proto.RegisterType((*ExtensionOptionsEthereumTx)(nil), "ethermint.evm.v1alpha1.ExtensionOptionsEthereumTx")
proto.RegisterType((*ExtensionOptionsWeb3Tx)(nil), "ethermint.evm.v1alpha1.ExtensionOptionsWeb3Tx")
proto.RegisterType((*MsgEthereumTxResponse)(nil), "ethermint.evm.v1alpha1.MsgEthereumTxResponse")
}
func init() { proto.RegisterFile("injective/evm/v1beta1/tx.proto", fileDescriptor_9fd15a427dc5b31e) }
func init() { proto.RegisterFile("ethermint/evm/v1alpha1/tx.proto", fileDescriptor_6a305e80b084ab0e) }
var fileDescriptor_9fd15a427dc5b31e = []byte{
// 572 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcd, 0x6e, 0xd3, 0x40,
0x10, 0x8e, 0xdb, 0xb4, 0x0d, 0xd3, 0x50, 0xaa, 0x55, 0x5b, 0x4c, 0x10, 0x76, 0x64, 0x50, 0x95,
0x03, 0xb5, 0x49, 0xab, 0x5e, 0xc2, 0x09, 0x43, 0x90, 0x22, 0x35, 0x02, 0xb9, 0x95, 0x2a, 0x71,
0x09, 0x6b, 0x7b, 0x71, 0x8c, 0x6c, 0x6f, 0xe4, 0xdd, 0x44, 0x2e, 0x47, 0x4e, 0x1c, 0x79, 0x03,
0x78, 0x9c, 0x1e, 0x7b, 0xe4, 0x64, 0xa1, 0xe4, 0xc6, 0xb1, 0x4f, 0x80, 0xbc, 0xb6, 0x43, 0x5a,
0x35, 0x12, 0xb7, 0xf9, 0xf9, 0xe6, 0x9b, 0x99, 0x6f, 0x67, 0x41, 0xf1, 0xa3, 0xcf, 0xc4, 0xe1,
0xfe, 0x84, 0x18, 0x64, 0x12, 0x1a, 0x93, 0xb6, 0x4d, 0x38, 0x6e, 0x1b, 0x3c, 0xd1, 0x47, 0x31,
0xe5, 0x14, 0xed, 0xce, 0xf3, 0x3a, 0x99, 0x84, 0x7a, 0x91, 0x6f, 0xec, 0x78, 0xd4, 0xa3, 0x02,
0x61, 0x64, 0x56, 0x0e, 0x6e, 0xa8, 0x77, 0x93, 0x65, 0x85, 0x02, 0xa0, 0xfd, 0x90, 0xe0, 0x7e,
0x9f, 0x79, 0x5d, 0x3e, 0x24, 0x31, 0x19, 0x87, 0x67, 0x09, 0x6a, 0x43, 0xd5, 0xc5, 0x1c, 0xcb,
0x52, 0x53, 0x6a, 0x6d, 0x1e, 0x3e,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4c, 0x16, 0xdd, 0x6c, 0x0d, 0x23, 0xa4, 0xee,
0x38, 0x20, 0x4c, 0xfc, 0x4e, 0x7e, 0x31, 0x22, 0xcc, 0x5e, 0x17, 0x1f, 0xf3, 0xe8, 0x6f, 0x00,
0x00, 0x00, 0xff, 0xff, 0xb3, 0xb6, 0x79, 0x34, 0x08, 0x04, 0x00, 0x00,
var fileDescriptor_6a305e80b084ab0e = []byte{
// 476 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x3f, 0x6f, 0xd3, 0x40,
0x18, 0xc6, 0x7d, 0x8d, 0xd3, 0x3f, 0x97, 0x02, 0xd5, 0xa9, 0x04, 0x63, 0x24, 0xdb, 0xb2, 0x84,
0x9a, 0x25, 0xb6, 0x9a, 0x6e, 0xd9, 0x6a, 0x51, 0x26, 0x2a, 0xa4, 0x53, 0x25, 0x10, 0x4b, 0x75,
0x76, 0x0e, 0xdb, 0x92, 0xed, 0xb3, 0xee, 0xae, 0x91, 0xcb, 0xca, 0xc2, 0xc8, 0xca, 0xc6, 0xc7,
0xe9, 0xd8, 0x91, 0xc9, 0x42, 0xc9, 0xc6, 0x98, 0x4f, 0x80, 0x7c, 0x6e, 0x52, 0x1a, 0x11, 0xa9,
0xdb, 0x7b, 0xef, 0xfb, 0xf3, 0xf9, 0x79, 0x9e, 0x7b, 0xa1, 0x4d, 0x65, 0x42, 0x79, 0x9e, 0x16,
0xd2, 0xa7, 0xd3, 0xdc, 0x9f, 0x1e, 0x93, 0xac, 0x4c, 0xc8, 0xb1, 0x2f, 0x2b, 0xaf, 0xe4, 0x4c,
0x32, 0xd4, 0x5f, 0x01, 0x1e, 0x9d, 0xe6, 0xde, 0x12, 0x30, 0x0f, 0x63, 0x16, 0x33, 0x85, 0xf8,
0x4d, 0xd5, 0xd2, 0xa6, 0xb3, 0xe1, 0xba, 0xe6, 0x53, 0x45, 0xb8, 0x3f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b1, 0x50, 0xce, 0x7b, 0xa3, 0xa3, 0x8d, 0x41, 0x72, 0x52,
0x08, 0x12, 0x35, 0xd2, 0xdf, 0xb1, 0x58, 0x04, 0xfd, 0x9b, 0xda, 0xd6, 0x16, 0xb5, 0xfd, 0xb4,
0x55, 0x70, 0x77, 0x8b, 0x8b, 0xb7, 0x65, 0xd5, 0xcc, 0xd1, 0x01, 0xec, 0x70, 0x2a, 0x55, 0x5c,
0xfb, 0xb8, 0x29, 0x91, 0x09, 0x77, 0x39, 0x9d, 0x52, 0x2e, 0xe9, 0xc4, 0xe8, 0x3a, 0x60, 0xb0,
0x8b, 0x57, 0xe7, 0x36, 0x85, 0x51, 0x0a, 0x3b, 0xe7, 0x22, 0x46, 0x21, 0x84, 0xff, 0x3c, 0xf4,
0xeb, 0x4d, 0x8a, 0x1e, 0xe4, 0x65, 0x0e, 0x1f, 0x85, 0x2d, 0x63, 0x0d, 0x4e, 0x6f, 0x66, 0x16,
0xb8, 0x9d, 0x59, 0xe0, 0xf7, 0xcc, 0x02, 0xdf, 0xe7, 0x96, 0x76, 0x3b, 0xb7, 0xb4, 0x5f, 0x73,
0x4b, 0xfb, 0x74, 0x14, 0xa7, 0x32, 0xb9, 0x0a, 0xbd, 0x88, 0xe5, 0x7e, 0xc4, 0x44, 0xce, 0x84,
0x7f, 0xbf, 0x9e, 0x95, 0x5a, 0x50, 0x79, 0x5d, 0x52, 0x11, 0x6e, 0xab, 0xd5, 0x3c, 0xf9, 0x1b,
0x00, 0x00, 0xff, 0xff, 0x74, 0xe0, 0xdf, 0x68, 0x0d, 0x03, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -348,7 +267,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient {
func (c *msgClient) EthereumTx(ctx context.Context, in *MsgEthereumTx, opts ...grpc.CallOption) (*MsgEthereumTxResponse, error) {
out := new(MsgEthereumTxResponse)
err := c.cc.Invoke(ctx, "/injective.evm.v1beta1.Msg/EthereumTx", in, out, opts...)
err := c.cc.Invoke(ctx, "/ethermint.evm.v1alpha1.Msg/EthereumTx", in, out, opts...)
if err != nil {
return nil, err
}
@@ -383,7 +302,7 @@ func _Msg_EthereumTx_Handler(srv interface{}, ctx context.Context, dec func(inte
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/injective.evm.v1beta1.Msg/EthereumTx",
FullMethod: "/ethermint.evm.v1alpha1.Msg/EthereumTx",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).EthereumTx(ctx, req.(*MsgEthereumTx))
@@ -392,7 +311,7 @@ func _Msg_EthereumTx_Handler(srv interface{}, ctx context.Context, dec func(inte
}
var _Msg_serviceDesc = grpc.ServiceDesc{
ServiceName: "injective.evm.v1beta1.Msg",
ServiceName: "ethermint.evm.v1alpha1.Msg",
HandlerType: (*MsgServer)(nil),
Methods: []grpc.MethodDesc{
{
@@ -401,7 +320,7 @@ var _Msg_serviceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "injective/evm/v1beta1/tx.proto",
Metadata: "ethermint/evm/v1alpha1/tx.proto",
}
func (m *MsgEthereumTx) Marshal() (dAtA []byte, err error) {
@@ -424,15 +343,17 @@ func (m *MsgEthereumTx) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if m.From != nil {
{
size, err := m.From.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintTx(dAtA, i, uint64(size))
}
if len(m.From) > 0 {
i -= len(m.From)
copy(dAtA[i:], m.From)
i = encodeVarintTx(dAtA, i, uint64(len(m.From)))
i--
dAtA[i] = 0x22
}
if len(m.Hash) > 0 {
i -= len(m.Hash)
copy(dAtA[i:], m.Hash)
i = encodeVarintTx(dAtA, i, uint64(len(m.Hash)))
i--
dAtA[i] = 0x1a
}
@@ -567,85 +488,6 @@ func (m *MsgEthereumTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
func (m *SigCache) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *SigCache) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *SigCache) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Address) > 0 {
i -= len(m.Address)
copy(dAtA[i:], m.Address)
i = encodeVarintTx(dAtA, i, uint64(len(m.Address)))
i--
dAtA[i] = 0x12
}
if m.Signer != nil {
{
size, err := m.Signer.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintTx(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *EIP155Signer) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *EIP155Signer) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *EIP155Signer) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.chainIdMul) > 0 {
i -= len(m.chainIdMul)
copy(dAtA[i:], m.chainIdMul)
i = encodeVarintTx(dAtA, i, uint64(len(m.chainIdMul)))
i--
dAtA[i] = 0x12
}
if len(m.chainId) > 0 {
i -= len(m.chainId)
copy(dAtA[i:], m.chainId)
i = encodeVarintTx(dAtA, i, uint64(len(m.chainId)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func encodeVarintTx(dAtA []byte, offset int, v uint64) int {
offset -= sovTx(v)
base := offset
@@ -670,8 +512,12 @@ func (m *MsgEthereumTx) Size() (n int) {
if m.Size_ != 0 {
n += 9
}
if m.From != nil {
l = m.From.Size()
l = len(m.Hash)
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
l = len(m.From)
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
return n
@@ -721,40 +567,6 @@ func (m *MsgEthereumTxResponse) Size() (n int) {
return n
}
func (m *SigCache) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Signer != nil {
l = m.Signer.Size()
n += 1 + l + sovTx(uint64(l))
}
l = len(m.Address)
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
return n
}
func (m *EIP155Signer) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.chainId)
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
l = len(m.chainIdMul)
if l > 0 {
n += 1 + l + sovTx(uint64(l))
}
return n
}
func sovTx(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
@@ -839,9 +651,9 @@ func (m *MsgEthereumTx) Unmarshal(dAtA []byte) error {
m.Size_ = float64(math.Float64frombits(v))
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field From", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType)
}
var msglen int
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
@@ -851,27 +663,55 @@ func (m *MsgEthereumTx) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthTx
}
postIndex := iNdEx + msglen
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthTx
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.From == nil {
m.From = &SigCache{}
m.Hash = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field From", wireType)
}
if err := m.From.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthTx
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthTx
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.From = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -879,7 +719,10 @@ func (m *MsgEthereumTx) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthTx
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTx
}
if (iNdEx + skippy) > l {
@@ -929,7 +772,10 @@ func (m *ExtensionOptionsEthereumTx) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthTx
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTx
}
if (iNdEx + skippy) > l {
@@ -979,7 +825,10 @@ func (m *ExtensionOptionsWeb3Tx) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthTx
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTx
}
if (iNdEx + skippy) > l {
@@ -1182,245 +1031,10 @@ func (m *MsgEthereumTxResponse) Unmarshal(dAtA []byte) error {
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if skippy < 0 {
return ErrInvalidLengthTx
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *SigCache) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: SigCache: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: SigCache: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthTx
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthTx
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Signer == nil {
m.Signer = &EIP155Signer{}
}
if err := m.Signer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthTx
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthTx
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...)
if m.Address == nil {
m.Address = []byte{}
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipTx(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTx
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *EIP155Signer) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: EIP155Signer: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: EIP155Signer: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field chainId", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthTx
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthTx
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.chainId = append(m.chainId[:0], dAtA[iNdEx:postIndex]...)
if m.chainId == nil {
m.chainId = []byte{}
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field chainIdMul", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthTx
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthTx
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.chainIdMul = append(m.chainIdMul[:0], dAtA[iNdEx:postIndex]...)
if m.chainIdMul == nil {
m.chainIdMul = []byte{}
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipTx(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTx
}
if (iNdEx + skippy) > l {
+4
View File
@@ -134,5 +134,9 @@ func IsEmptyHash(hash string) bool {
// IsZeroAddress returns true if the address corresponds to an empty ethereum hex address.
func IsZeroAddress(address string) bool {
if address == "" {
return true
}
return bytes.Equal(ethcmn.HexToAddress(address).Bytes(), ethcmn.Address{}.Bytes())
}