Skip to content

Commit

Permalink
Emit signer event for all cases (sei-protocol#1689)
Browse files Browse the repository at this point in the history
  • Loading branch information
codchen authored May 20, 2024
1 parent c725b57 commit 6140a56
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/seid/cmd/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ $ %s debug dump-iavl 12345
return cmd
}

//nolint:gosec
func dumpIavlCmdHandler(cmd *cobra.Command, args []string) error {
var err error
home, err := os.UserHomeDir()
Expand Down
6 changes: 6 additions & 0 deletions x/evm/ante/preprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,16 +365,22 @@ func (p *EVMAddressDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bo
acc := p.accountKeeper.GetAccount(ctx, signer)
if acc.GetPubKey() == nil {
ctx.Logger().Error(fmt.Sprintf("missing pubkey for %s", signer.String()))
ctx.EventManager().EmitEvent(sdk.NewEvent(evmtypes.EventTypeSigner,
sdk.NewAttribute(evmtypes.AttributeKeySeiAddress, signer.String())))
continue
}
pk, err := btcec.ParsePubKey(acc.GetPubKey().Bytes(), btcec.S256())
if err != nil {
ctx.Logger().Debug(fmt.Sprintf("failed to parse pubkey for %s, likely due to the fact that it isn't on secp256k1 curve", acc.GetPubKey()), "err", err)
ctx.EventManager().EmitEvent(sdk.NewEvent(evmtypes.EventTypeSigner,
sdk.NewAttribute(evmtypes.AttributeKeySeiAddress, signer.String())))
continue
}
evmAddr, err := pubkeyToEVMAddress(pk.SerializeUncompressed())
if err != nil {
ctx.Logger().Error(fmt.Sprintf("failed to get EVM address from pubkey due to %s", err))
ctx.EventManager().EmitEvent(sdk.NewEvent(evmtypes.EventTypeSigner,
sdk.NewAttribute(evmtypes.AttributeKeySeiAddress, signer.String())))
continue
}
ctx.EventManager().EmitEvent(sdk.NewEvent(evmtypes.EventTypeSigner,
Expand Down

0 comments on commit 6140a56

Please sign in to comment.