Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Create LedgerPreprocessHook to reformat EIP-712 payloads #1277

Merged
merged 12 commits into from
Sep 13, 2022
Prev Previous commit
Next Next commit
Implement minor fix and add changelog entry
  • Loading branch information
0a1c committed Sep 9, 2022
commit 4ae0eb03b3071523e8330dc7ae1103d5dfb69a57
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (cli) [#1226](https://github.com/evmos/ethermint/pull/1226) Add custom app db backend flag.
* (cli) [#1230](https://github.com/evmos/ethermint/pull/1230) Remove redundant positional height parameter from feemarket's query cli.
* (test) [#1311](https://github.com/evmos/ethermint/pull/1311) add integration test for the rollback cmd
* (ledger) [#1277](https://github.com/evmos/ethermint/pull/1277) Add Ledger preprocessing transaction hook for EIP-712-signed Cosmos payloads.

### Bug Fixes

Expand Down
6 changes: 5 additions & 1 deletion ethereum/eip712/preprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ func PreprocessLedgerTx(chainID string, keyType cosmoskr.KeyType, txBuilder clie
}

signature := sigs[0]
sigBytes := signature.Data.(*signing.SingleSignatureData).Signature
sigData, ok := signature.Data.(*signing.SingleSignatureData)
if !ok {
return fmt.Errorf("unexpected signature type, expected SingleSignatureData")
}
sigBytes := sigData.Signature

// Parse Chain ID as big.Int
chainIDInt, err := types.ParseChainID(chainID)
Expand Down