Transaction signing and encoding (#95)

* WIP setting up evm tx command and updating emint keys output

* Fix linting issue

* Wip restructuring to allow for ethereum signing and encoding

* WIP setting up keybase and context to use Ethermint keys

* Fixed encoding and decoding of emint keys

* Adds command for generating explicit ethereum tx

* Fixed evm route for handling tx

* Fixed tx and msg encoding which allows transactions to be sent

* Added relevant documentation for changes and cleaned up code

* Added documentation and indicators why code was overriden
This commit is contained in:
Austin Abell
2019-09-15 12:12:59 -04:00
committed by GitHub
parent 4c29c48905
commit 72fc3ca3af
20 changed files with 1070 additions and 66 deletions
+26 -1
View File
@@ -13,6 +13,9 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
emintkeys "github.com/cosmos/ethermint/keys"
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
bankcmd "github.com/cosmos/cosmos-sdk/x/bank/client/cli"
emintapp "github.com/cosmos/ethermint/app"
"github.com/spf13/cobra"
"github.com/spf13/viper"
@@ -48,7 +51,7 @@ func main() {
sdkrpc.StatusCommand(),
client.ConfigCmd(emintapp.DefaultCLIHome),
queryCmd(cdc),
// TODO: Set up tx command
txCmd(cdc),
// TODO: Set up rest routes (if included, different from web3 api)
rpc.Web3RpcCmd(cdc),
client.LineBreak,
@@ -83,6 +86,28 @@ func queryCmd(cdc *amino.Codec) *cobra.Command {
return queryCmd
}
func txCmd(cdc *amino.Codec) *cobra.Command {
txCmd := &cobra.Command{
Use: "tx",
Short: "Transactions subcommands",
}
txCmd.AddCommand(
bankcmd.SendTxCmd(cdc),
client.LineBreak,
authcmd.GetSignCommand(cdc),
client.LineBreak,
authcmd.GetBroadcastCommand(cdc),
authcmd.GetEncodeCommand(cdc),
client.LineBreak,
)
// add modules' tx commands
emintapp.ModuleBasics.AddTxCommands(txCmd, cdc)
return txCmd
}
func initConfig(cmd *cobra.Command) error {
home, err := cmd.PersistentFlags().GetString(cli.HomeFlag)
if err != nil {