Skip to content

Update integrate docs #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions docs/integrate/to-cosmos-sdk-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -925,10 +925,10 @@ func NewAnteHandler(options HandlerOptions) sdk.AnteHandler {
opts := txWithExtensions.GetExtensionOptions()
if len(opts) > 0 {
switch typeURL := opts[0].GetTypeUrl(); typeURL {
case "/os.evm.v1.ExtensionOptionsEthereumTx":
case "/cosmos.evm.vm.v1.ExtensionOptionsEthereumTx":
// handle as *evmtypes.MsgEthereumTx
anteHandler = newMonoEVMAnteHandler(options)
case "/os.types.v1.ExtensionOptionDynamicFeeTx":
case "/cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx":
// cosmos-sdk tx with dynamic fee extension
anteHandler = NewCosmosAnteHandler(options)
default:
Expand Down Expand Up @@ -1019,7 +1019,7 @@ func initRootCmd(
}
```

## Step 10: Update root.go to Use EVM-Compatible Keyring
## Step 10: Update root.go to Use EVM-Compatible Keyring and Coin Type

Update `cmd/evmd/root.go`:
```go
Expand All @@ -1038,8 +1038,14 @@ func NewRootCmd() *cobra.Command {
clientCtx = clientCtx.
// ... existing options
WithBroadcastMode(flags.FlagBroadcastMode). // Add this
WithKeyringOptions(evmkeyring.Option()). // Add this
WithLedgerHasProtobuf(true). // Add this
WithKeyringOptions(evmkeyring.Option()). // Add this
WithLedgerHasProtobuf(true) // Add this

// Update the coin type
cfg := sdk.GetConfig()
cfg.SetCoinType(evmtypes.Bip44CoinType)
cfg.SetPurpose(sdk.Purpose)
cfg.Seal()
}
```

Expand Down