Skip to content

Commit

Permalink
chore: added tittle and sumary to gov propossls for simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
JeancarloBarrios committed Jul 1, 2024
1 parent c561910 commit 6fbc3c5
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions x/ecocredit/base/simulation/msg_add_class_creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 2 additions & 0 deletions x/ecocredit/base/simulation/msg_add_credit_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 2 additions & 0 deletions x/ecocredit/base/simulation/msg_remove_class_creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 2 additions & 0 deletions x/ecocredit/base/simulation/msg_update_class_fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 2 additions & 0 deletions x/ecocredit/basket/simulation/msg_update_basket_fees.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
10 changes: 9 additions & 1 deletion x/ecocredit/marketplace/keeper/msg_buy_direct_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package keeper

import (
"encoding/json"
"fmt"
"reflect"
"strconv"
"testing"

Expand Down Expand Up @@ -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)))

Check failure on line 579 in x/ecocredit/marketplace/keeper/msg_buy_direct_test.go

View workflow job for this annotation

GitHub Actions / golangci (x/ecocredit)

commentFormatting: put a space between `//` and comment text (gocritic)
require.NoError(s.t, err)
evt := msgType.New().Interface()
evt2 := msgType.New().Interface()
Expand Down
2 changes: 2 additions & 0 deletions x/ecocredit/marketplace/simulation/msg_add_allowed_denom.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 6fbc3c5

Please sign in to comment.