@@ -176,8 +176,9 @@ describe("Integration tests", async () => {
176
176
177
177
const roundInfo = await core . getRoundInfo ( 0 , 0 ) ;
178
178
expect ( roundInfo . drawnJurors ) . deep . equal ( [ deployer , deployer , deployer ] ) ;
179
- expect ( roundInfo . tokensAtStakePerJuror ) . to . equal ( ONE_HUNDRED_PNK . mul ( 2 ) ) ;
179
+ expect ( roundInfo . pnkAtStakePerJuror ) . to . equal ( ONE_HUNDRED_PNK . mul ( 2 ) ) ;
180
180
expect ( roundInfo . totalFeesForJurors ) . to . equal ( arbitrationCost ) ;
181
+ expect ( roundInfo . feeToken ) . to . equal ( ethers . constants . AddressZero ) ;
181
182
182
183
expect ( ( await core . disputes ( 0 ) ) . period ) . to . equal ( Period . evidence ) ;
183
184
@@ -210,55 +211,75 @@ describe("Integration tests", async () => {
210
211
211
212
await core . setStake ( 1 , ONE_THOUSAND_PNK ) ;
212
213
await core . getJurorBalance ( deployer , 1 ) . then ( ( result ) => {
213
- expect ( result . staked ) . to . equal ( ONE_THOUSAND_PNK ) ;
214
- expect ( result . locked ) . to . equal ( 0 ) ;
214
+ expect ( result . totalStaked ) . to . equal ( ONE_THOUSAND_PNK ) ;
215
+ expect ( result . totalLocked ) . to . equal ( 0 ) ;
215
216
logJurorBalance ( result ) ;
216
217
} ) ;
217
218
218
219
await core . setStake ( 1 , ONE_HUNDRED_PNK . mul ( 5 ) ) ;
219
220
await core . getJurorBalance ( deployer , 1 ) . then ( ( result ) => {
220
- expect ( result . staked ) . to . equal ( ONE_HUNDRED_PNK . mul ( 5 ) ) ;
221
- expect ( result . locked ) . to . equal ( 0 ) ;
221
+ expect ( result . totalStaked ) . to . equal ( ONE_HUNDRED_PNK . mul ( 5 ) ) ;
222
+ expect ( result . totalLocked ) . to . equal ( 0 ) ;
222
223
logJurorBalance ( result ) ;
223
224
} ) ;
224
225
225
226
await core . setStake ( 1 , 0 ) ;
226
227
await core . getJurorBalance ( deployer , 1 ) . then ( ( result ) => {
227
- expect ( result . staked ) . to . equal ( 0 ) ;
228
- expect ( result . locked ) . to . equal ( 0 ) ;
228
+ expect ( result . totalStaked ) . to . equal ( 0 ) ;
229
+ expect ( result . totalLocked ) . to . equal ( 0 ) ;
229
230
logJurorBalance ( result ) ;
230
231
} ) ;
231
232
232
233
await core . setStake ( 1 , ONE_THOUSAND_PNK . mul ( 4 ) ) ;
233
234
await core . getJurorBalance ( deployer , 1 ) . then ( ( result ) => {
234
- expect ( result . staked ) . to . equal ( ONE_THOUSAND_PNK . mul ( 4 ) ) ;
235
- expect ( result . locked ) . to . equal ( 0 ) ;
235
+ expect ( result . totalStaked ) . to . equal ( ONE_THOUSAND_PNK . mul ( 4 ) ) ;
236
+ expect ( result . totalLocked ) . to . equal ( 0 ) ;
236
237
logJurorBalance ( result ) ;
237
238
} ) ;
238
- const tx = await arbitrable . createDispute ( 2 , "0x00" , 0 , {
239
+ const tx = await arbitrable . functions [ " createDispute(string)" ] ( "RNG test" , {
239
240
value : arbitrationCost ,
240
241
} ) ;
241
242
const trace = await network . provider . send ( "debug_traceTransaction" , [ tx . hash ] ) ;
242
243
const [ disputeId ] = ethers . utils . defaultAbiCoder . decode ( [ "uint" ] , `0x${ trace . returnValue } ` ) ; // get returned value from createDispute()
243
- console . log ( "Dispute Created" ) ;
244
- expect ( tx ) . to . emit ( foreignGateway , "DisputeCreation" ) ;
245
- expect ( tx ) . to . emit ( foreignGateway , "OutgoingDispute" ) ;
246
- console . log ( `disputeId: ${ disputeId } ` ) ;
244
+ console . log ( "Dispute Created with disputeId: %d" , disputeId ) ;
245
+ await expect ( tx )
246
+ . to . emit ( foreignGateway , "CrossChainDisputeOutgoing" )
247
+ . withArgs ( anyValue , arbitrable . address , 1 , 2 , "0x00" ) ;
248
+ await expect ( tx )
249
+ . to . emit ( arbitrable , "DisputeRequest" )
250
+ . withArgs (
251
+ foreignGateway . address ,
252
+ 1 ,
253
+ BigNumber . from ( "100587076116875319099890440047601180158236049259177371049006183970829186180694" ) ,
254
+ 0 ,
255
+ ""
256
+ ) ;
247
257
248
258
const lastBlock = await ethers . provider . getBlock ( tx . blockNumber - 1 ) ;
249
259
const disputeHash = ethers . utils . solidityKeccak256 (
250
- [ "uint " , "bytes " , "bytes " , "uint " , "uint " , "bytes " , "address " ] ,
251
- [ 31337 , lastBlock . hash , ethers . utils . toUtf8Bytes ( "createDispute" ) , disputeId , 2 , "0x00" , arbitrable . address ]
260
+ [ "bytes " , "bytes32 " , "uint256 " , "address " , "uint256 " , "uint256 " , "bytes " ] ,
261
+ [ ethers . utils . toUtf8Bytes ( "createDispute" ) , lastBlock . hash , 31337 , arbitrable . address , disputeId , 2 , "0x00" ]
252
262
) ;
253
263
254
- const events = ( await tx . wait ( ) ) . events ;
264
+ console . log ( "dispute hash: " , disputeHash ) ;
255
265
256
266
// Relayer tx
257
267
const tx2 = await homeGateway
258
268
. connect ( relayer )
259
- . relayCreateDispute ( 31337 , lastBlock . hash , disputeId , 2 , "0x00" , arbitrable . address , {
260
- value : arbitrationCost ,
261
- } ) ;
269
+ . functions [ "relayCreateDispute((bytes32,uint256,address,uint256,uint256,uint256,string,uint256,bytes))" ] (
270
+ {
271
+ foreignBlockHash : lastBlock . hash ,
272
+ foreignChainID : 31337 ,
273
+ foreignArbitrable : arbitrable . address ,
274
+ foreignDisputeID : disputeId ,
275
+ externalDisputeID : ethers . utils . keccak256 ( ethers . utils . toUtf8Bytes ( "RNG test" ) ) ,
276
+ templateId : 0 ,
277
+ templateUri : "" ,
278
+ choices : 2 ,
279
+ extraData : "0x00" ,
280
+ } ,
281
+ { value : arbitrationCost }
282
+ ) ;
262
283
expect ( tx2 ) . to . emit ( homeGateway , "Dispute" ) ;
263
284
const events2 = ( await tx2 . wait ( ) ) . events ;
264
285
0 commit comments