This repository has been archived by the owner on Feb 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d93bf0b
commit f729790
Showing
1 changed file
with
6 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} />); | ||
} |