Updates for wasmd v0.7.0-rc2

This commit is contained in:
Ethan Frey 2020-02-29 20:59:57 +01:00
parent 9195ae52cf
commit 653bccf1c7
3 changed files with 5 additions and 18 deletions

View File

@ -168,7 +168,7 @@ type RestClientResponse =
| WasmResponse<string>
| WasmResponse<CodeInfo[]>
| WasmResponse<ContractInfo[] | null>
| WasmResponse<ContractDetails>
| WasmResponse<ContractDetails | null>
| WasmResponse<GetCodeResult>;
/**
@ -363,21 +363,8 @@ export class RestClient {
*/
public async getContractInfo(address: string): Promise<ContractDetails | null> {
const path = `/wasm/contract/${address}`;
try {
const response = (await this.get(path)) as WasmResponse<ContractDetails>;
return unwrapWasmResponse(response);
} catch (error) {
if (error instanceof Error) {
if (error.message.startsWith("unknown address:")) {
return null;
} else {
throw error;
}
} else {
throw error;
}
}
const response = (await this.get(path)) as WasmResponse<ContractDetails | null>;
return unwrapWasmResponse(response);
}
// Returns all contract state.

View File

@ -126,7 +126,7 @@ declare type RestClientResponse =
| WasmResponse<string>
| WasmResponse<CodeInfo[]>
| WasmResponse<ContractInfo[] | null>
| WasmResponse<ContractDetails>
| WasmResponse<ContractDetails | null>
| WasmResponse<GetCodeResult>;
/**
* The mode used to send transaction

View File

@ -1,5 +1,5 @@
# Choose from https://hub.docker.com/r/cosmwasm/wasmd-demo/tags
REPOSITORY="cosmwasm/wasmd-demo"
VERSION="v0.7.0-rc1"
VERSION="v0.7.0-rc2"
CONTAINER_NAME="wasmd"