tempo.ts 0.4.4 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -3
- package/dist/chains.d.ts +15 -1
- package/dist/chains.d.ts.map +1 -1
- package/dist/chains.js +2 -1
- package/dist/chains.js.map +1 -1
- package/dist/prool/Instance.d.ts +12 -4
- package/dist/prool/Instance.d.ts.map +1 -1
- package/dist/prool/Instance.js +34 -18
- package/dist/prool/Instance.js.map +1 -1
- package/dist/viem/Actions/faucet.d.ts +34 -1
- package/dist/viem/Actions/faucet.d.ts.map +1 -1
- package/dist/viem/Actions/faucet.js +35 -0
- package/dist/viem/Actions/faucet.js.map +1 -1
- package/dist/viem/Chain.d.ts +6 -0
- package/dist/viem/Chain.d.ts.map +1 -1
- package/dist/viem/Transaction.d.ts +4 -1
- package/dist/viem/Transaction.d.ts.map +1 -1
- package/dist/viem/Transaction.js.map +1 -1
- package/package.json +1 -1
- package/src/chains.ts +2 -1
- package/src/ox/TransactionEnvelopeAA.test.ts +2 -663
- package/src/ox/e2e.test.ts +659 -0
- package/src/prool/Instance.ts +51 -23
- package/src/tsconfig.json +2 -2
- package/src/viem/Actions/amm.test.ts +68 -58
- package/src/viem/Actions/dex.test.ts +339 -283
- package/src/viem/Actions/faucet.ts +63 -1
- package/src/viem/Actions/fee.test.ts +34 -43
- package/src/viem/Actions/policy.test.ts +115 -81
- package/src/viem/Actions/reward.test.ts +92 -74
- package/src/viem/Actions/token.test.ts +691 -529
- package/src/viem/Transaction.ts +4 -1
- package/src/viem/e2e.test.ts +451 -472
- package/src/wagmi/Actions/amm.test.ts +2 -5
- package/src/wagmi/Actions/dex.test.ts +2 -1
- package/src/wagmi/Actions/token.test.ts +2 -1
- package/src/wagmi/Hooks/amm.test.ts +2 -5
- package/src/wagmi/Hooks/dex.test.ts +2 -1
- package/src/wagmi/Hooks/token.test.ts +2 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { parseEther, parseUnits } from 'viem'
|
|
2
2
|
import { describe, expect, test } from 'vitest'
|
|
3
|
-
import {
|
|
3
|
+
import { clientWithAccount, setupToken } from '../../../test/viem/config.js'
|
|
4
4
|
import * as actions from './index.js'
|
|
5
5
|
|
|
6
|
-
const account =
|
|
6
|
+
const account = clientWithAccount.account
|
|
7
7
|
|
|
8
8
|
describe('cancelSync', () => {
|
|
9
9
|
test('default', async () => {
|
|
10
|
-
const { token } = await setupToken(
|
|
10
|
+
const { token } = await setupToken(clientWithAccount)
|
|
11
11
|
|
|
12
12
|
// Start a reward stream with longer duration
|
|
13
13
|
const rewardAmount = parseUnits('100', 6)
|
|
14
|
-
const { id: streamId } = await actions.reward.startSync(
|
|
14
|
+
const { id: streamId } = await actions.reward.startSync(clientWithAccount, {
|
|
15
15
|
amount: rewardAmount,
|
|
16
16
|
seconds: 3600, // 1 hour to avoid stream ending during test
|
|
17
17
|
token,
|
|
@@ -19,7 +19,7 @@ describe('cancelSync', () => {
|
|
|
19
19
|
|
|
20
20
|
// Cancel the reward
|
|
21
21
|
const { receipt, refund, ...result } = await actions.reward.cancelSync(
|
|
22
|
-
|
|
22
|
+
clientWithAccount,
|
|
23
23
|
{
|
|
24
24
|
id: streamId,
|
|
25
25
|
token,
|
|
@@ -40,46 +40,46 @@ describe('cancelSync', () => {
|
|
|
40
40
|
// TODO: unskip
|
|
41
41
|
describe.skip('claimSync', () => {
|
|
42
42
|
test('default', async () => {
|
|
43
|
-
const { token } = await setupToken(
|
|
43
|
+
const { token } = await setupToken(clientWithAccount)
|
|
44
44
|
|
|
45
|
-
const balanceBefore = await actions.token.getBalance(
|
|
45
|
+
const balanceBefore = await actions.token.getBalance(clientWithAccount, {
|
|
46
46
|
token,
|
|
47
47
|
})
|
|
48
48
|
|
|
49
49
|
// Opt in to rewards
|
|
50
|
-
await actions.reward.setRecipientSync(
|
|
50
|
+
await actions.reward.setRecipientSync(clientWithAccount, {
|
|
51
51
|
recipient: account.address,
|
|
52
52
|
token,
|
|
53
53
|
})
|
|
54
54
|
|
|
55
55
|
// Mint reward tokens
|
|
56
56
|
const rewardAmount = parseUnits('100', 6)
|
|
57
|
-
await actions.token.mintSync(
|
|
57
|
+
await actions.token.mintSync(clientWithAccount, {
|
|
58
58
|
amount: rewardAmount,
|
|
59
59
|
to: account.address,
|
|
60
60
|
token,
|
|
61
61
|
})
|
|
62
62
|
|
|
63
63
|
// Start immediate reward to distribute rewards
|
|
64
|
-
await actions.reward.startSync(
|
|
64
|
+
await actions.reward.startSync(clientWithAccount, {
|
|
65
65
|
amount: rewardAmount,
|
|
66
66
|
seconds: 0,
|
|
67
67
|
token,
|
|
68
68
|
})
|
|
69
69
|
|
|
70
70
|
// Trigger reward accrual by transferring
|
|
71
|
-
await actions.token.transferSync(
|
|
71
|
+
await actions.token.transferSync(clientWithAccount, {
|
|
72
72
|
amount: 1n,
|
|
73
73
|
to: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
|
|
74
74
|
token,
|
|
75
75
|
})
|
|
76
76
|
|
|
77
77
|
// Claim rewards
|
|
78
|
-
await actions.reward.claimSync(
|
|
78
|
+
await actions.reward.claimSync(clientWithAccount, {
|
|
79
79
|
token,
|
|
80
80
|
})
|
|
81
81
|
|
|
82
|
-
const balanceAfter = await actions.token.getBalance(
|
|
82
|
+
const balanceAfter = await actions.token.getBalance(clientWithAccount, {
|
|
83
83
|
token,
|
|
84
84
|
})
|
|
85
85
|
|
|
@@ -89,36 +89,36 @@ describe.skip('claimSync', () => {
|
|
|
89
89
|
})
|
|
90
90
|
|
|
91
91
|
test('behavior: claiming from streaming reward', async () => {
|
|
92
|
-
const { token } = await setupToken(
|
|
92
|
+
const { token } = await setupToken(clientWithAccount)
|
|
93
93
|
|
|
94
|
-
const balanceBefore = await actions.token.getBalance(
|
|
94
|
+
const balanceBefore = await actions.token.getBalance(clientWithAccount, {
|
|
95
95
|
token,
|
|
96
96
|
})
|
|
97
97
|
|
|
98
98
|
// Mint tokens to have balance
|
|
99
99
|
const mintAmount = parseUnits('1000', 6)
|
|
100
|
-
await actions.token.mintSync(
|
|
100
|
+
await actions.token.mintSync(clientWithAccount, {
|
|
101
101
|
amount: mintAmount,
|
|
102
102
|
to: account.address,
|
|
103
103
|
token,
|
|
104
104
|
})
|
|
105
105
|
|
|
106
106
|
// Opt in to rewards
|
|
107
|
-
await actions.reward.setRecipientSync(
|
|
107
|
+
await actions.reward.setRecipientSync(clientWithAccount, {
|
|
108
108
|
recipient: account.address,
|
|
109
109
|
token,
|
|
110
110
|
})
|
|
111
111
|
|
|
112
112
|
// Mint reward tokens
|
|
113
113
|
const rewardAmount = parseUnits('100', 6)
|
|
114
|
-
await actions.token.mintSync(
|
|
114
|
+
await actions.token.mintSync(clientWithAccount, {
|
|
115
115
|
amount: rewardAmount,
|
|
116
116
|
to: account.address,
|
|
117
117
|
token,
|
|
118
118
|
})
|
|
119
119
|
|
|
120
120
|
// Start a streaming reward (not immediate)
|
|
121
|
-
await actions.reward.startSync(
|
|
121
|
+
await actions.reward.startSync(clientWithAccount, {
|
|
122
122
|
amount: rewardAmount,
|
|
123
123
|
seconds: 10,
|
|
124
124
|
token,
|
|
@@ -126,18 +126,18 @@ describe.skip('claimSync', () => {
|
|
|
126
126
|
|
|
127
127
|
// Wait a bit and trigger accrual by transferring
|
|
128
128
|
await new Promise((resolve) => setTimeout(resolve, 2000))
|
|
129
|
-
await actions.token.transferSync(
|
|
129
|
+
await actions.token.transferSync(clientWithAccount, {
|
|
130
130
|
amount: 1n,
|
|
131
131
|
to: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
|
|
132
132
|
token,
|
|
133
133
|
})
|
|
134
134
|
|
|
135
135
|
// Claim accumulated rewards from the stream
|
|
136
|
-
await actions.reward.claimSync(
|
|
136
|
+
await actions.reward.claimSync(clientWithAccount, {
|
|
137
137
|
token,
|
|
138
138
|
})
|
|
139
139
|
|
|
140
|
-
const balanceAfter = await actions.token.getBalance(
|
|
140
|
+
const balanceAfter = await actions.token.getBalance(clientWithAccount, {
|
|
141
141
|
token,
|
|
142
142
|
})
|
|
143
143
|
|
|
@@ -148,12 +148,12 @@ describe.skip('claimSync', () => {
|
|
|
148
148
|
|
|
149
149
|
describe('getStream', () => {
|
|
150
150
|
test('default', async () => {
|
|
151
|
-
const { token } = await setupToken(
|
|
151
|
+
const { token } = await setupToken(clientWithAccount)
|
|
152
152
|
|
|
153
153
|
// Start a reward stream
|
|
154
154
|
const rewardAmount = parseUnits('100', 6)
|
|
155
155
|
const duration = 10
|
|
156
|
-
const { id: streamId } = await actions.reward.startSync(
|
|
156
|
+
const { id: streamId } = await actions.reward.startSync(clientWithAccount, {
|
|
157
157
|
amount: rewardAmount,
|
|
158
158
|
seconds: duration,
|
|
159
159
|
token,
|
|
@@ -161,7 +161,7 @@ describe('getStream', () => {
|
|
|
161
161
|
|
|
162
162
|
// Get the stream
|
|
163
163
|
const { endTime, startTime, ...stream } = await actions.reward.getStream(
|
|
164
|
-
|
|
164
|
+
clientWithAccount,
|
|
165
165
|
{
|
|
166
166
|
id: streamId,
|
|
167
167
|
token,
|
|
@@ -180,23 +180,23 @@ describe('getStream', () => {
|
|
|
180
180
|
})
|
|
181
181
|
|
|
182
182
|
test('behavior: canceled stream has zero funder', async () => {
|
|
183
|
-
const { token } = await setupToken(
|
|
183
|
+
const { token } = await setupToken(clientWithAccount)
|
|
184
184
|
|
|
185
185
|
// Start and cancel a reward stream
|
|
186
186
|
const rewardAmount = parseUnits('100', 6)
|
|
187
|
-
const { id: streamId } = await actions.reward.startSync(
|
|
187
|
+
const { id: streamId } = await actions.reward.startSync(clientWithAccount, {
|
|
188
188
|
amount: rewardAmount,
|
|
189
189
|
seconds: 3600, // 1 hour to avoid stream ending during test
|
|
190
190
|
token,
|
|
191
191
|
})
|
|
192
192
|
|
|
193
|
-
await actions.reward.cancelSync(
|
|
193
|
+
await actions.reward.cancelSync(clientWithAccount, {
|
|
194
194
|
id: streamId,
|
|
195
195
|
token,
|
|
196
196
|
})
|
|
197
197
|
|
|
198
198
|
// Get the canceled stream
|
|
199
|
-
const stream = await actions.reward.getStream(
|
|
199
|
+
const stream = await actions.reward.getStream(clientWithAccount, {
|
|
200
200
|
id: streamId,
|
|
201
201
|
token,
|
|
202
202
|
})
|
|
@@ -215,9 +215,9 @@ describe('getStream', () => {
|
|
|
215
215
|
|
|
216
216
|
describe('getTotalPerSecond', () => {
|
|
217
217
|
test('default', async () => {
|
|
218
|
-
const { token } = await setupToken(
|
|
218
|
+
const { token } = await setupToken(clientWithAccount)
|
|
219
219
|
|
|
220
|
-
const rate = await actions.reward.getTotalPerSecond(
|
|
220
|
+
const rate = await actions.reward.getTotalPerSecond(clientWithAccount, {
|
|
221
221
|
token,
|
|
222
222
|
})
|
|
223
223
|
|
|
@@ -225,19 +225,19 @@ describe('getTotalPerSecond', () => {
|
|
|
225
225
|
})
|
|
226
226
|
|
|
227
227
|
test('behavior: increases after starting stream', async () => {
|
|
228
|
-
const { token } = await setupToken(
|
|
228
|
+
const { token } = await setupToken(clientWithAccount)
|
|
229
229
|
|
|
230
230
|
// Start a reward stream
|
|
231
231
|
const rewardAmount = parseUnits('100', 6)
|
|
232
232
|
const duration = 100
|
|
233
|
-
await actions.reward.startSync(
|
|
233
|
+
await actions.reward.startSync(clientWithAccount, {
|
|
234
234
|
amount: rewardAmount,
|
|
235
235
|
seconds: duration,
|
|
236
236
|
token,
|
|
237
237
|
})
|
|
238
238
|
|
|
239
239
|
// Check total reward per second
|
|
240
|
-
const rate = await actions.reward.getTotalPerSecond(
|
|
240
|
+
const rate = await actions.reward.getTotalPerSecond(clientWithAccount, {
|
|
241
241
|
token,
|
|
242
242
|
})
|
|
243
243
|
|
|
@@ -250,11 +250,11 @@ describe('getTotalPerSecond', () => {
|
|
|
250
250
|
|
|
251
251
|
describe('setRecipientSync', () => {
|
|
252
252
|
test('default', async () => {
|
|
253
|
-
const { token } = await setupToken(
|
|
253
|
+
const { token } = await setupToken(clientWithAccount)
|
|
254
254
|
|
|
255
255
|
// Set reward recipient to self
|
|
256
256
|
const { holder, receipt, recipient } =
|
|
257
|
-
await actions.reward.setRecipientSync(
|
|
257
|
+
await actions.reward.setRecipientSync(clientWithAccount, {
|
|
258
258
|
recipient: account.address,
|
|
259
259
|
token,
|
|
260
260
|
})
|
|
@@ -265,17 +265,17 @@ describe('setRecipientSync', () => {
|
|
|
265
265
|
})
|
|
266
266
|
|
|
267
267
|
test('behavior: opt out with zero address', async () => {
|
|
268
|
-
const { token } = await setupToken(
|
|
268
|
+
const { token } = await setupToken(clientWithAccount)
|
|
269
269
|
|
|
270
270
|
// First opt in
|
|
271
|
-
await actions.reward.setRecipientSync(
|
|
271
|
+
await actions.reward.setRecipientSync(clientWithAccount, {
|
|
272
272
|
recipient: account.address,
|
|
273
273
|
token,
|
|
274
274
|
})
|
|
275
275
|
|
|
276
276
|
// Then opt out
|
|
277
277
|
const { holder, recipient } = await actions.reward.setRecipientSync(
|
|
278
|
-
|
|
278
|
+
clientWithAccount,
|
|
279
279
|
{
|
|
280
280
|
recipient: '0x0000000000000000000000000000000000000000',
|
|
281
281
|
token,
|
|
@@ -289,16 +289,19 @@ describe('setRecipientSync', () => {
|
|
|
289
289
|
|
|
290
290
|
describe('startSync', () => {
|
|
291
291
|
test('default', async () => {
|
|
292
|
-
const { token } = await setupToken(
|
|
292
|
+
const { token } = await setupToken(clientWithAccount)
|
|
293
293
|
|
|
294
294
|
// Start a reward stream
|
|
295
295
|
const duration = 10
|
|
296
296
|
const rewardAmount = parseUnits('100', 6)
|
|
297
|
-
const { id, receipt, ...result } = await actions.reward.startSync(
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
297
|
+
const { id, receipt, ...result } = await actions.reward.startSync(
|
|
298
|
+
clientWithAccount,
|
|
299
|
+
{
|
|
300
|
+
amount: rewardAmount,
|
|
301
|
+
seconds: duration,
|
|
302
|
+
token,
|
|
303
|
+
},
|
|
304
|
+
)
|
|
302
305
|
|
|
303
306
|
expect(receipt).toBeDefined()
|
|
304
307
|
expect(result).toMatchInlineSnapshot(`
|
|
@@ -311,7 +314,7 @@ describe('startSync', () => {
|
|
|
311
314
|
|
|
312
315
|
// Verify the stream was created
|
|
313
316
|
const { endTime, startTime, ...stream } = await actions.reward.getStream(
|
|
314
|
-
|
|
317
|
+
clientWithAccount,
|
|
315
318
|
{
|
|
316
319
|
id,
|
|
317
320
|
token,
|
|
@@ -329,20 +332,23 @@ describe('startSync', () => {
|
|
|
329
332
|
`)
|
|
330
333
|
|
|
331
334
|
// Verify total reward per second
|
|
332
|
-
const totalRate = await actions.reward.getTotalPerSecond(
|
|
333
|
-
|
|
334
|
-
|
|
335
|
+
const totalRate = await actions.reward.getTotalPerSecond(
|
|
336
|
+
clientWithAccount,
|
|
337
|
+
{
|
|
338
|
+
token,
|
|
339
|
+
},
|
|
340
|
+
)
|
|
335
341
|
const expectedRate = (rewardAmount * parseEther('1')) / BigInt(duration)
|
|
336
342
|
expect(totalRate).toBe(expectedRate)
|
|
337
343
|
})
|
|
338
344
|
|
|
339
345
|
test('behavior: streaming distribution', async () => {
|
|
340
|
-
const { token } = await setupToken(
|
|
346
|
+
const { token } = await setupToken(clientWithAccount)
|
|
341
347
|
|
|
342
348
|
// Start a streaming reward
|
|
343
349
|
const duration = 3600
|
|
344
350
|
const rewardAmount = parseUnits('100', 6)
|
|
345
|
-
const { id } = await actions.reward.startSync(
|
|
351
|
+
const { id } = await actions.reward.startSync(clientWithAccount, {
|
|
346
352
|
amount: rewardAmount,
|
|
347
353
|
seconds: duration,
|
|
348
354
|
token,
|
|
@@ -351,9 +357,12 @@ describe('startSync', () => {
|
|
|
351
357
|
expect(id).toBeGreaterThan(0n) // Streaming distributions return ID > 0
|
|
352
358
|
|
|
353
359
|
// Verify the stream was created with correct rate
|
|
354
|
-
const totalRate = await actions.reward.getTotalPerSecond(
|
|
355
|
-
|
|
356
|
-
|
|
360
|
+
const totalRate = await actions.reward.getTotalPerSecond(
|
|
361
|
+
clientWithAccount,
|
|
362
|
+
{
|
|
363
|
+
token,
|
|
364
|
+
},
|
|
365
|
+
)
|
|
357
366
|
|
|
358
367
|
const expectedRate = (rewardAmount * parseEther('1')) / BigInt(duration)
|
|
359
368
|
expect(totalRate).toBe(expectedRate)
|
|
@@ -361,28 +370,31 @@ describe('startSync', () => {
|
|
|
361
370
|
|
|
362
371
|
// TODO: unskip
|
|
363
372
|
test.skip('behavior: immediate distribution (seconds = 0)', async () => {
|
|
364
|
-
const { token } = await setupToken(
|
|
373
|
+
const { token } = await setupToken(clientWithAccount)
|
|
365
374
|
|
|
366
375
|
// Opt in to rewards
|
|
367
|
-
await actions.reward.setRecipientSync(
|
|
376
|
+
await actions.reward.setRecipientSync(clientWithAccount, {
|
|
368
377
|
recipient: account.address,
|
|
369
378
|
token,
|
|
370
379
|
})
|
|
371
380
|
|
|
372
|
-
const balanceBeforeReward = await actions.token.getBalance(
|
|
373
|
-
|
|
374
|
-
|
|
381
|
+
const balanceBeforeReward = await actions.token.getBalance(
|
|
382
|
+
clientWithAccount,
|
|
383
|
+
{
|
|
384
|
+
token,
|
|
385
|
+
},
|
|
386
|
+
)
|
|
375
387
|
|
|
376
388
|
// Mint reward tokens
|
|
377
389
|
const rewardAmount = parseUnits('100', 6)
|
|
378
|
-
await actions.token.mintSync(
|
|
390
|
+
await actions.token.mintSync(clientWithAccount, {
|
|
379
391
|
amount: rewardAmount,
|
|
380
392
|
to: account.address,
|
|
381
393
|
token,
|
|
382
394
|
})
|
|
383
395
|
|
|
384
396
|
// Start immediate reward (seconds = 0)
|
|
385
|
-
const { id } = await actions.reward.startSync(
|
|
397
|
+
const { id } = await actions.reward.startSync(clientWithAccount, {
|
|
386
398
|
amount: rewardAmount,
|
|
387
399
|
seconds: 0,
|
|
388
400
|
token,
|
|
@@ -391,18 +403,18 @@ describe('startSync', () => {
|
|
|
391
403
|
expect(id).toBe(0n) // Immediate distributions return ID 0
|
|
392
404
|
|
|
393
405
|
// Trigger reward distribution by transferring
|
|
394
|
-
await actions.token.transferSync(
|
|
406
|
+
await actions.token.transferSync(clientWithAccount, {
|
|
395
407
|
amount: 1n,
|
|
396
408
|
to: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
|
|
397
409
|
token,
|
|
398
410
|
})
|
|
399
411
|
|
|
400
412
|
// Claim the accumulated rewards
|
|
401
|
-
await actions.reward.claimSync(
|
|
413
|
+
await actions.reward.claimSync(clientWithAccount, {
|
|
402
414
|
token,
|
|
403
415
|
})
|
|
404
416
|
|
|
405
|
-
const balanceAfter = await actions.token.getBalance(
|
|
417
|
+
const balanceAfter = await actions.token.getBalance(clientWithAccount, {
|
|
406
418
|
token,
|
|
407
419
|
})
|
|
408
420
|
|
|
@@ -412,24 +424,27 @@ describe('startSync', () => {
|
|
|
412
424
|
)
|
|
413
425
|
|
|
414
426
|
// Total reward per second should be zero for immediate distributions
|
|
415
|
-
const totalRate = await actions.reward.getTotalPerSecond(
|
|
416
|
-
|
|
417
|
-
|
|
427
|
+
const totalRate = await actions.reward.getTotalPerSecond(
|
|
428
|
+
clientWithAccount,
|
|
429
|
+
{
|
|
430
|
+
token,
|
|
431
|
+
},
|
|
432
|
+
)
|
|
418
433
|
expect(totalRate).toBe(0n)
|
|
419
434
|
})
|
|
420
435
|
|
|
421
436
|
test('behavior: immediate distribution with opted-in holders', async () => {
|
|
422
|
-
const { token } = await setupToken(
|
|
437
|
+
const { token } = await setupToken(clientWithAccount)
|
|
423
438
|
|
|
424
439
|
// Opt in to rewards
|
|
425
|
-
await actions.reward.setRecipientSync(
|
|
440
|
+
await actions.reward.setRecipientSync(clientWithAccount, {
|
|
426
441
|
recipient: account.address,
|
|
427
442
|
token,
|
|
428
443
|
})
|
|
429
444
|
|
|
430
445
|
// Mint reward tokens
|
|
431
446
|
const rewardAmount = parseUnits('100', 6)
|
|
432
|
-
await actions.token.mintSync(
|
|
447
|
+
await actions.token.mintSync(clientWithAccount, {
|
|
433
448
|
amount: rewardAmount,
|
|
434
449
|
to: account.address,
|
|
435
450
|
token,
|
|
@@ -437,7 +452,7 @@ describe('startSync', () => {
|
|
|
437
452
|
|
|
438
453
|
// Start immediate reward
|
|
439
454
|
const { amount, durationSeconds, funder, id } =
|
|
440
|
-
await actions.reward.startSync(
|
|
455
|
+
await actions.reward.startSync(clientWithAccount, {
|
|
441
456
|
amount: rewardAmount,
|
|
442
457
|
seconds: 0,
|
|
443
458
|
token,
|
|
@@ -449,9 +464,12 @@ describe('startSync', () => {
|
|
|
449
464
|
expect(durationSeconds).toBe(0)
|
|
450
465
|
|
|
451
466
|
// Total reward per second should be zero for immediate distributions
|
|
452
|
-
const totalRate = await actions.reward.getTotalPerSecond(
|
|
453
|
-
|
|
454
|
-
|
|
467
|
+
const totalRate = await actions.reward.getTotalPerSecond(
|
|
468
|
+
clientWithAccount,
|
|
469
|
+
{
|
|
470
|
+
token,
|
|
471
|
+
},
|
|
472
|
+
)
|
|
455
473
|
expect(totalRate).toBe(0n)
|
|
456
474
|
})
|
|
457
475
|
})
|