Skip to content
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

patch govshuttle #60

Merged
merged 16 commits into from
Jul 11, 2024
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
112 changes: 93 additions & 19 deletions api/canto/govshuttle/v1/genesis.pulsar.go

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

4 changes: 4 additions & 0 deletions api/canto/govshuttle/v1/govshuttle.pulsar.go

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

6 changes: 6 additions & 0 deletions app/amino_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (

coinswapapi "github.com/Canto-Network/Canto/v7/api/canto/coinswap/v1"
csrapi "github.com/Canto-Network/Canto/v7/api/canto/csr/v1"
govshuttleapi "github.com/Canto-Network/Canto/v7/api/canto/govshuttle/v1"
inflationapi "github.com/Canto-Network/Canto/v7/api/canto/inflation/v1"
onboardingapi "github.com/Canto-Network/Canto/v7/api/canto/onboarding/v1"
"github.com/Canto-Network/Canto/v7/x/coinswap"
Expand All @@ -38,6 +39,7 @@ import (
"github.com/Canto-Network/Canto/v7/x/epochs"
"github.com/Canto-Network/Canto/v7/x/erc20"
"github.com/Canto-Network/Canto/v7/x/govshuttle"
govshuttletypes "github.com/Canto-Network/Canto/v7/x/govshuttle/types"
"github.com/Canto-Network/Canto/v7/x/inflation"
inflationtypes "github.com/Canto-Network/Canto/v7/x/inflation/types"
"github.com/Canto-Network/Canto/v7/x/onboarding"
Expand Down Expand Up @@ -94,6 +96,10 @@ func TestAminoJSON_Equivalence(t *testing.T) {
// onboarding
GenType(&onboardingtypes.MsgUpdateParams{}, &onboardingapi.MsgUpdateParams{}, GenOpts.WithDisallowNil()),
GenType(&onboardingtypes.Params{}, &onboardingapi.Params{}, GenOpts.WithDisallowNil()),

// govshuttle
GenType(&govshuttletypes.LendingMarketProposal{}, &govshuttleapi.LendingMarketProposal{}, GenOpts.WithDisallowNil()),
GenType(&govshuttletypes.TreasuryProposal{}, &govshuttleapi.TreasuryProposal{}, GenOpts.WithDisallowNil()),
}

for _, tt := range testedMsgs {
Expand Down
4 changes: 2 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ func NewCanto(
ethermint.ProtoAccount,
maccPerms,
authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()),
sdk.Bech32MainPrefix,
sdk.GetConfig().GetBech32AccountAddrPrefix(),
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
app.BankKeeper = bankkeeper.NewBaseKeeper(
Expand Down Expand Up @@ -761,7 +761,7 @@ func NewCanto(
erc20.NewAppModule(app.Erc20Keeper, app.AccountKeeper),
epochs.NewAppModule(appCodec, app.EpochsKeeper),
onboarding.NewAppModule(*app.OnboardingKeeper),
govshuttle.NewAppModule(app.GovshuttleKeeper, app.AccountKeeper),
govshuttle.NewAppModule(app.GovshuttleKeeper, app.AccountKeeper, app.AccountKeeper.AddressCodec()),
csr.NewAppModule(app.CSRKeeper, app.AccountKeeper),
coinswap.NewAppModule(appCodec, app.CoinswapKeeper, app.AccountKeeper, app.BankKeeper),
)
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ require (
cosmossdk.io/client/v2 v2.0.0-beta.1
cosmossdk.io/collections v0.4.0
cosmossdk.io/core v0.12.0
cosmossdk.io/errors v1.0.1
cosmossdk.io/log v1.3.1
cosmossdk.io/math v1.3.0
cosmossdk.io/simapp v0.0.0-20231103111158-e83a20081ced
cosmossdk.io/store v1.1.0
cosmossdk.io/tools/confix v0.1.0
Expand Down Expand Up @@ -39,8 +41,12 @@ require (
github.com/rakyll/statik v0.1.7
github.com/spf13/cast v1.6.0
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.18.2
github.com/stretchr/testify v1.9.0
go.opencensus.io v0.24.0
golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0
golang.org/x/sync v0.7.0
google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de
google.golang.org/grpc v1.63.2
google.golang.org/protobuf v1.33.0
Expand Down Expand Up @@ -146,8 +152,6 @@ require (
)

require (
cosmossdk.io/errors v1.0.1
cosmossdk.io/math v1.3.0
filippo.io/edwards25519 v1.0.0 // indirect
github.com/99designs/keyring v1.2.2 // indirect
github.com/DataDog/zstd v1.5.5 // indirect
Expand Down Expand Up @@ -229,8 +233,6 @@ require (
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.18.2
github.com/status-im/keycard-go v0.2.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
Expand All @@ -239,9 +241,7 @@ require (
github.com/zondax/hid v0.9.2 // indirect
go.etcd.io/bbolt v1.3.8 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0
golang.org/x/net v0.24.0 // indirect
golang.org/x/sync v0.7.0
golang.org/x/sys v0.19.0 // indirect
golang.org/x/term v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
Expand Down
5 changes: 4 additions & 1 deletion init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ cantod init $MONIKER --chain-id $CHAINID
# Change parameter token denominations to acanto
cat $HOME/.cantod/config/genesis.json | jq '.app_state["staking"]["params"]["bond_denom"]="acanto"' > $HOME/.cantod/config/tmp_genesis.json && mv $HOME/.cantod/config/tmp_genesis.json $HOME/.cantod/config/genesis.json
cat $HOME/.cantod/config/genesis.json | jq '.app_state["crisis"]["constant_fee"]["denom"]="acanto"' > $HOME/.cantod/config/tmp_genesis.json && mv $HOME/.cantod/config/tmp_genesis.json $HOME/.cantod/config/genesis.json
cat $HOME/.cantod/config/genesis.json | jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="acanto"' > $HOME/.cantod/config/tmp_genesis.json && mv $HOME/.cantod/config/tmp_genesis.json $HOME/.cantod/config/genesis.json
cat $HOME/.cantod/config/genesis.json | jq '.app_state["coinswap"]["params"]["pool_creation_fee"]["denom"]="acanto"' > $HOME/.cantod/config/tmp_genesis.json && mv $HOME/.cantod/config/tmp_genesis.json $HOME/.cantod/config/genesis.json
cat $HOME/.cantod/config/genesis.json | jq '.app_state["coinswap"]["standard_denom"]="acanto"' > $HOME/.cantod/config/tmp_genesis.json && mv $HOME/.cantod/config/tmp_genesis.json $HOME/.cantod/config/genesis.json
cat $HOME/.cantod/config/genesis.json | jq '.app_state["gov"]["params"]["min_deposit"][0]["denom"]="acanto"' > $HOME/.cantod/config/tmp_genesis.json && mv $HOME/.cantod/config/tmp_genesis.json $HOME/.cantod/config/genesis.json
cat $HOME/.cantod/config/genesis.json | jq '.app_state["gov"]["params"]["expedited_min_deposit"][0]["denom"]="acanto"' > $HOME/.cantod/config/tmp_genesis.json && mv $HOME/.cantod/config/tmp_genesis.json $HOME/.cantod/config/genesis.json
cat $HOME/.cantod/config/genesis.json | jq '.app_state["evm"]["params"]["evm_denom"]="acanto"' > $HOME/.cantod/config/tmp_genesis.json && mv $HOME/.cantod/config/tmp_genesis.json $HOME/.cantod/config/genesis.json
cat $HOME/.cantod/config/genesis.json | jq '.app_state["inflation"]["params"]["mint_denom"]="acanto"' > $HOME/.cantod/config/tmp_genesis.json && mv $HOME/.cantod/config/tmp_genesis.json $HOME/.cantod/config/genesis.json

Expand Down
1 change: 1 addition & 0 deletions proto/canto/govshuttle/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ option go_package = "github.com/Canto-Network/Canto/v7/x/govshuttle/types";
// GenesisState defines the govshuttle module's genesis state.
message GenesisState {
Params params = 1 [ (gogoproto.nullable) = false ];
string port_contract_addr = 2;
// this line is used by starport scaffolding # genesis/proto/state
}
4 changes: 4 additions & 0 deletions proto/canto/govshuttle/v1/govshuttle.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ message Params { option (gogoproto.goproto_stringer) = false; }

// Define this object so that the govshuttle.pb.go file is generate, implements
// govtypes.Content
// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov
// proposals, see MsgLendingMarketProposal.
message LendingMarketProposal {
option (gogoproto.equal) = false;
option (cosmos_proto.implements_interface) =
Expand All @@ -25,6 +27,8 @@ message LendingMarketProposal {
}

// treasury proposal type,
// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov
// proposals, see MsgTreasuryProposal.
message TreasuryProposal {
option (gogoproto.equal) = false;
option (cosmos_proto.implements_interface) =
Expand Down
Loading
Loading