Skip to content

Commit

Permalink
Merge pull request #1011 from alleslabs/release/v1.7.1
Browse files Browse the repository at this point in the history
Cut Release v1.7.1
  • Loading branch information
evilpeach authored Jul 8, 2024
2 parents 47160a2 + b68c18d commit 02f2749
Show file tree
Hide file tree
Showing 95 changed files with 1,090 additions and 838 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Bug fixes

## v1.7.1

### Features

- [#1008](https://github.com/alleslabs/celatone-frontend/pull/1008) Support both new, old DB schema for NFTs
- [#994](https://github.com/alleslabs/celatone-frontend/pull/994) Add Sequencer, Mesa tier and TierSwitcher component

### Improvements

- [#1013](https://github.com/alleslabs/celatone-frontend/pull/1013) Remove unused validator's delegator count, disable Sentry
- [#1012](https://github.com/alleslabs/celatone-frontend/pull/1012) Move modules, balances query to LCD

### Bug fixes

- [#1004](https://github.com/alleslabs/celatone-frontend/pull/1004) Fix empty string moniker
- [#1010](https://github.com/alleslabs/celatone-frontend/pull/1010) Fix signer info sign mode multi type validation

## v1.7.0

### Features
Expand Down
1 change: 1 addition & 0 deletions sentry.client.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ Sentry.init({
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
// that it will also get attached to your source maps
integrations: [new CaptureConsole({ levels: ["error"] })],
enabled: false,
});
1 change: 1 addition & 0 deletions sentry.edge.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ Sentry.init({
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
// that it will also get attached to your source maps
integrations: [new CaptureConsole({ levels: ["error"] })],
enabled: false,
});
1 change: 1 addition & 0 deletions sentry.server.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ Sentry.init({
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
// that it will also get attached to your source maps
integrations: [new CaptureConsole({ levels: ["error"] })],
enabled: false,
});
97 changes: 97 additions & 0 deletions src/config/chain/initia.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable sonarjs/no-duplicate-string */
import { wallets as initiaWallets } from "@cosmos-kit/initia";
import { wallets as keplrWallets } from "@cosmos-kit/keplr";

Expand All @@ -7,6 +8,102 @@ const INITIA_DECODER =
"https://initia-api-jiod42ec2q-as.a.run.app/decode_module";

export const INITIA_CHAIN_CONFIGS: ChainConfigs = {
"tomcat-1-lite": {
tier: "lite",
chain: "initia",
registryChainName: "blackwingtestnet",
prettyName: "Blackwing Testnet Lite",
lcd: "https://maze-rest-18bdff44-3aa4-425e-9bc0-06a2afa40af8.ase1-prod.newmetric.xyz",
rpc: "https://maze-rpc-18bdff44-3aa4-425e-9bc0-06a2afa40af8.ase1-prod.newmetric.xyz",
indexer: "https://tomcat-1-graphql.alleslabs.dev/v1/graphql",
wallets: [...initiaWallets, ...keplrWallets],
features: {
faucet: {
enabled: false,
},
wasm: {
enabled: false,
},
move: {
enabled: true,
moduleMaxFileSize: 1_048_576,
decodeApi: INITIA_DECODER,
verify: "",
},
pool: {
enabled: false,
},
publicProject: {
enabled: true,
},
gov: {
enabled: false,
},
nft: {
enabled: true,
},
},
gas: {
gasPrice: {
tokenPerGas: 0.151,
denom:
"l2/aee375e9d0b181f0d9d3a49f9a3d1d6b05d62b0ac81f8c92b9282afa4213d884",
},
gasAdjustment: 1.5,
maxGasLimit: 25_000_000,
},
extra: {
isValidatorExternalLink: null,
},
},
"tomcat-1-sequencer": {
tier: "sequencer",
chain: "initia",
registryChainName: "blackwingtestnet",
prettyName: "Blackwing Testnet Sequencer",
lcd: "https://maze-rest-18bdff44-3aa4-425e-9bc0-06a2afa40af8.ase1-prod.newmetric.xyz",
rpc: "https://maze-rpc-18bdff44-3aa4-425e-9bc0-06a2afa40af8.ase1-prod.newmetric.xyz",
indexer: "https://tomcat-1-graphql.alleslabs.dev/v1/graphql",
wallets: [...initiaWallets, ...keplrWallets],
features: {
faucet: {
enabled: false,
},
wasm: {
enabled: false,
},
move: {
enabled: true,
moduleMaxFileSize: 1_048_576,
decodeApi: INITIA_DECODER,
verify: "",
},
pool: {
enabled: false,
},
publicProject: {
enabled: true,
},
gov: {
enabled: false,
},
nft: {
enabled: true,
},
},
gas: {
gasPrice: {
tokenPerGas: 0.151,
denom:
"l2/aee375e9d0b181f0d9d3a49f9a3d1d6b05d62b0ac81f8c92b9282afa4213d884",
},
gasAdjustment: 1.5,
maxGasLimit: 25_000_000,
},
extra: {
isValidatorExternalLink: null,
},
},
"initiation-1": {
tier: "full",
chain: "initia",
Expand Down
2 changes: 1 addition & 1 deletion src/config/chain/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type GovConfig =
type NftConfig = { enabled: boolean };

export interface ChainConfig {
tier: "lite" | "full";
tier: "lite" | "mesa" | "sequencer" | "full";
chain: string;
registryChainName: string;
prettyName: string;
Expand Down
13 changes: 10 additions & 3 deletions src/lib/app-provider/hooks/useConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { useInternalNavigate } from "./useInternalNavigate";

const TierMap: Record<ChainConfig["tier"], number> = {
lite: 0,
// new metric 1
full: 2,
mesa: 1,
sequencer: 2,
full: 3,
};

export const useTierConfig = (
Expand All @@ -26,7 +27,13 @@ export const useTierConfig = (
if (TierMap[tier] < TierMap[minTier])
navigate({ pathname: "/", replace: true });

return tier;
return {
tier,
isFullTier: tier === "full",
isLiteTier: tier === "lite",
isMesaTier: tier === "mesa",
isSequencerTier: tier === "sequencer",
};
};

type Features = ChainConfig["features"];
Expand Down
10 changes: 6 additions & 4 deletions src/lib/components/ExplorerLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ export type LinkType =
| "code_id"
| "block_height"
| "proposal_id"
| "pool_id"
| "proposal_id";
| "pool_id";

interface ExplorerLinkProps extends FlexProps {
value: string;
Expand Down Expand Up @@ -104,6 +103,7 @@ const LinkRender = ({
isInternal,
hrefLink,
textValue,
fallbackValue,
isEllipsis,
textVariant,
openNewTab,
Expand All @@ -112,6 +112,7 @@ const LinkRender = ({
isInternal: boolean;
hrefLink: string;
textValue: string;
fallbackValue: string;
isEllipsis: boolean;
textVariant: TextProps["variant"];
openNewTab: Option<boolean>;
Expand All @@ -121,12 +122,12 @@ const LinkRender = ({
<Text
variant={textVariant}
fontFamily="mono"
color="secondary.main"
color={textValue.length ? "secondary.main" : "text.disabled"}
className={isEllipsis ? "ellipsis" : undefined}
pointerEvents={hrefLink ? "auto" : "none"}
wordBreak={{ base: "break-all", md: "inherit" }}
>
{textValue}
{textValue || fallbackValue}
</Text>
);

Expand Down Expand Up @@ -210,6 +211,7 @@ export const ExplorerLink = ({
isInternal={isUndefined(externalLink)}
hrefLink={link}
textValue={textValue}
fallbackValue={copyValue || value}
isEllipsis={textFormat === "ellipsis"}
textVariant={textVariant}
openNewTab={openNewTab}
Expand Down
29 changes: 29 additions & 0 deletions src/lib/components/TierSwitcher.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { useTierConfig } from "lib/app-provider";

interface TierSwitcherProps {
full: React.ReactNode;
sequencer?: React.ReactNode;
mesa?: React.ReactNode;
lite: React.ReactNode;
}

export const TierSwitcher = ({
full,
lite,
mesa,
sequencer,
}: TierSwitcherProps) => {
const { tier } = useTierConfig();

switch (tier) {
case "full":
return full;
case "sequencer":
return sequencer ?? lite;
case "mesa":
return mesa ?? lite;
case "lite":
default:
return lite;
}
};
2 changes: 1 addition & 1 deletion src/lib/components/ValidatorBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const ValidatorBadge = ({
{isMobile && hasLabel && <MobileLabel label="Validator" />}
<ExplorerLink
type="validator_address"
value={validator.moniker || validator.validatorAddress}
value={validator.moniker ?? validator.validatorAddress}
copyValue={validator.validatorAddress}
externalLink={
isValidatorExternalLink
Expand Down
13 changes: 5 additions & 8 deletions src/lib/components/ValidatorImage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { ImageProps } from "@chakra-ui/react";
import { Image, SkeletonCircle } from "@chakra-ui/react";
import { isUndefined } from "lodash";

import { useValidatorImage } from "lib/services/validator";
import type { Nullable, Validator } from "lib/types";
Expand All @@ -15,11 +16,9 @@ export const ValidatorImage = ({
}: ValidatorImageProps) => {
const { data, isLoading } = useValidatorImage(validator);

if (
!validator ||
!validator.moniker ||
validator.moniker.trim().length === 0
) {
if (isLoading) return <SkeletonCircle boxSize={boxSize} minWidth={boxSize} />;

if (!validator || isUndefined(data) || isUndefined(validator.moniker)) {
return (
<Image
boxSize={boxSize}
Expand All @@ -31,9 +30,7 @@ export const ValidatorImage = ({
);
}

return isLoading || !data ? (
<SkeletonCircle boxSize={boxSize} minWidth={boxSize} />
) : (
return (
<Image
boxSize={boxSize}
minWidth={boxSize}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/modal/account/SaveNewAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function SaveNewAccountModal({
publicDescription,
}: SaveNewAccountModalProps) {
const { constants } = useCelatoneApp();
const isFullTier = useTierConfig() === "full";
const { isFullTier } = useTierConfig();
const { user: exampleUserAddress } = useExampleAddresses();
const { isSomeValidAddress } = useValidateAddress();
const formatAddresses = useFormatAddresses();
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/select-code/CodeSelectSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const CodeSelectSection = <T extends FieldValues>({
setCodeHash,
status,
}: CodeSelectSectionProps<T>) => {
const isFullTier = useTierConfig() === "full";
const { isFullTier } = useTierConfig();
const [method, setMethod] = useState<"select-existing" | "fill-manually">(
isFullTier ? "select-existing" : "fill-manually"
);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/select-contract/ContractListDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const ContractListDetail = ({
onContractSelect,
isReadOnly = false,
}: ContractListDetailProps) => {
const isFullTier = useTierConfig() === "full";
const { isFullTier } = useTierConfig();
const dataFull = useAdminByContractAddresses(
isReadOnly || !isFullTier
? []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const ContractsTableRowCTA = ({
showLastUpdate = true,
}: ContractsTableRowCTAProps) => {
const { address } = useCurrentChain();
const isFullTier = useTierConfig() === "full";
const { isFullTier } = useTierConfig();
const navigate = useInternalNavigate();

const isAdmin = !!address && address === contractInfo.admin;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/table/modules/ModulesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const ModulesTable = ({
<MobileTableContainer>
{modules.map((module) => (
<ModulesTableMobileCard
key={module.moduleName + module.address}
key={module.address + module.moduleName}
moduleInfo={module}
/>
))}
Expand All @@ -46,7 +46,7 @@ export const ModulesTable = ({
/>
{modules.map((module) => (
<ModulesTableRow
key={module.moduleName + module.address}
key={module.address + module.moduleName}
moduleInfo={module}
templateColumns={templateColumns}
isPublishedModules={isPublishedModules}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/table/proposals/ProposalsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const ProposalsTable = ({
isLoading,
emptyState,
}: ProposalsTableProps) => {
const isFullTier = useTierConfig() === "full";
const { isFullTier } = useTierConfig();
const isMobile = useMobile();

if (isLoading) return <Loading />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const ProposalsTableHeader = ({
templateColumns,
boxShadow,
}: ProposalsTableHeaderProps) => {
const isFullTier = useTierConfig() === "full";
const { isFullTier } = useTierConfig();

// TODO - Revisit split columnsWidth
const columnsWidth = templateColumns?.toString().split(" ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface ProposalsTableMobileCardProps {
export const ProposalsTableMobileCard = ({
proposal,
}: ProposalsTableMobileCardProps) => {
const isFullTier = useTierConfig() === "full";
const { isFullTier } = useTierConfig();
const navigate = useInternalNavigate();

const onCardSelect = (proposalId: number) =>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/table/proposals/ProposalsTableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const ProposalsTableRow = ({
templateColumns,
boxShadow,
}: ProposalsTableRowProps) => {
const isFullTier = useTierConfig() === "full";
const { isFullTier } = useTierConfig();
const navigate = useInternalNavigate();

const onRowSelect = (proposalId: number) =>
Expand Down
Loading

0 comments on commit 02f2749

Please sign in to comment.