Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfixes/fix sandbox api usage #14

Merged
merged 5 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion api/src/providers/apiNodeProvider.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import fetch from "node-fetch";
import { getDeploymentRelatedMessages } from "../db/deploymentProvider";
import { averageBlockCountInAMonth } from "@src/shared/constants";
import { round } from "@src/shared/utils/math";
import { getMarketData } from "./marketDataProvider";
import { coinToAsset } from "@src/shared/utils/coin";
import { getTransactionByAddress } from "@src/db/transactionsProvider";
Expand Down
14 changes: 7 additions & 7 deletions deploy-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion deploy-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"postinstall": "patch-package"
},
"dependencies": {
"@akashnetwork/akashjs": "0.4.15",
"@akashnetwork/akashjs": "0.4.17",
"@auth0/nextjs-auth0": "^3.1.0",
"@cosmjs/encoding": "^0.29.5",
"@cosmjs/stargate": "^0.29.5",
Expand Down
49 changes: 0 additions & 49 deletions deploy-web/patches/@akashnetwork+akashjs+0.4.15.patch

This file was deleted.

1 change: 1 addition & 0 deletions deploy-web/patches/placeholder.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DO NOT REMOVE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useRef } from "react";
import { useState, useEffect } from "react";
import { SigningStargateClient } from "@cosmjs/stargate";
import { mainnetId, selectedNetworkId, testnetId, uAktDenom } from "@src/utils/constants";
import { uAktDenom } from "@src/utils/constants";
import { TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx";
import { EncodeObject } from "@cosmjs/proto-signing";
import { useSnackbar } from "notistack";
Expand Down Expand Up @@ -411,16 +411,7 @@ export function useKeplr() {

const TransactionSnackbarContent = ({ snackMessage, transactionHash }) => {
const theme = useTheme();

const transactionLink = (txHash: string, networkId: string) => {
if (networkId === mainnetId || networkId === testnetId) {
return UrlService.transaction(txHash);
}

return null;
};

const txUrl = transactionHash && transactionLink(transactionHash, selectedNetworkId);
const txUrl = transactionHash && UrlService.transaction(transactionHash);

return (
<>
Expand Down
6 changes: 3 additions & 3 deletions deploy-web/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ export const BASE_API_TESTNET_URL = getApiTestnetUrl();
export const BASE_API_SANDBOX_URL = getApiSandboxUrl();

export const BASE_API_URL = getApiUrl();

export function getNetworkBaseApiUrl(network: string) {
switch (network) {
case testnetId:
return BASE_API_TESTNET_URL;
case sandboxId:
console.log("Use sandbox base api");
return BASE_API_SANDBOX_URL;
default:
return BASE_API_MAINNET_URL;
Expand Down Expand Up @@ -94,7 +94,7 @@ function getApiUrl() {
if (window.location?.hostname === "deploy.cloudmos.io") {
try {
const _selectedNetworkId = localStorage.getItem("selectedNetworkId");
return _selectedNetworkId === "testnet" ? productionTestnetApiUrl : productionMainnetApiUrl;
return getNetworkBaseApiUrl(_selectedNetworkId);
} catch (e) {
console.error(e);
return productionMainnetApiUrl;
Expand Down Expand Up @@ -129,7 +129,7 @@ export let selectedNetworkId = "";
// 5AKT aka 5000000uakt
export const defaultInitialDeposit = 5000000;

export let networkVersion;
export let networkVersion: "v1beta2" | "v1beta3";

export function setNetworkVersion() {
const _selectedNetworkId = localStorage.getItem("selectedNetworkId");
Expand Down
5 changes: 0 additions & 5 deletions deploy-web/src/utils/deploymentData/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as v1beta2 from "./v1beta2";
import * as v1beta3 from "./v1beta3";
import { mainnetId, testnetId, sandboxId } from "../constants";
export * from "./helpers";
Expand All @@ -11,11 +10,7 @@ export function initDeploymentData() {

switch (selectedNetworkId) {
case mainnetId:
deploymentData = v1beta3;
break;
case testnetId:
deploymentData = v1beta3;
break;
case sandboxId:
deploymentData = v1beta3;
break;
Expand Down
5 changes: 0 additions & 5 deletions deploy-web/src/utils/proto/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as v1beta2 from "./v1beta2";
import * as v1beta3 from "./v1beta3";
import { mainnetId, testnetId, sandboxId } from "../constants";

Expand All @@ -9,11 +8,7 @@ export function initProtoTypes() {

switch (selectedNetworkId) {
case mainnetId:
protoTypes = v1beta3;
break;
case testnetId:
protoTypes = v1beta3;
break;
case sandboxId:
protoTypes = v1beta3;
break;
Expand Down
3 changes: 2 additions & 1 deletion indexer/src/monitors/deploymentBalanceMonitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ export class DeploymentBalanceMonitor {

const balance = response.data.escrow_account.balance;
const funds = response.data.escrow_account.funds;
const isAktDenom = balance.denom === activeChain.denom || balance.denom === activeChain.udenom;

if (!balance || !funds) {
if (!balance || !funds || !isAktDenom) {
return null;
}

Expand Down