mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-13 07:36:21 +00:00
display gas cost of each test
This commit is contained in:
parent
c6d8cc80e4
commit
ada4d737ae
@ -25,6 +25,10 @@ class EmbarkSpec extends Base {
|
|||||||
|
|
||||||
console.log(fmt, receipt.className, receipt.gasUsed);
|
console.log(fmt, receipt.className, receipt.gasUsed);
|
||||||
}
|
}
|
||||||
|
function onBlockHeader(blockHeader) {
|
||||||
|
self.stats.totalGasCost += blockHeader.gasUsed;
|
||||||
|
self.stats.test.gasUsed += blockHeader.gasUsed;
|
||||||
|
}
|
||||||
|
|
||||||
function onBlockHeader(blockHeader) {
|
function onBlockHeader(blockHeader) {
|
||||||
self.stats.totalGasCost += blockHeader.gasUsed;
|
self.stats.totalGasCost += blockHeader.gasUsed;
|
||||||
|
@ -94,9 +94,22 @@ class Test {
|
|||||||
this.sim = getSimulator();
|
this.sim = getSimulator();
|
||||||
}
|
}
|
||||||
this.web3.setProvider(this.sim.provider(this.simOptions));
|
this.web3.setProvider(this.sim.provider(this.simOptions));
|
||||||
|
this.subscribeToPendingTransactions();
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
subscribeToPendingTransactions() {
|
||||||
|
const self = this;
|
||||||
|
if (self.logsSubscription) {
|
||||||
|
self.logsSubscription.unsubscribe();
|
||||||
|
}
|
||||||
|
self.logsSubscription = self.web3.eth
|
||||||
|
.subscribe('newBlockHeaders')
|
||||||
|
.on("data", function (blockHeader) {
|
||||||
|
self.engine.events.emit('block:header', blockHeader);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
initDeployServices() {
|
initDeployServices() {
|
||||||
this.engine.startService("web3", {
|
this.engine.startService("web3", {
|
||||||
web3: this.web3
|
web3: this.web3
|
||||||
|
Loading…
x
Reference in New Issue
Block a user