Skip to content

Commit

Permalink
Merge pull request #63 from hyperledger-labs/go-dep
Browse files Browse the repository at this point in the history
Replace go-iden3-crypto dependency with new release v0.0.17
  • Loading branch information
Chengxuan committed Sep 11, 2024
2 parents efcafe2 + 2fc6d63 commit 99afbe0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 43 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,6 @@ jobs:
path: zeto
fetch-depth: 0

- name: Checkout kaleido's fork of go-iden3-crypto
uses: actions/checkout@v3
with:
path: go-iden3-crypto
repository: kaleido-io/go-iden3-crypto
ref: multi-states
fetch-depth: 0

- name: Setup temp dir for the artifacts
run: |
mkdir -p ${{ runner.temp }}/zeto-artifacts
Expand Down
4 changes: 2 additions & 2 deletions go-sdk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GOGC=30

all: test go-mod-tidy
test: deps lint
$(VGO) test ./internal/... -cover -coverprofile=coverage.txt -covermode=atomic -timeout=30s ${TEST_ARGS}
$(VGO) test -v ./internal/... -cover -coverprofile=coverage.txt -covermode=atomic -timeout=30s ${TEST_ARGS}
coverage.html:
$(VGO) tool cover -html=coverage.txt
coverage: test coverage.html
Expand All @@ -23,7 +23,7 @@ ${LINT}:
go-mod-tidy: .ALWAYS
$(VGO) mod tidy
e2e: test
$(VGO) test ./integration-test
$(VGO) test -v ./integration-test
.ALWAYS: ;
clean:
$(VGO) clean
Expand Down
28 changes: 3 additions & 25 deletions go-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ Golang implementation of Sparse Merkle Tree that is optimized for managing an ap
## Running the unit tests for the Spark Merkle Tree implementation

```console
$ go test ./internal/node ./internal/smt ./internal/storage ./internal/utxo
? github.com/hyperledger-labs/zeto/internal/storage [no test files]
ok github.com/hyperledger-labs/zeto/internal/node 0.828s
ok github.com/hyperledger-labs/zeto/internal/smt 1.037s
ok github.com/hyperledger-labs/zeto/internal/utxo 1.269s
$ make
```

## Running the integration test
Expand All @@ -24,29 +20,11 @@ Once the proving keys and verification keys are generated, set the following env
- `PROVING_KEYS_ROOT`: the folder that contains the proving keys and verification keys

Note: you need to be running a postgres database locally before running the tests, you can run it in Docker with:

```console
docker run -d --name postgres -e POSTGRES_PASSWORD=my-secret -p 5432:5432 postgres
```

```console
$ go test -v ./integration-test/
=== RUN TestZeto_1_SuccessfulProving
Proving time: 201.09225ms
--- PASS: TestZeto_1_SuccessfulProving (0.58s)
=== RUN TestZeto_2_SuccessfulProving
Proving time: 404.013542ms
--- PASS: TestZeto_2_SuccessfulProving (0.69s)
=== RUN TestZeto_3_SuccessfulProving
Proving time: 2.30433175s
--- PASS: TestZeto_3_SuccessfulProving (2.61s)
=== RUN TestHashTokenUri
--- PASS: TestHashTokenUri (0.00s)
=== RUN TestZeto_4_SuccessfulProving
Proving time: 129.8345ms
--- PASS: TestZeto_4_SuccessfulProving (0.46s)
=== RUN TestZeto_5_SuccessfulProving
Proving time: 1.126922875s
--- PASS: TestZeto_5_SuccessfulProving (1.64s)
PASS
ok github.com/kaleido-io/zeto/lib 6.324s
$ make e2e
```
6 changes: 2 additions & 4 deletions go-sdk/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dchest/blake512 v1.0.0 // indirect
github.com/hyperledger/firefly-signer v1.1.13
github.com/iden3/go-iden3-crypto v0.0.16
github.com/iden3/go-iden3-crypto v0.0.17
github.com/iden3/go-rapidsnark/prover v0.0.10
github.com/iden3/go-rapidsnark/types v0.0.2 // indirect
github.com/iden3/go-rapidsnark/witness/v2 v2.0.0
Expand All @@ -51,7 +51,5 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
gorm.io/driver/postgres v1.5.9
gorm.io/driver/sqlite v1.5.6
gorm.io/gorm v1.25.11
gorm.io/gorm v1.25.12
)

