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:
parent
746d88eca8
commit
2124ff2c82
@ -59,7 +59,7 @@ export class DataTokens {
|
|||||||
.send({
|
.send({
|
||||||
from: account,
|
from: account,
|
||||||
gas: estGas+1,
|
gas: estGas+1,
|
||||||
gasPrice: '30000000000000'
|
gasPrice: '3000000000'
|
||||||
})
|
})
|
||||||
|
|
||||||
let tokenAddress = null
|
let tokenAddress = null
|
||||||
@ -108,13 +108,27 @@ export class DataTokens {
|
|||||||
amount: number,
|
amount: number,
|
||||||
toAddress?: string
|
toAddress?: string
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
const address = toAddress || account.getId()
|
const address = toAddress || account
|
||||||
const datatoken = new this.web3.eth.Contract(
|
const datatoken = new this.web3.eth.Contract(
|
||||||
this.datatokensABI,
|
this.datatokensABI,
|
||||||
dataTokenAddress,
|
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
|
return trxReceipt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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,
|
"constant": true,
|
||||||
"inputs": [
|
"inputs": [
|
||||||
|
@ -129,4 +129,4 @@
|
|||||||
"stateMutability": "nonpayable",
|
"stateMutability": "nonpayable",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
}
|
}
|
||||||
]
|
]
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user