Skip to content

Commit

Permalink
Use simplified pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
chipshort committed May 31, 2023
1 parent 8b51b67 commit 904f185
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions x/wasm/keeper/query_plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ func BankQuerier(bankKeeper types.BankViewKeeper) func(ctx sdk.Context, request
}
res := wasmvmtypes.AllDenomMetadataResponse{
Metadata: ConvertSdkDenomMetadatasToWasmDenomMetadatas(bankQueryRes.Metadatas),
NextKey: bankQueryRes.Pagination.NextKey,
}
return json.Marshal(res)
}
Expand Down Expand Up @@ -610,11 +611,9 @@ func ConvertToDenomsMetadataRequest(wasmRequest *wasmvmtypes.AllDenomMetadataQue
ret := &banktypes.QueryDenomsMetadataRequest{}
if wasmRequest.Pagination != nil {
ret.Pagination = &query.PageRequest{
Key: wasmRequest.Pagination.Key,
Offset: wasmRequest.Pagination.Offset,
Limit: wasmRequest.Pagination.Limit,
CountTotal: wasmRequest.Pagination.CountTotal,
Reverse: wasmRequest.Pagination.Reverse,
Key: wasmRequest.Pagination.Key,
Limit: wasmRequest.Pagination.Limit,
Reverse: wasmRequest.Pagination.Reverse,
}
}
return ret
Expand Down
2 changes: 1 addition & 1 deletion x/wasm/keeper/query_plugins_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ func TestBankQuerierMetadata(t *testing.T) {
},
},
}
assert.Equal(t, exp, got)
assert.Equal(t, exp, got.Metadata)
}

func TestBankQuerierAllMetadata(t *testing.T) {
Expand Down

0 comments on commit 904f185

Please sign in to comment.