replace github.com/iden3/go-iden3-crypto => github.com/kaleido-io/go-iden3-crypto v0.0.0-20240905154504-333f60687c26
8 changes: 4 additions & 4 deletions go-sdk/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ github.com/hyperledger/firefly-common v1.4.6 h1:qqXoSaRml3WjUnWcWxrrXs5AIOWa+UcM
github.com/hyperledger/firefly-common v1.4.6/go.mod h1:jkErZdQmC9fsAJZQO427tURdwB9iiW+NMUZSqS3eBIE=
github.com/hyperledger/firefly-signer v1.1.13 h1:eiHjc6HPRG8AzXUCUgm51qqX1I9BokiuiiqJ89XwK4M=
github.com/hyperledger/firefly-signer v1.1.13/go.mod h1:pK6kivzBFSue3zpJSQpH67VasnLLbwBJOBUNv0zHbRA=
github.com/iden3/go-iden3-crypto v0.0.17 h1:NdkceRLJo/pI4UpcjVah4lN/a3yzxRUGXqxbWcYh9mY=
github.com/iden3/go-iden3-crypto v0.0.17/go.mod h1:dLpM4vEPJ3nDHzhWFXDjzkn1qHoBeOT/3UEhXsEsP3E=
github.com/iden3/go-rapidsnark/prover v0.0.10 h1:NvOfRPpex/k646UsqOcUy7a7uVl17t4ok9kWvpQg4+k=
github.com/iden3/go-rapidsnark/prover v0.0.10/go.mod h1:wgDsmKOGCuWGtgVtuW9ARWNguNr4NJAIyg2G7+uTax0=
github.com/iden3/go-rapidsnark/types v0.0.2 h1:CjJSrlbWchHzuMRdxSYrEh7n/akP+Z2PLNbwT5yBmQY=
Expand All @@ -47,8 +49,6 @@ github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/kaleido-io/go-iden3-crypto v0.0.0-20240905154504-333f60687c26 h1:WHlF6wdeN4sJ9iB38fLpIm0tugEwmBzoxgWIHXXd1qU=
github.com/kaleido-io/go-iden3-crypto v0.0.0-20240905154504-333f60687c26/go.mod h1:dLpM4vEPJ3nDHzhWFXDjzkn1qHoBeOT/3UEhXsEsP3E=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
Expand Down Expand Up @@ -117,5 +117,5 @@ gorm.io/driver/postgres v1.5.9 h1:DkegyItji119OlcaLjqN11kHoUgZ/j13E0jkJZgD6A8=
gorm.io/driver/postgres v1.5.9/go.mod h1:DX3GReXH+3FPWGrrgffdvCk3DQ1dwDPdmbenSkweRGI=
gorm.io/driver/sqlite v1.5.6 h1:fO/X46qn5NUEEOZtnjJRWRzZMe8nqJiQ9E+0hi+hKQE=
gorm.io/driver/sqlite v1.5.6/go.mod h1:U+J8craQU6Fzkcvu8oLeAQmi50TkwPEhHDEjQZXDah4=
gorm.io/gorm v1.25.11 h1:/Wfyg1B/je1hnDx3sMkX+gAlxrlZpn6X0BXRlwXlvHg=
gorm.io/gorm v1.25.11/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ=
gorm.io/gorm v1.25.12 h1:I0u8i2hWQItBq1WfE0o2+WuL9+8L21K9e2HHSTE/0f8=
gorm.io/gorm v1.25.12/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ=

0 comments on commit 99afbe0

Please sign in to comment.