Skip to content

Commit

Permalink
show block height in vm simulate view
Browse files Browse the repository at this point in the history
  • Loading branch information
spoo-bar committed Jun 20, 2024
1 parent e44a45d commit 621c247
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/commands/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ export class ContractCmds {
);
panel.iconPath = vscode.Uri.joinPath(context.extensionUri, 'media', 'icon.svg');
const wasmBinary = await vscode.workspace.fs.readFile(wasm)
let view = new WasmVmPanel(panel, wasmBinary);
let view = new WasmVmPanel(panel, wasmBinary, global.workspaceChain);
await view.getWebviewContent(context.extensionUri);
});

Expand Down
12 changes: 6 additions & 6 deletions src/views/wasmVmPanel.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import * as vscode from "vscode";
import { CWSimulateApp } from '@terran-one/cw-simulate';
import { Coin, parseCoins } from "@cosmjs/launchpad";
import { JSONSchemaFaker } from "json-schema-faker";
var toml = require('toml');
import { ChainConfig } from "../helpers/workspace";


export class WasmVmPanel {
Expand All @@ -14,12 +13,12 @@ export class WasmVmPanel {
private readonly _app: CWSimulateApp;
private readonly _codeId: number;

constructor(panel: vscode.WebviewPanel, wasm: Uint8Array) {
constructor(panel: vscode.WebviewPanel, wasm: Uint8Array, chainConfig: ChainConfig) {
this._panel = panel;
this._wasmBinary = wasm;
this._app = new CWSimulateApp({
chainId: 'cosmy-wasmy-1',
bech32Prefix: 'test'
chainId: chainConfig.chainId,
bech32Prefix: chainConfig.addressPrefix,
});
this._codeId = this._app.wasm.create('', this._wasmBinary);

Expand Down Expand Up @@ -56,7 +55,8 @@ export class WasmVmPanel {
<vscode-panel-tab id="tab-2">${vscode.l10n.t("CONTRACTS")}</vscode-panel-tab>
<vscode-panel-view id="view-1">
<vscode-text-field disabled value="${this._app.chainId}" style="margin-right:20px;">${vscode.l10n.t("Chain ID")}</vscode-text-field>
<vscode-text-field disabled value="${this._app.bech32Prefix}" style="margin-right:20px;" size="5">${vscode.l10n.t("Bech32 Prefix")}</vscode-text-field>
<vscode-text-field disabled value="${this._app.bech32Prefix}" style="margin-right:20px;">${vscode.l10n.t("Bech32 Prefix")}</vscode-text-field>
<vscode-text-field disabled value="${this._app.height}" style="margin-right:20px;">${vscode.l10n.t("Block Height")}</vscode-text-field>
</vscode-panel-view>
<vscode-panel-view id="view-2">
<vscode-data-grid id="contracts-grid" grid-template-columns="5% 20% 75%" aria-label="Default"></vscode-data-grid>
Expand Down

0 comments on commit 621c247

Please sign in to comment.