Fix tests (CI) and debug button (#1443)

* fix(embark/tests): fix tests by not tampering with the contract addr

* fix(cockpit/debugButtong): use deployedAddress instead address
This commit is contained in:
Jonathan Rainville 2019-03-15 16:22:24 -04:00 committed by André Medeiros
parent f60c979c75
commit b1881719e0
3 changed files with 4 additions and 16 deletions

View File

@ -17,9 +17,9 @@ class DebugButton extends React.Component {
this.props.contracts &&
this.props.contracts.find(contract => {
const address = this.props.transaction.to || this.props.transaction.address;
return contract.address &&
return contract.deployedAddress &&
address &&
(contract.address.toLowerCase() === address.toLowerCase());
(contract.deployedAddress.toLowerCase() === address.toLowerCase());
}));
}

View File

@ -771,11 +771,11 @@ class BlockchainConnector {
this.contractsSubscriptions = [];
this.events.request("contracts:list", (_err, contractsList) => {
contractsList.forEach(contractObject => {
if (!contractObject.address){
if (!contractObject.deployedAddress){
return;
}
const contract = this.ContractObject({abi: contractObject.abiDefinition, address: contractObject.address});
const contract = this.ContractObject({abi: contractObject.abiDefinition, address: contractObject.deployedAddress});
const eventEmitter = contract.events.allEvents();
this.contractsSubscriptions.push(eventEmitter);
eventEmitter.on('data', (data) => {

View File

@ -61,18 +61,6 @@ class ContractsManager {
});
self.events.on("deploy:contract:deployed", (_contract) => {
const contract = self.contracts[_contract.className];
if (contract) {
if (!_contract.address && _contract.deployedAddress) {
_contract.address = _contract.deployedAddress;
}
if (!contract.address && _contract.address) {
contract.address = _contract.address;
}
if (!contract.deployedAddress && _contract.deployedAddress) {
contract.deployedAddress = _contract.deployedAddress;
}
}
self.events.emit('contractsState', self.contractsState());
});