From 2fc6d63e5c608e6e1b69d0e870f6f3847e96d246 Mon Sep 17 00:00:00 2001 From: Jim Zhang Date: Tue, 10 Sep 2024 21:35:02 -0400 Subject: [PATCH] Replace go-iden3-crypto dependency with new release v0.0.17 Signed-off-by: Jim Zhang --- .github/workflows/e2e.yaml | 8 -------- go-sdk/Makefile | 4 ++-- go-sdk/README.md | 28 +++------------------------- go-sdk/go.mod | 6 ++---- go-sdk/go.sum | 8 ++++---- 5 files changed, 11 insertions(+), 43 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 22a4bd0..ae49335 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -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 diff --git a/go-sdk/Makefile b/go-sdk/Makefile index 32221ae..1c372c2 100644 --- a/go-sdk/Makefile +++ b/go-sdk/Makefile @@ -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 @@ -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 diff --git a/go-sdk/README.md b/go-sdk/README.md index bbf6247..dc799ea 100644 --- a/go-sdk/README.md +++ b/go-sdk/README.md @@ -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 @@ -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 ``` diff --git a/go-sdk/go.mod b/go-sdk/go.mod index 1a3a66e..e1a90ef 100644 --- a/go-sdk/go.mod +++ b/go-sdk/go.mod @@ -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 @@ -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 diff --git a/go-sdk/go.sum b/go-sdk/go.sum index c2cc79e..fd08e3c 100644 --- a/go-sdk/go.sum +++ b/go-sdk/go.sum @@ -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= @@ -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= @@ -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=