Skip to content

Commit

Permalink
Range queries results order changed
Browse files Browse the repository at this point in the history
  • Loading branch information
maurolacy committed Oct 8, 2020
1 parent 2fc6338 commit e59da96
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions contracts/cw1-subkeys/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,31 +602,31 @@ mod tests {
assert_eq!(
allowances[0],
AllowanceInfo {
spender: spender1,
spender: spender2,
balance: NativeBalance(initial_allowances.clone()),
expires: Expiration::Never {},
}
);
assert_eq!(
allowances[1],
AllowanceInfo {
spender: spender2.clone(),
spender: spender3.clone(),
balance: NativeBalance(initial_allowances.clone()),
expires: Expiration::Never {},
expires: expires_later,
}
);

// now continue from after the last one
let allowances = query_all_allowances(&deps, Some(spender2), Some(2))
let allowances = query_all_allowances(&deps, Some(spender3), Some(2))
.unwrap()
.allowances;
assert_eq!(1, allowances.len());
assert_eq!(
allowances[0],
AllowanceInfo {
spender: spender3,
spender: spender1,
balance: NativeBalance(initial_allowances.clone()),
expires: expires_later,
expires: Expiration::Never {},
}
);
}
Expand Down Expand Up @@ -762,28 +762,28 @@ mod tests {
assert_eq!(
permissions[0],
PermissionsInfo {
spender: spender1,
permissions: god_mode,
spender: spender2,
permissions: noob_mode,
}
);
assert_eq!(
permissions[1],
PermissionsInfo {
spender: spender2.clone(),
spender: spender3.clone(),
permissions: noob_mode,
}
);

// now continue from after the last one
let permissions = query_all_permissions(&deps, Some(spender2), Some(2))
let permissions = query_all_permissions(&deps, Some(spender3), Some(2))
.unwrap()
.permissions;
assert_eq!(1, permissions.len());
assert_eq!(
permissions[0],
PermissionsInfo {
spender: spender3,
permissions: noob_mode,
spender: spender1,
permissions: god_mode,
}
);
}
Expand Down

0 comments on commit e59da96

Please sign in to comment.