Skip to content

Commit

Permalink
feat: Update WasmVmPanel to handle invalid funds for initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
spoo-bar committed Jun 20, 2024
1 parent 1af9e43 commit e44a45d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/views/wasmVmPanel.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as vscode from "vscode";
import { CWSimulateApp } from '@terran-one/cw-simulate';
import { parseCoins } from "@cosmjs/launchpad";
import { Coin, parseCoins } from "@cosmjs/launchpad";
import { JSONSchemaFaker } from "json-schema-faker";
var toml = require('toml');

Expand Down Expand Up @@ -159,7 +159,14 @@ export class WasmVmPanel {


private async initializeContract(value: any) {
let funds = parseCoins(value.funds);
let funds : Coin[]
try {
funds = parseCoins(value.funds);
}
catch (error) {
vscode.window.showErrorMessage('Invalid funds for initialize: ' + error.message);
return;
}
let input: any;
try {
input = JSON.parse(value.input);
Expand Down

0 comments on commit e44a45d

Please sign in to comment.