Skip to content

Commit

Permalink
Fix cw20-base tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanfrey committed Aug 24, 2020
1 parent 670a1d8 commit 2a25051
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions contracts/cw20-base/src/allowances.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ mod tests {

// set allowance with height expiration
let allow1 = Uint128(7777);
let expires = Expiration::AtHeight { height: 5432 };
let expires = Expiration::AtHeight(5432);
let msg = HandleMsg::IncreaseAllowance {
spender: spender.clone(),
amount: allow1,
Expand Down Expand Up @@ -352,7 +352,7 @@ mod tests {
// increase it some more and override the expires
let raise = Uint128(87654);
let allow3 = allow2 + raise;
let new_expire = Expiration::AtTime { time: 8888888888 };
let new_expire = Expiration::AtTime(8888888888);
let msg = HandleMsg::IncreaseAllowance {
spender: spender.clone(),
amount: raise,
Expand Down Expand Up @@ -405,7 +405,7 @@ mod tests {

// set allowance with height expiration
let allow1 = Uint128(7777);
let expires = Expiration::AtHeight { height: 5432 };
let expires = Expiration::AtHeight(5432);
let msg = HandleMsg::IncreaseAllowance {
spender: spender.clone(),
amount: allow1,
Expand Down Expand Up @@ -447,7 +447,7 @@ mod tests {
// also allow spender -> spender2 with no interference
let env = mock_env(spender.clone(), &[]);
let allow3 = Uint128(1821);
let expires3 = Expiration::AtTime { time: 3767626296 };
let expires3 = Expiration::AtTime(3767626296);
let msg = HandleMsg::IncreaseAllowance {
spender: spender2.clone(),
amount: allow3,
Expand Down Expand Up @@ -570,9 +570,7 @@ mod tests {
let msg = HandleMsg::IncreaseAllowance {
spender: spender.clone(),
amount: Uint128(1000),
expires: Some(Expiration::AtHeight {
height: env.block.height,
}),
expires: Some(Expiration::AtHeight(env.block.height)),
};
handle(&mut deps, env.clone(), msg).unwrap();

Expand Down Expand Up @@ -647,9 +645,7 @@ mod tests {
let msg = HandleMsg::IncreaseAllowance {
spender: spender.clone(),
amount: Uint128(1000),
expires: Some(Expiration::AtHeight {
height: env.block.height,
}),
expires: Some(Expiration::AtHeight(env.block.height)),
};
handle(&mut deps, env.clone(), msg).unwrap();

Expand Down Expand Up @@ -701,7 +697,6 @@ mod tests {
assert_eq!(1, res.messages.len());

// we record this as sent by the one who requested, not the one who was paying
// TODO: is this what we want??? or the owner???
let binary_msg = Cw20ReceiveMsg {
sender: spender.clone(),
amount: transfer,
Expand Down Expand Up @@ -749,9 +744,7 @@ mod tests {
let msg = HandleMsg::IncreaseAllowance {
spender: spender.clone(),
amount: Uint128(1000),
expires: Some(Expiration::AtHeight {
height: env.block.height,
}),
expires: Some(Expiration::AtHeight(env.block.height)),
};
handle(&mut deps, env.clone(), msg).unwrap();

Expand Down

0 comments on commit 2a25051

Please sign in to comment.