Skip to content

Commit

Permalink
cmd: fix command issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbeng committed Aug 16, 2024
1 parent a8a52ad commit 1cf61b4
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 44 deletions.
30 changes: 15 additions & 15 deletions api/artela/types/account.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions app/app_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
_ "github.com/artela-network/artela-rollkit/x/fee/module" // import for side-effects
feemoduletypes "github.com/artela-network/artela-rollkit/x/fee/types"

_ "github.com/artela-network/artela-rollkit/ethereum/types"

runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1"
appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1"
authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1"
Expand Down
14 changes: 14 additions & 0 deletions app/codec.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package app

import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"

crypto "github.com/artela-network/artela-rollkit/ethereum/crypto/codec"
"github.com/artela-network/artela-rollkit/ethereum/types"
)

// RegisterInterfaces registers Interfaces from types, crypto, and SDK std.
func RegisterInterfaces(interfaceRegistry codectypes.InterfaceRegistry) {
crypto.RegisterInterfaces(interfaceRegistry)
types.RegisterInterfaces(interfaceRegistry)
}
6 changes: 4 additions & 2 deletions cmd/artelad/cmd/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

_ "github.com/artela-network/artela-rollkit/ethereum/types"

"github.com/artela-network/artela-rollkit/app"
artclient "github.com/artela-network/artela-rollkit/client"
eth "github.com/artela-network/artela-rollkit/ethereum/server/flags"
Expand All @@ -41,13 +43,13 @@ func initRootCmd(
) {
rootCmd.AddCommand(
genutilcli.InitCmd(basicManager, app.DefaultNodeHome),
genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome, genutiltypes.DefaultMessageValidator, address.NewBech32Codec(app.AccountAddressPrefix)),
genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome, genutiltypes.DefaultMessageValidator, address.NewBech32Codec(app.AccountAddressPrefix+"valoper")),
genutilcli.GenTxCmd(
basicManager,
txConfig,
banktypes.GenesisBalancesIterator{},
app.DefaultNodeHome,
address.NewBech32Codec(app.AccountAddressPrefix),
address.NewBech32Codec(app.AccountAddressPrefix+"valoper"),
),
genutilcli.ValidateGenesisCmd(basicManager),
debug.Cmd(),
Expand Down
2 changes: 2 additions & 0 deletions cmd/artelad/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ func ProvideClientContext(
txConfig client.TxConfig,
legacyAmino *codec.LegacyAmino,
) client.Context {
app.RegisterInterfaces(interfaceRegistry)

clientCtx := client.Context{}.
WithCodec(appCodec).
WithInterfaceRegistry(interfaceRegistry).
Expand Down
44 changes: 22 additions & 22 deletions ethereum/types/account.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion ethereum/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package types

import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/tx"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
)
Expand All @@ -10,7 +11,7 @@ import (
// implementations and interfaces.
func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
registry.RegisterImplementations(
(*authtypes.AccountI)(nil),
(*types.AccountI)(nil),
&EthAccount{},
)
registry.RegisterImplementations(
Expand Down
6 changes: 3 additions & 3 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ if [ -d "$folder_path" ]; then
fi
fi

echo artela-rollkitd config set client keyring-backend $KEYRING
artela-rollkitd config set client keyring-backend $KEYRING
echo artela-rollkitd config set client chain-id $CHAINID
artela-rollkitd config set client chain-id $CHAINID
echo artela-rollkitd config set client keyring-backend $KEYRING
artela-rollkitd config set client keyring-backend $KEYRING

# if $KEY exists it should be deleted
artela-rollkitd keys add $KEY --keyring-backend $KEYRING --algo $KEYALGO
Expand Down Expand Up @@ -74,9 +74,9 @@ artela-rollkitd add-genesis-account $KEY 100000000000000000000000000aart --keyri
artela-rollkitd add-genesis-account $KEY2 100000000000000000000000000aart --keyring-backend $KEYRING
artela-rollkitd add-genesis-account $KEY3 100000000000000000000000000aart --keyring-backend $KEYRING
artela-rollkitd add-genesis-account $KEY4 100000000000000000000000000aart --keyring-backend $KEYRING
echo artela-rollkitd add-genesis-account $KEY 100000000000000000000000000aart --keyring-backend $KEYRING

# Sign genesis transaction
echo gentx $KEY 1000000000000000000000aart --keyring-backend $KEYRING --chain-id $CHAINID
artela-rollkitd gentx $KEY 1000000000000000000000aart --keyring-backend $KEYRING --chain-id $CHAINID

# Collect genesis tx
Expand Down
2 changes: 1 addition & 1 deletion proto/artela/types/account.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ message EthAccount {
option (gogoproto.equal) = false;

option (cosmos_proto.implements_interface) =
"github.com/cosmos/cosmos-sdk/x/auth/types.AccountI";
"github.com/cosmos/cosmos-sdk/types.AccountI";

// base_account is an authtypes.BaseAccount
cosmos.auth.v1beta1.BaseAccount base_account = 1 [
Expand Down

0 comments on commit 1cf61b4

Please sign in to comment.