-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(fix): callback gasUsed should not count gasForCallExactCheck (#10104)
* (fix): callback gasUsed should not count gasForCallExactCheck * (test): Add FaultyClient test * rename testhelper to FunctionsClientWithEmptyCallback
- Loading branch information
1 parent
78d6113
commit fa811af
Showing
5 changed files
with
88 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
contracts/src/v0.8/functions/tests/1_0_0/testhelpers/FunctionsClientWithEmptyCallback.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.6; | ||
|
||
import {ITermsOfServiceAllowList} from "../../../dev/1_0_0/accessControl/interfaces/ITermsOfServiceAllowList.sol"; | ||
import {IFunctionsSubscriptions} from "../../../dev/1_0_0/interfaces/IFunctionsSubscriptions.sol"; | ||
|
||
import {FunctionsRequest} from "../../../dev/1_0_0/libraries/FunctionsRequest.sol"; | ||
import {FunctionsClient} from "../../../dev/1_0_0/FunctionsClient.sol"; | ||
|
||
contract FunctionsClientWithEmptyCallback is FunctionsClient { | ||
using FunctionsRequest for FunctionsRequest.Request; | ||
|
||
event SendRequestInvoked(bytes32 requestId, string sourceCode, uint64 subscriptionId); | ||
event FulfillRequestInvoked(bytes32 requestId, bytes response, bytes err); | ||
|
||
constructor(address router) FunctionsClient(router) {} | ||
|
||
function sendSimpleRequestWithJavaScript( | ||
string memory sourceCode, | ||
uint64 subscriptionId, | ||
bytes32 donId, | ||
uint32 callbackGasLimit | ||
) public returns (bytes32 requestId) { | ||
FunctionsRequest.Request memory request; | ||
request.initializeRequestForInlineJavaScript(sourceCode); | ||
bytes memory requestData = FunctionsRequest.encodeCBOR(request); | ||
requestId = _sendRequest(requestData, subscriptionId, callbackGasLimit, donId); | ||
emit SendRequestInvoked(requestId, sourceCode, subscriptionId); | ||
} | ||
|
||
function fulfillRequest(bytes32 requestId, bytes memory response, bytes memory err) internal override {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.