From 7d6069931c683ca1695e7265b8621b4f7c324009 Mon Sep 17 00:00:00 2001 From: asabya Date: Wed, 6 Nov 2024 16:10:13 +0530 Subject: [PATCH] fix: build --- .github/workflows/release.yaml | 4 ++-- Makefile | 7 +++---- go.mod | 4 ++-- go.sum | 8 ++++---- pkg/act/act_test.go | 35 +++++++++++++++++----------------- pkg/act/new.go | 4 ++-- wasm/main.go | 4 +--- 7 files changed, 31 insertions(+), 35 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 66fd6340..87c94b1d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -74,11 +74,11 @@ jobs: run: | git checkout . - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 + uses: goreleaser/goreleaser-action@v6 with: distribution: goreleaser version: latest - args: release --rm-dist --config .goreleaser-mobile.yaml + args: release --clean --config .goreleaser-mobile.yaml env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Makefile b/Makefile index 6b7a9803..9761a62d 100644 --- a/Makefile +++ b/Makefile @@ -74,7 +74,7 @@ release: -v `pwd`:/go/src/github.com/fairDataSociety/fairOS-dfs \ -v /var/run/docker.sock:/var/run/docker.sock \ -w /go/src/github.com/fairDataSociety/fairOS-dfs \ - ghcr.io/goreleaser/goreleaser-cross:v1.21.0 release --rm-dist + ghcr.io/goreleaser/goreleaser-cross:v1.21.0 release --clean .PHONY: release-dry-run release-dry-run: @@ -84,9 +84,8 @@ release-dry-run: -v `pwd`:/go/src/github.com/fairDataSociety/fairOS-dfs \ -v /var/run/docker.sock:/var/run/docker.sock \ -w /go/src/github.com/fairDataSociety/fairOS-dfs \ - ghcr.io/goreleaser/goreleaser-cross:v1.21.0 release --rm-dist \ - --skip-validate=true \ - --skip-publish + ghcr.io/goreleaser/goreleaser-cross:v1.21.0 release \ + --clean --skip-validate=true --skip-publish .PHONY: wasm wasm: diff --git a/go.mod b/go.mod index 42ddc994..fc514c8b 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,8 @@ module github.com/fairdatasociety/fairOS-dfs go 1.22.0 require ( - github.com/asabya/swarm-act v0.0.0-20241022090815-9b494c0051de - github.com/asabya/swarm-blockstore v0.0.0-20241022084926-8d6753f32697 + github.com/asabya/swarm-act v0.0.0-20241106102524-234e35a79f95 + github.com/asabya/swarm-blockstore v0.0.0-20241106102400-00f682459f25 github.com/btcsuite/btcd/btcec/v2 v2.3.2 github.com/c-bata/go-prompt v0.2.6 github.com/dustin/go-humanize v1.0.1 diff --git a/go.sum b/go.sum index 5560e5bf..05b09d9f 100644 --- a/go.sum +++ b/go.sum @@ -11,10 +11,10 @@ github.com/VictoriaMetrics/fastcache v1.12.2/go.mod h1:AmC+Nzz1+3G2eCPapF6UcsnkT github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/asabya/swarm-act v0.0.0-20241022090815-9b494c0051de h1:d5PDY+pU7QCIu3VNSftUq6rc4hNC6GfxH8vI1JItWNU= -github.com/asabya/swarm-act v0.0.0-20241022090815-9b494c0051de/go.mod h1:JKFHSirdVKLWOdJpk7cl8732JiI+a9G64dzB58CEO8w= -github.com/asabya/swarm-blockstore v0.0.0-20241022084926-8d6753f32697 h1:MhH/TMo8jvCafB/WcI8MKajuWuodymKHiLZLGAQ35nE= -github.com/asabya/swarm-blockstore v0.0.0-20241022084926-8d6753f32697/go.mod h1:Tc8wjIjbbV0Ofrr3JPmxDcbmg571M6yFEdKOqWelWgo= +github.com/asabya/swarm-act v0.0.0-20241106102524-234e35a79f95 h1:+wmDLRIO5eY+aSvZprue0wUJg2fr1IHjPLHzEfJd5yQ= +github.com/asabya/swarm-act v0.0.0-20241106102524-234e35a79f95/go.mod h1:dIzdN1DEQVpjvzXVyB1b1RPJWO3ChEHOJzG/TYxD9KU= +github.com/asabya/swarm-blockstore v0.0.0-20241106102400-00f682459f25 h1:sx+0OADMTo5/EaG1PA7/Egt2WLIriCK3fExlVQE5SvE= +github.com/asabya/swarm-blockstore v0.0.0-20241106102400-00f682459f25/go.mod h1:Tc8wjIjbbV0Ofrr3JPmxDcbmg571M6yFEdKOqWelWgo= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bits-and-blooms/bitset v1.13.0 h1:bAQ9OPNFYbGHV6Nez0tmNI0RiEu7/hxlYJRUA0wFAVE= diff --git a/pkg/act/act_test.go b/pkg/act/act_test.go index dfe7ab8f..a5530d7a 100644 --- a/pkg/act/act_test.go +++ b/pkg/act/act_test.go @@ -1,4 +1,4 @@ -package act +package act_test import ( "context" @@ -11,6 +11,8 @@ import ( "testing" "time" + "github.com/fairdatasociety/fairOS-dfs/pkg/act" + "github.com/asabya/swarm-blockstore/bee" "github.com/asabya/swarm-blockstore/bee/mock" "github.com/btcsuite/btcd/btcec/v2" @@ -64,7 +66,7 @@ func TestACT(t *testing.T) { acc := accounts[0] fd := feed.New(acc.GetUserAccountInfo(), mockClient, -1, 0, logger) - ownerACT := NewACT(mockClient, fd, acc, tm, logger) + ownerACT := act.NewACT(mockClient, fd, acc, tm, logger) actName := acts[0] for i := 1; i < 10; i++ { acc := accounts[i] @@ -74,15 +76,12 @@ func TestACT(t *testing.T) { } <-time.After(1 * time.Second) } - a, err := ownerACT.GetACT(actName) - if err != nil { - t.Fatal(err) - } - addr, err := swarm.ParseHexAddress(a.GranteesRef) + _, err := ownerACT.GetACT(actName) if err != nil { t.Fatal(err) } - pubKeys, err := ownerACT.act.GetGrantees(context.Background(), addr) + + pubKeys, err := ownerACT.GetGrantees(actName) if err != nil { t.Fatal(err) } @@ -94,7 +93,7 @@ func TestACT(t *testing.T) { acc := accounts[0] fd := feed.New(acc.GetUserAccountInfo(), mockClient, -1, 0, logger) - ownerACT := NewACT(mockClient, fd, acc, tm, logger) + ownerACT := act.NewACT(mockClient, fd, acc, tm, logger) actName := acts[1] for i := 1; i < 2; i++ { acc := accounts[i] @@ -110,11 +109,11 @@ func TestACT(t *testing.T) { if err != nil { t.Fatal(err) } - addr, err := swarm.ParseHexAddress(a.GranteesRef) + _, err = swarm.ParseHexAddress(a.GranteesRef) if err != nil { t.Fatal(err) } - pubKeys, err := ownerACT.act.GetGrantees(context.Background(), addr) + pubKeys, err := ownerACT.GetGrantees(actName) if err != nil { t.Fatal(err) } @@ -134,11 +133,11 @@ func TestACT(t *testing.T) { if err != nil { t.Fatal(err) } - addr, err = swarm.ParseHexAddress(a.GranteesRef) + _, err = swarm.ParseHexAddress(a.GranteesRef) if err != nil { t.Fatal(err) } - pubKeys, err = ownerACT.act.GetGrantees(context.Background(), addr) + pubKeys, err = ownerACT.GetGrantees(actName) if err != nil { t.Fatal(err) } @@ -150,7 +149,7 @@ func TestACT(t *testing.T) { acc := accounts[0] fd := feed.New(acc.GetUserAccountInfo(), mockClient, -1, 0, logger) - ownerACT := NewACT(mockClient, fd, acc, tm, logger) + ownerACT := act.NewACT(mockClient, fd, acc, tm, logger) for _, actName := range acts { for i := 1; i < 10; i++ { acc := accounts[i] @@ -211,7 +210,7 @@ func TestACT(t *testing.T) { t.Fatal(err) } - ownerACT := NewACT(mockClient, fd, ownerAcc, tm, logger) + ownerACT := act.NewACT(mockClient, fd, ownerAcc, tm, logger) granteeAcc := accounts[1] _, err = ownerACT.CreateUpdateACT(acts[0], granteeAcc.GetUserAccountInfo().GetPublicKey(), nil) if err != nil { @@ -226,7 +225,7 @@ func TestACT(t *testing.T) { <-time.After(1 * time.Second) granteeFeed := feed.New(granteeAcc.GetUserAccountInfo(), mockClient, -1, 0, logger) - granteeACT := NewACT(mockClient, granteeFeed, granteeAcc, tm, logger) + granteeACT := act.NewACT(mockClient, granteeFeed, granteeAcc, tm, logger) err = granteeACT.SaveGrantedPod(acts[0], respOne) if err != nil { t.Fatal(err) @@ -252,7 +251,7 @@ func TestACT(t *testing.T) { if err != nil { t.Fatal(err) } - _, err = ownerACT.act.GetGrantees(context.Background(), addr) + _, err = ownerACT.GetGrantees(acts[0]) if err != nil { t.Fatal(err) } @@ -266,7 +265,7 @@ func TestACT(t *testing.T) { ownerAcc := accounts[0] fd := feed.New(ownerAcc.GetUserAccountInfo(), mockClient, -1, 0, logger) pod1 := pod.NewPod(mockClient, fd, ownerAcc, tm, sm, -1, 0, logger) - ownerACT := NewACT(mockClient, fd, ownerAcc, tm, logger) + ownerACT := act.NewACT(mockClient, fd, ownerAcc, tm, logger) granteeAcc := accounts[1] _, err := ownerACT.CreateUpdateACT(acts[1], granteeAcc.GetUserAccountInfo().GetPublicKey(), nil) if err != nil { diff --git a/pkg/act/new.go b/pkg/act/new.go index 3ce7ffa3..1980e333 100644 --- a/pkg/act/new.go +++ b/pkg/act/new.go @@ -6,8 +6,8 @@ import ( "fmt" "time" + swarm_act "github.com/asabya/swarm-act" "github.com/btcsuite/btcd/btcec/v2" - "github.com/ethersphere/bee/v2/pkg/api" "github.com/ethersphere/bee/v2/pkg/crypto" "github.com/ethersphere/bee/v2/pkg/swarm" "github.com/fairdatasociety/fairOS-dfs/pkg/utils" @@ -67,7 +67,7 @@ func (t *ACT) CreateUpdateACT(actName string, publicKeyGrant, publicKeyRevoke *e } var ( - resp = &api.GranteesPostResponse{} + resp = &swarm_act.GranteesPostResponse{} grantList []*ecdsa.PublicKey revokeList []*ecdsa.PublicKey owner = t.acc.GetUserAccountInfo().GetAddress() diff --git a/wasm/main.go b/wasm/main.go index 71809a39..05ba20d2 100644 --- a/wasm/main.go +++ b/wasm/main.go @@ -17,11 +17,9 @@ import ( "strings" "syscall/js" - "github.com/fairdatasociety/fairOS-dfs/pkg/act" - "github.com/btcsuite/btcd/btcec/v2" - "github.com/dustin/go-humanize" + "github.com/fairdatasociety/fairOS-dfs/pkg/act" "github.com/fairdatasociety/fairOS-dfs/pkg/collection" "github.com/fairdatasociety/fairOS-dfs/pkg/contracts" "github.com/fairdatasociety/fairOS-dfs/pkg/dfs"