@@ -3,7 +3,6 @@ import "module-alias/register";
3
3
import { Address , Account } from "@utils/types" ;
4
4
import { increaseTimeAsync } from "@utils/test" ;
5
5
import { setBlockNumber } from "@utils/test/testingUtils" ;
6
- import { base58ToHexString } from "@utils/common" ;
7
6
import { ONE_HOUR_IN_SECONDS , ZERO } from "@utils/constants" ;
8
7
import { OptimisticAuctionRebalanceExtensionV1 } from "@utils/contracts/index" ;
9
8
import {
@@ -45,6 +44,7 @@ if (process.env.INTEGRATIONTEST) {
45
44
describe ( "OptimisticAuctionRebalanceExtensionV1 - Integration Test dsEth" , ( ) => {
46
45
const contractAddresses = PRODUCTION_ADDRESSES ;
47
46
47
+ const rules = "Rules stored on ipfs under hash: Qmc5gCcjYypU7y28oCALwfSvxCBskLuPKWpK4qpterKC7z" ;
48
48
const liveness = BigNumber . from ( 60 * 60 * 24 * 2 ) ; // 2 days
49
49
const minimumBond = ether ( 140 ) ; // 140 INDEX Minimum Bond
50
50
@@ -154,7 +154,7 @@ if (process.env.INTEGRATIONTEST) {
154
154
let identifier : string ;
155
155
156
156
beforeEach ( async ( ) => {
157
- identifier = "0x4153534552545f54525554480000000000000000000000000000000000000000" ; // ASSERT_TRUTH identifier
157
+ identifier = "0x4153534552545f54525554480000000000000000000000000000000000000000" ; // ASSERT_TTH identifier
158
158
159
159
productSettings = {
160
160
collateral : collateralAssetAddress ,
@@ -166,10 +166,7 @@ if (process.env.INTEGRATIONTEST) {
166
166
167
167
await auctionRebalanceExtension
168
168
. connect ( operator )
169
- . setProductSettings (
170
- productSettings ,
171
- utils . arrayify ( base58ToHexString ( "Qmc5gCcjYypU7y28oCALwfSvxCBskLuPKWpK4qpterKC7z" ) ) ,
172
- ) ;
169
+ . setProductSettings ( productSettings , rules ) ;
173
170
} ) ;
174
171
175
172
context ( "when the extension is open to rebalances" , ( ) => {
@@ -198,9 +195,13 @@ if (process.env.INTEGRATIONTEST) {
198
195
199
196
subjectOldComponents = await dsEth . getComponents ( ) ;
200
197
201
- subjectNewComponents = [ contractAddresses . tokens . swETH , contractAddresses . tokens . ETHx ] ;
198
+ subjectNewComponents = [
199
+ contractAddresses . tokens . swETH ,
200
+ contractAddresses . tokens . ETHx ,
201
+ ] ;
202
202
subjectNewComponentsAuctionParams = [
203
- { // swETH: https://etherscan.io/address/0xf951E335afb289353dc249e82926178EaC7DEd78#readProxyContract#F6
203
+ {
204
+ // swETH: https://etherscan.io/address/0xf951E335afb289353dc249e82926178EaC7DEd78#readProxyContract#F6
204
205
targetUnit : "155716754710815260" ,
205
206
priceAdapterName : "BoundedStepwiseLinearPriceAdapter" ,
206
207
priceAdapterConfigData : await priceAdapter . getEncodedData (
@@ -212,7 +213,8 @@ if (process.env.INTEGRATIONTEST) {
212
213
ether ( 1.043 ) ,
213
214
) ,
214
215
} ,
215
- { // ETHx: https://etherscan.io/address/0xcf5ea1b38380f6af39068375516daf40ed70d299#readProxyContract#F5
216
+ {
217
+ // ETHx: https://etherscan.io/address/0xcf5ea1b38380f6af39068375516daf40ed70d299#readProxyContract#F5
216
218
targetUnit : "162815732702576500" ,
217
219
priceAdapterName : "BoundedStepwiseLinearPriceAdapter" ,
218
220
priceAdapterConfigData : await priceAdapter . getEncodedData (
@@ -287,17 +289,17 @@ if (process.env.INTEGRATIONTEST) {
287
289
. add ( effectiveBond )
288
290
. toHexString ( ) ;
289
291
290
- // set operator balance to effective bond
292
+ // set operator balance to effective bond
291
293
await ethers . provider . send ( "hardhat_setBalance" , [
292
294
await subjectCaller . getAddress ( ) ,
293
295
quantity ,
294
296
] ) ;
295
297
296
298
await getIndexTokens ( await subjectCaller . getAddress ( ) , effectiveBond ) ;
297
- await indexToken
298
- . connect ( subjectCaller )
299
- . approve ( auctionRebalanceExtension . address , effectiveBond ) ;
300
- } ) ;
299
+ await indexToken
300
+ . connect ( subjectCaller )
301
+ . approve ( auctionRebalanceExtension . address , effectiveBond ) ;
302
+ } ) ;
301
303
302
304
describe ( "#startRebalance" , ( ) => {
303
305
async function subject ( ) : Promise < ContractTransaction > {
@@ -450,7 +452,9 @@ if (process.env.INTEGRATIONTEST) {
450
452
expect ( proposalHash ) . to . not . eq ( ethers . constants . HashZero ) ;
451
453
452
454
await getIndexTokens ( await subjectCaller . getAddress ( ) , effectiveBond ) ;
453
- await indexToken . connect ( subjectCaller ) . approve ( optimisticOracleV3 . address , effectiveBond ) ;
455
+ await indexToken
456
+ . connect ( subjectCaller )
457
+ . approve ( optimisticOracleV3 . address , effectiveBond ) ;
454
458
await optimisticOracleV3
455
459
. connect ( subjectCaller )
456
460
. disputeAssertion ( proposalId , owner . address ) ;
@@ -471,9 +475,7 @@ if (process.env.INTEGRATIONTEST) {
471
475
identifier,
472
476
optimisticOracleV3 : optimisticOracleV3Mock . address ,
473
477
} ,
474
- utils . arrayify (
475
- base58ToHexString ( "Qmc5gCcjYypU7y28oCALwfSvxCBskLuPKWpK4qpterKC7z" ) ,
476
- ) ,
478
+ rules ,
477
479
) ;
478
480
479
481
const proposalHash = await auctionRebalanceExtension
@@ -506,9 +508,7 @@ if (process.env.INTEGRATIONTEST) {
506
508
identifier,
507
509
optimisticOracleV3 : optimisticOracleV3Mock . address ,
508
510
} ,
509
- utils . arrayify (
510
- base58ToHexString ( "Qmc5gCcjYypU7y28oCALwfSvxCBskLuPKWpK4qpterKC7z" ) ,
511
- ) ,
511
+ rules ,
512
512
) ;
513
513
const tx = await auctionRebalanceExtension
514
514
. connect ( subjectCaller )
0 commit comments