Skip to content
This repository was archived by the owner on Nov 30, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
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
13 changes: 10 additions & 3 deletions cmd/emintcli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
sdkrpc "github.com/cosmos/cosmos-sdk/client/rpc"
sdk "github.com/cosmos/cosmos-sdk/types"
emintkeys "github.com/cosmos/ethermint/keys"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"

authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
bankcmd "github.com/cosmos/cosmos-sdk/x/bank/client/cli"
Expand All @@ -27,6 +28,8 @@ func main() {

cdc := emintapp.MakeCodec()

authtypes.ModuleCdc = cdc

// Read in the configuration file for the sdk
config := sdk.GetConfig()
// TODO: Remove or change prefix if usable to generate Ethereum address
Expand Down Expand Up @@ -76,9 +79,13 @@ func queryCmd(cdc *amino.Codec) *cobra.Command {
}

// TODO: Possibly add these query commands from other modules
//queryCmd.AddCommand(
// ...
//)
queryCmd.AddCommand(
authcmd.GetAccountCmd(cdc),
client.LineBreak,
authcmd.QueryTxsByEventsCmd(cdc),
authcmd.QueryTxCmd(cdc),
client.LineBreak,
)

// add modules' query commands
emintapp.ModuleBasics.AddQueryCommands(queryCmd, cdc)
Expand Down
77 changes: 0 additions & 77 deletions types/account_retriever.go

This file was deleted.

2 changes: 1 addition & 1 deletion x/evm/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func GetCmdGenETHTx(cdc *codec.Codec) *cobra.Command {

payload := args[3]

txBldr, err = emintUtils.PrepareTxBuilder(txBldr, cliCtx)
txBldr, err = utils.PrepareTxBuilder(txBldr, cliCtx)
if err != nil {
return err
}
Expand Down
31 changes: 0 additions & 31 deletions x/evm/client/utils/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,34 +342,3 @@ func getFromFields(from string, genOnly bool) (sdk.AccAddress, string, error) {

return info.GetAddress(), info.GetName(), nil
}

// * Overriden function from cosmos-sdk/auth/client/utils/tx.go
// PrepareTxBuilder populates a TxBuilder in preparation for the build of a Tx.
func PrepareTxBuilder(txBldr authtypes.TxBuilder, cliCtx context.CLIContext) (authtypes.TxBuilder, error) {
from := cliCtx.GetFromAddress()

// * Function is needed to override to use different account getter (to not use static codec)
accGetter := emint.NewAccountRetriever(cliCtx, cliCtx.Codec)
if err := accGetter.EnsureExists(from); err != nil {
return txBldr, err
}

txbldrAccNum, txbldrAccSeq := txBldr.AccountNumber(), txBldr.Sequence()
// TODO: (ref #1903) Allow for user supplied account number without
// automatically doing a manual lookup.
if txbldrAccNum == 0 || txbldrAccSeq == 0 {
num, seq, err := accGetter.GetAccountNumberSequence(from)
if err != nil {
return txBldr, err
}

if txbldrAccNum == 0 {
txBldr = txBldr.WithAccountNumber(num)
}
if txbldrAccSeq == 0 {
txBldr = txBldr.WithSequence(seq)
}
}

return txBldr, nil
}