mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-02 18:34:09 +00:00
cleanup
This commit is contained in:
parent
dcf94a0924
commit
8ebd125575
@ -147,8 +147,6 @@ export function receiveContractProfileError() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function fetchContract(contractName) {
|
export function fetchContract(contractName) {
|
||||||
console.dir("== fetchContract");
|
|
||||||
console.dir(contractName);
|
|
||||||
return {
|
return {
|
||||||
type: FETCH_CONTRACT,
|
type: FETCH_CONTRACT,
|
||||||
contractName
|
contractName
|
||||||
@ -156,8 +154,6 @@ export function fetchContract(contractName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function receiveContract(contract) {
|
export function receiveContract(contract) {
|
||||||
console.dir("== receiveContract");
|
|
||||||
console.dir(contract);
|
|
||||||
return {
|
return {
|
||||||
type: RECEIVE_CONTRACT,
|
type: RECEIVE_CONTRACT,
|
||||||
contract
|
contract
|
||||||
@ -165,7 +161,6 @@ export function receiveContract(contract) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function receiveContractError() {
|
export function receiveContractError() {
|
||||||
console.dir("== receiveContractError");
|
|
||||||
return {
|
return {
|
||||||
type: RECEIVE_CONTRACT_ERROR
|
type: RECEIVE_CONTRACT_ERROR
|
||||||
};
|
};
|
||||||
|
@ -66,8 +66,6 @@ export function webSocketBlockHeader() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function fetchContract(contractName) {
|
export function fetchContract(contractName) {
|
||||||
console.dir("api: fetchContract");
|
|
||||||
console.dir(contractName);
|
|
||||||
return axios.get('http://localhost:8000/embark-api/contract/' + contractName);
|
return axios.get('http://localhost:8000/embark-api/contract/' + contractName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,7 +74,5 @@ export function fetchContracts() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function fetchContractProfile(contractName) {
|
export function fetchContractProfile(contractName) {
|
||||||
console.dir("api: fetchContractProfile");
|
|
||||||
console.dir(contractName);
|
|
||||||
return axios.get('http://localhost:8000/embark-api/profiler/' + contractName);
|
return axios.get('http://localhost:8000/embark-api/profiler/' + contractName);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import {
|
|||||||
Card,
|
Card,
|
||||||
Table
|
Table
|
||||||
} from "tabler-react";
|
} from "tabler-react";
|
||||||
import {Link} from 'react-router-dom';
|
|
||||||
|
|
||||||
const Contract = ({contract}) => (
|
const Contract = ({contract}) => (
|
||||||
<Page.Content title="Contract">
|
<Page.Content title="Contract">
|
||||||
|
@ -5,7 +5,6 @@ import {
|
|||||||
Card,
|
Card,
|
||||||
Table
|
Table
|
||||||
} from "tabler-react";
|
} from "tabler-react";
|
||||||
import {Link} from 'react-router-dom';
|
|
||||||
|
|
||||||
const ContractProfile = ({contract}) => (
|
const ContractProfile = ({contract}) => (
|
||||||
<Page.Content title={contract.name}>
|
<Page.Content title={contract.name}>
|
||||||
@ -27,7 +26,7 @@ const ContractProfile = ({contract}) => (
|
|||||||
contract.methods.map((method) => {
|
contract.methods.map((method) => {
|
||||||
return ([
|
return ([
|
||||||
{content: method.name},
|
{content: method.name},
|
||||||
{content: (method.payable == true).toString()},
|
{content: (method.payable === true).toString()},
|
||||||
{content: method.mutability},
|
{content: method.mutability},
|
||||||
{content: `(${method.inputs.map((x) => x.type).join(',')})`},
|
{content: `(${method.inputs.map((x) => x.type).join(',')})`},
|
||||||
{content: `(${method.outputs.map((x) => x.type).join(',')})`},
|
{content: `(${method.outputs.map((x) => x.type).join(',')})`},
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import {RECEIVE_CONTRACT_PROFILE, RECEIVE_CONTRACT_PROFILE_ERROR} from "../actions";
|
import {RECEIVE_CONTRACT_PROFILE, RECEIVE_CONTRACT_PROFILE_ERROR} from "../actions";
|
||||||
|
|
||||||
export default function contractProfile(state = {}, action) {
|
export default function contractProfile(state = {}, action) {
|
||||||
console.dir("** reducer contract profile");
|
|
||||||
console.dir(arguments);
|
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case RECEIVE_CONTRACT_PROFILE:
|
case RECEIVE_CONTRACT_PROFILE:
|
||||||
return Object.assign({}, state, {data: action.contractProfile.data});
|
return Object.assign({}, state, {data: action.contractProfile.data});
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import {RECEIVE_CONTRACT, RECEIVE_CONTRACT_ERROR} from "../actions";
|
import {RECEIVE_CONTRACT, RECEIVE_CONTRACT_ERROR} from "../actions";
|
||||||
|
|
||||||
export default function contract(state = {}, action) {
|
export default function contract(state = {}, action) {
|
||||||
console.dir("** reducer");
|
|
||||||
console.dir(arguments);
|
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case RECEIVE_CONTRACT:
|
case RECEIVE_CONTRACT:
|
||||||
return Object.assign({}, state, {data: action.contract.data});
|
return Object.assign({}, state, {data: action.contract.data});
|
||||||
|
@ -4,8 +4,6 @@ import {Route, Switch} from 'react-router-dom';
|
|||||||
import HomeContainer from './containers/HomeContainer';
|
import HomeContainer from './containers/HomeContainer';
|
||||||
import AccountsContainer from './containers/AccountsContainer';
|
import AccountsContainer from './containers/AccountsContainer';
|
||||||
import ContractsContainer from './containers/ContractsContainer';
|
import ContractsContainer from './containers/ContractsContainer';
|
||||||
import ContractContainer from './containers/ContractContainer';
|
|
||||||
import ContractProfileContainer from './containers/ContractProfileContainer';
|
|
||||||
import NoMatch from './components/NoMatch';
|
import NoMatch from './components/NoMatch';
|
||||||
import ExplorerLayout from './components/ExplorerLayout';
|
import ExplorerLayout from './components/ExplorerLayout';
|
||||||
import ProcessesLayout from './components/ProcessesLayout';
|
import ProcessesLayout from './components/ProcessesLayout';
|
||||||
|
@ -128,19 +128,15 @@ export default function *root() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function *fetchContract(action) {
|
export function *fetchContract(action) {
|
||||||
console.dir("** fetchContract");
|
|
||||||
console.dir(action);
|
|
||||||
try {
|
try {
|
||||||
const contract = yield call(api.fetchContract, action.contractName);
|
const contract = yield call(api.fetchContract, action.contractName);
|
||||||
yield put(actions.receiveContract(contract));
|
yield put(actions.receiveContract(contract));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.dir(e);
|
|
||||||
yield put(actions.receiveContractError());
|
yield put(actions.receiveContractError());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function *watchFetchContract() {
|
export function *watchFetchContract() {
|
||||||
console.dir("** watchFetchContract");
|
|
||||||
yield takeEvery(actions.FETCH_CONTRACT, fetchContract);
|
yield takeEvery(actions.FETCH_CONTRACT, fetchContract);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,19 +154,15 @@ export function *watchFetchContracts() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function *fetchContractProfile(action) {
|
export function *fetchContractProfile(action) {
|
||||||
console.dir("** fetchContractProfile");
|
|
||||||
console.dir(action);
|
|
||||||
try {
|
try {
|
||||||
const profile = yield call(api.fetchContractProfile, action.contractName);
|
const profile = yield call(api.fetchContractProfile, action.contractName);
|
||||||
yield put(actions.receiveContractProfile(profile));
|
yield put(actions.receiveContractProfile(profile));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.dir(e);
|
|
||||||
yield put(actions.receiveContractError());
|
yield put(actions.receiveContractError());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function *watchFetchContractProfile() {
|
export function *watchFetchContractProfile() {
|
||||||
console.dir("** watchFetchContractProfile");
|
|
||||||
yield takeEvery(actions.FETCH_CONTRACT_PROFILE, fetchContractProfile);
|
yield takeEvery(actions.FETCH_CONTRACT_PROFILE, fetchContractProfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user