cosmos-sdk/tests/integration/gov/common_test.go
2023-11-07 11:42:58 +00:00

33 lines
984 B
Go

package gov_test
import (
"testing"
"gotest.tools/v3/assert"
"cosmossdk.io/math"
authtypes "cosmossdk.io/x/auth/types"
"cosmossdk.io/x/gov/types"
v1 "cosmossdk.io/x/gov/types/v1"
"cosmossdk.io/x/gov/types/v1beta1"
stakingtypes "cosmossdk.io/x/staking/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)
var (
valTokens = sdk.TokensFromConsensusPower(42, sdk.DefaultPowerReduction)
TestProposal = v1beta1.NewTextProposal("Test", "description")
TestDescription = stakingtypes.NewDescription("T", "E", "S", "T", "Z")
TestCommissionRates = stakingtypes.NewCommissionRates(math.LegacyZeroDec(), math.LegacyZeroDec(), math.LegacyZeroDec())
)
// mkTestLegacyContent creates a MsgExecLegacyContent for testing purposes.
func mkTestLegacyContent(t *testing.T) *v1.MsgExecLegacyContent {
t.Helper()
msgContent, err := v1.NewLegacyContent(TestProposal, authtypes.NewModuleAddress(types.ModuleName).String())
assert.NilError(t, err)
return msgContent
}