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

fix: tidy up x/foundation #597

Merged
merged 8 commits into from
Jul 19, 2022
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: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (refactor) [\#493](https://github.com/line/lbm-sdk/pull/493) restructure x/consortium
* (server/grpc) [\#526](https://github.com/line/lbm-sdk/pull/526) add index field into TxResponse
* (cli) [\#535](https://github.com/line/lbm-sdk/pull/536) updated ostracon to v1.0.5; `unsafe-reset-all` command has been moved to the `ostracon` sub-command.
* (x/foundation) [\#597](https://github.com/line/lbm-sdk/pull/597) tidy up x/foundation

### Bug Fixes
* (x/wasm) [\#453](https://github.com/line/lbm-sdk/pull/453) modify wasm grpc query api path
Expand Down
10 changes: 5 additions & 5 deletions x/foundation/authz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import (
)

func TestReceiveFromTreasuryAuthorization(t *testing.T) {
testCases := map[string]struct{
msg sdk.Msg
valid bool
testCases := map[string]struct {
msg sdk.Msg
valid bool
accept bool
}{
"valid": {
msg: &foundation.MsgWithdrawFromTreasury{},
valid: true,
msg: &foundation.MsgWithdrawFromTreasury{},
valid: true,
accept: true,
},
"msg mismatch": {
Expand Down
2 changes: 1 addition & 1 deletion x/foundation/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ Example of the content of policy-json:
"threshold": "10",
"windows": {
"voting_period": "24h",
"min_execution_period": "0s",
"min_execution_period": "0s"
}
}
`,
Expand Down
4 changes: 2 additions & 2 deletions x/foundation/client/testutil/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (s *IntegrationTestSuite) TestNewQueryCmdParams() {
s.Require().NoError(err)

var actual foundation.QueryParamsResponse
s.Require().NoError(val.ClientCtx.LegacyAmino.UnmarshalJSON(out.Bytes(), &actual), out.String())
s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &actual), out.String())
s.Require().Equal(tc.expected, &actual)
})
}
Expand Down Expand Up @@ -525,7 +525,7 @@ func (s *IntegrationTestSuite) TestNewQueryCmdGrants() {
s.Require().NoError(err)

var actual foundation.QueryGrantsResponse
s.Require().NoError(val.ClientCtx.LegacyAmino.UnmarshalJSON(out.Bytes(), &actual), out.String())
s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &actual), out.String())
s.Require().Equal(tc.expected, len(actual.Authorizations))
})
}
Expand Down
4 changes: 2 additions & 2 deletions x/foundation/client/testutil/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type IntegrationTestSuite struct {
var commonArgs = []string{
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100))).String()),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100)))),
}

func NewIntegrationTestSuite(cfg network.Config) *IntegrationTestSuite {
Expand Down Expand Up @@ -185,7 +185,7 @@ func (s *IntegrationTestSuite) submitProposal(msg sdk.Msg, try bool) uint64 {
for _, e := range events {
if e.Type == proposalEvent.Type {
var proposal foundation.Proposal
err := s.cfg.Codec.UnmarshalJSON([]byte(e.Attributes[0].Value), &proposal)
err := val.ClientCtx.Codec.UnmarshalJSON([]byte(e.Attributes[0].Value), &proposal)
s.Require().NoError(err)

return proposal.Id
Expand Down
Loading