Skip to content

Commit

Permalink
chore(dev-tools): update wasm CLI to match new proto messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomasvdam committed Aug 29, 2024
1 parent b7b333f commit 1a01479
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 3 additions & 3 deletions libs/dev-tools/src/cli/wasm/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ list.action(async () => {

const queryResult = await wasmQueryClient.DataRequestWasms({});

const result = queryResult.hashTypePairs.map((hashTypePair) => {
const [hash, type] = hashTypePair.split(',');
return { hash, type };
const result = queryResult.list.map((hashTypePair) => {
const [hash, expirationHeight] = hashTypePair.split(',');
return { hash, expirationHeight };
});

spinnerSuccess();
Expand Down
1 change: 0 additions & 1 deletion libs/dev-tools/src/cli/wasm/show.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ show.action(async () => {
hash,
addedAt: wasm.addedAt,
expirationHeight: wasm.expirationHeight,
wasmType: wasm.wasmType,
});
},
Nothing() {
Expand Down
13 changes: 11 additions & 2 deletions libs/dev-tools/src/lib/services/signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
buildSigningConfig,
} from './config';
import { createWasmQueryClient } from '@dev-tools/services/wasm/query-client';
import { tryAsync } from '@dev-tools/utils/try-async';

const BECH32_ADDRESS_PREFIX = 'seda';

Expand Down Expand Up @@ -72,7 +73,15 @@ async function resolveCoreContractAddress(config: SigningConfig) {

const queryClient = await createWasmQueryClient(config);

const response = await queryClient.CoreContractRegistry({});
const response = await tryAsync(async () =>
queryClient.CoreContractRegistry({})
);

return response.address;
if (response.isErr) {
throw Error(
'No core contract set on chain. Please provide a SEDA_CORE_CONTRACT address manually.'
);
}

return response.value.address;
}

0 comments on commit 1a01479

Please sign in to comment.