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

wip fix mint test

This commit is contained in:
arsenyjin 2020-06-09 13:06:01 +02:00
parent 746d88eca8
commit 2124ff2c82
4 changed files with 61 additions and 14 deletions

View File

@ -55,12 +55,12 @@ export class DataTokens {
})
// Invoke createToken function of the contract
const trxReceipt = await factory.methods
.createToken(metaDataStoreURI)
.send({
from: account,
gas: estGas+1,
gasPrice: '30000000000000'
})
.createToken(metaDataStoreURI)
.send({
from: account,
gas: estGas+1,
gasPrice: '3000000000'
})
let tokenAddress = null
try {
@ -108,13 +108,27 @@ export class DataTokens {
amount: number,
toAddress?: string
): Promise<string> {
const address = toAddress || account.getId()
const address = toAddress || account
const datatoken = new this.web3.eth.Contract(
this.datatokensABI,
dataTokenAddress,
{ from: account.getId() }
{ from: account }
)
const trxReceipt = await datatoken.methods.mint(address, amount).send()
let fee = await this.web3.utils.toWei('1', 'ether')
const estGas = await datatoken.methods.mint(address, amount)
.estimateGas(function(err, estGas){
return estGas
})
const trxReceipt = await datatoken.methods.mint(address, amount)
.send({
value:fee,
from:account,
gas: estGas*2,
gasPrice: '3000000000'
})
return trxReceipt
}

View File

@ -1,4 +1,27 @@
[
{
"constant": true,
"inputs": [
{
"name": "str1",
"type": "string"
},
{
"name": "str2",
"type": "string"
}
],
"name": "concatenateStrings",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "pure",
"type": "function"
},
{
"constant": true,
"inputs": [

View File

@ -129,4 +129,4 @@
"stateMutability": "nonpayable",
"type": "function"
}
]
]

File diff suppressed because one or more lines are too long