Skip to content

Commit

Permalink
update readme for v0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
spoo-bar committed Jul 2, 2022
1 parent a3594a3 commit e6fef42
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 16 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ All notable changes to the "cosmy-wasmy" extension will be documented in this fi
### Security
-->

## [v0.4.0] - 03 July 2022
## [v0.4.0] - 02 July 2022

### Added

Expand All @@ -32,7 +32,7 @@ All notable changes to the "cosmy-wasmy" extension will be documented in this fi
### Fixed

- Custom sorting of the contract view was just straight up not working. Fixed now.
- Fixed [#8](https://github.com/spoo-bar/cosmy-wasmy/issues/8) - Initiate of contract was failing with "Input is not an integer" due to codeId not being parsed into number.
- Fixed [#8](https://github.com/spoo-bar/cosmy-wasmy/issues/8) - Initiation of contract was failing with "Input is not an integer" due to codeId not being parsed into number.

### Security

Expand Down
57 changes: 44 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This extension allows you to interact with Cosmwasm contracts on local, testnet or mainnet chains

![feature Show Cosnwasn History](images/history.gif)

## Requirements

The version of vscode should be above `^1.67.0`
Expand All @@ -21,6 +23,7 @@ You can set up the extension settings here
| `cosmywasmy.chains` | json | Juno UNI-3 testnet and Localnet - Juno config | Application | This setting stores an array of JSON objects which contains the Chain config details. <br /> This setting can be expanded to include any localnet or testnet chains (mainnet not recommended). <br/> The structure of the expected setting is elaborated below this table |
| `cosmywasmy.contractSortOrder` | enum | None | Workspace | This setting controls the sorting order of the Smart Contracts in the Contract view <br /> * Alphabetical - Sort the Smart Contracts alphabetically by their label<br /> * CodeId - Sort the Smart Contracts by the Code ID<br /> * None - No explicit sorting - Maintains the order the contracts were imported in |
| `cosmywasmy.cosmwasmResponseView` | enum | Terminal | Workspace | This setting controls where the smart contract interactions should be displayed <br /> * NewFile - Open a new dummy doc with response <br /> * Terminal - A seperate output channel by Cosmy Wasmy in the Output view |
| `cosmywasmy.maxHistoryStored` | number | 20 | Workspace | Controls the latest number of queries and txs kept in history for easy re-execution. If set to `0` the feature is disabled and nothing is stored |


The structure of the expected setting for `cosmywasamy.chains`:
Expand All @@ -43,16 +46,18 @@ These commands can be activated using View > Command Palette (Windows: Ctrl+Shft

All the given keybindings can be customized

| Title | Command | Keybinding | Details | Screenshot |
|-------|---------|------------|---------| ---------- |
| Setup Dev Environment | cosmy-wasmy.setupDevEnv | | Installs rust and cargo dependencies | ![feature Setup Dev Environment](images/devenv.gif) |
| Build | cosmy-wasmy.build | ctrl+shift+b | Builds the project and generates the initial wasm file | ![feature Build](images/build.gif) |
| Run Unit Tests | cosmy-wasmy.runUnitTests | ctrl+shift+t | Runs all the unit tests in the project | ![feature Run Unit tests](images/tests.gif)|
| Optimize Contract | cosmy-wasmy.optimizeContract | ctrl+shift+o | Runs the docker contract-optimizer and generates a small wasm artifact - Needs docker running | ![feature Optimize Wasm](images/optimize.png) |
| Generate Schema | cosmy-wasmy.generateSchema | ctrl+shift+g | Generates json-schema using the Rust schema files | ![feature Generate Schema](images/schema.gif) |
| Upload Contract | cosmy-wasmy.upload | ctrl+shift+u | Uploads a wasm file to selected chain with selected account. <br /> Right clicking on a wasm file shows this command in the context menu or command can be invocated using Command Palette/Key Binding and file dialog opens to select a wasm file | ![feature Upload Contract](images/upload.gif) |
| Reload Chain Config | cosmy-wasmy.reloadConfig | | This reloads the currently active chain config. Use this when you switch between different networks within same workspace | ![feature Selected Chain](images/status.png) |
| Reset Data | cosmy-wasmy.resetData | | Deletes all the extension stored data, like accounts and contracts. | ![feature Reset Data](images/reset.png) |
| Title | Command | Keybinding | Details |
|-------|---------|------------|---------|
| Setup Dev Environment | cosmy-wasmy.setupDevEnv | | Installs rust and cargo dependencies |
| Build | cosmy-wasmy.build | ctrl+shift+b | Builds the project and generates the initial wasm file |
| Run Unit Tests | cosmy-wasmy.runUnitTests | ctrl+shift+t | Runs all the unit tests in the project |
| Optimize Contract | cosmy-wasmy.optimizeContract | ctrl+shift+o | Runs the docker contract-optimizer and generates a small wasm artifact - Needs docker running |
| Generate Schema | cosmy-wasmy.generateSchema | ctrl+shift+g | Generates json-schema using the Rust schema files |
| Upload Contract | cosmy-wasmy.upload | ctrl+shift+u | Uploads a wasm file to selected chain with selected account. <br /> Right clicking on a wasm file shows this command in the context menu or command can be invocated using Command Palette/Key Binding and file dialog opens to select a wasm file |
| Reload Chain Config | cosmy-wasmy.reloadConfig | | This reloads the currently active chain config. Use this when you switch between different networks within same workspace |
| Reset Data | cosmy-wasmy.resetData | | Deletes all the extension stored data, like accounts and contracts. |
| Show Cosmwasm History | cosmy-wasmy.history | ctrl+shift+h | Shows latest queries and transactions and with saved inputs. Allows easy re-execution of same queries. The number of saved queries is configurable in the settings. |


## Features

Expand Down Expand Up @@ -82,16 +87,17 @@ Once a contract has been imported, you can

### Query

Input the request query data and select the smart contract from the above view to query and the response/err will be output
Input the request query data and select the smart contract from the above view to query and the response/err will be output. The historical queries are also stored and can be accessed by Show Cosmwasm History command for easy re-execution.

![feature Query](images/query.gif)

### Execute

Input the request tx data and select the smart contract as well as the wallet account from the above view to sign and broadcast the transaction and the response/err will be output
Input the request tx data and select the smart contract as well as the wallet account from the above view to sign and broadcast the transaction and the response/err will be output The historical txs are also stored and can be accessed by Show Cosmwasm History command for easy re-execution.

![feature Execute](images/execute.gif)


### Sign

Input the text which needs to be signed and select the wallet account in the view above and the signature/err will be output
Expand All @@ -110,7 +116,13 @@ Specify the codeId of the uploaded contract wasm and provide a label for the sma

![feature Initialize](images/initiate.png)

### Upload Wasm Smart Contract

You can also upload a wasm file to selected chain with selected account.

Right clicking on a wasm file shows this command in the context menu or command can be invocated using Command Palette/Key Binding and file dialog opens to select a wasm file.

![feature Upload Contract](images/upload.gif)

## Snippets

Expand All @@ -135,7 +147,7 @@ fn query_do_something(deps: Deps) -> StdResult<SomeResponse> {
}
```

### `tx` || `msg` - New Msg/Tx Function
### `tx` - New Msg Function

```rust
pub fn try_something(deps: DepsMut, info: MessageInfo) -> Result<Response, ContractError> {
Expand All @@ -150,6 +162,25 @@ pub fn try_something(deps: DepsMut, info: MessageInfo) -> Result<Response, Contr
}
```

### `test` - New Empty Test Function

```rust
#[test]
fn test_something() {
let mut deps = mock_dependencies(&[]);
let env = mock_env();
let info = mock_info("creator", &coins(2, "token"));

// ... arrange ...
let msg = SomethingMsg { };

// ... act ...
let res = Something(deps.as_mut(), env, info, msg).unwrap();

// ... assert ...
}
```


## Warnings

Expand Down
Binary file added images/history.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "cosmy-wasmy",
"displayName": "cosmy wasmy",
"description": "wibbly wobbly cosmy wasmy tool to interact with cosmwasm smart contracts",
"version": "0.3.0",
"version": "0.4.0",
"preview": true,
"publisher": "Spoorthi",
"icon": "media/icon.png",
Expand Down

0 comments on commit e6fef42

Please sign in to comment.