Skip to content

Commit

Permalink
Merge pull request #518 from alleslabs/fix-contract-migration
Browse files Browse the repository at this point in the history
fix: contract migration
  • Loading branch information
songwongtp committed Sep 6, 2023
2 parents dbdfe54 + aca7cc4 commit 1daa9ac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Bug fixes

- [#518](https://github.com/alleslabs/celatone-frontend/pull/518) Fix contract migration remark data
- [#511](https://github.com/alleslabs/celatone-frontend/pull/511) Fix tx relation selector incorrect option
- [#499](https://github.com/alleslabs/celatone-frontend/pull/499) Fix responsive for icns and add cl pool icon
- [#506](https://github.com/alleslabs/celatone-frontend/pull/506) Fix simulation bugs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { GridProps } from "@chakra-ui/react";
import { Flex, Grid, Text } from "@chakra-ui/react";
import { capitalize } from "lodash";

import { useGetAddressType } from "lib/app-provider";
import { ExplorerLink } from "lib/components/ExplorerLink";
import { TableRow, CodeNameCell } from "lib/components/table";
import type { ContractMigrationHistory } from "lib/types";
import { RemarkOperation } from "lib/types";
import { dateFromNow, formatUTC, getCw2Info } from "lib/utils";

interface MigrationRowProps {
Expand All @@ -19,17 +19,10 @@ export const RemarkRender = ({
remark: ContractMigrationHistory["remark"];
}) => {
const { operation, type, value } = remark;
const isGovernance = type === "governance";
if (
operation === RemarkOperation.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS
)
return <Text variant="body2">Genesis</Text>;

const prefix =
operation === RemarkOperation.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT
? "Instantiate"
: "Migrate";
if (type === "genesis") return <Text variant="body2">Genesis</Text>;

const isGovernance = type === "governance";
const prefix = capitalize(operation.split("_").pop());
const textFormat = isGovernance ? "normal" : "truncate";
return (
<Flex
Expand Down
2 changes: 1 addition & 1 deletion src/lib/types/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export enum RemarkOperation {
CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS = "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS",
}

type RemarkType = "governance" | "transaction";
type RemarkType = "genesis" | "governance" | "transaction";

export interface ContractHistoryRemark {
operation: RemarkOperation;
Expand Down

0 comments on commit 1daa9ac

Please sign in to comment.