Skip to content

Commit

Permalink
aqua: update sig service (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
justprosh authored Feb 5, 2022
1 parent 7c72a59 commit b9fbbbc
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 56 deletions.
16 changes: 8 additions & 8 deletions admin/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"license": "MIT",
"dependencies": {
"@fluencelabs/aqua": "^0.5.2-257",
"@fluencelabs/aqua-lib": "^0.3.2",
"@fluencelabs/aqua-lib": "^0.3.4",
"@fluencelabs/fluence": "^0.18.0",
"@fluencelabs/fluence-network-environment": "^1.0.10",
"@fluencelabs/trust-graph": "file:../aqua",
Expand Down
18 changes: 9 additions & 9 deletions aqua/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion aqua/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"*.aqua"
],
"dependencies": {
"@fluencelabs/aqua-lib": "^0.3.1"
"@fluencelabs/aqua-lib": "^0.3.4"
},
"scripts": {
"generate-aqua": "../service/build.sh",
Expand Down
47 changes: 21 additions & 26 deletions aqua/trust-graph-api.aqua
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,18 @@ func issue_trust(issuer: PeerId, issued_for: PeerId, expires_at_sec: u64) -> ?Tr
result: ?Trust
error: *Error
if bytes.success:
-- for %init_peer_id% Sig service available by default and registered as "sig"
-- for other peer ids custom Sig service should be implemented and registered with this peer id as service id
if issuer != %init_peer_id%:
Sig issuer
else:
Sig "sig"

signature <- Sig.sign(bytes.result)

on HOST_PEER_ID:
issue_result <- TrustGraph.issue_trust(issued_for, expires_at_sec, issued_at_sec, signature)
if issue_result.success:
result <<- issue_result.trust
Sig issuer
sig_res <- Sig.sign(bytes.result)

if sig_res.success:
on HOST_PEER_ID:
issue_result <- TrustGraph.issue_trust(issued_for, expires_at_sec, issued_at_sec, sig_res.signature!)
if issue_result.success:
result <<- issue_result.trust
else:
error <<- issue_result.error
else:
error <<- issue_result.error
error <<- sig_res.error!
else:
error <<- bytes.error
<- result, error
Expand Down Expand Up @@ -133,21 +130,19 @@ func issue_revocation(revoked_by: PeerId, revoked: PeerId) -> ?Revocation, ?Erro
result: ?Revocation
error: *Error
if bytes.success:
-- for %init_peer_id% Sig service available by default and registered as "sig"
-- for other peer ids custom Sig service should be implemented and registered with this peer id as service id
if revoked_by != %init_peer_id%:
Sig revoked_by
else:
Sig "sig"
Sig revoked_by

signature <- Sig.sign(bytes.result)
sig_res <- Sig.sign(bytes.result)

on HOST_PEER_ID:
issue_result <- TrustGraph.issue_revocation(revoked_by, revoked, issued_at_sec, signature)
if issue_result.success:
result <<- issue_result.revocation
if sig_res.success:
on HOST_PEER_ID:
issue_result <- TrustGraph.issue_revocation(revoked_by, revoked, issued_at_sec, sig_res.signature!)
if issue_result.success:
result <<- issue_result.revocation
else:
error <<- issue_result.error
else:
error <<- issue_result.error
error <<- sig_res.error!
else:
error <<- bytes.error
<- result, error
Expand Down
20 changes: 10 additions & 10 deletions example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"license": "MIT",
"dependencies": {
"@fluencelabs/aqua": "^0.5.2-257",
"@fluencelabs/aqua-lib": "^0.3.2",
"@fluencelabs/aqua-lib": "^0.3.4",
"@fluencelabs/fluence": "^0.18.0",
"@fluencelabs/fluence-network-environment": "^1.0.10",
"@fluencelabs/trust-graph": "file:../aqua",
Expand Down

0 comments on commit b9fbbbc

Please sign in to comment.