@@ -12,7 +12,6 @@ describe("RewardPool", () => {
12
12
deferred : Deferred ;
13
13
rewardPool : RewardPool ;
14
14
ekoke : Ekoke ;
15
- usdc : Ekoke ;
16
15
usdt : Ekoke ;
17
16
owner : SignerWithAddress ;
18
17
seller : SignerWithAddress ;
@@ -36,12 +35,6 @@ describe("RewardPool", () => {
36
35
await usdt . adminMint ( buyer . address , 1000 ) ;
37
36
await usdt . adminMint ( thirdParty . address , 1000 ) ;
38
37
39
- const usdcContract = await ethers . deployContract ( "Ekoke" , [ owner . address ] ) ;
40
- const usdc = usdcContract as unknown as Ekoke ;
41
- // mint 1000 USDC to alice
42
- await usdc . adminMint ( buyer . address , 1000 ) ;
43
- await usdc . adminMint ( thirdParty . address , 1000 ) ;
44
-
45
38
const deferredContract = await ethers . deployContract ( "Deferred" , [
46
39
owner . address ,
47
40
] ) ;
@@ -57,7 +50,6 @@ describe("RewardPool", () => {
57
50
const marketplaceContract = await ethers . deployContract ( "Marketplace" , [
58
51
owner . address ,
59
52
usdt . getAddress ( ) ,
60
- usdc . getAddress ( ) ,
61
53
ekoke . getAddress ( ) ,
62
54
deferred . getAddress ( ) ,
63
55
] ) ;
@@ -97,7 +89,6 @@ describe("RewardPool", () => {
97
89
seller,
98
90
minter,
99
91
usdt,
100
- usdc,
101
92
thirdParty,
102
93
} ;
103
94
} ) ;
@@ -109,7 +100,7 @@ describe("RewardPool", () => {
109
100
// give allowance to marketplace
110
101
await usdt . connect ( thirdParty ) . approve ( marketplace . getAddress ( ) , USD_PRICE ) ;
111
102
// buy
112
- await marketplace . connect ( thirdParty ) . buyTokenWithUSDT ( tokenId ) ;
103
+ await marketplace . connect ( thirdParty ) . buyToken ( tokenId ) ;
113
104
114
105
// USDT balance of buyer
115
106
expect ( await usdt . balanceOf ( thirdParty . address ) ) . to . equal ( 1000 - USD_PRICE ) ;
@@ -123,27 +114,6 @@ describe("RewardPool", () => {
123
114
expect ( await ekoke . balanceOf ( thirdParty . address ) ) . to . equal ( EKOKE_REWARD ) ;
124
115
} ) ;
125
116
126
- it ( "Should buy a NFT with USDC as third-party" , async ( ) => {
127
- const { marketplace, thirdParty, seller, deferred, ekoke, usdc } = deploy ;
128
-
129
- const tokenId = 0 ;
130
- // give allowance to marketplace
131
- await usdc . connect ( thirdParty ) . approve ( marketplace . getAddress ( ) , USD_PRICE ) ;
132
- // buy
133
- await marketplace . connect ( thirdParty ) . buyTokenWithUSDC ( tokenId ) ;
134
-
135
- // USDT balance of buyer
136
- expect ( await usdc . balanceOf ( thirdParty . address ) ) . to . equal ( 1000 - USD_PRICE ) ;
137
- // USDT balance of seller
138
- expect ( await usdc . balanceOf ( seller . address ) ) . to . equal ( USD_PRICE ) ;
139
-
140
- // check NFT has been transferred
141
- expect ( await deferred . ownerOf ( tokenId ) ) . to . equal ( thirdParty . address ) ;
142
-
143
- // check buyer has received the reward
144
- expect ( await ekoke . balanceOf ( thirdParty . address ) ) . to . equal ( EKOKE_REWARD ) ;
145
- } ) ;
146
-
147
117
it ( "Should buy a NFT with USDT as contract buyer" , async ( ) => {
148
118
const { marketplace, buyer, seller, deferred, ekoke, usdt } = deploy ;
149
119
@@ -154,7 +124,7 @@ describe("RewardPool", () => {
154
124
. connect ( buyer )
155
125
. approve ( marketplace . getAddress ( ) , USD_PRICE + interest ) ;
156
126
// buy
157
- await marketplace . connect ( buyer ) . buyTokenWithUSDT ( tokenId ) ;
127
+ await marketplace . connect ( buyer ) . buyToken ( tokenId ) ;
158
128
159
129
// USDT balance of buyer
160
130
expect ( await usdt . balanceOf ( buyer . address ) ) . to . equal (
0 commit comments