Skip to content

Commit

Permalink
fix types; add nonce; cleanup; comment nginx perl module;
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-nax committed Sep 16, 2024
1 parent 2c14844 commit 1e211b8
Show file tree
Hide file tree
Showing 19 changed files with 86 additions and 517 deletions.
2 changes: 1 addition & 1 deletion spaceward/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ worker_processes auto;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
load_module modules/ngx_http_perl_module.so;
#load_module modules/ngx_http_perl_module.so;

events {
worker_connections 1024;
Expand Down
29 changes: 17 additions & 12 deletions spaceward/src/features/actions/StatusSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useContext, useEffect } from "react";
import { isDeliverTxSuccess } from "@cosmjs/stargate";
import { useChain, walletContext } from "@cosmos-kit/react-lite";
import { cosmos, warden } from "@wardenprotocol/wardenjs";
import { ActionStatus } from "@wardenprotocol/wardenjs/codegen/warden/act/v1beta1/action";
import { Action, ActionStatus } from "@wardenprotocol/wardenjs/codegen/warden/act/v1beta1/action";
import { useToast } from "@/components/ui/use-toast";

import {
Expand Down Expand Up @@ -151,16 +151,21 @@ function ActionItem({ single, ...item }: ItemProps) {
}

const client = await getClient();
let action: Action | undefined;

const res = await client.warden.act.v1beta1.actionById({
id: item.actionId,
});
try {
const res = await client.warden.act.v1beta1.actionById({
id: item.actionId,
});

action = res.action;
} catch (e) {
console.error("failed to get action", e);
}

if (
res.action?.status === ActionStatus.ACTION_STATUS_COMPLETED
action?.status === ActionStatus.ACTION_STATUS_COMPLETED
) {
const { action } = res;

setData({
[item.id]: {
...item,
Expand All @@ -169,14 +174,14 @@ function ActionItem({ single, ...item }: ItemProps) {
},
});
} else if (
res.action?.status === ActionStatus.ACTION_STATUS_PENDING
action?.status === ActionStatus.ACTION_STATUS_PENDING
) {
timeout = setTimeout(
checkAction,
1000,
) as unknown as number;
} else if (res.action?.status === ActionStatus.ACTION_STATUS_REVOKED) {
console.error("action revoked", res);
} else if (action?.status === ActionStatus.ACTION_STATUS_REVOKED) {
console.error("action revoked", action);

toast({
title: "Failed",
Expand All @@ -188,11 +193,11 @@ function ActionItem({ single, ...item }: ItemProps) {
[item.id]: {
...item,
status: QueuedActionStatus.Failed,
action: res.action,
action,
}
})
} else {
console.error("action failed", res);
console.error("action failed", action);

toast({
title: "Failed",
Expand Down
2 changes: 1 addition & 1 deletion spaceward/src/features/assets/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const useAssetQueries = (spaceId?: string | null) => {

const currencyPairs = useMemo(
() =>
pairs.data?.currencyPairs.map(({ Base, Quote }) => ({
pairs.data?.currencyPairs.map(({ base: Base, quote: Quote }) => ({
id: `${Base}/${Quote}`,
token: Base,
})) ?? [],
Expand Down
4 changes: 2 additions & 2 deletions spaceward/src/features/dashboard/Intent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { Icons } from "@/components/ui/icons-assets";
import { useQueryHooks } from "@/hooks/useClient";

const ActiveIntent = ({ activeIntentId }: { activeIntentId: number }) => {
const intent = useQueryHooks().warden.act.v1beta1.useRuleById({
const intent = useQueryHooks().warden.act.v1beta1.useTemplateById({
request: { id: BigInt(activeIntentId) },
});

return (
<div className="text-muted-foreground flex items-center">
{intent.data?.rule?.name}
{intent.data?.template?.name}
<Icons.chevronSecondary />
</div>
);
Expand Down
2 changes: 0 additions & 2 deletions spaceward/src/features/intents/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,6 @@ export const useRules = () => {
{
authority,
spaceId: BigInt(space.id),
adminTemplateId: BigInt(0),
signTemplateId: BigInt(0),
approveAdminTemplateId: BigInt(0),
approveSignTemplateId: BigInt(id),
rejectAdminTemplateId: BigInt(0),
Expand Down
155 changes: 0 additions & 155 deletions spaceward/src/features/keys/KeyRequestDialog.tsx

This file was deleted.

109 changes: 0 additions & 109 deletions spaceward/src/features/keys/KeyRequestStatus.tsx

This file was deleted.

Loading

0 comments on commit 1e211b8

Please sign in to comment.