Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcos20 committed Jul 14, 2020
1 parent 1b2522e commit ed8eef6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
15 changes: 4 additions & 11 deletions src/datatokens/Datatokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,8 @@ export class DataTokens {
amount: number,
account: Account
): Promise<string> {
const datatoken = new this.web3.eth.Contract(
this.datatokensABI,
dataTokenAddress,
{ from: account }
)
const trxReceipt = await datatoken.methods
.transfer(toAddress, this.web3.utils.toWei(String(amount)))
.send()
return trxReceipt
const weiAmount = this.web3.utils.toWei(String(amount))
return this.transferWei(dataTokenAddress, toAddress, weiAmount, account)
}

/**
Expand Down Expand Up @@ -232,8 +225,8 @@ export class DataTokens {
dataTokenAddress,
{ from: account }
)
const trxReceipt = await datatoken.methods.balanceOf(account).call()
return this.web3.utils.fromWei(trxReceipt)
const balance = await datatoken.methods.balanceOf(account).call()
return this.web3.utils.fromWei(balance)
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/ocean/Assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ export class Assets extends Instantiable {
*/
public async createAccessServiceAttributes(
creator: Account,
dtCost: string,
cost: string,
datePublished: string,
timeout: number = 0
): Promise<ServiceAccess> {
Expand All @@ -383,7 +383,7 @@ export class Assets extends Instantiable {
main: {
creator: creator.getId(),
datePublished,
cost: dtCost,
cost,
timeout: timeout,
name: 'dataAssetAccess'
}
Expand Down

0 comments on commit ed8eef6

Please sign in to comment.