Skip to content

Commit

Permalink
Merge pull request #334 from alleslabs/update/change-to-osmo-test-5
Browse files Browse the repository at this point in the history
feat: change osmo-test-4 to osmo-test-5
  • Loading branch information
evilpeach committed May 16, 2023
2 parents ba4f083 + d857250 commit f35a09a
Show file tree
Hide file tree
Showing 11 changed files with 97 additions and 82 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Improvements

- [#334](https://github.com/alleslabs/celatone-frontend/pull/334) Change `osmo-test-4` to `osmo-test-5`, fix tx service when accountId is undefined
- [#311](https://github.com/alleslabs/celatone-frontend/pull/311) Refine css styling
- [#328](https://github.com/alleslabs/celatone-frontend/pull/328) Add proposal and pool page in sidebar navigation
- [#298](https://github.com/alleslabs/celatone-frontend/pull/298) Show deposit/voting period from gov params and add minimum required alert
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"axios": "^1.1.3",
"big.js": "^6.2.1",
"camelcase": "^7.0.0",
"chain-registry": "^1.3.1",
"chain-registry": "1.13.0",
"cosmjs-types": "^0.7.2",
"dayjs": "^1.11.6",
"framer-motion": "^7.6.12",
Expand Down
10 changes: 5 additions & 5 deletions src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {
} from "types";

export const CELATONE_FALLBACK_GAS_PRICE: Record<string, ChainGasPrice> = {
osmosistestnet: {
osmosistestnet5: {
denom: "uosmo",
gasPrice: "0.025" as U<Token>,
},
Expand All @@ -32,7 +32,7 @@ export const CELATONE_APP_CONTRACT_ADDRESS = (
): CelatoneContractAddress => {
switch (chainName) {
case "osmosis":
case "osmosistestnet":
case "osmosistestnet5":
return {
example:
"osmo1p0pxllmqjgl2tefy7grypt34jdpdltg3ka98n8unnl322wqps7lqtu576h" as ContractAddr,
Expand All @@ -55,7 +55,7 @@ export const CELATONE_APP_HUMAN_ADDRESS = (
): CelatoneHumanAddress => {
switch (chainName) {
case "osmosis":
case "osmosistestnet":
case "osmosistestnet5":
return {
example: "osmo14wk9zecqam9jsac7xwtf8e349ckquzzlx9k8c3" as HumanAddr,
};
Expand All @@ -73,7 +73,7 @@ export const CELATONE_APP_HUMAN_ADDRESS = (

export const FALLBACK_LCD_ENDPOINT: Record<string, string> = {
osmosis: "https://lcd.osmosis.zone/",
osmosistestnet: "https://lcd-test.osmosis.zone/",
osmosistestnet5: "https://lcd.osmotest5.osmosis.zone/",
terra2: "https://phoenix-lcd.terra.dev/",
terra2testnet: "https://pisco-lcd.terra.dev/",
};
Expand All @@ -94,7 +94,7 @@ export const CELATONE_API_ENDPOINT = "https://celatone-api.alleslabs.dev";

export const getChainApiPath = (chainName: string) => {
switch (chainName) {
case "osmosistestnet":
case "osmosistestnet5":
case "osmosis":
return "osmosis";
case "terra2":
Expand Down
6 changes: 3 additions & 3 deletions src/lib/app-fns/explorer/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const explorerMap: Record<string, string> = {
osmosis: "https://www.mintscan.io/osmosis",
osmosistestnet: "https://testnet.mintscan.io/osmosis-testnet",
osmosistestnet5: "https://testnet.mintscan.io/osmosis-testnet",
terra2: "https://terrasco.pe/mainnet",
terra2testnet: "https://terrasco.pe/testnet",
};
Expand All @@ -9,7 +9,7 @@ export const getExplorerProposalUrl = (chainName: string) => {
let pathSuffix = "";
switch (chainName) {
case "osmosis":
case "osmosistestnet":
case "osmosistestnet5":
pathSuffix = "proposals";
break;
case "terra2":
Expand All @@ -26,7 +26,7 @@ export const getExplorerValidatorUrl = (chainName: string) => {
let pathSuffix = "";
switch (chainName) {
case "osmosis":
case "osmosistestnet":
case "osmosistestnet5":
pathSuffix = "validators";
break;
case "terra2":
Expand Down
2 changes: 1 addition & 1 deletion src/lib/app-provider/hooks/useAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const addressLengthMap: {
50: "validator_address",
63: "contract_address",
},
osmosistestnet: {
osmosistestnet5: {
43: "user_address",
50: "validator_address",
63: "contract_address",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/app-provider/query-client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const GRAPH_URL: Record<string, string> = {
* Revisit graphql for terra2 mainnet and osmosis mainnet
*/
osmosis: "https://osmosis-mainnet-graphql.alleslabs.dev/v1/graphql",
osmosistestnet: "https://osmosis-testnet-graphql.alleslabs.dev/v1/graphql",
osmosistestnet5: "https://osmo-test-5-graphql.alleslabs.dev/v1/graphql",
terra2testnet: "https://terra-testnet-graphql.alleslabs.dev/v1/graphql",
};

Expand Down
4 changes: 2 additions & 2 deletions src/lib/data/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ export const TERRA_CHAINS: Chain = {

export const OSMOSIS_CHAINS: Chain = {
mainnet: "osmosis",
testnet: "osmosistestnet",
testnet: "osmosistestnet5",
};

// TODO: Remove this when mitosis is ready
export const MITOSIS_CHAINS: Chain = {
mainnet: "osmosis",
testnet: "osmosistestnet",
testnet: "osmosistestnet5",
};

export const getSupportedChainNames = (): SupportedChain[] => {
Expand Down
10 changes: 5 additions & 5 deletions src/lib/layout/navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ const Navbar = observer(({ isExpand, setIsExpand }: NavbarProps) => {
slug: "/proposals",
icon: "proposal",
},
{
name: "Osmosis Pools",
slug: "/pools",
icon: "pool",
},
// {
// name: "Osmosis Pools",
// slug: "/pools",
// icon: "pool",
// },
],
},
{
Expand Down
96 changes: 46 additions & 50 deletions src/lib/services/txService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,55 +85,52 @@ export const useTxsByAddressPagination = (
isSigner,
});

const queryFn = useCallback(
async () =>
indexerGraphClient
.request(getTxsByAddressPagination, {
expression,
offset,
pageSize,
})
.then(({ account_transactions }) =>
account_transactions.map<Transaction>((transaction) => ({
hash: parseTxHash(transaction.transaction.hash),
messages: snakeToCamel(
transaction.transaction.messages
) as Message[],
sender: transaction.transaction.account.address as Addr,
isSigner: transaction.is_signer,
height: transaction.block.height,
created: parseDate(transaction.block.timestamp),
success: transaction.transaction.success,
actionMsgType: getActionMsgType([
transaction.transaction.is_execute,
transaction.transaction.is_instantiate,
transaction.transaction.is_send,
transaction.transaction.is_store_code,
transaction.transaction.is_migrate,
transaction.transaction.is_update_admin,
transaction.transaction.is_clear_admin,
]),
furtherAction: getMsgFurtherAction(
transaction.transaction.messages.length,
{
isExecute: transaction.transaction.is_execute,
isInstantiate: transaction.transaction.is_instantiate,
isSend: transaction.transaction.is_send,
isUpload: transaction.transaction.is_store_code,
isMigrate: transaction.transaction.is_migrate,
isUpdateAdmin: transaction.transaction.is_update_admin,
isClearAdmin: transaction.transaction.is_clear_admin,
isIbc: transaction.transaction.is_ibc,
},
transaction.transaction.success,
transaction.is_signer
),
isIbc: transaction.transaction.is_ibc,
isInstantiate: transaction.transaction.is_instantiate,
}))
),
[expression, indexerGraphClient, offset, pageSize]
);
const queryFn = useCallback(async () => {
if (!address && !accountId) return [];
return indexerGraphClient
.request(getTxsByAddressPagination, {
expression,
offset,
pageSize,
})
.then(({ account_transactions }) =>
account_transactions.map<Transaction>((transaction) => ({
hash: parseTxHash(transaction.transaction.hash),
messages: snakeToCamel(transaction.transaction.messages) as Message[],
sender: transaction.transaction.account.address as Addr,
isSigner: transaction.is_signer,
height: transaction.block.height,
created: parseDate(transaction.block.timestamp),
success: transaction.transaction.success,
actionMsgType: getActionMsgType([
transaction.transaction.is_execute,
transaction.transaction.is_instantiate,
transaction.transaction.is_send,
transaction.transaction.is_store_code,
transaction.transaction.is_migrate,
transaction.transaction.is_update_admin,
transaction.transaction.is_clear_admin,
]),
furtherAction: getMsgFurtherAction(
transaction.transaction.messages.length,
{
isExecute: transaction.transaction.is_execute,
isInstantiate: transaction.transaction.is_instantiate,
isSend: transaction.transaction.is_send,
isUpload: transaction.transaction.is_store_code,
isMigrate: transaction.transaction.is_migrate,
isUpdateAdmin: transaction.transaction.is_update_admin,
isClearAdmin: transaction.transaction.is_clear_admin,
isIbc: transaction.transaction.is_ibc,
},
transaction.transaction.success,
transaction.is_signer
),
isIbc: transaction.transaction.is_ibc,
isInstantiate: transaction.transaction.is_instantiate,
}))
);
}, [accountId, address, expression, indexerGraphClient, offset, pageSize]);
return useQuery(
[
"transactions_by_address_pagination",
Expand All @@ -148,7 +145,6 @@ export const useTxsByAddressPagination = (
],
createQueryFnWithTimeout(queryFn),
{
enabled: !!address || !!accountId,
retry: 1,
refetchOnWindowFocus: false,
}
Expand Down
11 changes: 5 additions & 6 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { AppProvider } from "lib/app-provider/contexts/app";
import { Chakra } from "lib/components/Chakra";
import { MobileGuard } from "lib/components/MobileGuard";
import { CelatoneSeo } from "lib/components/Seo";
import { terra2testnet, terra2testnetAssets } from "lib/config/terra2testnet";
import Layout from "lib/layout";
import "lib/styles/globals.css";
import { StoreProvider } from "lib/providers/store";
Expand Down Expand Up @@ -64,17 +63,17 @@ const MyApp = ({ Component, pageProps }: AppProps) => {

<QueryClientProvider client={queryClient}>
<WalletProvider
chains={[...chains, terra2testnet]}
assetLists={[...assets, terra2testnetAssets]}
chains={chains}
assetLists={assets}
wallets={wallets}
endpointOptions={{
osmosis: {
rpc: ["https://rpc.osmosis.zone/"],
rest: ["https://lcd.osmosis.zone/"],
},
osmosistestnet: {
rpc: ["https://rpc-test.osmosis.zone/"],
rest: ["https://lcd-test.osmosis.zone/"],
osmosistestnet5: {
rpc: ["https://rpc.osmotest5.osmosis.zone/"],
rest: ["https://lcd.osmotest5.osmosis.zone/"],
},
terra2: {
rpc: ["https://terra-rpc.lavenderfive.com/"],
Expand Down
35 changes: 27 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,13 @@
dependencies:
regenerator-runtime "^0.13.10"

"@babel/runtime@^7.21.0":
version "7.21.5"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.21.5.tgz#8492dddda9644ae3bda3b45eabe87382caee7200"
integrity sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q==
dependencies:
regenerator-runtime "^0.13.11"

"@babel/template@^7.15.4", "@babel/template@^7.18.10":
version "7.18.10"
resolved "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz"
Expand Down Expand Up @@ -657,6 +664,13 @@
dependencies:
"@babel/runtime" "^7.19.4"

"@chain-registry/types@^0.16.0":
version "0.16.0"
resolved "https://registry.yarnpkg.com/@chain-registry/types/-/types-0.16.0.tgz#f76409186899a976d33693d7f458c33d71a66730"
integrity sha512-4j6vq2Vqn/nF+UBjvRPUVs6eM3+5rJ+dPmEWpd/OoNH3wTy1k6aoilcSTZRR//vGcI5EOVGsxhhJxUzo2qqweA==
dependencies:
"@babel/runtime" "^7.21.0"

"@chakra-ui/accordion@2.1.2":
version "2.1.2"
resolved "https://registry.npmjs.org/@chakra-ui/accordion/-/accordion-2.1.2.tgz"
Expand Down Expand Up @@ -4424,6 +4438,14 @@ capital-case@^1.0.4:
tslib "^2.0.3"
upper-case-first "^2.0.2"

chain-registry@1.13.0:
version "1.13.0"
resolved "https://registry.yarnpkg.com/chain-registry/-/chain-registry-1.13.0.tgz#375d7cbc7288f9915bde11758355a49c90395b4d"
integrity sha512-LFfKuEN2fV1QHJuTdqz1VmdiMGy87yAAYODy6i6/9tC+m6hwDroIPhR8iwuY4BxyJMZj9yr2cpD8m+8X8cZ/PA==
dependencies:
"@babel/runtime" "^7.21.0"
"@chain-registry/types" "^0.16.0"

chain-registry@^0.14.0:
version "0.14.0"
resolved "https://registry.npmjs.org/chain-registry/-/chain-registry-0.14.0.tgz"
Expand All @@ -4432,14 +4454,6 @@ chain-registry@^0.14.0:
"@babel/runtime" "^7.19.0"
"@chain-registry/types" "^0.11.0"

chain-registry@^1.3.1:
version "1.3.1"
resolved "https://registry.npmjs.org/chain-registry/-/chain-registry-1.3.1.tgz"
integrity sha512-/3rHkZiO4Q0Sah6gtYiIpPn4PCCat+eZDkbDkgtK6g4dzcUeZFcZXfsO6YhmGDfc5HSMC63CWUNjkLD2AG78Kw==
dependencies:
"@babel/runtime" "^7.19.4"
"@chain-registry/types" "^0.13.1"

chalk@3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4"
Expand Down Expand Up @@ -8414,6 +8428,11 @@ regenerator-runtime@^0.13.10:
resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.10.tgz"
integrity sha512-KepLsg4dU12hryUO7bp/axHAKvwGOCV0sGloQtpagJ12ai+ojVDqkeGSiRX1zlq+kjIMZ1t7gpze+26QqtdGqw==

regenerator-runtime@^0.13.11:
version "0.13.11"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9"
integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==

regenerator-runtime@^0.13.4:
version "0.13.9"
resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz"
Expand Down

1 comment on commit f35a09a

@vercel
Copy link

@vercel vercel bot commented on f35a09a May 16, 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.