# MockVerifier v0.3.1 API Reference
Source: https://docs.chain.link/chainlink-local/api-reference/v0.3.1/mock-verifier

> For the complete documentation index, see [llms.txt](/llms.txt).

> **NOTE: Integrate Chainlink Local into your project**
>
> ### npm
>
> If you use [NPM](https://www.npmjs.com/), install the [@chainlink/local NPM
> package](https://www.npmjs.com/package/@chainlink/local):
>
> ```shell
> npm install @chainlink/local@0.3.1
> ```
>
> ### yarn
>
> If you use [Yarn](https://yarnpkg.com/), install the [@chainlink/local NPM
> package](https://www.npmjs.com/package/@chainlink/local):
>
> ```shell
> yarn add @chainlink/local@0.3.1
> ```
>
> ### foundry
>
> If you use [Foundry](https://book.getfoundry.sh/):
>
> ```shell
> forge install smartcontractkit/chainlink-local@v0.3.1
> ```
>
> and then set remappings to: `@chainlink/local/=lib/chainlink-local/` in either `remappings.txt` or `foundry.toml` file
>
> ### RemixIDE
>
> Import the `CCIPLocalSimulator` contract from the `@chainlink/local` package:
>
> ```solidity
> import {CCIPLocalSimulator} from "@chainlink/local@0.3.1/src/ccip/CCIPLocalSimulator.sol";
> ```

## MockVerifier

A mock implementation of the Data Streams verifier for local testing.

[`MockVerifier`](https://github.com/smartcontractkit/chainlink-local/blob/v0.3.1/src/data-streams/MockVerifier.sol)

> **NOTE**
>
> This contract verifies reports signed by the mock DON address (generated from `keccak256("Mock Data Streams DON")`).
> Only the [`MockVerifierProxy`](/chainlink-local/api-reference/v0.3.1/mock-verifier-proxy) may call `verify`. Reports
> are generated with [`MockReportGenerator`](/chainlink-local/api-reference/v0.3.1/mock-report-generator).

## Errors

### AccessForbidden

```solidity
error AccessForbidden()
```

> **NOTE**
>
> Reverts when `verify` is called by anyone other than the verifier proxy.

### InactiveFeed

```solidity
error InactiveFeed(bytes32 feedId)
```

### DigestInactive

```solidity
error DigestInactive(bytes32 feedId, bytes32 configDigest)
```

### BadVerification

```solidity
error BadVerification()
```

> **NOTE**
>
> Reverts when the report signature does not recover to the mock DON address.

### InvalidV

```solidity
error InvalidV()
```

### AlreadyUsedSignature

```solidity
error AlreadyUsedSignature()
```

> **NOTE**
>
> Reverts on a replayed report signature.

### InvalidSignatureLength

```solidity
error InvalidSignatureLength()
```

### InvalidS

```solidity
error InvalidS()
```

> **NOTE**
>
> Reverts when `s` exceeds half the secp256k1 curve order (EIP-2 signature malleability check).

## Events

### ReportVerified

```solidity
event ReportVerified(bytes32 indexed feedId, address indexed sender)
```

## Functions

### constructor

Initializes the contract with the verifier proxy address.

```solidity
constructor(address verifierProxy)
```

#### Parameters

| Parameter     | Type      | Description                                |
| ------------- | --------- | ------------------------------------------ |
| verifierProxy | `address` | The address of the verifier proxy contract |

### verify

Verifies a signed report and returns the report data.

```solidity
function verify(bytes calldata signedReport, address sender) external returns (bytes memory verifierResponse)
```

> **NOTE**
>
> Only callable by the verifier proxy. Decodes the signed report, checks the feed and config digest are active, recovers
> the signer with `ecrecover` and marks the signature as used. Returns the report data.

#### Parameters

| Parameter    | Type      | Description                           |
| ------------ | --------- | ------------------------------------- |
| signedReport | `bytes`   | The ABI-encoded signed report         |
| sender       | `address` | The address that submitted the report |

#### Returns

| Parameter        | Type    | Description             |
| ---------------- | ------- | ----------------------- |
| verifierResponse | `bytes` | The decoded report data |

### deactivateConfig

Deactivates a config digest for a feed.

```solidity
function deactivateConfig(bytes32 feedId, bytes32 configDigest) external
```

### activateConfig

Activates a config digest for a feed.

```solidity
function activateConfig(bytes32 feedId, bytes32 configDigest) external
```

### deactivateFeed

Deactivates a feed.

```solidity
function deactivateFeed(bytes32 feedId) external
```

### activateFeed

Activates a feed.

```solidity
function activateFeed(bytes32 feedId) external
```

### supportsInterface

```solidity
function supportsInterface(bytes4 interfaceId) external pure override returns (bool)
```

> **NOTE**
>
> Returns true only for the `verify` selector.