mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 21:49:15 +00:00
Remove compressedChecksum
This commit is contained in:
parent
94ed39b4e3
commit
7f9425f7d9
@ -16,12 +16,16 @@ and this project adheres to
|
|||||||
query strings and key/value pairs are now supported. ([#1411])
|
query strings and key/value pairs are now supported. ([#1411])
|
||||||
- @cosmjs/cosmwasm-stargate: Let `searchTx` return non-readonly array. The
|
- @cosmjs/cosmwasm-stargate: Let `searchTx` return non-readonly array. The
|
||||||
caller owns this array and can mutate it as they want. ([#1411])
|
caller owns this array and can mutate it as they want. ([#1411])
|
||||||
|
- @cosmjs/cosmwasm-stargate: In `UploadResult` (result from
|
||||||
|
`SigningCosmWasmClient.upload`), rename `originalChecksum` to `checksum` and
|
||||||
|
remove `compressedChecksum` ([#1409]).
|
||||||
- @cosmjs/stargate: Implement auto-detection for Tendermint 0.34/37 ([#1411]).
|
- @cosmjs/stargate: Implement auto-detection for Tendermint 0.34/37 ([#1411]).
|
||||||
- @cosmjs/stargate: Remove structured `searchTx` queries. Only raw query strings
|
- @cosmjs/stargate: Remove structured `searchTx` queries. Only raw query strings
|
||||||
and key/value pairs are now supported. ([#1411])
|
and key/value pairs are now supported. ([#1411])
|
||||||
- @cosmjs/stargate: Let `searchTx` return non-readonly array. The caller owns
|
- @cosmjs/stargate: Let `searchTx` return non-readonly array. The caller owns
|
||||||
this array and can mutate it as they want. ([#1411])
|
this array and can mutate it as they want. ([#1411])
|
||||||
|
|
||||||
|
[#1409]: https://github.com/cosmos/cosmjs/issues/1409
|
||||||
[#1411]: https://github.com/cosmos/cosmjs/pull/1411
|
[#1411]: https://github.com/cosmos/cosmjs/pull/1411
|
||||||
|
|
||||||
## [0.30.1] - 2023-03-22
|
## [0.30.1] - 2023-03-22
|
||||||
|
@ -104,11 +104,13 @@ describe("SigningCosmWasmClient", () => {
|
|||||||
const options = { ...defaultSigningClientOptions, prefix: wasmd.prefix };
|
const options = { ...defaultSigningClientOptions, prefix: wasmd.prefix };
|
||||||
const client = await SigningCosmWasmClient.connectWithSigner(wasmd.endpoint, wallet, options);
|
const client = await SigningCosmWasmClient.connectWithSigner(wasmd.endpoint, wallet, options);
|
||||||
const wasm = getHackatom().data;
|
const wasm = getHackatom().data;
|
||||||
const { codeId, originalChecksum, originalSize, compressedChecksum, compressedSize } =
|
const { codeId, checksum, originalSize, compressedSize } = await client.upload(
|
||||||
await client.upload(alice.address0, wasm, defaultUploadFee);
|
alice.address0,
|
||||||
expect(originalChecksum).toEqual(toHex(sha256(wasm)));
|
wasm,
|
||||||
|
defaultUploadFee,
|
||||||
|
);
|
||||||
|
expect(checksum).toEqual(toHex(sha256(wasm)));
|
||||||
expect(originalSize).toEqual(wasm.length);
|
expect(originalSize).toEqual(wasm.length);
|
||||||
expect(compressedChecksum).toMatch(/^[0-9a-f]{64}$/);
|
|
||||||
expect(compressedSize).toBeLessThan(wasm.length * 0.5);
|
expect(compressedSize).toBeLessThan(wasm.length * 0.5);
|
||||||
expect(codeId).toBeGreaterThanOrEqual(1);
|
expect(codeId).toBeGreaterThanOrEqual(1);
|
||||||
client.disconnect();
|
client.disconnect();
|
||||||
|
@ -67,14 +67,12 @@ import {
|
|||||||
} from "./modules";
|
} from "./modules";
|
||||||
|
|
||||||
export interface UploadResult {
|
export interface UploadResult {
|
||||||
|
/** A hex encoded sha256 checksum of the original Wasm code (that is stored on chain) */
|
||||||
|
readonly checksum: string;
|
||||||
/** Size of the original wasm code in bytes */
|
/** Size of the original wasm code in bytes */
|
||||||
readonly originalSize: number;
|
readonly originalSize: number;
|
||||||
/** A hex encoded sha256 checksum of the original wasm code (that is stored on chain) */
|
|
||||||
readonly originalChecksum: string;
|
|
||||||
/** Size of the compressed wasm code in bytes */
|
/** Size of the compressed wasm code in bytes */
|
||||||
readonly compressedSize: number;
|
readonly compressedSize: number;
|
||||||
/** A hex encoded sha256 checksum of the compressed wasm code (that stored in the transaction) */
|
|
||||||
readonly compressedChecksum: string;
|
|
||||||
/** The ID of the code asigned by the chain */
|
/** The ID of the code asigned by the chain */
|
||||||
readonly codeId: number;
|
readonly codeId: number;
|
||||||
readonly logs: readonly logs.Log[];
|
readonly logs: readonly logs.Log[];
|
||||||
@ -301,10 +299,9 @@ export class SigningCosmWasmClient extends CosmWasmClient {
|
|||||||
const parsedLogs = logs.parseRawLog(result.rawLog);
|
const parsedLogs = logs.parseRawLog(result.rawLog);
|
||||||
const codeIdAttr = logs.findAttribute(parsedLogs, "store_code", "code_id");
|
const codeIdAttr = logs.findAttribute(parsedLogs, "store_code", "code_id");
|
||||||
return {
|
return {
|
||||||
|
checksum: toHex(sha256(wasmCode)),
|
||||||
originalSize: wasmCode.length,
|
originalSize: wasmCode.length,
|
||||||
originalChecksum: toHex(sha256(wasmCode)),
|
|
||||||
compressedSize: compressed.length,
|
compressedSize: compressed.length,
|
||||||
compressedChecksum: toHex(sha256(compressed)),
|
|
||||||
codeId: Number.parseInt(codeIdAttr.value, 10),
|
codeId: Number.parseInt(codeIdAttr.value, 10),
|
||||||
logs: parsedLogs,
|
logs: parsedLogs,
|
||||||
height: result.height,
|
height: result.height,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user