merge
Merges two compact ranges along a given seed node.
Merge folds hashes in from leftRange and rightRange into seed in order to create a combined compact range. The merged range is left + seed + right. leftRange is assumed to start its coverage at index 0.
function merge(
bytes32[] calldata leftRange,
bytes32 seed,
uint256 seedHeight,
uint256 seedIndex,
bytes32[] calldata rightRange,
uint256 rightRangeEnd
) pure returns (bytes32[] calldata left, bytes32 newSeed, bytes32[] calldata right);
Parameters
| Name | Type | Description |
|---|---|---|
leftRange | bytes32[] | The left compact range to merge. |
seed | bytes32 | The seed node to merge along. |
seedHeight | uint256 | The height of the seed node. |
seedIndex | uint256 | The index of the seed node. |
rightRange | bytes32[] | The right compact range to merge. |
rightRangeEnd | uint256 | The end of the right range's coverage. |
Returns
| Name | Type | Description |
|---|---|---|
left | bytes32[] | The left portion of the merged compact range. |
newSeed | bytes32 | The new seed node of the merged range. |
right | bytes32[] | The right portion of the merged compact range. |