diff --git a/examples/gno.land/r/gov/dao/v2/prop4_filetest.gno b/examples/gno.land/r/gov/dao/v2/prop4_filetest.gno deleted file mode 100644 index 13ca572c512..00000000000 --- a/examples/gno.land/r/gov/dao/v2/prop4_filetest.gno +++ /dev/null @@ -1,132 +0,0 @@ -package main - -import ( - "gno.land/p/demo/dao" - "gno.land/r/gov/dao/bridge" - govdaov2 "gno.land/r/gov/dao/v2" - "gno.land/r/sys/params" -) - -func init() { - mExec := params.NewStringPropExecutor("prop1.string", "value1") - title := "Setting prop1.string param" - comment := "setting prop1.string param" - prop := dao.ProposalRequest{ - Title: title, - Description: comment, - Executor: mExec, - } - id := bridge.GovDAO().Propose(prop) - println("new prop", id) -} - -func main() { - println("--") - println(govdaov2.Render("")) - println("--") - println(govdaov2.Render("0")) - println("--") - bridge.GovDAO().VoteOnProposal(0, "YES") - println("--") - println(govdaov2.Render("0")) - println("--") - bridge.GovDAO().ExecuteProposal(0) - println("--") - println(govdaov2.Render("0")) -} - -// Output: -// new prop 0 -// -- -// # GovDAO Proposals -// -// ## [Prop #0 - Setting prop1.string param](/r/gov/dao/v2:0) -// -// **Status: ACTIVE** -// -// **Author: g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm** -// -// -// -- -// # Proposal #0 - Setting prop1.string param -// -// ## Description -// -// setting prop1.string param -// -// ## Proposal information -// -// **Status: ACTIVE** -// -// **Voting stats:** -// - YES 0 (0%) -// - NO 0 (0%) -// - ABSTAIN 0 (0%) -// - MISSING VOTES 10 (100%) -// -// -// **Threshold met: FALSE** -// -// **Author: g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm** -// -// ### Actions -// -// #### [[Vote YES](/r/gov/dao/v2$help&func=VoteOnProposal&id=0&option=YES)] - [[Vote NO](/r/gov/dao/v2$help&func=VoteOnProposal&id=0&option=NO)] - [[Vote ABSTAIN](/r/gov/dao/v2$help&func=VoteOnProposal&id=0&option=ABSTAIN)] -// -// -// -- -// -- -// # Proposal #0 - Setting prop1.string param -// -// ## Description -// -// setting prop1.string param -// -// ## Proposal information -// -// **Status: ACCEPTED** -// -// **Voting stats:** -// - YES 10 (100%) -// - NO 0 (0%) -// - ABSTAIN 0 (0%) -// - MISSING VOTES 0 (0%) -// -// -// **Threshold met: TRUE** -// -// **Author: g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm** -// -// ### Actions -// -// The voting period for this proposal is over. -// -// -// -- -// -- -// # Proposal #0 - Setting prop1.string param -// -// ## Description -// -// setting prop1.string param -// -// ## Proposal information -// -// **Status: EXECUTION SUCCESSFUL** -// -// **Voting stats:** -// - YES 10 (100%) -// - NO 0 (0%) -// - ABSTAIN 0 (0%) -// - MISSING VOTES 0 (0%) -// -// -// **Threshold met: TRUE** -// -// **Author: g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm** -// -// ### Actions -// -// The voting period for this proposal is over. -// -// diff --git a/tm2/pkg/sdk/params/keeper_test.go b/tm2/pkg/sdk/params/keeper_test.go index 3c1c53c5f7e..bbfcfe2ba06 100644 --- a/tm2/pkg/sdk/params/keeper_test.go +++ b/tm2/pkg/sdk/params/keeper_test.go @@ -147,17 +147,18 @@ type Params struct { } func TestGetAndSetParams(t *testing.T) { + prefix := "params_test" env := setupTestEnv() ctx := env.ctx keeper := env.keeper // SetParams a := Params{p1: 1, p2: "a"} - err := keeper.SetParams(ctx, ModuleName, "p", a) + err := keeper.SetParams(ctx, prefix, "p", a) require.NoError(t, err) // GetParams a1 := Params{} - _, err1 := keeper.GetParams(ctx, ModuleName, "p", &a1) + _, err1 := keeper.GetParams(ctx, prefix, "p", &a1) require.NoError(t, err1) require.True(t, amino.DeepEqual(a, a1), "a and a1 should equal") } diff --git a/tm2/pkg/sdk/params/test_common.go b/tm2/pkg/sdk/params/test_common.go index 8e785f89cd5..ef240d86d12 100644 --- a/tm2/pkg/sdk/params/test_common.go +++ b/tm2/pkg/sdk/params/test_common.go @@ -23,8 +23,9 @@ func setupTestEnv() testEnv { ms.MountStoreWithDB(paramsCapKey, iavl.StoreConstructor, db) ms.LoadLatestVersion() + prefix := "params_test" km := NewPrefixKeyMapper() - km.RegisterPrefix(ModuleName) + km.RegisterPrefix(prefix) keeper := NewParamsKeeper(paramsCapKey, km) ctx := sdk.NewContext(sdk.RunTxModeDeliver, ms, &bft.Header{Height: 1, ChainID: "test-chain-id"}, log.NewNoopLogger())