chore: remove fiddle dead code

This commit is contained in:
Anthony Laibe 2018-11-07 11:35:36 +00:00
parent c25c644b5a
commit 0e7aad81aa
3 changed files with 2 additions and 14 deletions

View File

@ -5,7 +5,7 @@ import {contracts as contractsAction} from "../actions";
import Contracts from '../components/Contracts';
import DataWrapper from "../components/DataWrapper";
import {getContracts, getFiddleContracts} from "../reducers/selectors";
import {getContracts} from "../reducers/selectors";
class ContractsContainer extends Component {
componentDidMount() {
@ -18,11 +18,6 @@ class ContractsContainer extends Component {
<DataWrapper shouldRender={this.props.contracts.length > 0} {...this.props} render={({contracts}) => (
<Contracts contracts={contracts} />
)} />
<DataWrapper shouldRender={this.props.fiddleContracts.length > 0} {...this.props} render={({fiddleContracts}) => (
<React.Fragment>
<Contracts contracts={fiddleContracts} title="Fiddle contracts" />
</React.Fragment>
)} />
</React.Fragment>
);
}
@ -31,7 +26,6 @@ class ContractsContainer extends Component {
function mapStateToProps(state) {
return {
contracts: getContracts(state),
fiddleContracts: getFiddleContracts(state),
error: state.errorMessage,
loading: state.loading};
}

View File

@ -73,11 +73,7 @@ export function getContractEventsByContract(state, contractName) {
}
export function getContracts(state) {
return state.entities.contracts.filter(contract => !contract.isFiddle);
}
export function getFiddleContracts(state) {
return state.entities.contracts.filter(contract => contract.isFiddle);
return state.entities.contracts
}
export function getContract(state, contractName) {

View File

@ -75,7 +75,6 @@ class ContractsManager {
deploy: contract.deploy,
error: contract.error,
address: contract.deployedAddress,
isFiddle: Boolean(contract.isFiddle),
args: contract.args,
transactionHash: contract.transactionHash,
gas: contract.gas,
@ -201,7 +200,6 @@ class ContractsManager {
const contract = self.contracts[contractName];
contract.args = []; /* TODO: override contract.args */
contract.className = contractName;
contract.isFiddle = true;
self.events.request("deploy:contract", contract, (err) => {
next(err);
});