Skip to content

Commit

Permalink
Merge branch 'main' into instantiate2
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaster128 committed May 24, 2023
2 parents 3152646 + 87a2f9e commit dcb358b
Show file tree
Hide file tree
Showing 125 changed files with 4,060 additions and 891 deletions.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ workflows:
- build
matrix:
parameters:
simapp: ["simapp44", "simapp46"]
simapp: ["simapp44", "simapp46", "simapp47"]
- test-node:
requires:
- build
Expand Down Expand Up @@ -159,6 +159,7 @@ jobs:
command: |
[ "<< parameters.simapp >>" = "simapp44" ] && export SIMAPP44_ENABLED=1 SLOW_SIMAPP44_ENABLED=1
[ "<< parameters.simapp >>" = "simapp46" ] && export SIMAPP46_ENABLED=1 SLOW_SIMAPP46_ENABLED=1
[ "<< parameters.simapp >>" = "simapp47" ] && export SIMAPP47_ENABLED=1 SLOW_SIMAPP47_ENABLED=1
yarn test --stream
- run:
name: Run CLI selftest
Expand All @@ -178,6 +179,7 @@ jobs:
command: |
[ "<< parameters.simapp >>" = "simapp44" ] && export SIMAPP44_ENABLED=1 SLOW_SIMAPP44_ENABLED=1
[ "<< parameters.simapp >>" = "simapp46" ] && export SIMAPP46_ENABLED=1 SLOW_SIMAPP46_ENABLED=1
[ "<< parameters.simapp >>" = "simapp47" ] && export SIMAPP47_ENABLED=1 SLOW_SIMAPP47_ENABLED=1
./run_examples.sh
- run:
name: Stop chains
Expand Down
16 changes: 8 additions & 8 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions .yarn/cache/cosmjs-types-npm-0.7.2-655e4f4384-4a0b730a7f.zip

This file was deleted.

3 changes: 3 additions & 0 deletions .yarn/cache/cosmjs-types-npm-0.8.0-4c175fd383-99714ec956.zip
Git LFS file not shown
2 changes: 2 additions & 0 deletions .yarn/sdks/typescript/lib/tsserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ const moduleWrapper = tsserver => {
str = `zip:${str}`;
} break;
}
} else {
str = str.replace(/^\/?/, process.platform === `win32` ? `` : `/`);
}
}

Expand Down
2 changes: 2 additions & 0 deletions .yarn/sdks/typescript/lib/tsserverlibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ const moduleWrapper = tsserver => {
str = `zip:${str}`;
} break;
}
} else {
str = str.replace(/^\/?/, process.platform === `win32` ? `` : `/`);
}
}

Expand Down
2 changes: 1 addition & 1 deletion .yarn/sdks/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typescript",
"version": "4.6.4-sdk",
"version": "4.9.5-sdk",
"main": "./lib/typescript.js",
"type": "commonjs"
}
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,28 @@ and this project adheres to

## [Unreleased]

### Changed

