Skip to content

Commit

Permalink
feat: remove useless build functions in AuthBuilder, ClaimBuilder and
Browse files Browse the repository at this point in the history
ProofBuilder testing libraries + bump hardhat version
  • Loading branch information
yum0e committed Sep 7, 2023
1 parent 6345303 commit 90038ca
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 385 deletions.
2 changes: 1 addition & 1 deletion .hardhat/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sismo-core/sismo-connect-solidity",
"description": "Sismo Connect Library",
"version": "0.0.20",
"version": "0.0.21",
"scripts": {
"prepare": "mkdir -p contracts; cp -r ../src/* contracts"
},
Expand Down
102 changes: 6 additions & 96 deletions src/utils/AuthBuilder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,40 +11,7 @@ library AuthBuilder {
bool public constant DEFAULT_AUTH_IS_SELECTABLE_BY_USER = true;
bytes public constant DEFAULT_AUTH_EXTRA_DATA = "";

function build(
AuthType authType,
bool isAnon,
uint256 userId,
bool isSelectableByUser,
bytes memory extraData
) external pure returns (Auth memory) {
return
Auth({
authType: authType,
isAnon: isAnon,
userId: userId,
isSelectableByUser: isSelectableByUser,
extraData: extraData
});
}

function build(
AuthType authType,
bool isAnon,
uint256 userId,
bytes memory extraData
) external pure returns (Auth memory) {
return
Auth({
authType: authType,
isAnon: isAnon,
userId: userId,
isSelectableByUser: DEFAULT_AUTH_IS_SELECTABLE_BY_USER,
extraData: extraData
});
}

function build(AuthType authType) external pure returns (Auth memory) {
function build(AuthType authType) internal pure returns (Auth memory) {
return
Auth({
authType: authType,
Expand All @@ -55,18 +22,7 @@ library AuthBuilder {
});
}

function build(AuthType authType, bool isAnon) external pure returns (Auth memory) {
return
Auth({
authType: authType,
isAnon: isAnon,
userId: DEFAULT_AUTH_USER_ID,
isSelectableByUser: DEFAULT_AUTH_IS_SELECTABLE_BY_USER,
extraData: DEFAULT_AUTH_EXTRA_DATA
});
}

function build(AuthType authType, uint256 userId) external pure returns (Auth memory) {
function build(AuthType authType, uint256 userId) internal pure returns (Auth memory) {
return
Auth({
authType: authType,
Expand All @@ -77,27 +33,12 @@ library AuthBuilder {
});
}

function build(AuthType authType, bytes memory extraData) external pure returns (Auth memory) {
return
Auth({
authType: authType,
isAnon: DEFAULT_AUTH_IS_ANON,
userId: DEFAULT_AUTH_USER_ID,
isSelectableByUser: DEFAULT_AUTH_IS_SELECTABLE_BY_USER,
extraData: extraData
});
}

function build(
AuthType authType,
bool isAnon,
uint256 userId
) external pure returns (Auth memory) {
function build(AuthType authType, bool isAnon) internal pure returns (Auth memory) {
return
Auth({
authType: authType,
isAnon: isAnon,
userId: userId,
userId: DEFAULT_AUTH_USER_ID,
isSelectableByUser: DEFAULT_AUTH_IS_SELECTABLE_BY_USER,
extraData: DEFAULT_AUTH_EXTRA_DATA
});
Expand All @@ -106,45 +47,14 @@ library AuthBuilder {
function build(
AuthType authType,
bool isAnon,
bytes memory extraData
) external pure returns (Auth memory) {
uint256 userId
) internal pure returns (Auth memory) {
return
Auth({
authType: authType,
isAnon: isAnon,
userId: DEFAULT_AUTH_USER_ID,
isSelectableByUser: DEFAULT_AUTH_IS_SELECTABLE_BY_USER,
extraData: extraData
});
}

function build(
AuthType authType,
uint256 userId,
bytes memory extraData
) external pure returns (Auth memory) {
return
Auth({
authType: authType,
isAnon: DEFAULT_AUTH_IS_ANON,
userId: userId,
isSelectableByUser: DEFAULT_AUTH_IS_SELECTABLE_BY_USER,
extraData: extraData
});
}

function build(
AuthType authType,
bool isAnon,
uint256 userId,
bool isSelectableByUser
) external pure returns (Auth memory) {
return
Auth({
authType: authType,
isAnon: isAnon,
userId: userId,
isSelectableByUser: isSelectableByUser,
extraData: DEFAULT_AUTH_EXTRA_DATA
});
}
Expand Down
Loading

0 comments on commit 90038ca

Please sign in to comment.