rename name to className so it matches contract object

This commit is contained in:
Jonathan Rainville 2018-08-10 12:57:37 -04:00 committed by Pascal Precht
parent 4526c1a871
commit c7f9a374f2
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
5 changed files with 5 additions and 9 deletions

View File

@ -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()}
]); ]);

View File

@ -26,7 +26,7 @@ function mapStateToProps(state) {
} }
ContractsContainer.propTypes = { ContractsContainer.propTypes = {
contracts: PropTypes.object, contracts: PropTypes.array,
fetchContracts: PropTypes.func fetchContracts: PropTypes.func
}; };

View File

@ -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);

View File

@ -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) {

View File

@ -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