From 433362608c70627108cde72639a882c025ad8057 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Tue, 7 Jul 2020 06:39:34 +0200 Subject: [PATCH] Improve source/builder documentation --- packages/cosmwasm/src/cosmwasmclient.ts | 11 +++++++++++ packages/cosmwasm/src/restclient.ts | 12 +++++++++++- packages/cosmwasm/src/signingcosmwasmclient.ts | 13 +++++++++++-- packages/cosmwasm/types/cosmwasmclient.d.ts | 11 +++++++++++ packages/cosmwasm/types/restclient.d.ts | 11 +++++++++++ packages/cosmwasm/types/signingcosmwasmclient.d.ts | 13 +++++++++++-- 6 files changed, 66 insertions(+), 5 deletions(-) diff --git a/packages/cosmwasm/src/cosmwasmclient.ts b/packages/cosmwasm/src/cosmwasmclient.ts index 4d7d4a4c..1df52b9f 100644 --- a/packages/cosmwasm/src/cosmwasmclient.ts +++ b/packages/cosmwasm/src/cosmwasmclient.ts @@ -104,7 +104,18 @@ export interface Code { readonly creator: string; /** Hex-encoded sha256 hash of the code stored here */ readonly checksum: string; + /** + * An URL to a .tar.gz archive of the source code of the contract, which can be used to reproducibly build the Wasm bytecode. + * + * @see https://github.com/CosmWasm/cosmwasm-verify + */ readonly source?: string; + /** + * A docker image (including version) to reproducibly build the Wasm bytecode from the source code. + * + * @example ```cosmwasm/rust-optimizer:0.8.0``` + * @see https://github.com/CosmWasm/cosmwasm-verify + */ readonly builder?: string; } diff --git a/packages/cosmwasm/src/restclient.ts b/packages/cosmwasm/src/restclient.ts index a915f565..d5406da6 100644 --- a/packages/cosmwasm/src/restclient.ts +++ b/packages/cosmwasm/src/restclient.ts @@ -23,8 +23,18 @@ export interface CodeInfo { readonly creator: string; /** Hex-encoded sha256 hash of the code stored here */ readonly data_hash: string; - // TODO: these are not supported in current wasmd + /** + * An URL to a .tar.gz archive of the source code of the contract, which can be used to reproducibly build the Wasm bytecode. + * + * @see https://github.com/CosmWasm/cosmwasm-verify + */ readonly source?: string; + /** + * A docker image (including version) to reproducibly build the Wasm bytecode from the source code. + * + * @example ```cosmwasm/rust-optimizer:0.8.0``` + * @see https://github.com/CosmWasm/cosmwasm-verify + */ readonly builder?: string; } diff --git a/packages/cosmwasm/src/signingcosmwasmclient.ts b/packages/cosmwasm/src/signingcosmwasmclient.ts index cae59657..e713e82f 100644 --- a/packages/cosmwasm/src/signingcosmwasmclient.ts +++ b/packages/cosmwasm/src/signingcosmwasmclient.ts @@ -83,9 +83,18 @@ const defaultFees: FeeTable = { }; export interface UploadMeta { - /** The source URL */ + /** + * An URL to a .tar.gz archive of the source code of the contract, which can be used to reproducibly build the Wasm bytecode. + * + * @see https://github.com/CosmWasm/cosmwasm-verify + */ readonly source?: string; - /** The builder tag */ + /** + * A docker image (including version) to reproducibly build the Wasm bytecode from the source code. + * + * @example ```cosmwasm/rust-optimizer:0.8.0``` + * @see https://github.com/CosmWasm/cosmwasm-verify + */ readonly builder?: string; } diff --git a/packages/cosmwasm/types/cosmwasmclient.d.ts b/packages/cosmwasm/types/cosmwasmclient.d.ts index 87e5360c..82eecb72 100644 --- a/packages/cosmwasm/types/cosmwasmclient.d.ts +++ b/packages/cosmwasm/types/cosmwasmclient.d.ts @@ -64,7 +64,18 @@ export interface Code { readonly creator: string; /** Hex-encoded sha256 hash of the code stored here */ readonly checksum: string; + /** + * An URL to a .tar.gz archive of the source code of the contract, which can be used to reproducibly build the Wasm bytecode. + * + * @see https://github.com/CosmWasm/cosmwasm-verify + */ readonly source?: string; + /** + * A docker image (including version) to reproducibly build the Wasm bytecode from the source code. + * + * @example ```cosmwasm/rust-optimizer:0.8.0``` + * @see https://github.com/CosmWasm/cosmwasm-verify + */ readonly builder?: string; } export interface CodeDetails extends Code { diff --git a/packages/cosmwasm/types/restclient.d.ts b/packages/cosmwasm/types/restclient.d.ts index 2ca6f5e2..43e4be1e 100644 --- a/packages/cosmwasm/types/restclient.d.ts +++ b/packages/cosmwasm/types/restclient.d.ts @@ -6,7 +6,18 @@ export interface CodeInfo { readonly creator: string; /** Hex-encoded sha256 hash of the code stored here */ readonly data_hash: string; + /** + * An URL to a .tar.gz archive of the source code of the contract, which can be used to reproducibly build the Wasm bytecode. + * + * @see https://github.com/CosmWasm/cosmwasm-verify + */ readonly source?: string; + /** + * A docker image (including version) to reproducibly build the Wasm bytecode from the source code. + * + * @example ```cosmwasm/rust-optimizer:0.8.0``` + * @see https://github.com/CosmWasm/cosmwasm-verify + */ readonly builder?: string; } export interface CodeDetails extends CodeInfo { diff --git a/packages/cosmwasm/types/signingcosmwasmclient.d.ts b/packages/cosmwasm/types/signingcosmwasmclient.d.ts index b86bebeb..2a3e17ea 100644 --- a/packages/cosmwasm/types/signingcosmwasmclient.d.ts +++ b/packages/cosmwasm/types/signingcosmwasmclient.d.ts @@ -14,9 +14,18 @@ export interface FeeTable { readonly changeAdmin: StdFee; } export interface UploadMeta { - /** The source URL */ + /** + * An URL to a .tar.gz archive of the source code of the contract, which can be used to reproducibly build the Wasm bytecode. + * + * @see https://github.com/CosmWasm/cosmwasm-verify + */ readonly source?: string; - /** The builder tag */ + /** + * A docker image (including version) to reproducibly build the Wasm bytecode from the source code. + * + * @example ```cosmwasm/rust-optimizer:0.8.0``` + * @see https://github.com/CosmWasm/cosmwasm-verify + */ readonly builder?: string; } export interface UploadResult {