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

Update wasm CLI to match new proto messages #66

Merged
merged 1 commit into from
Aug 29, 2024
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
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;
}
Loading