Skip to content

Commit

Permalink
Fix VRF foundry tests for nightly build version (#10717)
Browse files Browse the repository at this point in the history
* Fix VRF foundry tests for nightly build version

* prettier

* Add foundry test trigger for CI

---------

Co-authored-by: Austin Born <[email protected]>
  • Loading branch information
vreff and austinborn authored Sep 19, 2023
1 parent af1f6e7 commit c827d6a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 28 deletions.
1 change: 1 addition & 0 deletions .github/workflows/solidity-foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
filters: |
src:
- 'contracts/src/v0.8/**/*'
- 'contracts/test/v0.8/foundry/**/*'
- '.github/workflows/solidity-foundry.yml'
- 'contracts/foundry.toml'
- 'contracts/gas-snapshots/*.gas-snapshot'
Expand Down
56 changes: 28 additions & 28 deletions contracts/test/v0.8/foundry/vrf/VRFV2Plus.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -282,15 +282,15 @@ contract VRFV2Plus is BaseTest {
// Store the previous block's blockhash, and assert that it is as expected.
vm.roll(requestBlock + 1);
s_bhs.store(requestBlock);
assertEq(bytes32(uint256(requestBlock)), s_bhs.getBlockhash(requestBlock));
assertEq(hex"c65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8", s_bhs.getBlockhash(requestBlock));

// Fulfill the request.
// Proof generated via the generate-proof-v2-plus script command. Example usage:
/*
go run . generate-proof-v2-plus \
-key-hash 0x9f2353bde94264dbc3d554a94cceba2d7d2b4fdce4304d3e09a1fea9fbeb1528 \
-pre-seed 93724884573574303181157854277074121673523280784530506403108144933983063023487 \
-block-hash 0x000000000000000000000000000000000000000000000000000000000000000a \
-pre-seed 53391429126065232382402681707515137895470547057819816488254124798726362946635 \
-block-hash 0xc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8 \
-block-num 10 \
-sender 0x90A8820424CC8a819d14cBdE54D12fD3fbFa9bb2 \
-native-payment true
Expand All @@ -301,22 +301,22 @@ contract VRFV2Plus is BaseTest {
62070622898698443831883535403436258712770888294397026493185421712108624767191
],
gamma: [
51111463251706978184511913295560024261167135799300172382907308330135472647507,
41885656274025752055847945432737871864088659248922821023734315208027501951872
2973102176083872659982988645522968133664529102555885971868619302367987919116,
43610558806647181042154132372309425100765955827430056035281841579494767100593
],
c: 16524568342669389118511849307228542933779732546262509461687493305210182275018,
s: 41994650358817457338836417117109954917585544148583960677058620868924739846555,
seed: 93724884573574303181157854277074121673523280784530506403108144933983063023487,
uWitness: 0x239F36bb6F40B875feDB78A35668ED503714229D,
c: 44558436621153210954487996771157467729629491520915192177070584116261579650304,
s: 18447217702001910909971999949841419857536434117467121546901211519652998560328,
seed: 53391429126065232382402681707515137895470547057819816488254124798726362946635,
uWitness: 0x61e70839187C12Fe136bdcC78D1D3765BecA245d,
cGammaWitness: [
39509254444382483930263995092200486700241035538419529811079167788988152938775,
45386456067856204990374891906500133027941582609057652148999284389995660222714
57868024672571504735938309170346165090467827794150592801232968679608710558443,
19249635816589941728350586356475545703589085434839461964712223344491075318152
],
sHashWitness: [
111625720767470372476405191521859549066251564741183518661578940869038469627728,
102482035245447833089088394562631090129269030797203395897444301192092668485625
61151023867440095994162103308586528914977848168432699421313437043942463394142,
107161674609768447269383119603000260750848712436031813376573304048979100187696
],
zInv: 46854489406365983023053639507653417780777725139199393583659574012051139260916
zInv: 92231836131549905872346812799402691650433126386650679876913933650318463342041
});
VRFCoordinatorV2Plus.RequestCommitment memory rc = VRFCoordinatorV2Plus.RequestCommitment({
blockNum: requestBlock,
Expand Down Expand Up @@ -399,15 +399,15 @@ contract VRFV2Plus is BaseTest {
// Store the previous block's blockhash, and assert that it is as expected.
vm.roll(requestBlock + 1);
s_bhs.store(requestBlock);
assertEq(bytes32(uint256(requestBlock)), s_bhs.getBlockhash(requestBlock));
assertEq(hex"ce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec", s_bhs.getBlockhash(requestBlock));

// Fulfill the request.
// Proof generated via the generate-proof-v2-plus script command. Example usage:
/*
go run . generate-proof-v2-plus \
-key-hash 0x9f2353bde94264dbc3d554a94cceba2d7d2b4fdce4304d3e09a1fea9fbeb1528 \
-pre-seed 108233140904510496268355288815996296196427471042093167619305836589216327096601 \
-block-hash 0x0000000000000000000000000000000000000000000000000000000000000014 \
-pre-seed 14817911724325909152780695848148728017190840227899344848185245004944693487904 \
-block-hash 0xce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec \
-block-num 20 \
-sender 0x90A8820424CC8a819d14cBdE54D12fD3fbFa9bb2
*/
Expand All @@ -417,22 +417,22 @@ contract VRFV2Plus is BaseTest {
62070622898698443831883535403436258712770888294397026493185421712108624767191
],
gamma: [
49785247270467418393187938018746488660500261614113251546613288843777654841004,
8320717868018488740308781441198484312662094766876176838868269181386589318272
33866404953216897461413961842321788789902210776565180957857448351149268461878,
115311460432520855364215812517921508651759645277579047898967111537639679255245
],
c: 76453805415479914665188560136648688491255275134351022531196270897692316685243,
s: 22475315809542512110111038532919582593833813393763591614796010376988981373422,
seed: 108233140904510496268355288815996296196427471042093167619305836589216327096601,
uWitness: 0x5FEaCA3fb4754440E6a2A9954FC9239C598575D6,
c: 32561838617228634441320154326890637858849550728945663611942735469609183032389,
s: 55806041637816588920133401262818662941786708593795051215322306020699218819370,
seed: 14817911724325909152780695848148728017190840227899344848185245004944693487904,
uWitness: 0x917554f18dB75eac206Ae5366B80c0b6A87b5996,
cGammaWitness: [
55445396003779478156538753672495726993840482493921680192868130506843942678541,
106319974075683500018668841039963899149060186085112051787355016812064025102025
84076069514674055711740813040098459867759972960517070154541804330775196519927,
23456142794899412334950030002327578074149212885334118042147040122102091306080
],
sHashWitness: [
34533061775486739812426491689767238316751877347882380297143821485918957938090,
2922713080913931101723342979079557154957284247074698150345640807351459691338
67919054534004130885903575144858988177160334233773664996450084407340736891592,
82934864721844704662104532515068228502043057799129930869203380251475000254135
],
zInv: 5351690486803355464662962731889988792533544566214255216629618109252893229562
zInv: 37397948970756055003892765560695914630264479979131589134478580629419519112029
});
VRFCoordinatorV2Plus.RequestCommitment memory rc = VRFCoordinatorV2Plus.RequestCommitment({
blockNum: requestBlock,
Expand Down

0 comments on commit c827d6a

Please sign in to comment.