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 b7c073c commit 20b8c1d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions x/evm/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package types

import (
errorsmod "cosmossdk.io/errors"
"fmt"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -93,6 +94,8 @@ func UnpackTxData(any *codectypes.Any) (TxData, error) {
return nil, errorsmod.Wrap(errortypes.ErrUnpackAny, "protobuf Any message cannot be nil")
}

fmt.Println("UnpackTxData", any.GetCachedValue())

txData, ok := any.GetCachedValue().(TxData)
if !ok {
return nil, errorsmod.Wrapf(errortypes.ErrUnpackAny, "cannot unpack Any into TxData %T", any)
Expand Down
8 changes: 8 additions & 0 deletions x/evm/types/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,14 @@ func GetSigners(msg protov2.Message) ([][]byte, error) {
return nil, err
}

testMsg := &MsgEthereumTx{}

err = protov1.Unmarshal(marshaledData, testMsg)
fmt.Println("Eth unmarshaled data message", testMsg)
if err != nil {
fmt.Println("Eth message unmarshaled first message from proto error", err)
}

msgData := &MsgEthereumTx{}
err = msgData.Unmarshal(marshaledData)
fmt.Println("Eth message data after transformation", msgData)
Expand Down

0 comments on commit 20b8c1d

Please sign in to comment.