Fix jsonrpc method rename on block txs

This commit is contained in:
Willian Mitsuda 2021-07-21 23:00:09 -03:00
parent 35374f0e92
commit ea21605f84

View File

@ -5,7 +5,11 @@ import queryString from "query-string";
import StandardFrame from "./StandardFrame";
import BlockTransactionHeader from "./BlockTransactionHeader";
import BlockTransactionResults from "./BlockTransactionResults";
import { ProcessedTransaction } from "./types";
import {
InternalOperation,
OperationType,
ProcessedTransaction,
} from "./types";
import { PAGE_SIZE } from "./params";
import { RuntimeContext } from "./useRuntime";
@ -72,14 +76,18 @@ const BlockTransactions: React.FC = () => {
const internalChecks = await Promise.all(
responses.map(async (res) => {
const r = await provider.send("ots_getTransactionTransfers", [
res.hash,
]);
for (const t of r) {
const r: InternalOperation[] = await provider.send(
"ots_getInternalOperations",
[res.hash]
);
for (const op of r) {
if (op.type !== OperationType.TRANSFER) {
continue;
}
if (
res.miner &&
(res.miner === ethers.utils.getAddress(t.from) ||
res.miner === ethers.utils.getAddress(t.to))
(res.miner === ethers.utils.getAddress(op.from) ||
res.miner === ethers.utils.getAddress(op.to))
) {
return true;
}