Skip to content

Commit

Permalink
fix(contracts): use sha256 for output hash (#47)
Browse files Browse the repository at this point in the history
* fix: use sha256 for output hash

* test: fix
  • Loading branch information
ctian1 authored Aug 14, 2023
1 parent ba79cd0 commit b4514b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contracts/src/FunctionGateway.sol
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ contract FunctionGateway is IFunctionGateway, FunctionRegistry, TimelockedUpgrad
revert RequestNotFound(_requestId);
} else if (r.contextHash != keccak256(_context)) {
revert ContextMismatch(_requestId, _context);
} else if (r.outputHash != keccak256(_output)) {
} else if (r.outputHash != sha256(_output)) {
revert OutputMismatch(_requestId, _output);
} else if (!r.proofFulfilled) {
revert ProofNotFulfilled(_requestId);
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/FunctionGateway.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ contract FunctionGatewayTest is Test, IFunctionGatewayEvents, IFunctionGatewayEr
bytes4 internal constant CALLBACK_SELECTOR = TestConsumer.handleRequest.selector;
bytes internal constant CALLBACK_CONTEXT = abi.encode(0);
bytes internal constant REQUEST_OUTPUT = abi.encode(true);
bytes32 internal constant REQUEST_OUTPUT_HASH = keccak256(REQUEST_OUTPUT);
bytes32 internal constant REQUEST_OUTPUT_HASH = sha256(REQUEST_OUTPUT);
bytes internal constant REQUEST_PROOF = hex"";
bytes32 internal EXPECTED_REQUEST_ID;
uint256 internal constant DEFAULT_FEE = 0.1 ether;
Expand Down

0 comments on commit b4514b9

Please sign in to comment.