@@ -177,10 +177,10 @@ func teardown() {
177
177
178
178
func TestMetererReservations (t * testing.T ) {
179
179
ctx := context .Background ()
180
- paymentChainState .On ("GetReservationWindow" , testifymock .Anything ).Return (uint32 (5 ), nil )
180
+ paymentChainState .On ("GetReservationWindow" , testifymock .Anything ).Return (uint64 (5 ), nil )
181
181
paymentChainState .On ("GetGlobalSymbolsPerSecond" , testifymock .Anything ).Return (uint64 (1009 ), nil )
182
- paymentChainState .On ("GetGlobalRatePeriodInterval" , testifymock .Anything ).Return (uint32 (1 ), nil )
183
- paymentChainState .On ("GetMinNumSymbols" , testifymock .Anything ).Return (uint32 (3 ), nil )
182
+ paymentChainState .On ("GetGlobalRatePeriodInterval" , testifymock .Anything ).Return (uint64 (1 ), nil )
183
+ paymentChainState .On ("GetMinNumSymbols" , testifymock .Anything ).Return (uint64 (3 ), nil )
184
184
185
185
now := time .Now ().UnixNano ()
186
186
reservationPeriod := meterer .GetReservationPeriodByNanosecond (now , mt .ChainPaymentState .GetReservationWindow ())
@@ -281,8 +281,8 @@ func TestMetererReservations(t *testing.T) {
281
281
func TestMetererOnDemand (t * testing.T ) {
282
282
ctx := context .Background ()
283
283
quorumNumbers := []uint8 {0 , 1 }
284
- paymentChainState .On ("GetPricePerSymbol" , testifymock .Anything ).Return (uint32 (2 ), nil )
285
- paymentChainState .On ("GetMinNumSymbols" , testifymock .Anything ).Return (uint32 (3 ), nil )
284
+ paymentChainState .On ("GetPricePerSymbol" , testifymock .Anything ).Return (uint64 (2 ), nil )
285
+ paymentChainState .On ("GetMinNumSymbols" , testifymock .Anything ).Return (uint64 (3 ), nil )
286
286
now := time .Now ().Unix ()
287
287
288
288
paymentChainState .On ("GetOnDemandPaymentByAccount" , testifymock .Anything , testifymock .MatchedBy (func (account gethcommon.Address ) bool {
@@ -328,7 +328,7 @@ func TestMetererOnDemand(t *testing.T) {
328
328
header = createPaymentHeader (now , priceCharged , accountID2 )
329
329
symbolsCharged , err := mt .MeterRequest (ctx , * header , symbolLength , quorumNumbers )
330
330
assert .NoError (t , err )
331
- assert .Equal (t , uint32 (102 ), symbolsCharged )
331
+ assert .Equal (t , uint64 (102 ), symbolsCharged )
332
332
header = createPaymentHeader (now , priceCharged , accountID2 )
333
333
_ , err = mt .MeterRequest (ctx , * header , symbolLength , quorumNumbers )
334
334
assert .ErrorContains (t , err , "exact payment already exists" )
@@ -339,7 +339,7 @@ func TestMetererOnDemand(t *testing.T) {
339
339
header = createPaymentHeader (now , new (big.Int ).Mul (priceCharged , big .NewInt (int64 (i + 1 ))), accountID2 )
340
340
symbolsCharged , err = mt .MeterRequest (ctx , * header , symbolLength , quorumNumbers )
341
341
assert .NoError (t , err )
342
- assert .Equal (t , uint32 (102 ), symbolsCharged )
342
+ assert .Equal (t , uint64 (102 ), symbolsCharged )
343
343
}
344
344
345
345
// test cumulative payment on-chain constraint
@@ -384,8 +384,8 @@ func TestMeterer_paymentCharged(t *testing.T) {
384
384
tests := []struct {
385
385
name string
386
386
symbolLength uint64
387
- pricePerSymbol uint32
388
- minNumSymbols uint32
387
+ pricePerSymbol uint64
388
+ minNumSymbols uint64
389
389
expected * big.Int
390
390
}{
391
391
{
@@ -427,8 +427,8 @@ func TestMeterer_paymentCharged(t *testing.T) {
427
427
428
428
paymentChainState := & mock.MockOnchainPaymentState {}
429
429
for _ , tt := range tests {
430
- paymentChainState .On ("GetPricePerSymbol" , testifymock .Anything ).Return (uint32 (tt .pricePerSymbol ), nil )
431
- paymentChainState .On ("GetMinNumSymbols" , testifymock .Anything ).Return (uint32 (tt .minNumSymbols ), nil )
430
+ paymentChainState .On ("GetPricePerSymbol" , testifymock .Anything ).Return (uint64 (tt .pricePerSymbol ), nil )
431
+ paymentChainState .On ("GetMinNumSymbols" , testifymock .Anything ).Return (uint64 (tt .minNumSymbols ), nil )
432
432
t .Run (tt .name , func (t * testing.T ) {
433
433
m := & meterer.Meterer {
434
434
ChainPaymentState : paymentChainState ,
0 commit comments