Skip to content

Commit 0c682e3

Browse files
committed
tests: fix
1 parent b778d8e commit 0c682e3

6 files changed

Lines changed: 15 additions & 9 deletions

connect/connect_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,7 @@ func testConnect(
776776
balanceCodeA, err := model.CreateBalanceCode(
777777
ctx,
778778
initialTransferBalance,
779+
24*time.Hour,
779780
0,
780781
"test-1",
781782
"",
@@ -795,6 +796,7 @@ func testConnect(
795796
balanceCodeB, err := model.CreateBalanceCode(
796797
ctx,
797798
initialTransferBalance,
799+
24*time.Hour,
798800
0,
799801
"test-2",
800802
"",

controller/account_payment_controller_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"testing"
7+
"time"
78

89
"golang.org/x/exp/maps"
910

@@ -58,7 +59,7 @@ func TestSubscriptionSendPayment(t *testing.T) {
5859
// we don't want to send out messages in our tests
5960
SetMessageSender(mockAWSMessageSender)
6061

61-
balanceCode, err := model.CreateBalanceCode(ctx, netTransferByteCount, netRevenue, "", "", "")
62+
balanceCode, err := model.CreateBalanceCode(ctx, netTransferByteCount, 24*time.Hour, netRevenue, "", "", "")
6263
assert.Equal(t, err, nil)
6364
model.RedeemBalanceCode(&model.RedeemBalanceCodeArgs{
6465
Secret: balanceCode.Secret,

model/account_payment_model_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func TestCancelAccountPayment(t *testing.T) {
3636
ClientId: &destinationId,
3737
})
3838

39-
balanceCode, err := CreateBalanceCode(ctx, netTransferByteCount, netRevenue, "", "", "")
39+
balanceCode, err := CreateBalanceCode(ctx, netTransferByteCount, 24*time.Hour, netRevenue, "", "", "")
4040
assert.Equal(t, err, nil)
4141
RedeemBalanceCode(&RedeemBalanceCodeArgs{
4242
Secret: balanceCode.Secret,
@@ -139,7 +139,7 @@ func TestGetNetworkProvideStats(t *testing.T) {
139139
// fund the source network
140140
netTransferByteCount := ByteCount(1024 * 1024)
141141
netRevenue := UsdToNanoCents(10.00)
142-
balanceCode, err := CreateBalanceCode(ctx, netTransferByteCount, netRevenue, "", "", "")
142+
balanceCode, err := CreateBalanceCode(ctx, netTransferByteCount, 24*time.Hour, netRevenue, "", "", "")
143143
assert.Equal(t, err, nil)
144144
RedeemBalanceCode(&RedeemBalanceCodeArgs{
145145
Secret: balanceCode.Secret,
@@ -264,7 +264,7 @@ func TestPaymentPlanSubsidy(t *testing.T) {
264264
assert.Equal(t, getAccountBalanceResult.Balance.PaidByteCount, ByteCount(0))
265265
assert.Equal(t, getAccountBalanceResult.Balance.PaidNetRevenue, NanoCents(0))
266266

267-
balanceCode, err := CreateBalanceCode(ctx, netTransferByteCount, netRevenue, "", "", "")
267+
balanceCode, err := CreateBalanceCode(ctx, netTransferByteCount, 24*time.Hour, netRevenue, "", "", "")
268268
assert.Equal(t, err, nil)
269269
RedeemBalanceCode(&RedeemBalanceCodeArgs{
270270
Secret: balanceCode.Secret,

model/account_point_model_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
mathrand "math/rand"
77
"net/netip"
88
"testing"
9+
"time"
910

1011
"github.com/go-playground/assert/v2"
1112
"github.com/urnetwork/glog"
@@ -191,7 +192,7 @@ func TestAccountPointsPerPayout(t *testing.T) {
191192
/**
192193
* Create balance for network C
193194
*/
194-
balanceCode, err := CreateBalanceCode(ctx, 2*netTransferByteCount, 2*netRevenue, "", "", "")
195+
balanceCode, err := CreateBalanceCode(ctx, 2*netTransferByteCount, 24*time.Hour, 2*netRevenue, "", "", "")
195196
assert.Equal(t, err, nil)
196197
RedeemBalanceCode(&RedeemBalanceCodeArgs{
197198
Secret: balanceCode.Secret,

model/leaderboard_model_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package model
33
import (
44
"context"
55
"testing"
6+
"time"
67

78
"github.com/go-playground/assert/v2"
89
"github.com/urnetwork/server"
@@ -61,7 +62,7 @@ func TestLeaderboard(t *testing.T) {
6162
/**
6263
* Create balance for network C
6364
*/
64-
balanceCode, err := CreateBalanceCode(ctx, 2*netTransferByteCount, 2*netRevenue, "", "", "")
65+
balanceCode, err := CreateBalanceCode(ctx, 2*netTransferByteCount, 24*time.Hour, 2*netRevenue, "", "", "")
6566
assert.Equal(t, err, nil)
6667
RedeemBalanceCode(&RedeemBalanceCodeArgs{
6768
Secret: balanceCode.Secret,

model/subscription_model_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func TestEscrow(t *testing.T) {
103103
assert.Equal(t, getAccountBalanceResult.Balance.PaidByteCount, ByteCount(0))
104104
assert.Equal(t, getAccountBalanceResult.Balance.PaidNetRevenue, NanoCents(0))
105105

106-
balanceCode, err := CreateBalanceCode(ctx, netTransferByteCount, netRevenue, "", "", "")
106+
balanceCode, err := CreateBalanceCode(ctx, netTransferByteCount, 24*time.Hour, netRevenue, "", "", "")
107107
assert.Equal(t, err, nil)
108108
RedeemBalanceCode(&RedeemBalanceCodeArgs{
109109
Secret: balanceCode.Secret,
@@ -340,7 +340,7 @@ func TestCompanionEscrowAndCheckpoint(t *testing.T) {
340340
assert.Equal(t, getAccountBalanceResult.Balance.PaidByteCount, ByteCount(0))
341341
assert.Equal(t, getAccountBalanceResult.Balance.PaidNetRevenue, NanoCents(0))
342342

343-
balanceCode, err := CreateBalanceCode(ctx, 2*netTransferByteCount, 2*netRevenue, "", "", "")
343+
balanceCode, err := CreateBalanceCode(ctx, 2*netTransferByteCount, 24*time.Hour, 2*netRevenue, "", "", "")
344344
assert.Equal(t, err, nil)
345345
RedeemBalanceCode(&RedeemBalanceCodeArgs{
346346
Secret: balanceCode.Secret,
@@ -603,6 +603,7 @@ func TestBalanceCode(t *testing.T) {
603603
balanceCode, err := CreateBalanceCode(
604604
ctx,
605605
1024,
606+
24*time.Hour,
606607
100,
607608
"test-purchase-1",
608609
"rest-purchase-1-receipt",
@@ -1275,7 +1276,7 @@ func TestGetOpenTransferByteCount(t *testing.T) {
12751276
ClientId: &sourceId,
12761277
})
12771278

1278-
balanceCode, err := CreateBalanceCode(ctx, 2*netTransferByteCount, 2*netRevenue, "", "", "")
1279+
balanceCode, err := CreateBalanceCode(ctx, 2*netTransferByteCount, 24*time.Hour, 2*netRevenue, "", "", "")
12791280
assert.Equal(t, err, nil)
12801281
RedeemBalanceCode(&RedeemBalanceCodeArgs{
12811282
Secret: balanceCode.Secret,

0 commit comments

Comments
 (0)