MockFeeManager v0.3.1 API Reference
MockFeeManager
A mock implementation of the Data Streams verifier fee manager for local testing.
Errors
Unauthorized
error Unauthorized()
InvalidAddress
error InvalidAddress()
InvalidQuote
error InvalidQuote()
ExpiredReport
error ExpiredReport()
InvalidDiscount
error InvalidDiscount()
InvalidSurcharge
error InvalidSurcharge()
InvalidDeposit
error InvalidDeposit()
Functions
constructor
Initializes the contract.
constructor(address linkAddress, address nativeAddress, address proxyAddress, address rewardManager)
Parameters
| Parameter | Type | Description |
|---|---|---|
| linkAddress | address | The LINK token address |
| nativeAddress | address | The wrapped native token address |
| proxyAddress | address | The verifier proxy address (only caller) |
| rewardManager | address | The reward manager address |
processFee
Processes the fee for a single report verification.
function processFee(bytes calldata payload, bytes calldata parameterPayload, address subscriber) external payable override onlyProxy
processFeeBulk
Processes fees for multiple report verifications.
function processFeeBulk(bytes[] calldata payloads, bytes calldata parameterPayload, address subscriber) external payable override onlyProxy
getFeeAndReward
Returns the fee and reward for a report and quote token.
function getFeeAndReward(address subscriber, bytes memory report, address quoteAddress) public view returns (Common.Asset memory, Common.Asset memory, uint256)
Parameters
| Parameter | Type | Description |
|---|---|---|
| subscriber | address | The subscriber address (for the discount lookup) |
| report | bytes | The report data |
| quoteAddress | address | The fee token to quote (LINK or wrapped native) |
Returns
| Parameter | Type | Description |
|---|---|---|
| (unnamed) | Common.Asset | The fee asset and amount |
| (unnamed) | Common.Asset | The reward asset and amount (always LINK) |
| (unnamed) | uint256 | The discount applied |
setNativeSurcharge
Sets the surcharge applied to native token fees.
function setNativeSurcharge(uint256 surcharge) external onlyOwner
setMockDiscount
Sets a per-subscriber discount.
function setMockDiscount(address subscriber, uint256 discount) external onlyOwner
withdrawMockFee
Withdraws accumulated fees.
function withdrawMockFee(address to, address coin) external onlyOwner
withdrawLink
Withdraws accumulated LINK.
function withdrawLink(address to) external onlyOwner