-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds tests for encoding input. Failing to encode public keys
- Loading branch information
1 parent
7f0018d
commit 28cfa79
Showing
4 changed files
with
103 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
|
||
library RotateLib { | ||
struct RotateInput { | ||
bytes32 syncCommitteeSSZ; | ||
bytes32 syncCommitteePoseidon; | ||
} | ||
|
||
/** | ||
* @notice Compute the public input commitment for the rotation | ||
* This must always match the method used in lightclient-circuits/src/committee_udate_circuit.rs - CommitteeUpdateCircuit::instance() | ||
* @param args The arguments for the sync step | ||
* @return The public input commitment that can be sent to the verifier contract. | ||
*/ | ||
function toInputCommitment(RotateInput memory args, bytes32 finalizedHeaderRoot) internal pure returns (uint256[] memory) { | ||
// TODO: Impment this | ||
return new uint256[](0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.19; | ||
|
||
import { RotateLib } from "../src/RotateLib.sol"; | ||
|
||
/** | ||
* @title SyncStepLibTest | ||
* @dev This contract exists solely for the purpose of exposing the SyncStepLib functions | ||
* so they can be used in the Rust test suite. It should not be part of a production deployment | ||
*/ | ||
contract RotateExternal { | ||
using RotateLib for RotateLib.RotateInput; | ||
|
||
function toInputCommitment(RotateLib.RotateInput calldata args, bytes32 finalizedHeaderRoot) public pure returns (uint256[] memory) { | ||
return args.toInputCommitment(finalizedHeaderRoot); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters