File tree 3 files changed +17
-6
lines changed
3 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import "@kleros/vea-contracts/interfaces/IFastBridgeReceiver.sol";
7
7
8
8
contract VeaMock is IFastBridgeSender , IFastBridgeReceiver {
9
9
/* solhint-disable */
10
+
10
11
// ************************************* //
11
12
// * Function Modifiers * //
12
13
// ************************************* //
@@ -18,7 +19,17 @@ contract VeaMock is IFastBridgeSender, IFastBridgeReceiver {
18
19
* @param _calldata The receiving domain encoded message data.
19
20
*/
20
21
function sendFast (address _receiver , bytes memory _calldata ) external {
21
- _receiver.call (_calldata);
22
+ // Dirty workaround: Solidity does not support array slices for memory arrays and the sender interface cannot be changed.
23
+ (bytes4 selector , bytes memory payload ) = this .decode (_calldata);
24
+
25
+ bytes32 sender = bytes32 (uint256 (uint160 (msg .sender )));
26
+ bytes memory data = abi.encodePacked (selector, sender, payload);
27
+ (bool success , bytes memory res ) = _receiver.call (data);
28
+ require (success, "Call failure " );
29
+ }
30
+
31
+ function decode (bytes calldata data ) external pure returns (bytes4 , bytes memory ) {
32
+ return (bytes4 (data[:4 ]), data[4 :]);
22
33
}
23
34
24
35
/**
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ describe("Integration tests", async () => {
110
110
} ) ;
111
111
const tx = await arbitrable . createDispute ( 2 , "0x00" , 0 , { value : arbitrationCost } ) ;
112
112
const trace = await network . provider . send ( "debug_traceTransaction" , [ tx . hash ] ) ;
113
- const [ disputeId ] = ethers . utils . defaultAbiCoder . decode ( [ "uint" ] , `0x${ trace . returnValue } ` ) ;
113
+ const [ disputeId ] = ethers . utils . defaultAbiCoder . decode ( [ "uint" ] , `0x${ trace . returnValue } ` ) ; // get returned value from createDispute()
114
114
console . log ( "Dispute Created" ) ;
115
115
expect ( tx ) . to . emit ( foreignGateway , "DisputeCreation" ) ;
116
116
expect ( tx ) . to . emit ( foreignGateway , "OutgoingDispute" ) ;
@@ -179,7 +179,7 @@ describe("Integration tests", async () => {
179
179
180
180
const tx4 = await core . executeRuling ( 0 ) ;
181
181
console . log ( "Ruling executed on KlerosCore" ) ;
182
- expect ( tx4 ) . to . emit ( arbitrable , "Ruling" ) ;
182
+ expect ( tx4 ) . to . emit ( arbitrable , "Ruling" ) . withArgs ( foreignGateway . address , 1 , 0 ) ;
183
183
} ) ;
184
184
185
185
async function mineBlocks ( n ) {
Original file line number Diff line number Diff line change @@ -2383,11 +2383,11 @@ __metadata:
2383
2383
linkType: hard
2384
2384
2385
2385
"@kleros/vea-contracts@npm:dev":
2386
- version: 0.1.3
2387
- resolution: "@kleros/vea-contracts@npm:0.1.3 "
2386
+ version: 0.1.9
2387
+ resolution: "@kleros/vea-contracts@npm:0.1.9 "
2388
2388
dependencies:
2389
2389
"@openzeppelin/contracts": ^4.8.0
2390
- checksum: 3ab8e03ed81b14c868850fc213681070bbd10931bb31a845a01d6636d3ec080c4533e48a848c405b1d59dbac0d8f5647f84212ca5e23099fe3744fa9ee1484c2
2390
+ checksum: 191014204d21e832d55b9f50cffc07657a4e5d7e907fbe134b4b11f6ad53b92bff959b80d41c388e088d2c01c60c470bd7b115fd7a612c20fbd770fbdf31f90c
2391
2391
languageName: node
2392
2392
linkType: hard
2393
2393
You can’t perform that action at this time.
0 commit comments