Skip to content

Commit 2a14a0a

Browse files
author
Jayash Satolia
committed
Fix unit tests
1 parent 8fca480 commit 2a14a0a

File tree

6 files changed

+12
-17
lines changed

6 files changed

+12
-17
lines changed

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

0 commit comments

Comments
 (0)