Skip to content

Commit

Permalink
fixup: merge main
Browse files Browse the repository at this point in the history
Signed-off-by: 170210 <[email protected]>
  • Loading branch information
170210 committed Aug 22, 2023
2 parents 67097d6 + 1b88f0d commit 8bec17b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
### Bug Fixes
* [\#62](https://github.com/Finschia/wasmd/pull/62) fill ContractHistory querier result's Updated field
* [\#52](https://github.com/Finschia/wasmd/pull/52) fix cli_test error of wasmplus and add cli_test ci
* [\#89](https://github.com/Finschia/wasmd/pull/89) fill ContractInfo querier result's Updated field
* [\#90](https://github.com/Finschia/wasmd/pull/90) delete output in TestQueryContractsByCode

### Breaking Changes
Expand Down
4 changes: 3 additions & 1 deletion x/wasm/client/testutil/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ func (s *IntegrationTestSuite) TestGetCmdGetContractInfo() {

codeID, err := strconv.ParseUint(s.codeID, 10, 64)
s.Require().NoError(err)
s.Require().True(s.setupHeight > 0)
codeUpdateHeight := uint64(s.setupHeight)

testCases := map[string]struct {
args []string
Expand All @@ -158,7 +160,7 @@ func (s *IntegrationTestSuite) TestGetCmdGetContractInfo() {
Creator: val.Address.String(),
Admin: val.Address.String(),
Label: "TestContract",
Created: nil,
Created: &types.AbsoluteTxPosition{BlockHeight: codeUpdateHeight, TxIndex: 0},
IBCPortID: "",
Extension: nil,
},
Expand Down
2 changes: 0 additions & 2 deletions x/wasm/keeper/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,6 @@ func queryContractInfo(ctx sdk.Context, addr sdk.AccAddress, keeper types.ViewKe
if info == nil {
return nil, types.ErrNotFound
}
// redact the Created field (just used for sorting, not part of public API)
info.Created = nil
return &types.QueryContractInfoResponse{
Address: addr.String(),
ContractInfo: *info,
Expand Down
12 changes: 4 additions & 8 deletions x/wasm/keeper/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -855,20 +855,16 @@ func TestQueryContractInfo(t *testing.T) {
src: &types.QueryContractInfoRequest{Address: contractAddr.String()},
stored: types.ContractInfoFixture(),
expRsp: &types.QueryContractInfoResponse{
Address: contractAddr.String(),
ContractInfo: types.ContractInfoFixture(func(info *types.ContractInfo) {
info.Created = nil // not returned on queries
}),
Address: contractAddr.String(),
ContractInfo: types.ContractInfoFixture(),
},
},
"with extension": {
src: &types.QueryContractInfoRequest{Address: contractAddr.String()},
stored: types.ContractInfoFixture(myExtension),
expRsp: &types.QueryContractInfoResponse{
Address: contractAddr.String(),
ContractInfo: types.ContractInfoFixture(myExtension, func(info *types.ContractInfo) {
info.Created = nil // not returned on queries
}),
Address: contractAddr.String(),
ContractInfo: types.ContractInfoFixture(myExtension),
},
},
"not found": {
Expand Down

0 comments on commit 8bec17b

Please sign in to comment.