diff --git a/src/datatokens/Datatokens.ts b/src/datatokens/Datatokens.ts index a90f1435..d8d1201d 100644 --- a/src/datatokens/Datatokens.ts +++ b/src/datatokens/Datatokens.ts @@ -189,11 +189,15 @@ export class DataTokens { } /** - * - * @param dataTokenAddress - * @param account + * + * @param dataTokenAddress + * @param account */ - public async allowance(dataTokenAddress: string, owner: string, spender: string): Promise { + public async allowance( + dataTokenAddress: string, + owner: string, + spender: string + ): Promise { const datatoken = new this.web3.eth.Contract( this.datatokensABI, dataTokenAddress, diff --git a/test/integration/Marketplaceflow.test.ts b/test/integration/Marketplaceflow.test.ts index 51a859ed..94909b61 100644 --- a/test/integration/Marketplaceflow.test.ts +++ b/test/integration/Marketplaceflow.test.ts @@ -98,19 +98,21 @@ describe('Marketplace flow', () => { }) it('Alice allows marketplace to sell her datatokens', async () => { - await datatoken.approve( - tokenAddress, - marketplace.getId(), - marketplaceAllowance, - alice.getId() - ).then(async () => { - const allowance = await datatoken.allowance( + await datatoken + .approve( tokenAddress, - alice.getId(), - marketplace.getId() + marketplace.getId(), + marketplaceAllowance, + alice.getId() ) - assert(allowance.toString() === marketplaceAllowance.toString()) - }) + .then(async () => { + const allowance = await datatoken.allowance( + tokenAddress, + alice.getId(), + marketplace.getId() + ) + assert(allowance.toString() === marketplaceAllowance.toString()) + }) }) it('Marketplace withdraw Alice tokens from allowance', async () => { @@ -119,11 +121,17 @@ describe('Marketplace flow', () => { alice.getId(), marketplace.getId() ) - await datatoken.transferFrom(tokenAddress, alice.getId(), allowance, marketplace.getId()) - .then(async () => { - const marketplaceBalance = await datatoken.balance(tokenAddress, marketplace.getId()) - assert(marketplaceBalance.toString() === marketplaceAllowance.toString()) - }) + await datatoken + .transferFrom(tokenAddress, alice.getId(), allowance, marketplace.getId()) + .then(async () => { + const marketplaceBalance = await datatoken.balance( + tokenAddress, + marketplace.getId() + ) + assert( + marketplaceBalance.toString() === marketplaceAllowance.toString() + ) + }) }) // it('Marketplace posts asset for sale', async () => { @@ -136,7 +144,12 @@ describe('Marketplace flow', () => { // }) it('Bob gets datatokens', async () => { - const ts = await datatoken.transfer(tokenAddress, bob.getId(), transferAmount, alice.getId()) + const ts = await datatoken.transfer( + tokenAddress, + bob.getId(), + transferAmount, + alice.getId() + ) transactionId = ts.transactionHash })