mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-01-24 06:08:48 +00:00
display gas cost of each test
This commit is contained in:
parent
8da1fca0bc
commit
239a182404
@ -26,6 +26,10 @@ class EmbarkSpec extends Base {
|
||||
|
||||
console.log(fmt, receipt.className, receipt.gasUsed);
|
||||
}
|
||||
function onBlockHeader(blockHeader) {
|
||||
self.stats.totalGasCost += blockHeader.gasUsed;
|
||||
self.stats.test.gasUsed += blockHeader.gasUsed;
|
||||
}
|
||||
|
||||
function onBlockHeader(blockHeader) {
|
||||
if(!self.listenForGas) {
|
||||
|
@ -140,6 +140,18 @@ class Test {
|
||||
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() {
|
||||
this.engine.startService("web3", {
|
||||
web3: this.web3
|
||||
|
Loading…
x
Reference in New Issue
Block a user