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

Mint Tests #10

Merged
merged 3 commits into from
Apr 5, 2023
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
1 change: 0 additions & 1 deletion .github/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ jobs:
matrix:
test_type:
- "DungeonTransferBlock"
- "ScheduledCall"

steps:
- name: Set up Go 1.18
Expand Down
72 changes: 32 additions & 40 deletions integration_tests/dungeon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import (
"context"
"encoding/json"
"fmt"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
"os"
"strings"
"testing"
"time"

"github.com/cosmos/cosmos-sdk/codec"
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
paramsutils "github.com/cosmos/cosmos-sdk/x/params/client/utils"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
"github.com/icza/dyno"
Expand Down Expand Up @@ -196,36 +197,32 @@ func TestDungeonTransferBlock(t *testing.T) {
Enabled: false,
},
}
data, err := json.Marshal(sendEnableds)
require.NoError(t, err)

prop := paramsutils.ParamChangeProposalJSON{
Title: "Disable sendability of uxion",
Description: "This proposal prevents uxion from being sent in the bank module",
Changes: []paramsutils.ParamChangeJSON{
{
Subspace: banktypes.ModuleName,
Key: "SendEnabled",
Value: data,
},
},
Deposit: "100uxion",
}

prop := govtypes.NewMsgSubmitProposal(
[]types.Msg{
config := types.GetConfig()
config.SetBech32PrefixForAccount("xion", "xionpub")

},
types.Coins{
{
Denom: "uxion",
Amount: "100"
},
setSendEnabledMsg := banktypes.MsgSetSendEnabled{
Authority: authtypes.NewModuleAddress("gov").String(),
SendEnabled: sendEnableds,
}

}
registry := cdctypes.NewInterfaceRegistry()
registry.RegisterImplementations(
(*types.Msg)(nil),
&banktypes.MsgSetSendEnabled{},
)
cdc := codec.NewProtoCodec(registry)

paramChangeTx, err := xion.LegacyParamChangeProposal(ctx, xionUser.KeyName(), &prop)
msg, err := cdc.MarshalInterfaceJSON(&setSendEnabledMsg)

prop := cosmos.Proposal{
Messages: []json.RawMessage{msg},
Metadata: "",
Deposit: "100uxion",
Title: "Disable sendability of uxion",
Summary: "This proposal prevents uxion from being sent in the bank module",
}
paramChangeTx, err := xion.SubmitProposal(ctx, xionUser.KeyName(), &prop)
require.NoError(t, err)
t.Logf("Param change proposal submitted with ID %s in transaction %s", paramChangeTx.ProposalID, paramChangeTx.TxHash)

Expand Down Expand Up @@ -358,22 +355,17 @@ func modifyGenesisShortProposals(votingPeriod string, maxDepositPeriod string) f
if err := json.Unmarshal(genbz, &g); err != nil {
return nil, fmt.Errorf("failed to unmarshal genesis file: %w", err)
}
votingParams := map[string]interface{}{"voting_period": votingPeriod}
if err := dyno.Set(g, votingParams, "app_state", "gov", "voting_params"); err != nil {
return nil, fmt.Errorf("failed to set voting params in genesis json: %w", err)
if err := dyno.Set(g, votingPeriod, "app_state", "gov", "params", "voting_period"); err != nil {
return nil, fmt.Errorf("failed to set voting period in genesis json: %w", err)
}
minDeposit := []interface{}{
map[string]interface{}{
"denom": chainConfig.Denom,
"amount": "100",
},
if err := dyno.Set(g, maxDepositPeriod, "app_state", "gov", "params", "max_deposit_period"); err != nil {
return nil, fmt.Errorf("failed to set voting period in genesis json: %w", err)
}
depositParams := map[string]interface{}{
"max_deposit_period": maxDepositPeriod,
"min_deposit": minDeposit,
if err := dyno.Set(g, chainConfig.Denom, "app_state", "gov", "params", "min_deposit", 0, "denom"); err != nil {
return nil, fmt.Errorf("failed to set voting period in genesis json: %w", err)
}
if err := dyno.Set(g, depositParams, "app_state", "gov", "deposit_params"); err != nil {
return nil, fmt.Errorf("failed to set deposit params in genesis json: %w", err)
if err := dyno.Set(g, "100", "app_state", "gov", "params", "min_deposit", 0, "amount"); err != nil {
return nil, fmt.Errorf("failed to set voting period in genesis json: %w", err)
}
out, err := json.Marshal(g)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -236,5 +236,5 @@ replace (
github.com/ChainSafe/go-schnorrkel/1 => github.com/ChainSafe/go-schnorrkel v1.0.0
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
github.com/vedhavyas/go-subkey => github.com/strangelove-ventures/go-subkey v1.0.7
github.com/strangelove-ventures/interchaintest/v7 => ../../interchaintest
github.com/strangelove-ventures/interchaintest/v7 => github.com/burnt-labs/interchaintest/v7 v7.0.0-20230404233655-f37b60cca9b6
)