Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Barge c2d & latest contracts bump #1248

Merged
merged 12 commits into from
Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ jobs:
- name: Run Barge
working-directory: ${{ github.workspace }}/barge
run: |
bash -x start_ocean.sh --with-provider2 --no-dashboard 2>&1 > start_ocean.log &
bash -x start_ocean.sh --with-provider2 --no-dashboard --with-c2d 2>&1 > start_ocean.log &
cd .. && ./scripts/waitforcontracts.sh

- name: integration
run: npm run test:integration:cover
- name: docker logs
run: docker logs ocean_aquarius_1
run: docker logs ocean_aquarius_1 && docker logs ocean_provider_1 && docker logs ocean_provider2_1
if: ${{ failure() }}
- name: Upload coverage
uses: actions/upload-artifact@v2
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"web3": ">=1.3.5"
},
"dependencies": {
"@oceanprotocol/contracts": "^1.0.0-alpha.17",
"@oceanprotocol/contracts": "^1.0.0-alpha.18",
"bignumber.js": "^9.0.2",
"cross-fetch": "^3.1.4",
"crypto-js": "^4.0.0",
Expand Down
6 changes: 3 additions & 3 deletions scripts/waitforcontracts.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
while [ ! -f "${HOME}/.ocean/ocean-contracts/artifacts/ready" ]; do
#!/bin/bash
while [ ! -f "$HOME/.ocean/ocean-contracts/artifacts/ready" ] || [ ! -f "$HOME/.ocean/ocean-c2d/ready" ]; do
sleep 2
done

cat "barge/start_ocean.log"
#cat "barge/start_ocean.log"
ls -lh "${HOME}/.ocean/ocean-contracts/"
ls -lh "${HOME}/.ocean/ocean-contracts/artifacts/"
cat "${HOME}/.ocean/ocean-contracts/artifacts/address.json"
58 changes: 29 additions & 29 deletions src/factories/NFTFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -628,14 +628,14 @@ export class NftFactory {
}

/**
* Estimate gas cost for createNftWithErc method
* Estimate gas cost for createNftWithErc20 method
* @param address Caller address
* @param _NftCreateData input data for nft creation
* @param _ErcCreateData input data for erc20 creation
* @return {Promise<TransactionReceipt>} transaction receipt
*/

public async estGasCreateNftWithErc(
public async estGasCreateNftWithErc20(
address: string,
nftCreateData: NftCreateData,
ercParams: Erc20CreateParams
Expand All @@ -646,7 +646,7 @@ export class NftFactory {
try {
const ercCreateData = getErcCreationParams(ercParams)
estGas = await this.factory721.methods
.createNftWithErc(nftCreateData, ercCreateData)
.createNftWithErc20(nftCreateData, ercCreateData)
.estimateGas({ from: address }, (err, estGas) => (err ? gasLimitDefault : estGas))
} catch (e) {
estGas = gasLimitDefault
Expand All @@ -655,25 +655,25 @@ export class NftFactory {
}

/**
* @dev createNftWithErc
* @dev createNftWithErc20
* Creates a new NFT, then a ERC20,all in one call
* @param address Caller address
* @param _NftCreateData input data for nft creation
* @param _ErcCreateData input data for erc20 creation
* @return {Promise<TransactionReceipt>} transaction receipt
*/

public async createNftWithErc(
public async createNftWithErc20(
address: string,
nftCreateData: NftCreateData,
ercParams: Erc20CreateParams
): Promise<TransactionReceipt> {
const ercCreateData = getErcCreationParams(ercParams)

const estGas = await this.estGasCreateNftWithErc(address, nftCreateData, ercParams)
const estGas = await this.estGasCreateNftWithErc20(address, nftCreateData, ercParams)
// Invoke createToken function of the contract
const trxReceipt = await this.factory721.methods
.createNftWithErc(nftCreateData, ercCreateData)
.createNftWithErc20(nftCreateData, ercCreateData)
.send({
from: address,
gas: estGas + 1,
Expand All @@ -684,14 +684,14 @@ export class NftFactory {
}

/**
* Estimate gas cost for createNftErcWithPool method
* Estimate gas cost for createNftErc20WithPool method
* @param address Caller address
* @param nftCreateData input data for NFT Creation
* @param ercParams input data for ERC20 Creation
* @param poolParams input data for Pool Creation
* @return {Promise<TransactionReceipt>} transaction receipt
*/
public async estGasCreateNftErcWithPool(
public async estGasCreateNftErc20WithPool(
address: string,
nftCreateData: NftCreateData,
ercParams: Erc20CreateParams,
Expand All @@ -703,7 +703,7 @@ export class NftFactory {
const ercCreateData = getErcCreationParams(ercParams)
const poolData = getPoolCreationParams(poolParams)
estGas = await this.factory721.methods
.createNftErcWithPool(nftCreateData, ercCreateData, poolData)
.createNftWithErc20WithPool(nftCreateData, ercCreateData, poolData)
.estimateGas({ from: address }, (err, estGas) => (err ? gasLimitDefault : estGas))
} catch (e) {
estGas = gasLimitDefault
Expand All @@ -712,7 +712,7 @@ export class NftFactory {
}

/**
* @dev createNftErcWithPool
* @dev createNftErc20WithPool
* Creates a new NFT, then a ERC20, then a Pool, all in one call
* Use this carefully, because if Pool creation fails, you are still going to pay a lot of gas
* @param address Caller address
Expand All @@ -721,13 +721,13 @@ export class NftFactory {
* @param poolParams input data for Pool Creation
* @return {Promise<TransactionReceipt>} transaction receipt
*/
public async createNftErcWithPool(
public async createNftErc20WithPool(
address: string,
nftCreateData: NftCreateData,
ercParams: Erc20CreateParams,
poolParams: PoolCreationParams
): Promise<TransactionReceipt> {
const estGas = await this.estGasCreateNftErcWithPool(
const estGas = await this.estGasCreateNftErc20WithPool(
address,
nftCreateData,
ercParams,
Expand All @@ -738,7 +738,7 @@ export class NftFactory {

// Invoke createToken function of the contract
const trxReceipt = await this.factory721.methods
.createNftErcWithPool(nftCreateData, ercCreateData, poolData)
.createNftWithErc20WithPool(nftCreateData, ercCreateData, poolData)
.send({
from: address,
gas: estGas + 1,
Expand All @@ -748,14 +748,14 @@ export class NftFactory {
return trxReceipt
}

/** Estimate gas cost for createNftErcWithFixedRate method
/** Estimate gas cost for createNftErc20WithFixedRate method
* @param address Caller address
* @param nftCreateData input data for NFT Creation
* @param ercParams input data for ERC20 Creation
* @param freParams input data for FixedRate Creation
* @return {Promise<TransactionReceipt>} transaction receipt
*/
public async estGasCreateNftErcWithFixedRate(
public async estGasCreateNftErc20WithFixedRate(
address: string,
nftCreateData: NftCreateData,
ercParams: Erc20CreateParams,
Expand All @@ -770,7 +770,7 @@ export class NftFactory {

try {
estGas = await this.factory721.methods
.createNftErcWithFixedRate(nftCreateData, ercCreateData, fixedData)
.createNftWithErc20WithFixedRate(nftCreateData, ercCreateData, fixedData)
.estimateGas({ from: address }, (err, estGas) => (err ? gasLimitDefault : estGas))
} catch (e) {
estGas = gasLimitDefault
Expand All @@ -779,7 +779,7 @@ export class NftFactory {
}

/**
* @dev createNftErcWithFixedRate
* @dev createNftErc20WithFixedRate
* Creates a new NFT, then a ERC20, then a FixedRateExchange, all in one call
* Use this carefully, because if Fixed Rate creation fails, you are still going to pay a lot of gas
* @param address Caller address
Expand All @@ -788,7 +788,7 @@ export class NftFactory {
* @param freParams input data for FixedRate Creation
* @return {Promise<TransactionReceipt>} transaction receipt
*/
public async createNftErcWithFixedRate(
public async createNftErc20WithFixedRate(
address: string,
nftCreateData: NftCreateData,
ercParams: Erc20CreateParams,
Expand All @@ -797,7 +797,7 @@ export class NftFactory {
const ercCreateData = getErcCreationParams(ercParams)
const fixedData = getFreCreationParams(freParams)

const estGas = await this.estGasCreateNftErcWithFixedRate(
const estGas = await this.estGasCreateNftErc20WithFixedRate(
address,
nftCreateData,
ercParams,
Expand All @@ -806,7 +806,7 @@ export class NftFactory {

// Invoke createToken function of the contract
const trxReceipt = await this.factory721.methods
.createNftErcWithFixedRate(nftCreateData, ercCreateData, fixedData)
.createNftWithErc20WithFixedRate(nftCreateData, ercCreateData, fixedData)
.send({
from: address,
gas: estGas + 1,
Expand All @@ -816,14 +816,14 @@ export class NftFactory {
return trxReceipt
}

/** Estimate gas cost for createNftErcWithFixedRate method
/** Estimate gas cost for createNftErc20WithFixedRate method
* @param address Caller address
* @param nftCreateData input data for NFT Creation
* @param ercParams input data for ERC20 Creation
* @param dispenserParams input data for Dispenser Creation
* @return {Promise<TransactionReceipt>} transaction receipt
*/
public async estGasCreateNftErcWithDispenser(
public async estGasCreateNftErc20WithDispenser(
address: string,
nftCreateData: NftCreateData,
ercParams: Erc20CreateParams,
Expand All @@ -836,17 +836,17 @@ export class NftFactory {

try {
estGas = await this.factory721.methods
.createNftErcWithDispenser(nftCreateData, ercCreateData, dispenserParams)
.createNftWithErc20WithDispenser(nftCreateData, ercCreateData, dispenserParams)
.estimateGas({ from: address }, (err, estGas) => (err ? gasLimitDefault : estGas))
} catch (e) {
estGas = gasLimitDefault
LoggerInstance.error('Failed to estimate gas for createNftErcWithDispenser', e)
LoggerInstance.error('Failed to estimate gas for createNftErc20WithDispenser', e)
}
return estGas
}

/**
* @dev createNftErcWithDispenser
* @dev createNftErc20WithDispenser
* Creates a new NFT, then a ERC20, then a Dispenser, all in one call
* Use this carefully, because if Dispenser creation fails, you are still going to pay a lot of gas
* @param address Caller address
Expand All @@ -855,15 +855,15 @@ export class NftFactory {
* @param dispenserParams input data for Dispenser Creation
* @return {Promise<TransactionReceipt>} transaction receipt
*/
public async createNftErcWithDispenser(
public async createNftErc20WithDispenser(
address: string,
nftCreateData: NftCreateData,
ercParams: Erc20CreateParams,
dispenserParams: DispenserCreationParams
): Promise<TransactionReceipt> {
const ercCreateData = getErcCreationParams(ercParams)

const estGas = await this.estGasCreateNftErcWithDispenser(
const estGas = await this.estGasCreateNftErc20WithDispenser(
address,
nftCreateData,
ercParams,
Expand All @@ -872,7 +872,7 @@ export class NftFactory {

// Invoke createToken function of the contract
const trxReceipt = await this.factory721.methods
.createNftErcWithDispenser(nftCreateData, ercCreateData, dispenserParams)
.createNftWithErc20WithDispenser(nftCreateData, ercCreateData, dispenserParams)
.send({
from: address,
gas: estGas + 1,
Expand Down
Loading