1
1
import { describe , expect , test } from '@jest/globals'
2
- import { client } from './utils'
2
+ import { sponsorClient } from './utils'
3
3
import { WhitelistType } from '../src'
4
4
import { POLICY_UUID , ACCOUNT_ADDRESS , CONTRACT_METHOD } from './env'
5
5
@@ -12,7 +12,7 @@ describe('sponsorQuery', () => {
12
12
*/
13
13
describe ( 'addToWhitelist FromAccountWhitelist' , ( ) => {
14
14
test ( 'should add an account address to FromAccountWhitelist successfully' , async ( ) => {
15
- const res = await client . addToWhitelist ( {
15
+ const res = await sponsorClient . addToWhitelist ( {
16
16
PolicyUUID : POLICY_UUID ,
17
17
WhitelistType : WhitelistType . FromAccountWhitelist ,
18
18
Values : [ ACCOUNT_ADDRESS ] ,
@@ -28,7 +28,7 @@ describe('sponsorQuery', () => {
28
28
*/
29
29
describe ( 'addToWhitelist ToAccountWhitelist' , ( ) => {
30
30
test ( 'should add an account address to ToAccountWhitelist successfully' , async ( ) => {
31
- const res = await client . addToWhitelist ( {
31
+ const res = await sponsorClient . addToWhitelist ( {
32
32
PolicyUUID : POLICY_UUID ,
33
33
WhitelistType : WhitelistType . ToAccountWhitelist ,
34
34
Values : [ ACCOUNT_ADDRESS ] ,
@@ -44,7 +44,7 @@ describe('sponsorQuery', () => {
44
44
*/
45
45
describe ( 'addToWhitelist BEP20ReceiverWhiteList' , ( ) => {
46
46
test ( 'should add an account address to BEP20ReceiverWhiteList successfully' , async ( ) => {
47
- const res = await client . addToWhitelist ( {
47
+ const res = await sponsorClient . addToWhitelist ( {
48
48
PolicyUUID : POLICY_UUID ,
49
49
WhitelistType : WhitelistType . BEP20ReceiverWhiteList ,
50
50
Values : [ ACCOUNT_ADDRESS ] ,
@@ -60,7 +60,7 @@ describe('sponsorQuery', () => {
60
60
*/
61
61
describe ( 'addToWhitelist ContractMethodSigWhitelist' , ( ) => {
62
62
test ( 'should add a contract method signature to ContractMethodSigWhitelist successfully' , async ( ) => {
63
- const res = await client . addToWhitelist ( {
63
+ const res = await sponsorClient . addToWhitelist ( {
64
64
PolicyUUID : POLICY_UUID ,
65
65
WhitelistType : WhitelistType . ContractMethodSigWhitelist ,
66
66
Values : [ CONTRACT_METHOD ] ,
@@ -76,7 +76,7 @@ describe('sponsorQuery', () => {
76
76
*/
77
77
describe ( 'getWhitelist' , ( ) => {
78
78
test ( 'should retrieve contract method signatures successfully' , async ( ) => {
79
- const res = await client . getWhitelist ( {
79
+ const res = await sponsorClient . getWhitelist ( {
80
80
PolicyUUID : POLICY_UUID ,
81
81
WhitelistType : WhitelistType . ContractMethodSigWhitelist ,
82
82
Offset : 0 ,
@@ -93,7 +93,7 @@ describe('sponsorQuery', () => {
93
93
*/
94
94
describe ( 'removeFromWhitelist' , ( ) => {
95
95
test ( 'should remove an account address from FromAccountWhitelist successfully' , async ( ) => {
96
- const res = await client . removeFromWhitelist ( {
96
+ const res = await sponsorClient . removeFromWhitelist ( {
97
97
PolicyUUID : POLICY_UUID ,
98
98
WhitelistType : WhitelistType . FromAccountWhitelist ,
99
99
Values : [ ACCOUNT_ADDRESS ] ,
@@ -109,7 +109,7 @@ describe('sponsorQuery', () => {
109
109
*/
110
110
describe ( 'getWhitelist' , ( ) => {
111
111
test ( 'should not contain account address post-removal' , async ( ) => {
112
- const res = await client . getWhitelist ( {
112
+ const res = await sponsorClient . getWhitelist ( {
113
113
PolicyUUID : POLICY_UUID ,
114
114
WhitelistType : WhitelistType . FromAccountWhitelist ,
115
115
Offset : 0 ,
@@ -127,7 +127,7 @@ describe('sponsorQuery', () => {
127
127
*/
128
128
describe ( 'emptyWhitelist' , ( ) => {
129
129
test ( 'should clear all entries from BEP20ReceiverWhiteList successfully' , async ( ) => {
130
- const res = await client . emptyWhitelist ( {
130
+ const res = await sponsorClient . emptyWhitelist ( {
131
131
PolicyUUID : POLICY_UUID ,
132
132
WhitelistType : WhitelistType . BEP20ReceiverWhiteList ,
133
133
} )
@@ -142,7 +142,7 @@ describe('sponsorQuery', () => {
142
142
*/
143
143
describe ( 'getWhitelist' , ( ) => {
144
144
test ( 'should confirm the whitelist is empty' , async ( ) => {
145
- const res = await client . getWhitelist ( {
145
+ const res = await sponsorClient . getWhitelist ( {
146
146
PolicyUUID : POLICY_UUID ,
147
147
WhitelistType : WhitelistType . BEP20ReceiverWhiteList ,
148
148
Offset : 0 ,
@@ -159,7 +159,7 @@ describe('sponsorQuery', () => {
159
159
*/
160
160
describe ( 'getUserSpendData' , ( ) => {
161
161
test ( 'should return null for spend data when user has none' , async ( ) => {
162
- const res = await client . getUserSpendData ( ACCOUNT_ADDRESS , POLICY_UUID )
162
+ const res = await sponsorClient . getUserSpendData ( ACCOUNT_ADDRESS , POLICY_UUID )
163
163
164
164
expect ( res ) . toBeNull ( )
165
165
console . log ( 'User spend data:' , res )
@@ -171,7 +171,7 @@ describe('sponsorQuery', () => {
171
171
*/
172
172
describe ( 'getPolicySpendData' , ( ) => {
173
173
test ( 'should retrieve policy spend data successfully' , async ( ) => {
174
- const res = await client . getPolicySpendData ( POLICY_UUID )
174
+ const res = await sponsorClient . getPolicySpendData ( POLICY_UUID )
175
175
expect ( res . ChainID ) . not . toBeNull ( )
176
176
console . log ( 'Policy spend data:' , res )
177
177
} )
@@ -182,7 +182,7 @@ describe('sponsorQuery', () => {
182
182
*/
183
183
describe ( 'addToWhitelist FromAccountWhitelist' , ( ) => {
184
184
test ( 'should re-add an account address to FromAccountWhitelist successfully after removal' , async ( ) => {
185
- const res = await client . addToWhitelist ( {
185
+ const res = await sponsorClient . addToWhitelist ( {
186
186
PolicyUUID : POLICY_UUID ,
187
187
WhitelistType : WhitelistType . FromAccountWhitelist ,
188
188
Values : [ ACCOUNT_ADDRESS ] ,
0 commit comments