import { CreditCardEscrow , getPlatformAddresses , ManualOracle , getETHPayment } from '@imtbl/platform' ; import { ethers , Wallet } from 'ethers' ; import 'jest' ; import { GU_S1_CAP , GU_S1_EPIC_PACK_PRICE , GU_S1_EPIC_PACK_SKU , GU_S1_LEGENDARY_PACK_PRICE , GU_S1_LEGENDARY_PACK_SKU , GU_S1_RARE_PACK_PRICE , GU_S1_RARE_PACK_SKU , GU_S1_SHINY_PACK_PRICE , GU_S1_SHINY_PACK_SKU , GU_S1_RARE_CHEST_PRICE , GU_S1_RARE_CHEST_SKU , GU_S1_LEGENDARY_CHEST_SKU , GU_S1_LEGENDARY_CHEST_PRICE } from '../../deployment/constants' ; import { getGodsUnchainedAddresses } from '../../src/addresses/index' ; import { Beacon , Cards , EpicPack , Escrow , LegendaryPack , PurchaseProcessor , Raffle , RarePack , S1Cap , S1Sale , ShinyPack , Chest } from '../../src/contracts' ; ethers . errors . setLogLevel ( 'error' ) ; jest . setTimeout ( 60000 ) ; const config = require ( 'dotenv' ) . config ( { path : '../../.env' } ) . parsed ; const provider = new ethers . providers . JsonRpcProvider ( config . RPC_ENDPOINT ) ; const wallet = new ethers . Wallet ( config . PRIVATE_KEY , provider ) ; const INTENDED_OWNER = wallet . address ; const INTENDED_SIGNER = wallet . address ; describe ( '02_deployment_verification' , ( ) => { const godUnchainedAddressBook = getGodsUnchainedAddresses ( config . DEPLOYMENT_NETWORK_ID , config . DEPLOYMENT_ENVIRONMENT ) ; const platformAddressBook = getPlatformAddresses ( config . DEPLOYMENT_NETWORK_ID , config . DEPLOYMENT_ENVIRONMENT ) ; let beacon ; let processor ; let escrow ; let creditCard ; let cards ; let s1Raffle ; let s1Sale ; let s1Cap ; let epicPack ; let rarePack ; let shinyPack ; let legendaryPack ; let oracle ; let rareChest ; let legendaryChest ; beforeAll ( async ( ) => { beacon = Beacon . at ( wallet , platformAddressBook . beaconAddress ) ; processor = PurchaseProcessor . at ( wallet , platformAddressBook . processorAddress ) ; escrow = Escrow . at ( wallet , platformAddressBook . escrowAddress ) ; cards = Cards . at ( wallet , godUnchainedAddressBook . cardsAddress ) ; s1Raffle = Raffle . at ( wallet , godUnchainedAddressBook . seasonOne . raffleAddress ) ; s1Sale = S1Sale . at ( wallet , godUnchainedAddressBook . seasonOne . saleAddress ) ; s1Cap = S1Cap . at ( wallet , godUnchainedAddressBook . seasonOne . capAddress ) ; epicPack = EpicPack . at ( wallet , godUnchainedAddressBook . seasonOne . epicPackAddress ) ; rarePack = RarePack . at ( wallet , godUnchainedAddressBook . seasonOne . rarePackAddress ) ; shinyPack = ShinyPack . at ( wallet , godUnchainedAddressBook . seasonOne . shinyPackAddress ) ; rareChest = Chest . at ( wallet , godUnchainedAddressBook . seasonOne . rareChestAddress ) ; legendaryChest = Chest . at ( wallet , godUnchainedAddressBook . seasonOne . legendaryChestAddress ) ; oracle = ManualOracle . at ( wallet , platformAddressBook . manualOracleAddress ) ; creditCard = CreditCardEscrow . at ( wallet , platformAddressBook . creditCardAddress ) ; legendaryPack = LegendaryPack . at ( wallet , godUnchainedAddressBook . seasonOne . legendaryPackAddress ) ; } ) ; it ( 'should have the correct owner set' , async ( ) => { } ) ; it ( 'should have the correct SKUs set' , async ( ) => { expect ( await rarePack . sku ( ) ) . toBe ( GU_S1_RARE_PACK_SKU ) ; expect ( await shinyPack . sku ( ) ) . toBe ( GU_S1_SHINY_PACK_SKU ) ; expect ( await legendaryPack . sku ( ) ) . toBe ( GU_S1_LEGENDARY_PACK_SKU ) ; expect ( await epicPack . sku ( ) ) . toBe ( GU_S1_EPIC_PACK_SKU ) ; expect ( ( await legendaryChest . sku ( ) ) ) . toBe ( GU_S1_LEGENDARY_CHEST_SKU ) ; expect ( ( await rareChest . sku ( ) ) ) . toBe ( GU_S1_RARE_CHEST_SKU ) ; } ) ; it ( 'should have the correct prices set' , async ( ) => { expect ( ( await rarePack . price ( ) ) . toNumber ( ) ) . toBe ( GU_S1_RARE_PACK_PRICE ) ; expect ( ( await shinyPack . price ( ) ) . toNumber ( ) ) . toBe ( GU_S1_SHINY_PACK_PRICE ) ; expect ( ( await legendaryPack . price ( ) ) . toNumber ( ) ) . toBe ( GU_S1_LEGENDARY_PACK_PRICE ) ; expect ( ( await epicPack . price ( ) ) . toNumber ( ) ) . toBe ( GU_S1_EPIC_PACK_PRICE ) ; expect ( ( await legendaryChest . price ( ) ) . toNumber ( ) ) . toBe ( GU_S1_LEGENDARY_CHEST_PRICE ) ; expect ( ( await rareChest . price ( ) ) . toNumber ( ) ) . toBe ( GU_S1_RARE_CHEST_PRICE ) ; } ) ; it ( 'should have the correct caps set' , async ( ) => { expect ( ( await s1Cap . cap ( ) ) . toNumber ( ) ) . toBe ( GU_S1_CAP ) ; } ) ; it ( 'should have the correct seasons' , async ( ) => { for ( let i = 0 ; i < 6 ; i ++ ) { let s = await cards . seasons ( i ) ; } } ) ; } ) ;