MockBiomapperLog
Inherits: IBiomapperLogRead, IMockBiomapperLogWrite
Mock contract implementing BiomapperLog contract interfaces.
It is constructed as part of the MockBiomapper, but it is also
possible to construct and use the MockBiomapperLog independently.
When used in conjunction with MockBiomapper, the interactions with
the corresponding MockBiomapper will drive the MockBiomapperLog state
accordingly, so there is no need to separately control
the MockBiomapperLog state.
When deployed independently, use the IMockBiomapperLogWrite
interface to drive the state.
State Variables
generationsHead
uint256 public generationsHead;
generationsTail
uint256 public generationsTail;
generationsList
mapping(uint256 => Generation) public generationsList;
biomappingsHeads
mapping(address => uint256) public biomappingsHeads;
biomappingsTails
mapping(address => uint256) public biomappingsTails;
biomappingsLists
mapping(address => mapping(uint256 => Biomapping)) public biomappingsLists;
generationBiomappings
mapping(address => mapping(uint256 => uint256)) public generationBiomappings;
Functions
biomappingsHead
Returns the most recent biomapping pointer for a given account address.
function biomappingsHead(address account) external view override returns (uint256);
Parameters
| Name | Type | Description |
|---|---|---|
account | address | The address of the requested account. |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | The block number in which the most recent biomap occurred, or 0 if the account was never biomapped. |
biomappingsTail
Returns the oldest biomapping pointer for a given account address.
function biomappingsTail(address account) external view override returns (uint256);
Parameters
| Name | Type | Description |
|---|---|---|
account | address | The address of the requested account. |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | The block number in which the oldest biomap occurred, or 0 if the account was never biomapped. |
biomappingsListItem
Returns the {Biomapping} struct for a given biomapping pointer and account address.
function biomappingsListItem(address account, uint256 ptr) external view override returns (Biomapping memory);
Parameters
| Name | Type | Description |
|---|---|---|
account | address | The address of the requested account. |
ptr | uint256 | The biomapping pointer of the requested biomapping. |
Returns
| Name | Type | Description |
|---|---|---|
<none> | Biomapping | The {Biomapping} structure. |
generationsListItem
Returns the generation struct for a given generation pointer.
function generationsListItem(uint256 ptr) external view override returns (Generation memory);
Parameters
| Name | Type | Description |
|---|---|---|
ptr | uint256 | The pointer of the requested generation. |
Returns
| Name | Type | Description |
|---|---|---|
<none> | Generation | The {Generation} structure. |
generationBiomapping
Returns the biomapping pointer for a given account address and generation pointer.
function generationBiomapping(address account, uint256 generationPtr) external view override returns (uint256);
Parameters
| Name | Type | Description |
|---|---|---|
account | address | The address of the requested account. |
generationPtr | uint256 | The pointer of the requested generation. |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | The block number in which the requested user was biomapped in the requested generation, or 0 if there was no biomapping. |
initGeneration
Initializes a new generation.
function initGeneration(bytes32 generation) external;
Parameters
| Name | Type | Description |
|---|---|---|
generation | bytes32 | Arbitrarty bytes to represent the generation. |
biomap
Creates a new biomapping for the specified account.
function biomap(address account) external;
Parameters
| Name | Type | Description |
|---|---|---|
account | address | The address of the account to biomap. |