Skip to content

Commit ca50168

Browse files
KyrylRArvolear
andauthored
Add getPublicSignals function to the AQueryProofExecutor (#44)
* Added getPublicSignals function to the AQueryProofExecutor * Updated version * typo fix --------- Co-authored-by: Artem Chystiakov <artem.ch31@gmail.com>
1 parent 2b9c6f6 commit ca50168

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [0.4.1]
4+
5+
* Added `getPublicSignals` function to the `AQueryProofExecutor` contract
6+
37
## [0.4.0]
48

59
### Breaking Change

contracts/sdk/AQueryProofExecutor.sol

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ abstract contract AQueryProofExecutor is Initializable {
7777
* @dev This function should decode `userPayload_` and use the `PublicSignalsBuilder` library functions
7878
* (attached via `using for`) to populate the public signals array based on the specific application's requirements.
7979
* @param userPayload_ Encoded application-specific data required to build the public signals.
80-
* @return dataPointer_ A `uint256` representing the memory pointer to the constructed public signals array.
80+
* @return builder_ A `uint256` representing the memory pointer to the constructed public signals array.
8181
*/
8282
function _buildPublicSignals(
8383
bytes32 registrationRoot_,
8484
uint256 currentDate_,
8585
bytes memory userPayload_
86-
) public virtual returns (uint256 dataPointer_);
86+
) public virtual returns (uint256 builder_);
8787

8888
/**
8989
* @notice Executes the full ZK proof verification workflow for a Circom (Groth16) proof.
@@ -141,6 +141,17 @@ abstract contract AQueryProofExecutor is Initializable {
141141
_afterVerify(registrationRoot_, currentDate_, userPayload_);
142142
}
143143

144+
function getPublicSignals(
145+
bytes32 registrationRoot_,
146+
uint256 currentDate_,
147+
bytes memory userPayload_
148+
) public virtual returns (bytes32[] memory publicSignals) {
149+
uint256 builder_ = _buildPublicSignals(registrationRoot_, currentDate_, userPayload_);
150+
builder_.withIdStateRoot(registrationRoot_);
151+
152+
return PublicSignalsBuilder.buildAsBytesArray(builder_);
153+
}
154+
144155
function getRegistrationSMT() public view returns (address) {
145156
return _getABuilderStorage().registrationSMT;
146157
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rarimo/passport-contracts",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"license": "MIT",
55
"author": "Zero Block Global Foundation",
66
"readme": "README.md",

0 commit comments

Comments
 (0)