Skip to content
This repository has been archived by the owner on Feb 27, 2021. It is now read-only.

Commit

Permalink
fix: simplify transaction container
Browse files Browse the repository at this point in the history
  • Loading branch information
shanejonas committed Jun 24, 2019
1 parent d93bf0b commit f729790
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/containers/Transaction.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
import * as React from "react";
import TxView from "../components/TxView";

import usePromise from "react-use-promise";
import TxView from "../components/TxView";
import erpc from "../erpc";

export default function TransactionContainer(props: any) {
const { hash } = props.match.params;
const [{ transaction, receipt }, error, state] = usePromise(async () => {
return {
transaction: await erpc.eth_getBlockTransactionCountByHash(hash),
receipt: await erpc.eth_getTransactionReceipt(hash),
};
}, []);
const [{ transaction, receipt }, error, state] = usePromise(async () => ({
transaction: await erpc.eth_getBlockTransactionCountByHash(props.match.params),
receipt: await erpc.eth_getTransactionReceipt(props.match.params),
}), []);

return (
<TxView tx={transaction} receipt={receipt} />
);
return (<TxView tx={transaction} receipt={receipt} />);
}

0 comments on commit f729790

Please sign in to comment.