Skip to content

Commit

Permalink
Merge pull request #459 from alleslabs/fix/contract-address-to-accoun…
Browse files Browse the repository at this point in the history
…t-id

fix: change contract addr to id in contract txs
  • Loading branch information
evilpeach committed Aug 3, 2023
2 parents b4af521 + ef3345d commit 21efc62
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Bug fixes

- [#459](https://github.com/alleslabs/celatone-frontend/pull/459) Fix contract txs by using contract account id instead of contract address
- [#456](https://github.com/alleslabs/celatone-frontend/pull/456) Fix pool count chip in pool transaction table
- [#454](https://github.com/alleslabs/celatone-frontend/pull/454) Fix contract selection loading state for other folders
- [#452](https://github.com/alleslabs/celatone-frontend/pull/452) Fix public project data on the account details and code details page still remains when switching network
Expand Down
8 changes: 4 additions & 4 deletions src/lib/pages/contract-details/components/tables/TxsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ import { EmptyState } from "lib/components/state";
import { TransactionsTable } from "lib/components/table";
import { DEFAULT_TX_FILTERS } from "lib/data";
import { useTxsByAddressPagination } from "lib/services/txService";
import type { ContractAddr, Option } from "lib/types";
import type { Option } from "lib/types";

interface TxsTableProps {
contractAddress: ContractAddr;
contractAccountId: Option<number | null>;
scrollComponentId: string;
totalData: Option<number>;
refetchCount: () => void;
}

export const TxsTable = ({
contractAddress,
contractAccountId,
scrollComponentId,
totalData,
refetchCount,
Expand All @@ -41,8 +41,8 @@ export const TxsTable = ({
});

const { data: transactions, isLoading } = useTxsByAddressPagination(
contractAddress,
undefined,
contractAccountId,
"",
DEFAULT_TX_FILTERS,
undefined,
Expand Down
4 changes: 3 additions & 1 deletion src/lib/pages/contract-details/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { Loading } from "lib/components/Loading";
import PageContainer from "lib/components/PageContainer";
import { InvalidState } from "lib/components/state";
import { useContractDetailsTableCounts } from "lib/model/contract";
import { useAccountId } from "lib/services/accountService";
import { AmpEvent, AmpTrack } from "lib/services/amplitude";
import type { ContractAddr } from "lib/types";
import { getFirstQueryParam, jsonPrettify } from "lib/utils";
Expand Down Expand Up @@ -50,6 +51,7 @@ const ContractDetailsBody = observer(
refetchTransactions,
refetchRelatedProposals,
} = useContractDetailsTableCounts(contractAddress);
const { data: contractAccountId } = useAccountId(contractAddress);
const isMobile = useMobile();
if (!contractData.contractDetail) return <InvalidContract />;

Expand Down Expand Up @@ -127,7 +129,7 @@ const ContractDetailsBody = observer(
<TabPanels>
<TabPanel p={0}>
<TxsTable
contractAddress={contractAddress}
contractAccountId={contractAccountId}
scrollComponentId={tableHeaderId}
totalData={tableCounts.transactionsCount}
refetchCount={refetchTransactions}
Expand Down

2 comments on commit 21efc62

@vercel
Copy link

@vercel vercel bot commented on 21efc62 Aug 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 21efc62 Aug 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.