|
| 1 | +// SPDX-License-Identifier: MIT |
| 2 | +pragma solidity ^0.8.20; |
| 3 | + |
| 4 | +import {IMockBridgedBiomapperControl} from "./IMockBridgedBiomapperControl.sol"; |
| 5 | +import {IBridgedBiomapperRead} from "@biomapper-sdk/core/IBridgedBiomapperRead.sol"; |
| 6 | + |
| 7 | +/// @notice Mock contract implementing `BridgedBiomapper` contract interfaces. |
| 8 | +contract MockBridgedBiomapper is |
| 9 | + IBridgedBiomapperRead, |
| 10 | + IMockBridgedBiomapperControl |
| 11 | +{ |
| 12 | + uint256 public generationsHead; |
| 13 | + uint256 public generationsTail; |
| 14 | + mapping(uint256 => Generation) public generationsList; |
| 15 | + |
| 16 | + mapping(address => uint256) public biomappingsHeads; |
| 17 | + mapping(address => uint256) public biomappingsTails; |
| 18 | + mapping(address => mapping(uint256 => Biomapping)) public biomappingsLists; |
| 19 | + |
| 20 | + mapping(address => mapping(uint256 => uint256)) |
| 21 | + public generationBiomappings; |
| 22 | + |
| 23 | + /// @inheritdoc IBridgedBiomapperRead |
| 24 | + function biomappingsHead( |
| 25 | + address account |
| 26 | + ) external view override returns (uint256) { |
| 27 | + return biomappingsHeads[account]; |
| 28 | + } |
| 29 | + |
| 30 | + /// @inheritdoc IBridgedBiomapperRead |
| 31 | + function biomappingsTail( |
| 32 | + address account |
| 33 | + ) external view override returns (uint256) { |
| 34 | + return biomappingsTails[account]; |
| 35 | + } |
| 36 | + |
| 37 | + /// @inheritdoc IBridgedBiomapperRead |
| 38 | + function biomappingsListItem( |
| 39 | + address account, |
| 40 | + uint256 ptr |
| 41 | + ) external view override returns (Biomapping memory) { |
| 42 | + return biomappingsLists[account][ptr]; |
| 43 | + } |
| 44 | + |
| 45 | + /// @inheritdoc IBridgedBiomapperRead |
| 46 | + function generationsListItem( |
| 47 | + uint256 ptr |
| 48 | + ) external view override returns (Generation memory) { |
| 49 | + return generationsList[ptr]; |
| 50 | + } |
| 51 | + |
| 52 | + /// @inheritdoc IBridgedBiomapperRead |
| 53 | + function lookupBiomappingPtr( |
| 54 | + address account, |
| 55 | + uint256 generationPtr |
| 56 | + ) external view override returns (uint256) { |
| 57 | + return generationBiomappings[account][generationPtr]; |
| 58 | + } |
| 59 | + |
| 60 | + /// @inheritdoc IMockBridgedBiomapperControl |
| 61 | + function bridge() external { |
| 62 | + revert("TODO"); |
| 63 | + } |
| 64 | +} |
0 commit comments