mirror of
https://github.com/status-im/keycard-redeem.git
synced 2025-02-05 16:53:35 +00:00
minAt NOW to avoid failing in next test files
This commit is contained in:
parent
aec3c4d77e
commit
d9b4ff8584
@ -33,8 +33,8 @@ library RedeemUtil {
|
||||
require(_redeem.blockNumber >= (block.number - _maxTxDelayInBlocks), "transaction too old");
|
||||
require(_redeem.blockHash == blockhash(_redeem.blockNumber), "invalid block hash");
|
||||
|
||||
require(block.timestamp < _expirationTime, "expired gift");
|
||||
require(block.timestamp > _startTime, "reedeming not yet started");
|
||||
require(block.timestamp < _expirationTime, "expired gift");
|
||||
require(block.timestamp > _startTime, "reedeming not yet started");
|
||||
}
|
||||
|
||||
function hashRedeem(Redeem memory _redeem) internal pure returns (bytes32) {
|
||||
@ -79,4 +79,4 @@ library RedeemUtil {
|
||||
bytes32 codeHash = keccak256(abi.encodePacked(_redeem.code));
|
||||
require(codeHash == _code, "invalid code");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -361,7 +361,7 @@ contract("GiftBucket", function () {
|
||||
} catch (e) {
|
||||
assert.match(e.message, /invalid block hash/);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it("can redeem before expiration date", async function() {
|
||||
const block = await web3.eth.getBlock("latest");
|
||||
@ -398,5 +398,6 @@ contract("GiftBucket", function () {
|
||||
it("shop can kill contract after expirationTime", async function() {
|
||||
await mineAt(EXPIRATION_TIME);
|
||||
await testKill();
|
||||
await mineAt(NOW);
|
||||
});
|
||||
});
|
||||
|
@ -205,7 +205,7 @@ contract("NFTBucket", function () {
|
||||
assert.match(e.message, /only the NFT/);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
async function testRedeem(receiver, recipient, signer, relayer, redeemCode, blockNumber, blockHash) {
|
||||
let gift = await NFTBucket.methods.gifts(recipient).call();
|
||||
@ -295,7 +295,7 @@ contract("NFTBucket", function () {
|
||||
} catch (e) {
|
||||
assert.match(e.message, /invalid block hash/);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it("can redeem before expiration date", async function() {
|
||||
const block = await web3.eth.getBlock("latest");
|
||||
@ -322,5 +322,6 @@ contract("NFTBucket", function () {
|
||||
it("shop can kill contract after expirationTime", async function() {
|
||||
await mineAt(EXPIRATION_TIME);
|
||||
await testKill();
|
||||
await mineAt(NOW);
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user