Skip to content

Commit

Permalink
wip: update message signer
Browse files Browse the repository at this point in the history
  • Loading branch information
boodyvo committed Nov 1, 2024
1 parent 884c77e commit 8661160
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions x/evm/types/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"errors"
"fmt"
"github.com/cosmos/cosmos-proto/anyutil"
"github.com/cosmos/cosmos-sdk/types/tx"
signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing"
"google.golang.org/protobuf/reflect/protoreflect"
"math/big"
Expand Down Expand Up @@ -330,15 +329,6 @@ func GetSigners(msg protov2.Message) ([][]byte, error) {
if err != nil {
}

type protoTxProvider interface {
GetProtoTx() *tx.Tx
}

wrapperTx, ok := msg.(protoTxProvider)
fmt.Println("Eth message is protoTxProvider", wrapperTx, ok)
if !ok {
}

fmt.Println("Test Eth Get signers is invoked")
fmt.Println("Eth message type", msgV1.String())

Expand Down Expand Up @@ -401,6 +391,11 @@ func GetSigners(msg protov2.Message) ([][]byte, error) {
if err != nil {
fmt.Println("Eth message tryingTypeAnyV1 error", err)
}
msgEthTx, is := tryingTypeAnyV1.(*MsgEthereumTx)

Check failure on line 394 in x/evm/types/msg.go

View workflow job for this annotation

GitHub Actions / Run golangci-lint

invalid operation: tryingTypeAnyV1 (variable of type *"github.com/cosmos/cosmos-sdk/codec/types".Any) is not an interface (typecheck)

Check failure on line 394 in x/evm/types/msg.go

View workflow job for this annotation

GitHub Actions / Run golangci-lint

invalid operation: tryingTypeAnyV1 (variable of type *"github.com/cosmos/cosmos-sdk/codec/types".Any) is not an interface) (typecheck)

Check failure on line 394 in x/evm/types/msg.go

View workflow job for this annotation

GitHub Actions / Run golangci-lint

invalid operation: tryingTypeAnyV1 (variable of type *"github.com/cosmos/cosmos-sdk/codec/types".Any) is not an interface) (typecheck)

Check failure on line 394 in x/evm/types/msg.go

View workflow job for this annotation

GitHub Actions / Run golangci-lint

invalid operation: tryingTypeAnyV1 (variable of type *"github.com/cosmos/cosmos-sdk/codec/types".Any) is not an interface) (typecheck)

Check failure on line 394 in x/evm/types/msg.go

View workflow job for this annotation

GitHub Actions / Run golangci-lint

invalid operation: tryingTypeAnyV1 (variable of type *"github.com/cosmos/cosmos-sdk/codec/types".Any) is not an interface) (typecheck)

Check failure on line 394 in x/evm/types/msg.go

View workflow job for this annotation

GitHub Actions / test-importer

invalid operation: tryingTypeAnyV1 (variable of type *"github.com/cosmos/cosmos-sdk/codec/types".Any) is not an interface

Check failure on line 394 in x/evm/types/msg.go

View workflow job for this annotation

GitHub Actions / build

invalid operation: tryingTypeAnyV1 (variable of type *"github.com/cosmos/cosmos-sdk/codec/types".Any) is not an interface

Check failure on line 394 in x/evm/types/msg.go

View workflow job for this annotation

GitHub Actions / test-rpc

invalid operation: tryingTypeAnyV1 (variable of type *"github.com/cosmos/cosmos-sdk/codec/types".Any) is not an interface

Check failure on line 394 in x/evm/types/msg.go

View workflow job for this annotation

GitHub Actions / test-unit-cover

invalid operation: tryingTypeAnyV1 (variable of type *"github.com/cosmos/cosmos-sdk/codec/types".Any) is not an interface
if !is {
fmt.Println("Eth message tryingTypeAnyV1 is not MsgEthereumTx")
//return nil, fmt.Errorf("invalid type, expected MsgEthereumTx and got %T", msg)
}

var data TxData
switch {
Expand All @@ -425,6 +420,17 @@ func GetSigners(msg protov2.Message) ([][]byte, error) {
if err != nil {
fmt.Println("Eth message tryingTypeAnyV1 LegacyTx error", err)
}
case tryingTypeAnyV1.TypeUrl == "/ethermint.evm.v1.MsgEthereumTx":
msgTyped := &MsgEthereumTx{}
err = msgTyped.Unmarshal(tryingTypeAnyV1.Value)
fmt.Println("Eth message tryingTypeAnyV1 MsgEthereumTx", msgTyped)
if err != nil {
fmt.Println("Eth message tryingTypeAnyV1 MsgEthereumTx error", err)
}
data, err = UnpackTxData(msgTyped.Data)
if err != nil {
fmt.Println("Eth message tryingTypeAnyV1 MsgEthereumTx data error", err)
}
default:
fmt.Println("Eth message tryingTypeAnyV1 unknown")
}
Expand Down

0 comments on commit 8661160

Please sign in to comment.