rename name to className so it matches contract object
This commit is contained in:
parent
4526c1a871
commit
c7f9a374f2
|
@ -24,7 +24,7 @@ const Contracts = ({contracts}) => (
|
||||||
bodyItems={
|
bodyItems={
|
||||||
contracts.map((contract) => {
|
contracts.map((contract) => {
|
||||||
return ([
|
return ([
|
||||||
{content: <Link to={`contracts/${contract.name}`}>{contract.name}</Link>},
|
{content: <Link to={`contracts/${contract.className}`}>{contract.className}</Link>},
|
||||||
{content: contract.address},
|
{content: contract.address},
|
||||||
{content: contract.deploy.toString()}
|
{content: contract.deploy.toString()}
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -26,7 +26,7 @@ function mapStateToProps(state) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ContractsContainer.propTypes = {
|
ContractsContainer.propTypes = {
|
||||||
contracts: PropTypes.object,
|
contracts: PropTypes.array,
|
||||||
fetchContracts: PropTypes.func
|
fetchContracts: PropTypes.func
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ const filtrer = {
|
||||||
return index === self.findIndex((t) => t.name === process.name);
|
return index === self.findIndex((t) => t.name === process.name);
|
||||||
},
|
},
|
||||||
contracts: function(contract, index, self) {
|
contracts: function(contract, index, self) {
|
||||||
return index === self.findIndex((t) => t.name === contract.name);
|
return index === self.findIndex((t) => t.className === contract.className);
|
||||||
},
|
},
|
||||||
accounts: function(account, index, self) {
|
accounts: function(account, index, self) {
|
||||||
return index === self.findIndex((t) => t.address === account.address);
|
return index === self.findIndex((t) => t.address === account.address);
|
||||||
|
|
|
@ -51,7 +51,7 @@ export function getContracts(state) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getContract(state, contractName) {
|
export function getContract(state, contractName) {
|
||||||
return state.entities.contracts.find((contract => contract.name === contractName));
|
return state.entities.contracts.find((contract => contract.className === contractName));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getContractProfile(state, contractName) {
|
export function getContractProfile(state, contractName) {
|
||||||
|
|
|
@ -63,10 +63,6 @@ class ContractsManager {
|
||||||
self.events.emit('contractsState', self.contractsState());
|
self.events.emit('contractsState', self.contractsState());
|
||||||
});
|
});
|
||||||
|
|
||||||
self.events.setCommandHandler("contracts:contract", (contractName, cb) => {
|
|
||||||
cb(self.getContract(contractName));
|
|
||||||
});
|
|
||||||
|
|
||||||
self.events.setCommandHandler("contracts:all", (contractName, cb) => {
|
self.events.setCommandHandler("contracts:all", (contractName, cb) => {
|
||||||
let contracts = self.listContracts();
|
let contracts = self.listContracts();
|
||||||
let results = [];
|
let results = [];
|
||||||
|
@ -76,7 +72,7 @@ class ContractsManager {
|
||||||
|
|
||||||
results.push({
|
results.push({
|
||||||
index: i,
|
index: i,
|
||||||
name: contract.className,
|
className: contract.className,
|
||||||
deploy: contract.deploy,
|
deploy: contract.deploy,
|
||||||
error: contract.error,
|
error: contract.error,
|
||||||
address: contract.deployedAddress
|
address: contract.deployedAddress
|
||||||
|
|
Loading…
Reference in New Issue