Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
asabya committed Nov 6, 2024
1 parent badfdb6 commit 7d60699
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
35 changes: 17 additions & 18 deletions pkg/act/act_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package act
package act_test

import (
"context"
Expand All @@ -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"
Expand Down Expand Up @@ -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]
Expand All @@ -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)
}
Expand All @@ -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]
Expand All @@ -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)
}
Expand All @@ -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)
}
Expand All @@ -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]
Expand Down Expand Up @@ -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 {
Expand All @@ -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)
Expand All @@ -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)
}
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions pkg/act/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 1 addition & 3 deletions wasm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 7d60699

Please sign in to comment.