Skip to content

Commit

Permalink
Change second parameter name to parameterPayload
Browse files Browse the repository at this point in the history
  • Loading branch information
austinborn committed Sep 19, 2023
1 parent 7a0963f commit 280acd0
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 54 deletions.
8 changes: 4 additions & 4 deletions contracts/src/v0.8/llo-feeds/VerifierProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ contract VerifierProxy is IVerifierProxy, ConfirmedOwner, TypeAndVersionInterfac
/// @inheritdoc IVerifierProxy
function verify(
bytes calldata payload,
bytes calldata feePayload
bytes calldata parameterPayload
) external payable checkAccess returns (bytes memory) {
IVerifierFeeManager feeManager = s_feeManager;

// Bill the verifier
if (address(feeManager) != address(0)) {
feeManager.processFee{value: msg.value}(payload, feePayload, msg.sender);
feeManager.processFee{value: msg.value}(payload, parameterPayload, msg.sender);
}

return _verify(payload);
Expand All @@ -138,13 +138,13 @@ contract VerifierProxy is IVerifierProxy, ConfirmedOwner, TypeAndVersionInterfac
/// @inheritdoc IVerifierProxy
function verifyBulk(
bytes[] calldata payloads,
bytes calldata feePayload
bytes calldata parameterPayload
) external payable checkAccess returns (bytes[] memory verifiedReports) {
IVerifierFeeManager feeManager = s_feeManager;

// Bill the verifier
if (address(feeManager) != address(0)) {
feeManager.processFeeBulk{value: msg.value}(payloads, feePayload, msg.sender);
feeManager.processFeeBulk{value: msg.value}(payloads, parameterPayload, msg.sender);
}

//verify the reports
Expand Down
12 changes: 6 additions & 6 deletions contracts/src/v0.8/llo-feeds/dev/FeeManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@ contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface {
/// @inheritdoc IVerifierFeeManager
function processFee(
bytes calldata payload,
bytes calldata feePayload,
bytes calldata parameterPayload,
address subscriber
) external payable override onlyProxy {
(Common.Asset memory fee, Common.Asset memory reward, uint256 appliedDiscount) = _processFee(
payload,
feePayload,
parameterPayload,
subscriber
);

Expand All @@ -198,7 +198,7 @@ contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface {
/// @inheritdoc IVerifierFeeManager
function processFeeBulk(
bytes[] calldata payloads,
bytes calldata feePayload,
bytes calldata parameterPayload,
address subscriber
) external payable override onlyProxy {
FeeAndReward[] memory feesAndRewards = new IFeeManager.FeeAndReward[](payloads.length);
Expand All @@ -211,7 +211,7 @@ contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface {
for (uint256 i; i < payloads.length; ++i) {
(Common.Asset memory fee, Common.Asset memory reward, uint256 appliedDiscount) = _processFee(
payloads[i],
feePayload,
parameterPayload,
subscriber
);

Expand Down Expand Up @@ -371,7 +371,7 @@ contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface {

function _processFee(
bytes calldata payload,
bytes calldata quotePayload,
bytes calldata parameterPayload,
address subscriber
) internal view returns (Common.Asset memory, Common.Asset memory, uint256) {
if (subscriber == address(this)) revert InvalidAddress();
Expand All @@ -386,7 +386,7 @@ contract FeeManager is IFeeManager, ConfirmedOwner, TypeAndVersionInterface {
address quote;
if (_getReportVersion(feedId) != REPORT_V1) {
//decode the quote from the bytes
(quote) = abi.decode(quotePayload, (address));
(quote) = abi.decode(parameterPayload, (address));
}

//decode the fee, it will always be native or LINK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ interface IVerifierFeeManager is IERC165 {
/**
* @notice Handles fees for a report from the subscriber and manages rewards
* @param payload report to process the fee for
* @param feePayload fee payload
* @param parameterPayload fee payload
* @param subscriber address of the fee will be applied
*/
function processFee(bytes calldata payload, bytes calldata feePayload, address subscriber) external payable;
function processFee(bytes calldata payload, bytes calldata parameterPayload, address subscriber) external payable;

/**
* @notice Processes the fees for each report in the payload, billing the subscriber and paying the reward manager
* @param payloads reports to process
* @param feePayload fee payload
* @param parameterPayload fee payload
* @param subscriber address of the user to process fee for
*/
function processFeeBulk(bytes[] calldata payloads, bytes calldata feePayload, address subscriber) external payable;
function processFeeBulk(bytes[] calldata payloads, bytes calldata parameterPayload, address subscriber) external payable;

/**
* @notice Sets the fee recipients according to the fee manager
Expand Down
8 changes: 4 additions & 4 deletions contracts/src/v0.8/llo-feeds/interfaces/IVerifierProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ interface IVerifierProxy {
* correctly by routing to the correct verifier, and bills the user if applicable.
* @param payload The encoded data to be verified, including the signed
* report.
* @param feePayload fee metadata for billing
* @param parameterPayload fee metadata for billing
* @return verifierResponse The encoded report from the verifier.
*/
function verify(
bytes calldata payload,
bytes calldata feePayload
bytes calldata parameterPayload
) external payable returns (bytes memory verifierResponse);

/**
* @notice Bulk verifies that the data encoded has been signed
* correctly by routing to the correct verifier, and bills the user if applicable.
* @param payloads The encoded payloads to be verified, including the signed
* report.
* @param feePayload fee metadata for billing
* @param parameterPayload fee metadata for billing
* @return verifiedReports The encoded reports from the verifier.
*/
function verifyBulk(
bytes[] calldata payloads,
bytes calldata feePayload
bytes calldata parameterPayload
) external payable returns (bytes[] memory verifiedReports);

/**
Expand Down
8 changes: 4 additions & 4 deletions contracts/src/v0.8/llo-feeds/test/mocks/FeeManagerProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import "../../dev/interfaces/IFeeManager.sol";
contract FeeManagerProxy {
IFeeManager internal i_feeManager;

function processFee(bytes calldata payload, bytes calldata feePayload) public payable {
i_feeManager.processFee{value: msg.value}(payload, feePayload, msg.sender);
function processFee(bytes calldata payload, bytes calldata parameterPayload) public payable {
i_feeManager.processFee{value: msg.value}(payload, parameterPayload, msg.sender);
}

function processFeeBulk(bytes[] calldata payloads, bytes calldata feePayload) public payable {
i_feeManager.processFeeBulk{value: msg.value}(payloads, feePayload, msg.sender);
function processFeeBulk(bytes[] calldata payloads, bytes calldata parameterPayload) public payable {
i_feeManager.processFeeBulk{value: msg.value}(payloads, parameterPayload, msg.sender);
}

function setFeeManager(IFeeManager feeManager) public {
Expand Down
30 changes: 15 additions & 15 deletions core/gethwrappers/llo-feeds/generated/fee_manager/fee_manager.go

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
GETH_VERSION: 1.12.0
errored_verifier: ../../../contracts/solc/v0.8.16/ErroredVerifier.abi ../../../contracts/solc/v0.8.16/ErroredVerifier.bin 510d18a58bfda646be35e46491baf73041eb333a349615465b20e2b5b41c5f73
exposed_verifier: ../../../contracts/solc/v0.8.16/ExposedVerifier.abi ../../../contracts/solc/v0.8.16/ExposedVerifier.bin 6932cea8f2738e874d3ec9e1a4231d2421704030c071d9e15dd2f7f08482c246
fee_manager: ../../../contracts/solc/v0.8.16/FeeManager.abi ../../../contracts/solc/v0.8.16/FeeManager.bin 14e1aca5c41bf899cec3c6d3f626642f786348c9d8746f78fe7c3e921d1c878e
fee_manager: ../../../contracts/solc/v0.8.16/FeeManager.abi ../../../contracts/solc/v0.8.16/FeeManager.bin cac01f18ad6eebac0c58d64fafa9a6076c00a91496bdc1e90aeb18e7b13a815c
llo_feeds: ../../../contracts/solc/v0.8.16/FeeManager.abi ../../../contracts/solc/v0.8.16/FeeManager.bin cb71e018f67e49d7bc0e194c822204dfd59f79ff42e4fc8fd8ab63f3acd71361
llo_feeds_test: ../../../contracts/solc/v0.8.16/ExposedVerifier.abi ../../../contracts/solc/v0.8.16/ExposedVerifier.bin 6932cea8f2738e874d3ec9e1a4231d2421704030c071d9e15dd2f7f08482c246
reward_manager: ../../../contracts/solc/v0.8.16/RewardManager.abi ../../../contracts/solc/v0.8.16/RewardManager.bin ec52c851ffe7ed00e05a68dbb363b2e01d38088ac829988b611653b30d10ec97
verifier: ../../../contracts/solc/v0.8.16/Verifier.abi ../../../contracts/solc/v0.8.16/Verifier.bin 135206eccb805c267392c398df385aa51b22db4d4c59fa1f31f0e5b0a607c812
verifier_proxy: ../../../contracts/solc/v0.8.16/VerifierProxy.abi ../../../contracts/solc/v0.8.16/VerifierProxy.bin ea00d5bea59a19066e36c2f9ec118e2eeb70536ea1862ba3cd1b88796d174ddd
verifier_proxy: ../../../contracts/solc/v0.8.16/VerifierProxy.abi ../../../contracts/solc/v0.8.16/VerifierProxy.bin 250e4066936535d57d8e3859dfd33fddc7abc525b0f81e1fe87d96f00663a74f

0 comments on commit 280acd0

Please sign in to comment.