From 6fbc3c5abb4d5b18aa2e69c8d204535971c2226a Mon Sep 17 00:00:00 2001 From: Jeancarlo Date: Mon, 1 Jul 2024 15:26:32 -0600 Subject: [PATCH] chore: added tittle and sumary to gov propossls for simulation --- x/ecocredit/base/simulation/msg_add_class_creator.go | 2 ++ x/ecocredit/base/simulation/msg_add_credit_type.go | 2 ++ .../base/simulation/msg_remove_class_creator.go | 2 ++ .../base/simulation/msg_set_class_creator_allowlist.go | 2 ++ x/ecocredit/base/simulation/msg_update_class_fee.go | 2 ++ .../basket/simulation/msg_update_basket_fees.go | 2 ++ x/ecocredit/marketplace/keeper/msg_buy_direct_test.go | 10 +++++++++- .../marketplace/simulation/msg_add_allowed_denom.go | 2 ++ .../marketplace/simulation/msg_remove_allowed_denom.go | 2 ++ 9 files changed, 25 insertions(+), 1 deletion(-) diff --git a/x/ecocredit/base/simulation/msg_add_class_creator.go b/x/ecocredit/base/simulation/msg_add_class_creator.go index add4b83784..b1ad9598d3 100644 --- a/x/ecocredit/base/simulation/msg_add_class_creator.go +++ b/x/ecocredit/base/simulation/msg_add_class_creator.go @@ -65,10 +65,12 @@ func SimulateMsgAddClassCreator(ak ecocredit.AccountKeeper, bk ecocredit.BankKee } msg := &govtypes.MsgSubmitProposal{ + Title: simtypes.RandStringOfLength(r, 10), Messages: []*codectypes.Any{anyMsg}, InitialDeposit: deposit, Proposer: proposerAddr, Metadata: simtypes.RandStringOfLength(r, 10), + Summary: simtypes.RandStringOfLength(r, 10), } txCtx := simulation.OperationInput{ diff --git a/x/ecocredit/base/simulation/msg_add_credit_type.go b/x/ecocredit/base/simulation/msg_add_credit_type.go index f116ff1f04..7c2de56273 100644 --- a/x/ecocredit/base/simulation/msg_add_credit_type.go +++ b/x/ecocredit/base/simulation/msg_add_credit_type.go @@ -76,10 +76,12 @@ func SimulateMsgAddCreditType(ak ecocredit.AccountKeeper, bk ecocredit.BankKeepe } msg := &govtypes.MsgSubmitProposal{ + Title: simtypes.RandStringOfLength(r, 10), Messages: []*codectypes.Any{anyMsg}, InitialDeposit: deposit, Proposer: proposerAddr, Metadata: simtypes.RandStringOfLength(r, 10), + Summary: simtypes.RandStringOfLength(r, 10), } txCtx := simulation.OperationInput{ diff --git a/x/ecocredit/base/simulation/msg_remove_class_creator.go b/x/ecocredit/base/simulation/msg_remove_class_creator.go index 2b37e2ec68..4f53f102bd 100644 --- a/x/ecocredit/base/simulation/msg_remove_class_creator.go +++ b/x/ecocredit/base/simulation/msg_remove_class_creator.go @@ -65,10 +65,12 @@ func SimulateMsgRemoveClassCreator(ak ecocredit.AccountKeeper, bk ecocredit.Bank } msg := &govtypes.MsgSubmitProposal{ + Title: simtypes.RandStringOfLength(r, 10), Messages: []*codectypes.Any{anyMsg}, InitialDeposit: deposit, Proposer: proposerAddr, Metadata: simtypes.RandStringOfLength(r, 10), + Summary: simtypes.RandStringOfLength(r, 10), } txCtx := simulation.OperationInput{ diff --git a/x/ecocredit/base/simulation/msg_set_class_creator_allowlist.go b/x/ecocredit/base/simulation/msg_set_class_creator_allowlist.go index bcd28d3686..e0c659a288 100644 --- a/x/ecocredit/base/simulation/msg_set_class_creator_allowlist.go +++ b/x/ecocredit/base/simulation/msg_set_class_creator_allowlist.go @@ -56,10 +56,12 @@ func SimulateMsgSetClassCreatorAllowlist(ak ecocredit.AccountKeeper, bk ecocredi } msg := &govtypes.MsgSubmitProposal{ + Title: simtypes.RandStringOfLength(r, 10), Messages: []*codectypes.Any{anyMsg}, InitialDeposit: deposit, Proposer: proposerAddr, Metadata: simtypes.RandStringOfLength(r, 10), + Summary: simtypes.RandStringOfLength(r, 10), } txCtx := simulation.OperationInput{ diff --git a/x/ecocredit/base/simulation/msg_update_class_fee.go b/x/ecocredit/base/simulation/msg_update_class_fee.go index 2f9677224a..f577b32e51 100644 --- a/x/ecocredit/base/simulation/msg_update_class_fee.go +++ b/x/ecocredit/base/simulation/msg_update_class_fee.go @@ -61,10 +61,12 @@ func SimulateMsgUpdateClassFee(ak ecocredit.AccountKeeper, bk ecocredit.BankKeep } msg := &govtypes.MsgSubmitProposal{ + Title: simtypes.RandStringOfLength(r, 10), Messages: []*codectypes.Any{anyMsg}, InitialDeposit: deposit, Proposer: proposerAddr, Metadata: simtypes.RandStringOfLength(r, 10), + Summary: simtypes.RandStringOfLength(r, 10), } txCtx := simulation.OperationInput{ diff --git a/x/ecocredit/basket/simulation/msg_update_basket_fees.go b/x/ecocredit/basket/simulation/msg_update_basket_fees.go index 7dd5a40496..d72b180a30 100644 --- a/x/ecocredit/basket/simulation/msg_update_basket_fees.go +++ b/x/ecocredit/basket/simulation/msg_update_basket_fees.go @@ -63,6 +63,8 @@ func SimulateMsgUpdateBasketFee(ak ecocredit.AccountKeeper, bk ecocredit.BankKee } proposalMsg := govtypes.MsgSubmitProposal{ + Title: simtypes.RandStringOfLength(r, 10), + Summary: simtypes.RandStringOfLength(r, 10), InitialDeposit: deposit, Proposer: proposerAddr, Metadata: simtypes.RandStringOfLength(r, 10), diff --git a/x/ecocredit/marketplace/keeper/msg_buy_direct_test.go b/x/ecocredit/marketplace/keeper/msg_buy_direct_test.go index 9ec3fa64d1..7060566857 100644 --- a/x/ecocredit/marketplace/keeper/msg_buy_direct_test.go +++ b/x/ecocredit/marketplace/keeper/msg_buy_direct_test.go @@ -3,6 +3,8 @@ package keeper import ( "encoding/json" + "fmt" + "reflect" "strconv" "testing" @@ -567,8 +569,14 @@ func (s *buyDirectSuite) expectEvent(expected gogoproto.Message) { foundEvt, err := sdk.ParseTypedEvent(abci.Event(sdkEvent)) require.NoError(s.t, err) + name := gogoproto.MessageName(expected) + a := reflect.TypeOf(expected) + fmt.Println(a) - msgType, err := protoregistry.GlobalTypes.FindMessageByName(protoreflect.FullName(gogoproto.MessageName(expected))) + input := protoreflect.FullName(name) + msgType, err := protoregistry.GlobalTypes.FindMessageByName(input) + + //msgType, err := protoregistry.GlobalTypes.FindMessageByName(protoreflect.FullName(gogoproto.MessageName(expected))) require.NoError(s.t, err) evt := msgType.New().Interface() evt2 := msgType.New().Interface() diff --git a/x/ecocredit/marketplace/simulation/msg_add_allowed_denom.go b/x/ecocredit/marketplace/simulation/msg_add_allowed_denom.go index ab84eccfa8..81d7951b9f 100644 --- a/x/ecocredit/marketplace/simulation/msg_add_allowed_denom.go +++ b/x/ecocredit/marketplace/simulation/msg_add_allowed_denom.go @@ -69,6 +69,8 @@ func SimulateMsgAddAllowedDenom(ak ecocredit.AccountKeeper, bk ecocredit.BankKee } proposalMsg := govtypes.MsgSubmitProposal{ + Title: simtypes.RandStringOfLength(r, 10), + Summary: simtypes.RandStringOfLength(r, 10), InitialDeposit: deposit, Proposer: proposerAddr, Metadata: simtypes.RandStringOfLength(r, 10), diff --git a/x/ecocredit/marketplace/simulation/msg_remove_allowed_denom.go b/x/ecocredit/marketplace/simulation/msg_remove_allowed_denom.go index b2520ef989..a535107748 100644 --- a/x/ecocredit/marketplace/simulation/msg_remove_allowed_denom.go +++ b/x/ecocredit/marketplace/simulation/msg_remove_allowed_denom.go @@ -65,6 +65,8 @@ func SimulateMsgRemoveAllowedDenom(ak ecocredit.AccountKeeper, bk ecocredit.Bank } proposalMsg := govtypes.MsgSubmitProposal{ + Title: simtypes.RandStringOfLength(r, 10), + Summary: simtypes.RandStringOfLength(r, 10), InitialDeposit: deposit, Proposer: proposerAddr, Metadata: simtypes.RandStringOfLength(r, 10),