- all: upgrade cosmjs-types to 0.8.0 to include Cosmos SDK 0.46/0.47 and IBC v7
types.
- @cosmjs/cosmwasm-stargate: Implement auto-detection for Tendermint 0.34/37
([#1411]).
- @cosmjs/cosmwasm-stargate: Remove structured `searchTx` queries. Only raw
query strings and key/value pairs are now supported. ([#1411])
- @cosmjs/cosmwasm-stargate: Let `searchTx` return non-readonly array. The
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: Remove structured `searchTx` queries. Only raw query strings
and key/value pairs are now supported. ([#1411])
- @cosmjs/stargate: Let `searchTx` return non-readonly array. The caller owns
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

## [0.30.1] - 2023-03-22

### Fixed
Expand Down
1 change: 1 addition & 0 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ order to avoid conflicts. Here is an overview of the ports used:
| 9090 | simapp gRPC | Manual Stargate debugging |
| 11134 | Standalone Tendermint 0.34 RPC | @cosmjs/tendermint-rpc tests |
| 11135 | Standalone Tendermint 0.35 RPC | @cosmjs/tendermint-rpc tests |
| 11137 | Standalone Tendermint 0.37 RPC | @cosmjs/tendermint-rpc tests |
| 26658 | simapp Tendermint RPC | Stargate client tests |
| 26659 | wasmd Tendermint RPC | @cosmjs/cosmwasm-stargate tests |
| 26660 | simapp slow Tendermint RPC | Stargate client tests |
2 changes: 1 addition & 1 deletion packages/cli/examples/delegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const msg: MsgDelegateEncodeObject = {
delegatorAddress: signerAddress,
// To get the proper validator address, start the demo chain (./scripts/simapp44/start.sh), then run:
// curl http://localhost:1318/staking/validators | jq '.result[0].operator_address'
validatorAddress: "cosmosvaloper1urk9gy7cfws0ak9x5nu7lx4un9n6gqkrp230jk",
validatorAddress: "cosmosvaloper12nt2hqjps8r065wc02qks88tvqzdeua06e982h",
amount: coin(300000, "ustake"),
},
};
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"axios": "^0.21.2",
"babylon": "^6.18.0",
"chalk": "^4",
"cosmjs-types": "^0.7.1",
"cosmjs-types": "^0.8.0",
"diff": "^4",
"recast": "^0.20",
"ts-node": "^8",
Expand Down
2 changes: 1 addition & 1 deletion packages/cosmwasm-stargate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@cosmjs/stargate": "workspace:^",
"@cosmjs/tendermint-rpc": "workspace:^",
"@cosmjs/utils": "workspace:^",
"cosmjs-types": "^0.7.1",
"cosmjs-types": "^0.8.0",
"long": "^4.0.0",
"pako": "^2.0.2"
},
Expand Down
75 changes: 8 additions & 67 deletions packages/cosmwasm-stargate/src/cosmwasmclient.searchtx.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@ describe("CosmWasmClient.getTx and .searchTx", () => {
});
});

describe("with SearchByHeightQuery", () => {
describe("searchTx", () => {
it("can search successful tx by height", async () => {
pendingWithoutWasmd();
assert(sendSuccessful, "value must be set in beforeAll()");
const client = await CosmWasmClient.connect(wasmd.endpoint);
const result = await client.searchTx({ height: sendSuccessful.height });
const result = await client.searchTx(`tx.height=${sendSuccessful.height}`);
expect(result.length).toBeGreaterThanOrEqual(1);
expect(result).toContain(
jasmine.objectContaining({
Expand All @@ -218,7 +218,7 @@ describe("CosmWasmClient.getTx and .searchTx", () => {
pendingWithoutWasmd();
assert(sendUnsuccessful, "value must be set in beforeAll()");
const client = await CosmWasmClient.connect(wasmd.endpoint);
const result = await client.searchTx({ height: sendUnsuccessful.height });
const result = await client.searchTx(`tx.height=${sendUnsuccessful.height}`);
expect(result.length).toBeGreaterThanOrEqual(1);
expect(result).toContain(
jasmine.objectContaining({
Expand All @@ -230,14 +230,13 @@ describe("CosmWasmClient.getTx and .searchTx", () => {
}),
);
});
});

describe("with SearchBySentFromOrToQuery", () => {
it("can search by sender", async () => {
pendingWithoutWasmd();
assert(sendSuccessful, "value must be set in beforeAll()");
const client = await CosmWasmClient.connect(wasmd.endpoint);
const results = await client.searchTx({ sentFromOrTo: sendSuccessful.sender });
const query = `message.action = '/cosmos.bank.v1beta1.MsgSend' AND message.sender = '${sendSuccessful.sender}'`;
const results = await client.searchTx(query);
expect(results.length).toBeGreaterThanOrEqual(1);

// Check basic structure of all results
Expand Down Expand Up @@ -266,7 +265,7 @@ describe("CosmWasmClient.getTx and .searchTx", () => {
pendingWithoutWasmd();
assert(sendSuccessful, "value must be set in beforeAll()");
const client = await CosmWasmClient.connect(wasmd.endpoint);
const results = await client.searchTx({ sentFromOrTo: sendSuccessful.recipient });
const results = await client.searchTx(`transfer.recipient='${sendSuccessful.recipient}'`);
expect(results.length).toBeGreaterThanOrEqual(1);

// Check basic structure of all results
Expand All @@ -290,69 +289,11 @@ describe("CosmWasmClient.getTx and .searchTx", () => {
);
});

it("can search by recipient and filter by minHeight", async () => {
pendingWithoutWasmd();
assert(sendSuccessful);
const client = await CosmWasmClient.connect(wasmd.endpoint);
const query = { sentFromOrTo: sendSuccessful.recipient };

{
const result = await client.searchTx(query, { minHeight: 0 });
expect(result.length).toEqual(1);
}

{
const result = await client.searchTx(query, { minHeight: sendSuccessful.height - 1 });
expect(result.length).toEqual(1);
}

{
const result = await client.searchTx(query, { minHeight: sendSuccessful.height });
expect(result.length).toEqual(1);
}

{
const result = await client.searchTx(query, { minHeight: sendSuccessful.height + 1 });
expect(result.length).toEqual(0);
}
});

it("can search by recipient and filter by maxHeight", async () => {
pendingWithoutWasmd();
assert(sendSuccessful);
const client = await CosmWasmClient.connect(wasmd.endpoint);
const query = { sentFromOrTo: sendSuccessful.recipient };

{
const result = await client.searchTx(query, { maxHeight: 9999999999999 });
expect(result.length).toEqual(1);
}

{
const result = await client.searchTx(query, { maxHeight: sendSuccessful.height + 1 });
expect(result.length).toEqual(1);
}

{
const result = await client.searchTx(query, { maxHeight: sendSuccessful.height });
expect(result.length).toEqual(1);
}

{
const result = await client.searchTx(query, { maxHeight: sendSuccessful.height - 1 });
expect(result.length).toEqual(0);
}
});
});

describe("with SearchByTagsQuery", () => {
it("can search by transfer.recipient", async () => {
it("works with tags", async () => {
pendingWithoutWasmd();
assert(sendSuccessful, "value must be set in beforeAll()");
const client = await CosmWasmClient.connect(wasmd.endpoint);
const results = await client.searchTx({
tags: [{ key: "transfer.recipient", value: sendSuccessful.recipient }],
});
const results = await client.searchTx([{ key: "transfer.recipient", value: sendSuccessful.recipient }]);
expect(results.length).toBeGreaterThanOrEqual(1);

// Check basic structure of all results
Expand Down
Loading

0 comments on commit dcb358b

Please sign in to comment.