Skip to content

Commit

Permalink
Fix migration code context
Browse files Browse the repository at this point in the history
  • Loading branch information
maurolacy committed Jan 31, 2022
1 parent 51c281a commit d03f55d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions MIGRATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ Migration code example:

```diff
fn list_allowed(
limit: Option<u32>,
) -> StdResult<ListAllowedResponse> {
deps: Deps,
start_after: Option<String>,
limit: Option<u32>,
) -> StdResult<ListAllowedResponse> {
let limit = limit.unwrap_or(DEFAULT_LIMIT).min(MAX_LIMIT) as usize;
- let start = match start_after {
- Some(x) => Some(Bound::exclusive(deps.api.addr_validate(&x)?.into_string())),
Expand All @@ -35,7 +37,11 @@ Migration code example, in case you want to keep your raw bounds:

```diff
pub fn query_all_allowances(
) -> StdResult<AllAllowancesResponse> {
deps: Deps,
env: Env,
start_after: Option<String>,
limit: Option<u32>,
) -> StdResult<AllAllowancesResponse> {
let limit = calc_limit(limit);
// we use raw addresses here....
- let start = start_after.map(Bound::exclusive);
Expand Down

0 comments on commit d03f55d

Please sign in to comment.