Skip to content

Commit

Permalink
Test VRF LogPoller functionality- initializeLastProcessedBlock, updat…
Browse files Browse the repository at this point in the history
…eLastProcessedBlock and getUnfulfilled (#11472)

* Test VRF LogPoller functionality- initializeLastProcessedBlock, updateLastProcessedBlock and getUnfulfilled

* Addressed PR comments

* Minor change

* Add comments to explain replay

* Addressed PR comments

* Prettier
  • Loading branch information
kidambisrinivas authored Dec 7, 2023
1 parent 6bb80e0 commit 5a98ac6
Show file tree
Hide file tree
Showing 6 changed files with 1,617 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contracts/scripts/native_solc_compile_all_logpoller
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ compileContract () {
}


compileContract tests/LogEmitter.sol
compileContract tests/LogEmitter.sol
compileContract tests/VRFLogEmitter.sol
42 changes: 42 additions & 0 deletions contracts/src/v0.8/tests/VRFLogEmitter.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract VRFLogEmitter {
event RandomWordsRequested(
bytes32 indexed keyHash,
uint256 requestId,
uint256 preSeed,
uint64 indexed subId,
uint16 minimumRequestConfirmations,
uint32 callbackGasLimit,
uint32 numWords,
address indexed sender
);
event RandomWordsFulfilled(uint256 indexed requestId, uint256 outputSeed, uint96 payment, bool success);

function emitRandomWordsRequested(
bytes32 keyHash,
uint256 requestId,
uint256 preSeed,
uint64 subId,
uint16 minimumRequestConfirmations,
uint32 callbackGasLimit,
uint32 numWords,
address sender
) public {
emit RandomWordsRequested(
keyHash,
requestId,
preSeed,
subId,
minimumRequestConfirmations,
callbackGasLimit,
numWords,
sender
);
}

function emitRandomWordsFulfilled(uint256 requestId, uint256 outputSeed, uint96 payment, bool success) public {
emit RandomWordsFulfilled(requestId, outputSeed, payment, success);
}
}
Loading

0 comments on commit 5a98ac6

Please sign in to comment.