From 83b4d7357026e4d8161346c7365cc619f7856791 Mon Sep 17 00:00:00 2001 From: zeroXbrock <2791467+zeroXbrock@users.noreply.github.com> Date: Fri, 24 May 2024 15:00:34 -0700 Subject: [PATCH] invoke dag in newOrder to test --- examples/app-ofa-private/ofa-private.sol | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/examples/app-ofa-private/ofa-private.sol b/examples/app-ofa-private/ofa-private.sol index d8b6236..b26fa3a 100644 --- a/examples/app-ofa-private/ofa-private.sol +++ b/examples/app-ofa-private/ofa-private.sol @@ -25,7 +25,7 @@ contract OFAPrivate { bytes hint; } - event HintEvent(Suave.DataId id, bytes hint); + event HintEvent(Suave.DataId id, bytes hint, bytes res); event BundleEmitted(string bundleRawResponse); @@ -57,14 +57,17 @@ contract OFAPrivate { return hintOrder; } - function emitHint(HintOrder memory order) public { - emit HintEvent(order.id, order.hint); + function emitHint(HintOrder memory order, bytes memory dagResult) public { + emit HintEvent(order.id, order.hint, dagResult); } // Function to create a new user order function newOrder(uint64 decryptionCondition) external returns (bytes memory) { HintOrder memory hintOrder = saveOrder(decryptionCondition); - return abi.encodeWithSelector(this.emitHint.selector, hintOrder); + + bytes memory testRes = DagStore.get(keccak256("testkey")); + + return abi.encodeWithSelector(this.emitHint.selector, hintOrder, testRes); } // Function to match and backrun another dataRecord. @@ -78,7 +81,7 @@ contract OFAPrivate { dataRecords[1] = hintOrder.id; Suave.confidentialStore(hintOrder.id, "mevshare:v0:mergedDataRecords", abi.encode(dataRecords)); - return abi.encodeWithSelector(this.emitHint.selector, hintOrder); + return abi.encodeWithSelector(this.emitHint.selector, hintOrder, bytes("undefined")); } function emitMatchDataRecordAndHintCallback(string memory bundleRawResponse) external {