1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00

simplify constants

This commit is contained in:
Miquel A. Cabot 2022-04-28 17:50:13 +02:00
parent 689823d281
commit 604ede0ee8

View File

@ -38,37 +38,28 @@ describe('SideStaking unit test', () => {
let daiContract: Contract let daiContract: Contract
let usdcContract: Contract let usdcContract: Contract
const DAI_AMOUNT = 2000
const USDC_AMOUNT = 10000
const VESTED_BLOCKS = 2500000 const VESTED_BLOCKS = 2500000
const VESTING_AMOUNT = '10000' const VESTING_AMOUNT = '10000'
const CAP_AMOUNT = '1000000'
const NFT_NAME = '72120Bundle'
const NFT_SYMBOL = '72Bundle'
const NFT_TOKEN_URI = 'https://oceanprotocol.com/nft/'
const ERC20_NAME = 'ERC20B1'
const ERC20_SYMBOL = 'ERC20DT1Symbol'
const FEE_ZERO = '0'
const NFT_DATA: NftCreateData = { const nftData: NftCreateData = {
name: NFT_NAME, name: '72120Bundle',
symbol: NFT_SYMBOL, symbol: '72Bundle',
templateIndex: 1, templateIndex: 1,
tokenURI: NFT_TOKEN_URI, tokenURI: 'https://oceanprotocol.com/nft/',
transferable: true, transferable: true,
owner: factoryOwner owner: factoryOwner
} }
const ERC_PARAMS: Erc20CreateParams = { const ercParams: Erc20CreateParams = {
templateIndex: 1, templateIndex: 1,
minter: factoryOwner, minter: factoryOwner,
paymentCollector: user2, paymentCollector: user2,
mpFeeAddress: factoryOwner, mpFeeAddress: factoryOwner,
feeToken: ZERO_ADDRESS, feeToken: ZERO_ADDRESS,
cap: CAP_AMOUNT, cap: '1000000',
feeAmount: FEE_ZERO, feeAmount: '0',
name: ERC20_NAME, name: 'ERC20B1',
symbol: ERC20_SYMBOL symbol: 'ERC20DT1Symbol'
} }
before(async () => { before(async () => {
@ -77,10 +68,10 @@ describe('SideStaking unit test', () => {
user1 = accounts[1] user1 = accounts[1]
user2 = accounts[2] user2 = accounts[2]
NFT_DATA.owner = factoryOwner nftData.owner = factoryOwner
ERC_PARAMS.minter = factoryOwner ercParams.minter = factoryOwner
ERC_PARAMS.paymentCollector = user2 ercParams.paymentCollector = user2
ERC_PARAMS.mpFeeAddress = factoryOwner ercParams.mpFeeAddress = factoryOwner
}) })
it('should deploy contracts', async () => { it('should deploy contracts', async () => {
@ -102,7 +93,7 @@ describe('SideStaking unit test', () => {
factoryOwner, factoryOwner,
contracts.daiAddress, contracts.daiAddress,
contracts.erc721FactoryAddress, contracts.erc721FactoryAddress,
DAI_AMOUNT.toString() '2000'
) )
assert( assert(
@ -113,7 +104,7 @@ describe('SideStaking unit test', () => {
factoryOwner, factoryOwner,
contracts.erc721FactoryAddress contracts.erc721FactoryAddress
) )
) >= DAI_AMOUNT ) >= 2000
) )
await approve( await approve(
@ -121,7 +112,7 @@ describe('SideStaking unit test', () => {
factoryOwner, factoryOwner,
contracts.usdcAddress, contracts.usdcAddress,
contracts.erc721FactoryAddress, contracts.erc721FactoryAddress,
USDC_AMOUNT.toString() '10000'
) )
assert( assert(
@ -132,7 +123,7 @@ describe('SideStaking unit test', () => {
factoryOwner, factoryOwner,
contracts.erc721FactoryAddress contracts.erc721FactoryAddress
) )
) >= USDC_AMOUNT ) >= 10000
) )
}) })
@ -160,8 +151,8 @@ describe('SideStaking unit test', () => {
const txReceipt = await nftFactory.createNftErc20WithPool( const txReceipt = await nftFactory.createNftErc20WithPool(
factoryOwner, factoryOwner,
NFT_DATA, nftData,
ERC_PARAMS, ercParams,
poolParams poolParams
) )
@ -398,8 +389,8 @@ describe('SideStaking unit test', () => {
const txReceipt = await nftFactory.createNftErc20WithPool( const txReceipt = await nftFactory.createNftErc20WithPool(
factoryOwner, factoryOwner,
NFT_DATA, nftData,
ERC_PARAMS, ercParams,
poolParams poolParams
) )