From 6dea99d3b2e0af462f2d0ba5928e06e876783a13 Mon Sep 17 00:00:00 2001 From: hitenjain14 Date: Thu, 24 Oct 2024 12:03:17 +0530 Subject: [PATCH 1/5] fix delete nodes --- .../blobbercore/handler/object_operation_handler.go | 2 +- go.mod | 4 ++-- go.sum | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/code/go/0chain.net/blobbercore/handler/object_operation_handler.go b/code/go/0chain.net/blobbercore/handler/object_operation_handler.go index 43ffc4146..b23a97eb9 100644 --- a/code/go/0chain.net/blobbercore/handler/object_operation_handler.go +++ b/code/go/0chain.net/blobbercore/handler/object_operation_handler.go @@ -1166,7 +1166,7 @@ func (fsh *StorageHandler) CommitWriteV2(ctx context.Context, r *http.Request) ( elapsedSaveAllocation := time.Since(startTime) - elapsedAllocation - elapsedGetLock - elapsedGetConnObj - elapsedVerifyWM - elapsedWritePreRedeem - elapsedMoveToFilestore - elapsedApplyChanges - elapsedTrieCommit - err = batcher.Commit(false) + err = batcher.Commit(true) if err != nil { return nil, common.NewError("trie_commit_error", "Error committing the trie") } diff --git a/go.mod b/go.mod index 6c977d5c6..90c26e54d 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ toolchain go1.22.5 require ( github.com/0chain/errors v1.0.3 - github.com/0chain/gosdk v1.18.0-RC6.0.20241023193003-8d5ec2f50067 + github.com/0chain/gosdk v1.18.0-RC3 github.com/DATA-DOG/go-sqlmock v1.5.0 github.com/didip/tollbooth/v6 v6.1.2 github.com/go-openapi/runtime v0.26.0 @@ -101,7 +101,7 @@ require ( ) require ( - github.com/0chain/common v1.18.0 + github.com/0chain/common v1.13.1-0.20241024063045-ca6853425ce5 github.com/Luzifer/go-openssl/v3 v3.1.0 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/btcsuite/btcd v0.23.4 // indirect diff --git a/go.sum b/go.sum index 1834cf7ec..94e14b0b4 100644 --- a/go.sum +++ b/go.sum @@ -36,12 +36,12 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/0chain/common v1.18.0 h1:vCkD869DR0zTZS4CDl5MMN3qixxyfTNxDDcHp7cTRrc= -github.com/0chain/common v1.18.0/go.mod h1:vHK9Q0/nz28PxmKsLSMLzEs5iK6QVgl1LxdDQdR7y6s= +github.com/0chain/common v1.13.1-0.20241024063045-ca6853425ce5 h1:GyMZ3jdQnbFtPqrmO/XMy+yI1gd0qTYvPbZikcc2Jg4= +github.com/0chain/common v1.13.1-0.20241024063045-ca6853425ce5/go.mod h1:Lapu2Tj7z5Sm4r+X141e7vsz4NDODTEypeElYAP3iSw= github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM= github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc= -github.com/0chain/gosdk v1.18.0-RC6.0.20241023193003-8d5ec2f50067 h1:4+Z1tC4/1vXABA2OS28qVNo3lu5knw6/uMHzhYOOKbA= -github.com/0chain/gosdk v1.18.0-RC6.0.20241023193003-8d5ec2f50067/go.mod h1:BJQPX/J6ShHV5ViGjh5aCooQD/aOhvBfnfkBOuSIFfQ= +github.com/0chain/gosdk v1.18.0-RC3 h1:62E+HIprNStAZA/BJw6rGI8pQa7iY0PyeKux9ot0duU= +github.com/0chain/gosdk v1.18.0-RC3/go.mod h1:OxXnxfqGJ9OIwX7WITV/A9ZctYorVMbaHuqkhERAImU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= From dec0efebb4e14652e40061ddfc74bc2a7ef106d4 Mon Sep 17 00:00:00 2001 From: hitenjain14 Date: Thu, 24 Oct 2024 12:07:28 +0530 Subject: [PATCH 2/5] update gosdk --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 90c26e54d..5ce568a6c 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ toolchain go1.22.5 require ( github.com/0chain/errors v1.0.3 - github.com/0chain/gosdk v1.18.0-RC3 + github.com/0chain/gosdk v1.18.0-RC7 github.com/DATA-DOG/go-sqlmock v1.5.0 github.com/didip/tollbooth/v6 v6.1.2 github.com/go-openapi/runtime v0.26.0 @@ -101,7 +101,7 @@ require ( ) require ( - github.com/0chain/common v1.13.1-0.20241024063045-ca6853425ce5 + github.com/0chain/common v1.18.0 github.com/Luzifer/go-openssl/v3 v3.1.0 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/btcsuite/btcd v0.23.4 // indirect diff --git a/go.sum b/go.sum index 94e14b0b4..abf6fe798 100644 --- a/go.sum +++ b/go.sum @@ -36,12 +36,12 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/0chain/common v1.13.1-0.20241024063045-ca6853425ce5 h1:GyMZ3jdQnbFtPqrmO/XMy+yI1gd0qTYvPbZikcc2Jg4= -github.com/0chain/common v1.13.1-0.20241024063045-ca6853425ce5/go.mod h1:Lapu2Tj7z5Sm4r+X141e7vsz4NDODTEypeElYAP3iSw= +github.com/0chain/common v1.18.0 h1:vCkD869DR0zTZS4CDl5MMN3qixxyfTNxDDcHp7cTRrc= +github.com/0chain/common v1.18.0/go.mod h1:vHK9Q0/nz28PxmKsLSMLzEs5iK6QVgl1LxdDQdR7y6s= github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM= github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc= -github.com/0chain/gosdk v1.18.0-RC3 h1:62E+HIprNStAZA/BJw6rGI8pQa7iY0PyeKux9ot0duU= -github.com/0chain/gosdk v1.18.0-RC3/go.mod h1:OxXnxfqGJ9OIwX7WITV/A9ZctYorVMbaHuqkhERAImU= +github.com/0chain/gosdk v1.18.0-RC7 h1:cMqxvqPXThggZ7l1cSWvwknPs0dvYC5TFzfWscTVkI4= +github.com/0chain/gosdk v1.18.0-RC7/go.mod h1:BJQPX/J6ShHV5ViGjh5aCooQD/aOhvBfnfkBOuSIFfQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= From 419465717c456cabb73b50ac8112a3d2a390f4e7 Mon Sep 17 00:00:00 2001 From: hitenjain14 Date: Thu, 24 Oct 2024 12:34:05 +0530 Subject: [PATCH 3/5] fix ut --- .../0chain.net/blobbercore/allocation/copyfilechange_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/go/0chain.net/blobbercore/allocation/copyfilechange_test.go b/code/go/0chain.net/blobbercore/allocation/copyfilechange_test.go index 5bba58ed8..988e132c2 100644 --- a/code/go/0chain.net/blobbercore/allocation/copyfilechange_test.go +++ b/code/go/0chain.net/blobbercore/allocation/copyfilechange_test.go @@ -16,7 +16,6 @@ import ( "github.com/0chain/blobber/code/go/0chain.net/core/common" "github.com/0chain/blobber/code/go/0chain.net/core/logging" "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/core/client" "github.com/0chain/gosdk/core/zcncrypto" mocket "github.com/selvatico/go-mocket" "go.uber.org/zap" @@ -31,14 +30,14 @@ func TestBlobberCore_CopyFile(t *testing.T) { sch := zcncrypto.NewSignatureScheme("bls0chain") 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" - _, err := sch.RecoverKeys(mnemonic) + w, err := sch.RecoverKeys(mnemonic) if err != nil { t.Fatal(err) } ts := time.Now().Add(time.Hour) alloc := makeTestAllocation(common.Timestamp(ts.Unix())) alloc.OwnerPublicKey = sch.GetPublicKey() - alloc.OwnerID = client.Wallet().ClientID + alloc.OwnerID = w.ClientID testCases := []struct { name string From 8fca48088e371a71da1689cbdc6965c97f0c547b Mon Sep 17 00:00:00 2001 From: hitenjain14 Date: Thu, 24 Oct 2024 14:00:54 +0530 Subject: [PATCH 4/5] update common --- go.mod | 4 ++-- go.sum | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 5ce568a6c..72cd9e7df 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ toolchain go1.22.5 require ( github.com/0chain/errors v1.0.3 - github.com/0chain/gosdk v1.18.0-RC7 + github.com/0chain/gosdk v1.18.0-RC7.0.20241024081749-a7097fdb6f7c github.com/DATA-DOG/go-sqlmock v1.5.0 github.com/didip/tollbooth/v6 v6.1.2 github.com/go-openapi/runtime v0.26.0 @@ -101,7 +101,7 @@ require ( ) require ( - github.com/0chain/common v1.18.0 + github.com/0chain/common v1.13.1-0.20241024063045-ca6853425ce5 github.com/Luzifer/go-openssl/v3 v3.1.0 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/btcsuite/btcd v0.23.4 // indirect diff --git a/go.sum b/go.sum index abf6fe798..98710fef1 100644 --- a/go.sum +++ b/go.sum @@ -36,12 +36,16 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/0chain/common v1.13.1-0.20241024063045-ca6853425ce5 h1:GyMZ3jdQnbFtPqrmO/XMy+yI1gd0qTYvPbZikcc2Jg4= +github.com/0chain/common v1.13.1-0.20241024063045-ca6853425ce5/go.mod h1:Lapu2Tj7z5Sm4r+X141e7vsz4NDODTEypeElYAP3iSw= github.com/0chain/common v1.18.0 h1:vCkD869DR0zTZS4CDl5MMN3qixxyfTNxDDcHp7cTRrc= github.com/0chain/common v1.18.0/go.mod h1:vHK9Q0/nz28PxmKsLSMLzEs5iK6QVgl1LxdDQdR7y6s= github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM= github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc= github.com/0chain/gosdk v1.18.0-RC7 h1:cMqxvqPXThggZ7l1cSWvwknPs0dvYC5TFzfWscTVkI4= github.com/0chain/gosdk v1.18.0-RC7/go.mod h1:BJQPX/J6ShHV5ViGjh5aCooQD/aOhvBfnfkBOuSIFfQ= +github.com/0chain/gosdk v1.18.0-RC7.0.20241024081749-a7097fdb6f7c h1:oHMzBnC7Fh9O63FlavM5o6Wqvw/grl2nHbHTXD6jnKk= +github.com/0chain/gosdk v1.18.0-RC7.0.20241024081749-a7097fdb6f7c/go.mod h1:0RNseQGWc3XmhjfPhQwmMm9yK6VulnU3hMiIwlhgGh4= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= From 2a14a0a793e23c585c5a189d75ba6b26ac1d7cb4 Mon Sep 17 00:00:00 2001 From: Jayash Satolia Date: Thu, 24 Oct 2024 14:16:23 +0530 Subject: [PATCH 5/5] Fix unit tests --- .../blobbercore/allocation/deletefilechange_test.go | 5 ++--- .../blobbercore/allocation/file_changer_upload_test.go | 5 ++--- .../0chain.net/blobbercore/allocation/movefilechange_test.go | 5 ++--- code/go/0chain.net/blobbercore/allocation/multiop_test.go | 5 ++--- .../blobbercore/allocation/renamefilechange_test.go | 4 ++-- .../blobbercore/allocation/updatefilechange_test.go | 5 ++--- 6 files changed, 12 insertions(+), 17 deletions(-) diff --git a/code/go/0chain.net/blobbercore/allocation/deletefilechange_test.go b/code/go/0chain.net/blobbercore/allocation/deletefilechange_test.go index 1b5c0aaba..1654372b9 100644 --- a/code/go/0chain.net/blobbercore/allocation/deletefilechange_test.go +++ b/code/go/0chain.net/blobbercore/allocation/deletefilechange_test.go @@ -13,7 +13,6 @@ import ( "github.com/0chain/blobber/code/go/0chain.net/blobbercore/filestore" "github.com/0chain/blobber/code/go/0chain.net/blobbercore/reference" "github.com/0chain/blobber/code/go/0chain.net/core/common" - "github.com/0chain/gosdk/core/client" "github.com/0chain/gosdk/core/zcncrypto" mocket "github.com/selvatico/go-mocket" "github.com/stretchr/testify/assert" @@ -25,14 +24,14 @@ func TestBlobberCore_DeleteFile(t *testing.T) { sch := zcncrypto.NewSignatureScheme("bls0chain") 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" - _, err := sch.RecoverKeys(mnemonic) + w, err := sch.RecoverKeys(mnemonic) if err != nil { t.Fatal(err) } ts := time.Now().Add(time.Hour) alloc := makeTestAllocation(common.Timestamp(ts.Unix())) alloc.OwnerPublicKey = sch.GetPublicKey() - alloc.OwnerID = client.Wallet().ClientID + alloc.OwnerID = w.ClientID testCases := []struct { name string context metadata.MD diff --git a/code/go/0chain.net/blobbercore/allocation/file_changer_upload_test.go b/code/go/0chain.net/blobbercore/allocation/file_changer_upload_test.go index ba8c17a79..68656f805 100644 --- a/code/go/0chain.net/blobbercore/allocation/file_changer_upload_test.go +++ b/code/go/0chain.net/blobbercore/allocation/file_changer_upload_test.go @@ -18,7 +18,6 @@ import ( "github.com/0chain/blobber/code/go/0chain.net/core/encryption" "github.com/0chain/blobber/code/go/0chain.net/core/logging" "github.com/0chain/gosdk/constants" - "github.com/0chain/gosdk/core/client" "github.com/0chain/gosdk/core/zcncrypto" mocket "github.com/selvatico/go-mocket" "go.uber.org/zap" @@ -32,14 +31,14 @@ func init() { func TestBlobberCore_FileChangerUpload(t *testing.T) { sch := zcncrypto.NewSignatureScheme("bls0chain") 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" - _, err := sch.RecoverKeys(mnemonic) + w, err := sch.RecoverKeys(mnemonic) if err != nil { t.Fatal(err) } ts := time.Now().Add(time.Hour) alloc := makeTestAllocation(common.Timestamp(ts.Unix())) alloc.OwnerPublicKey = sch.GetPublicKey() - alloc.OwnerID = client.Wallet().ClientID + alloc.OwnerID = w.ClientID testCases := []struct { name string diff --git a/code/go/0chain.net/blobbercore/allocation/movefilechange_test.go b/code/go/0chain.net/blobbercore/allocation/movefilechange_test.go index 832d1e2a7..c87304854 100644 --- a/code/go/0chain.net/blobbercore/allocation/movefilechange_test.go +++ b/code/go/0chain.net/blobbercore/allocation/movefilechange_test.go @@ -16,7 +16,6 @@ import ( "github.com/0chain/blobber/code/go/0chain.net/blobbercore/filestore" "github.com/0chain/blobber/code/go/0chain.net/core/common" "github.com/0chain/blobber/code/go/0chain.net/core/logging" - "github.com/0chain/gosdk/core/client" "github.com/0chain/gosdk/core/zcncrypto" "go.uber.org/zap" "google.golang.org/grpc/metadata" @@ -30,14 +29,14 @@ func TestBlobberCore_MoveFile(t *testing.T) { sch := zcncrypto.NewSignatureScheme("bls0chain") 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" - _, err := sch.RecoverKeys(mnemonic) + w, err := sch.RecoverKeys(mnemonic) if err != nil { t.Fatal(err) } ts := time.Now().Add(time.Hour) alloc := makeTestAllocation(common.Timestamp(ts.Unix())) alloc.OwnerPublicKey = sch.GetPublicKey() - alloc.OwnerID = client.Wallet().ClientID + alloc.OwnerID = w.ClientID testCases := []struct { name string diff --git a/code/go/0chain.net/blobbercore/allocation/multiop_test.go b/code/go/0chain.net/blobbercore/allocation/multiop_test.go index ec03ca67c..80d00a3c6 100644 --- a/code/go/0chain.net/blobbercore/allocation/multiop_test.go +++ b/code/go/0chain.net/blobbercore/allocation/multiop_test.go @@ -13,7 +13,6 @@ import ( "github.com/0chain/blobber/code/go/0chain.net/blobbercore/datastore" "github.com/0chain/blobber/code/go/0chain.net/blobbercore/reference" "github.com/0chain/blobber/code/go/0chain.net/core/common" - "github.com/0chain/gosdk/core/client" "github.com/0chain/gosdk/core/zcncrypto" mocket "github.com/selvatico/go-mocket" "github.com/stretchr/testify/require" @@ -23,14 +22,14 @@ func TestMultiOp(t *testing.T) { sch := zcncrypto.NewSignatureScheme("bls0chain") 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" - _, err := sch.RecoverKeys(mnemonic) + w, err := sch.RecoverKeys(mnemonic) if err != nil { t.Fatal(err) } ts := time.Now().Add(time.Hour) alloc := makeTestAllocation(common.Timestamp(ts.Unix())) alloc.OwnerPublicKey = sch.GetPublicKey() - alloc.OwnerID = client.Wallet().ClientID + alloc.OwnerID = w.ClientID datastore.MocketTheStore(t, true) ctx := datastore.GetStore().CreateTransaction(context.TODO()) setupDbMock() diff --git a/code/go/0chain.net/blobbercore/allocation/renamefilechange_test.go b/code/go/0chain.net/blobbercore/allocation/renamefilechange_test.go index d4b5eff77..de2de2140 100644 --- a/code/go/0chain.net/blobbercore/allocation/renamefilechange_test.go +++ b/code/go/0chain.net/blobbercore/allocation/renamefilechange_test.go @@ -145,14 +145,14 @@ func TestBlobberCore_RenameFile(t *testing.T) { sch := zcncrypto.NewSignatureScheme("bls0chain") 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" - _, err := sch.RecoverKeys(mnemonic) + w, err := sch.RecoverKeys(mnemonic) if err != nil { t.Fatal(err) } ts := time.Now().Add(time.Hour) alloc := makeTestAllocation(common.Timestamp(ts.Unix())) alloc.OwnerPublicKey = sch.GetPublicKey() - alloc.OwnerID = client.Wallet().ClientID + alloc.OwnerID = w.ClientID testCases := []struct { name string diff --git a/code/go/0chain.net/blobbercore/allocation/updatefilechange_test.go b/code/go/0chain.net/blobbercore/allocation/updatefilechange_test.go index ff82525ee..99007dd0c 100644 --- a/code/go/0chain.net/blobbercore/allocation/updatefilechange_test.go +++ b/code/go/0chain.net/blobbercore/allocation/updatefilechange_test.go @@ -12,7 +12,6 @@ import ( "github.com/0chain/blobber/code/go/0chain.net/core/common" "github.com/0chain/blobber/code/go/0chain.net/core/encryption" "github.com/0chain/blobber/code/go/0chain.net/core/logging" - "github.com/0chain/gosdk/core/client" "github.com/0chain/gosdk/core/zcncrypto" mocket "github.com/selvatico/go-mocket" "github.com/stretchr/testify/assert" @@ -29,14 +28,14 @@ func TestBlobberCore_UpdateFile(t *testing.T) { sch := zcncrypto.NewSignatureScheme("bls0chain") 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" - _, err := sch.RecoverKeys(mnemonic) + w, err := sch.RecoverKeys(mnemonic) if err != nil { t.Fatal(err) } ts := time.Now().Add(time.Hour) alloc := makeTestAllocation(common.Timestamp(ts.Unix())) alloc.OwnerPublicKey = sch.GetPublicKey() - alloc.OwnerID = client.Wallet().ClientID + alloc.OwnerID = w.ClientID testCases := []struct { name string