Hide ENS Transaction log

This commit is contained in:
Anthony Laibe 2018-08-23 09:23:51 +01:00
parent fa551f67a3
commit 607c2657c4
2 changed files with 21 additions and 11 deletions

View File

@ -8,7 +8,11 @@ class ConsoleListener {
this.addressToContract = [];
this.contractsConfig = embark.config.contractsConfig;
this.contractsDeployed = false;
this.outputDone = false;
this._listenForLogRequests();
this.events.on('outputDone', () => {
this.outputDone = true;
});
this.events.on("contractsDeployed", () => {
this.contractsDeployed = true;
@ -44,7 +48,8 @@ class ConsoleListener {
this.addressToContract[address] = {
name: contract.className,
functions: funcSignatures
functions: funcSignatures,
silent: contract.silent
};
}
});
@ -58,14 +63,19 @@ class ConsoleListener {
if (!this.contractsDeployed) return;
let {address, data, transactionHash, blockNumber, gasUsed, status} = request;
if (!this.addressToContract[address]) {
const contract = this.addressToContract[address];
if (!contract) {
this._updateContractList();
return;
}
if (!this.addressToContract[address]) return;
const {name, silent} = contract;
if (silent && !this.outputDone) {
return;
}
const name = this.addressToContract[address].name;
const func = this.addressToContract[address].functions[data.substring(0, 10)];
const func = contract.functions[data.substring(0, 10)];
const functionName = func.functionName;
const decodedParameters = utils.decodeParams(func.abi.inputs, data.substring(10));

View File

@ -291,12 +291,12 @@ class ENS {
"args": ["$ENSRegistry", rootNode],
"onDeploy": [
`ENSRegistry.methods.setOwner('${rootNode}', web3.eth.defaultAccount).send({from: web3.eth.defaultAccount}).then(() => {
ENSRegistry.methods.setResolver('${rootNode}', "$Resolver").send({from: web3.eth.defaultAccount});
var reverseNode = web3.utils.soliditySha3(web3.eth.defaultAccount.toLowerCase().substr(2) + '${reverseAddrSuffix}');
ENSRegistry.methods.setResolver(reverseNode, "$Resolver").send({from: web3.eth.defaultAccount});
Resolver.methods.setAddr('${rootNode}', web3.eth.defaultAccount).send({from: web3.eth.defaultAccount});
Resolver.methods.setName(reverseNode, '${this.registration.rootDomain}').send({from: web3.eth.defaultAccount});
})`
ENSRegistry.methods.setResolver('${rootNode}', "$Resolver").send({from: web3.eth.defaultAccount});
var reverseNode = web3.utils.soliditySha3(web3.eth.defaultAccount.toLowerCase().substr(2) + '${reverseAddrSuffix}');
ENSRegistry.methods.setResolver(reverseNode, "$Resolver").send({from: web3.eth.defaultAccount});
Resolver.methods.setAddr('${rootNode}', web3.eth.defaultAccount).send({from: web3.eth.defaultAccount});
Resolver.methods.setName(reverseNode, '${this.registration.rootDomain}').send({from: web3.eth.defaultAccount});
})`
]
};
}