Skip to content

Commit 77da154

Browse files
Merge pull request #1484 from 0chain/fix/unit-tests
Fix blobber unit tests
2 parents 3fc5621 + 5272be7 commit 77da154

File tree

8 files changed

+9
-9
lines changed

8 files changed

+9
-9
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func TestBlobberCore_CopyFile(t *testing.T) {
3838
ts := time.Now().Add(time.Hour)
3939
alloc := makeTestAllocation(common.Timestamp(ts.Unix()))
4040
alloc.OwnerPublicKey = sch.GetPublicKey()
41-
alloc.OwnerID = client.ClientID()
41+
alloc.OwnerID = client.Wallet().ClientID
4242

4343
testCases := []struct {
4444
name string

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func TestBlobberCore_DeleteFile(t *testing.T) {
3232
ts := time.Now().Add(time.Hour)
3333
alloc := makeTestAllocation(common.Timestamp(ts.Unix()))
3434
alloc.OwnerPublicKey = sch.GetPublicKey()
35-
alloc.OwnerID = client.ClientID()
35+
alloc.OwnerID = client.Wallet().ClientID
3636
testCases := []struct {
3737
name string
3838
context metadata.MD

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func TestBlobberCore_FileChangerUpload(t *testing.T) {
3939
ts := time.Now().Add(time.Hour)
4040
alloc := makeTestAllocation(common.Timestamp(ts.Unix()))
4141
alloc.OwnerPublicKey = sch.GetPublicKey()
42-
alloc.OwnerID = client.ClientID()
42+
alloc.OwnerID = client.Wallet().ClientID
4343

4444
testCases := []struct {
4545
name string

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func TestBlobberCore_MoveFile(t *testing.T) {
3737
ts := time.Now().Add(time.Hour)
3838
alloc := makeTestAllocation(common.Timestamp(ts.Unix()))
3939
alloc.OwnerPublicKey = sch.GetPublicKey()
40-
alloc.OwnerID = client.ClientID()
40+
alloc.OwnerID = client.Wallet().ClientID
4141

4242
testCases := []struct {
4343
name string

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func TestMultiOp(t *testing.T) {
3030
ts := time.Now().Add(time.Hour)
3131
alloc := makeTestAllocation(common.Timestamp(ts.Unix()))
3232
alloc.OwnerPublicKey = sch.GetPublicKey()
33-
alloc.OwnerID = client.ClientID()
33+
alloc.OwnerID = client.Wallet().ClientID
3434
datastore.MocketTheStore(t, true)
3535
ctx := datastore.GetStore().CreateTransaction(context.TODO())
3636
setupDbMock()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func TestBlobberCore_RenameFile(t *testing.T) {
152152
ts := time.Now().Add(time.Hour)
153153
alloc := makeTestAllocation(common.Timestamp(ts.Unix()))
154154
alloc.OwnerPublicKey = sch.GetPublicKey()
155-
alloc.OwnerID = client.ClientID()
155+
alloc.OwnerID = client.Wallet().ClientID
156156

157157
testCases := []struct {
158158
name string

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func TestBlobberCore_UpdateFile(t *testing.T) {
3636
ts := time.Now().Add(time.Hour)
3737
alloc := makeTestAllocation(common.Timestamp(ts.Unix()))
3838
alloc.OwnerPublicKey = sch.GetPublicKey()
39-
alloc.OwnerID = client.ClientID()
39+
alloc.OwnerID = client.Wallet().ClientID
4040

4141
testCases := []struct {
4242
name string

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func TestDownloadFile(t *testing.T) {
121121
if p.useAuthTicket {
122122
authTicket := &marker.AuthTicket{
123123
AllocationID: p.inData.allocationID,
124-
ClientID: client.ClientID(),
124+
ClientID: client.Wallet().ClientID,
125125
Expiration: int64(time.Duration(now) + 10000*time.Second),
126126
OwnerID: mockOwner.ClientID,
127127
Timestamp: int64(common.Now()),
@@ -292,7 +292,7 @@ func TestDownloadFile(t *testing.T) {
292292

293293
setupCtx := func(p parameters) context.Context {
294294
ctx := context.TODO()
295-
ctx = context.WithValue(ctx, constants.ContextKeyClient, client.ClientID())
295+
ctx = context.WithValue(ctx, constants.ContextKeyClient, client.Wallet().ClientID)
296296
ctx = context.WithValue(ctx, constants.ContextKeyAllocation, p.inData.allocationTx)
297297
ctx = context.WithValue(ctx, constants.ContextKeyClientKey, client.PublicKey())
298298

0 commit comments

Comments
 (0)