Skip to content

Commit

Permalink
gas limit in ddo publish
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcos20 committed Oct 26, 2020
1 parent 9124160 commit 7d62aee
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/metadatacache/OnChainMetaDataCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { didZeroX, Logger } from '../utils'
// Using limited, compress-only version
// See https://github.com/LZMA-JS/LZMA-JS#but-i-dont-want-to-use-web-workers
import { LZMA } from 'lzma/src/lzma-c'
const DEFAULT_GAS_LIMIT = 1000000
const DEFAULT_GAS_LIMIT = 10000000
/**
* Provides an interface with Metadata Cache.
* Metadata Cache provides an off-chain database store for metadata about data assets.
Expand Down Expand Up @@ -106,6 +106,7 @@ export class OnChainMetadataCache {
return null
}
let estGas
/*
try {
estGas = await this.DDOContract.methods
.create(didZeroX(did), flags, data)
Expand All @@ -119,6 +120,7 @@ export class OnChainMetadataCache {
} catch (e) {
estGas = DEFAULT_GAS_LIMIT
}
try {
const trxReceipt = await this.DDOContract.methods
.create(didZeroX(did), flags, data)
Expand All @@ -128,6 +130,16 @@ export class OnChainMetadataCache {
this.logger.error(`ERROR: Failed to publish raw DDO : ${e.message}`)
return null
}
*/
try {
const trxReceipt = await this.DDOContract.methods
.create(didZeroX(did), flags, data)
.send({ from: consumerAccount, gas: DEFAULT_GAS_LIMIT })
return trxReceipt
} catch (e) {
this.logger.error(`ERROR: Failed to publish raw DDO : ${e.message}`)
return null
}
}

/**
Expand Down

0 comments on commit 7d62aee

Please sign in to comment.