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

add some debug

This commit is contained in:
alexcos20 2020-07-15 23:09:57 -07:00
parent f7a1a4cb44
commit 210e32579d
2 changed files with 8 additions and 9 deletions

View File

@ -57,18 +57,19 @@ export class BalancerContractHandler {
public async SdeployContracts(minter: string) { public async SdeployContracts(minter: string) {
let estGas let estGas
console.log('Trying to deploy SPool')
console.log("Bytecode size:"+this.poolBytecode.length)
estGas = await this.pool estGas = await this.pool
.deploy({ .deploy({
data: this.poolBytecode, data: this.poolBytecode,
arguments: [] arguments: []
}) })
.estimateGas({ from: minter, gas: 9007199254740991 }, function (err, estGas) { .estimateGas({ from: minter, gas: 9007199254740991 }, function (err, estGas) {
if (err) console.log('DeployContracts: ' + err) if (err) console.log('Pool deploy estimate gas: ' + err)
return estGas return estGas
}) })
// deploy the contract and get it's address // deploy the contract and get it's address
console.log('estGas:' + estGas) console.log('Pool estGas:' + estGas)
this.poolAddress = await this.pool this.poolAddress = await this.pool
.deploy({ .deploy({
data: this.poolBytecode, data: this.poolBytecode,
@ -82,7 +83,7 @@ export class BalancerContractHandler {
.then(function (contract) { .then(function (contract) {
return contract.options.address return contract.options.address
}) })
console.log("Pool deployed:"+this.poolAddress)
estGas = await this.factory estGas = await this.factory
.deploy({ .deploy({
data: this.factoryBytecode, data: this.factoryBytecode,

View File

@ -89,14 +89,12 @@ describe('Balancer flow', () => {
) )
await OceanPoolContracts.getAccounts() await OceanPoolContracts.getAccounts()
owner = OceanPoolContracts.accounts[0] owner = OceanPoolContracts.accounts[0]
console.log('Owner:' + owner)
await OceanPoolContracts.deployContracts(owner) await OceanPoolContracts.deployContracts(owner)
OceanPoolFactoryAddress = OceanPoolContracts.factoryAddress OceanPoolFactoryAddress = OceanPoolContracts.factoryAddress
assert(OceanPoolFactoryAddress !== null) assert(OceanPoolFactoryAddress !== null)
}) })
it('Deploy Spool/SFactory', async () => {
it('Deploy SFactory', async () => {
const SContracts = new BalancerContractHandler( const SContracts = new BalancerContractHandler(
SFactory.abi, SFactory.abi,
SFactory.bytecode, SFactory.bytecode,
@ -106,7 +104,7 @@ describe('Balancer flow', () => {
) )
await SContracts.getAccounts() await SContracts.getAccounts()
owner = SContracts.accounts[0] owner = SContracts.accounts[0]
console.log('Owner:' + owner)
await SContracts.SdeployContracts(owner) await SContracts.SdeployContracts(owner)
const SFactoryAddress = SContracts.factoryAddress const SFactoryAddress = SContracts.factoryAddress
assert(SFactoryAddress !== null) assert(SFactoryAddress !== null)