Skip to content

Commit 317e9f6

Browse files
authored
Merge pull request #1488 from 0chain/fix/delete-nodes
Fix delete nodes
2 parents de4f0f5 + 2a14a0a commit 317e9f6

File tree

10 files changed

+23
-25
lines changed

10 files changed

+23
-25
lines changed

code/go/0chain.net/blobbercore/allocation/copyfilechange_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
"github.com/0chain/blobber/code/go/0chain.net/core/common"
1717
"github.com/0chain/blobber/code/go/0chain.net/core/logging"
1818
"github.com/0chain/gosdk/constants"
19-
"github.com/0chain/gosdk/core/client"
2019
"github.com/0chain/gosdk/core/zcncrypto"
2120
mocket "github.com/selvatico/go-mocket"
2221
"go.uber.org/zap"
@@ -31,14 +30,14 @@ func TestBlobberCore_CopyFile(t *testing.T) {
3130
sch := zcncrypto.NewSignatureScheme("bls0chain")
3231
mnemonic := "expose culture dignity plastic digital couple promote best pool error" +
3332
" brush upgrade correct art become lobster nature moment obtain trial multiply arch miss toe"
34-
_, err := sch.RecoverKeys(mnemonic)
33+
w, err := sch.RecoverKeys(mnemonic)
3534
if err != nil {
3635
t.Fatal(err)
3736
}
3837
ts := time.Now().Add(time.Hour)
3938
alloc := makeTestAllocation(common.Timestamp(ts.Unix()))
4039
alloc.OwnerPublicKey = sch.GetPublicKey()
41-
alloc.OwnerID = client.Wallet().ClientID
40+
alloc.OwnerID = w.ClientID
4241

4342
testCases := []struct {
4443
name string

code/go/0chain.net/blobbercore/allocation/deletefilechange_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/filestore"
1414
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/reference"
1515
"github.com/0chain/blobber/code/go/0chain.net/core/common"
16-
"github.com/0chain/gosdk/core/client"
1716
"github.com/0chain/gosdk/core/zcncrypto"
1817
mocket "github.com/selvatico/go-mocket"
1918
"github.com/stretchr/testify/assert"
@@ -25,14 +24,14 @@ func TestBlobberCore_DeleteFile(t *testing.T) {
2524
sch := zcncrypto.NewSignatureScheme("bls0chain")
2625
mnemonic := "expose culture dignity plastic digital couple promote best pool error" +
2726
" brush upgrade correct art become lobster nature moment obtain trial multiply arch miss toe"
28-
_, err := sch.RecoverKeys(mnemonic)
27+
w, err := sch.RecoverKeys(mnemonic)
2928
if err != nil {
3029
t.Fatal(err)
3130
}
3231
ts := time.Now().Add(time.Hour)
3332
alloc := makeTestAllocation(common.Timestamp(ts.Unix()))
3433
alloc.OwnerPublicKey = sch.GetPublicKey()
35-
alloc.OwnerID = client.Wallet().ClientID
34+
alloc.OwnerID = w.ClientID
3635
testCases := []struct {
3736
name string
3837
context metadata.MD

code/go/0chain.net/blobbercore/allocation/file_changer_upload_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
"github.com/0chain/blobber/code/go/0chain.net/core/encryption"
1919
"github.com/0chain/blobber/code/go/0chain.net/core/logging"
2020
"github.com/0chain/gosdk/constants"
21-
"github.com/0chain/gosdk/core/client"
2221
"github.com/0chain/gosdk/core/zcncrypto"
2322
mocket "github.com/selvatico/go-mocket"
2423
"go.uber.org/zap"
@@ -32,14 +31,14 @@ func init() {
3231
func TestBlobberCore_FileChangerUpload(t *testing.T) {
3332
sch := zcncrypto.NewSignatureScheme("bls0chain")
3433
mnemonic := "expose culture dignity plastic digital couple promote best pool error brush upgrade correct art become lobster nature moment obtain trial multiply arch miss toe"
35-
_, err := sch.RecoverKeys(mnemonic)
34+
w, err := sch.RecoverKeys(mnemonic)
3635
if err != nil {
3736
t.Fatal(err)
3837
}
3938
ts := time.Now().Add(time.Hour)
4039
alloc := makeTestAllocation(common.Timestamp(ts.Unix()))
4140
alloc.OwnerPublicKey = sch.GetPublicKey()
42-
alloc.OwnerID = client.Wallet().ClientID
41+
alloc.OwnerID = w.ClientID
4342

4443
testCases := []struct {
4544
name string

code/go/0chain.net/blobbercore/allocation/movefilechange_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/filestore"
1717
"github.com/0chain/blobber/code/go/0chain.net/core/common"
1818
"github.com/0chain/blobber/code/go/0chain.net/core/logging"
19-
"github.com/0chain/gosdk/core/client"
2019
"github.com/0chain/gosdk/core/zcncrypto"
2120
"go.uber.org/zap"
2221
"google.golang.org/grpc/metadata"
@@ -30,14 +29,14 @@ func TestBlobberCore_MoveFile(t *testing.T) {
3029
sch := zcncrypto.NewSignatureScheme("bls0chain")
3130
mnemonic := "expose culture dignity plastic digital couple promote best pool error" +
3231
" brush upgrade correct art become lobster nature moment obtain trial multiply arch miss toe"
33-
_, err := sch.RecoverKeys(mnemonic)
32+
w, err := sch.RecoverKeys(mnemonic)
3433
if err != nil {
3534
t.Fatal(err)
3635
}
3736
ts := time.Now().Add(time.Hour)
3837
alloc := makeTestAllocation(common.Timestamp(ts.Unix()))
3938
alloc.OwnerPublicKey = sch.GetPublicKey()
40-
alloc.OwnerID = client.Wallet().ClientID
39+
alloc.OwnerID = w.ClientID
4140

4241
testCases := []struct {
4342
name string

code/go/0chain.net/blobbercore/allocation/multiop_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/datastore"
1414
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/reference"
1515
"github.com/0chain/blobber/code/go/0chain.net/core/common"
16-
"github.com/0chain/gosdk/core/client"
1716
"github.com/0chain/gosdk/core/zcncrypto"
1817
mocket "github.com/selvatico/go-mocket"
1918
"github.com/stretchr/testify/require"
@@ -23,14 +22,14 @@ func TestMultiOp(t *testing.T) {
2322
sch := zcncrypto.NewSignatureScheme("bls0chain")
2423
mnemonic := "expose culture dignity plastic digital couple promote best pool error" +
2524
" brush upgrade correct art become lobster nature moment obtain trial multiply arch miss toe"
26-
_, err := sch.RecoverKeys(mnemonic)
25+
w, err := sch.RecoverKeys(mnemonic)
2726
if err != nil {
2827
t.Fatal(err)
2928
}
3029
ts := time.Now().Add(time.Hour)
3130
alloc := makeTestAllocation(common.Timestamp(ts.Unix()))
3231
alloc.OwnerPublicKey = sch.GetPublicKey()
33-
alloc.OwnerID = client.Wallet().ClientID
32+
alloc.OwnerID = w.ClientID
3433
datastore.MocketTheStore(t, true)
3534
ctx := datastore.GetStore().CreateTransaction(context.TODO())
3635
setupDbMock()

code/go/0chain.net/blobbercore/allocation/renamefilechange_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,14 @@ func TestBlobberCore_RenameFile(t *testing.T) {
145145

146146
sch := zcncrypto.NewSignatureScheme("bls0chain")
147147
mnemonic := "expose culture dignity plastic digital couple promote best pool error brush upgrade correct art become lobster nature moment obtain trial multiply arch miss toe"
148-
_, err := sch.RecoverKeys(mnemonic)
148+
w, err := sch.RecoverKeys(mnemonic)
149149
if err != nil {
150150
t.Fatal(err)
151151
}
152152
ts := time.Now().Add(time.Hour)
153153
alloc := makeTestAllocation(common.Timestamp(ts.Unix()))
154154
alloc.OwnerPublicKey = sch.GetPublicKey()
155-
alloc.OwnerID = client.Wallet().ClientID
155+
alloc.OwnerID = w.ClientID
156156

157157
testCases := []struct {
158158
name string

code/go/0chain.net/blobbercore/allocation/updatefilechange_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"github.com/0chain/blobber/code/go/0chain.net/core/common"
1313
"github.com/0chain/blobber/code/go/0chain.net/core/encryption"
1414
"github.com/0chain/blobber/code/go/0chain.net/core/logging"
15-
"github.com/0chain/gosdk/core/client"
1615
"github.com/0chain/gosdk/core/zcncrypto"
1716
mocket "github.com/selvatico/go-mocket"
1817
"github.com/stretchr/testify/assert"
@@ -29,14 +28,14 @@ func TestBlobberCore_UpdateFile(t *testing.T) {
2928

3029
sch := zcncrypto.NewSignatureScheme("bls0chain")
3130
mnemonic := "expose culture dignity plastic digital couple promote best pool error brush upgrade correct art become lobster nature moment obtain trial multiply arch miss toe"
32-
_, err := sch.RecoverKeys(mnemonic)
31+
w, err := sch.RecoverKeys(mnemonic)
3332
if err != nil {
3433
t.Fatal(err)
3534
}
3635
ts := time.Now().Add(time.Hour)
3736
alloc := makeTestAllocation(common.Timestamp(ts.Unix()))
3837
alloc.OwnerPublicKey = sch.GetPublicKey()
39-
alloc.OwnerID = client.Wallet().ClientID
38+
alloc.OwnerID = w.ClientID
4039

4140
testCases := []struct {
4241
name string

code/go/0chain.net/blobbercore/handler/object_operation_handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ func (fsh *StorageHandler) CommitWriteV2(ctx context.Context, r *http.Request) (
11661166
elapsedSaveAllocation := time.Since(startTime) - elapsedAllocation - elapsedGetLock -
11671167
elapsedGetConnObj - elapsedVerifyWM - elapsedWritePreRedeem - elapsedMoveToFilestore - elapsedApplyChanges - elapsedTrieCommit
11681168

1169-
err = batcher.Commit(false)
1169+
err = batcher.Commit(true)
11701170
if err != nil {
11711171
return nil, common.NewError("trie_commit_error", "Error committing the trie")
11721172
}

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ toolchain go1.22.5
66

77
require (
88
github.com/0chain/errors v1.0.3
9-
github.com/0chain/gosdk v1.18.0-RC6.0.20241023193003-8d5ec2f50067
9+
github.com/0chain/gosdk v1.18.0-RC7.0.20241024081749-a7097fdb6f7c
1010
github.com/DATA-DOG/go-sqlmock v1.5.0
1111
github.com/didip/tollbooth/v6 v6.1.2
1212
github.com/go-openapi/runtime v0.26.0
@@ -101,7 +101,7 @@ require (
101101
)
102102

103103
require (
104-
github.com/0chain/common v1.18.0
104+
github.com/0chain/common v1.13.1-0.20241024063045-ca6853425ce5
105105
github.com/Luzifer/go-openssl/v3 v3.1.0 // indirect
106106
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
107107
github.com/btcsuite/btcd v0.23.4 // indirect

go.sum

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,16 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX
3636
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
3737
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
3838
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
39+
github.com/0chain/common v1.13.1-0.20241024063045-ca6853425ce5 h1:GyMZ3jdQnbFtPqrmO/XMy+yI1gd0qTYvPbZikcc2Jg4=
40+
github.com/0chain/common v1.13.1-0.20241024063045-ca6853425ce5/go.mod h1:Lapu2Tj7z5Sm4r+X141e7vsz4NDODTEypeElYAP3iSw=
3941
github.com/0chain/common v1.18.0 h1:vCkD869DR0zTZS4CDl5MMN3qixxyfTNxDDcHp7cTRrc=
4042
github.com/0chain/common v1.18.0/go.mod h1:vHK9Q0/nz28PxmKsLSMLzEs5iK6QVgl1LxdDQdR7y6s=
4143
github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM=
4244
github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc=
43-
github.com/0chain/gosdk v1.18.0-RC6.0.20241023193003-8d5ec2f50067 h1:4+Z1tC4/1vXABA2OS28qVNo3lu5knw6/uMHzhYOOKbA=
44-
github.com/0chain/gosdk v1.18.0-RC6.0.20241023193003-8d5ec2f50067/go.mod h1:BJQPX/J6ShHV5ViGjh5aCooQD/aOhvBfnfkBOuSIFfQ=
45+
github.com/0chain/gosdk v1.18.0-RC7 h1:cMqxvqPXThggZ7l1cSWvwknPs0dvYC5TFzfWscTVkI4=
46+
github.com/0chain/gosdk v1.18.0-RC7/go.mod h1:BJQPX/J6ShHV5ViGjh5aCooQD/aOhvBfnfkBOuSIFfQ=
47+
github.com/0chain/gosdk v1.18.0-RC7.0.20241024081749-a7097fdb6f7c h1:oHMzBnC7Fh9O63FlavM5o6Wqvw/grl2nHbHTXD6jnKk=
48+
github.com/0chain/gosdk v1.18.0-RC7.0.20241024081749-a7097fdb6f7c/go.mod h1:0RNseQGWc3XmhjfPhQwmMm9yK6VulnU3hMiIwlhgGh4=
4549
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
4650
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
4751
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=

0 commit comments

Comments
 (0)