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 18:01:25 +02:00
parent 4b50824162
commit edf2c81eae

View File

@ -21,33 +21,25 @@ describe('Dispenser flow', () => {
let datatoken: Datatoken let datatoken: Datatoken
let dtAddress: string let dtAddress: string
const CAP_AMOUNT = '1000000' const nftData: NftCreateData = {
const NFT_NAME = '72120Bundle' name: '72120Bundle',
const NFT_SYMBOL = '72Bundle' 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 = {
name: NFT_NAME,
symbol: NFT_SYMBOL,
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: user1, mpFeeAddress: user1,
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 () => {
@ -56,10 +48,10 @@ describe('Dispenser flow', () => {
user1 = accounts[3] user1 = accounts[3]
user2 = accounts[4] user2 = accounts[4]
NFT_DATA.owner = factoryOwner nftData.owner = factoryOwner
ERC_PARAMS.minter = factoryOwner ercParams.minter = factoryOwner
ERC_PARAMS.paymentCollector = user2 ercParams.paymentCollector = user2
ERC_PARAMS.mpFeeAddress = user1 ercParams.mpFeeAddress = user1
}) })
it('should deploy contracts', async () => { it('should deploy contracts', async () => {
@ -76,8 +68,8 @@ describe('Dispenser flow', () => {
const txReceipt = await nftFactory.createNftWithErc20( const txReceipt = await nftFactory.createNftWithErc20(
factoryOwner, factoryOwner,
NFT_DATA, nftData,
ERC_PARAMS ercParams
) )
expect(txReceipt.events.NFTCreated.event === 'NFTCreated') expect(txReceipt.events.NFTCreated.event === 'NFTCreated')