Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bumpup cosmjs to 0.31.0 #98

Merged
merged 14 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/finschia-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ jobs:
- name: Build
run: yarn build

- name: start finschia
run: CI= scripts/finschia/start.sh
- name: start finschia with relayer
run: |
cd scripts/with-ibc
docker-compose up -d

- name: init contract on finschia
run: scripts/finschia/init.sh
run: scripts/with-ibc/finschia/init.sh

- name: Unit Test
run: |
cd packages/finschia
SIMAPP_ENABLED=true yarn run test
run: SIMAPP_ENABLED=true IBC_ENABLED=true yarn run test
276 changes: 139 additions & 137 deletions .pnp.cjs

Large diffs are not rendered by default.

This file was deleted.

Git LFS file not shown

This file was deleted.

Git LFS file not shown

This file was deleted.

Git LFS file not shown

This file was deleted.

Git LFS file not shown

This file was deleted.

Git LFS file not shown
3 changes: 0 additions & 3 deletions .yarn/cache/@cosmjs-math-npm-0.30.1-bfef2aeb61-c13d2a8934.zip

This file was deleted.

3 changes: 3 additions & 0 deletions .yarn/cache/@cosmjs-math-npm-0.31.0-a7c0e7525d-0917ab11f2.zip
Git LFS file not shown

This file was deleted.

Git LFS file not shown

This file was deleted.

Git LFS file not shown

This file was deleted.

Git LFS file not shown

This file was deleted.

Git LFS file not shown

This file was deleted.

Git LFS file not shown

This file was deleted.

Git LFS file not shown
3 changes: 0 additions & 3 deletions .yarn/cache/cosmjs-types-npm-0.7.1-d44ec482fd-533d56d076.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
3 changes: 0 additions & 3 deletions .yarn/cache/libsodium-npm-0.7.9-98a3b621b1-1c922c9972.zip

This file was deleted.

Git LFS file not shown

This file was deleted.

Git LFS file not shown
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- [\#98](https://github.com/Finschia/finschia-js/pull/98) bumpup cosmjs to 0.31.0

### Changed

- [\#93](https://github.com/Finschia/finschia-js/pull/93) remove UpdateParams in x/foundation
Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
"publish-latest": "yarn workspaces foreach --no-private exec yarn npm publish"
},
"devDependencies": {
"@cosmjs/crypto": "^0.30.1",
"@cosmjs/encoding": "^0.30.1",
"@cosmjs/proto-signing": "^0.30.1",
"@cosmjs/stargate": "^0.30.1",
"@cosmjs/crypto": "^0.31.0",
"@cosmjs/encoding": "^0.31.0",
"@cosmjs/proto-signing": "^0.31.0",
"@cosmjs/stargate": "^0.31.0",
"@finschia/finschia": "workspace:packages/finschia",
"eslint": "^7.5",
"karma-chrome-launcher": "^3.1.0",
Expand All @@ -49,5 +49,8 @@
"prettier": "^2.4.1",
"ts-node": "^8",
"typescript": "~4.4"
},
"dependencies": {
"cosmjs-types": "^0.8.0"
}
}
20 changes: 10 additions & 10 deletions packages/finschia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@
"pack-web": "yarn build-or-skip && webpack --mode development --config webpack.web.config.js"
},
"dependencies": {
"@cosmjs/amino": "^0.30.1",
"@cosmjs/cosmwasm-stargate": "^0.30.1",
"@cosmjs/crypto": "^0.30.1",
"@cosmjs/encoding": "^0.30.1",
"@cosmjs/math": "^0.30.1",
"@cosmjs/proto-signing": "^0.30.1",
"@cosmjs/stargate": "^0.30.1",
"@cosmjs/tendermint-rpc": "^0.30.1",
"@cosmjs/utils": "^0.30.1",
"@cosmjs/amino": "^0.31.0",
"@cosmjs/cosmwasm-stargate": "^0.31.0",
"@cosmjs/crypto": "^0.31.0",
"@cosmjs/encoding": "^0.31.0",
"@cosmjs/math": "^0.31.0",
"@cosmjs/proto-signing": "^0.31.0",
"@cosmjs/stargate": "^0.31.0",
"@cosmjs/tendermint-rpc": "^0.31.0",
"@cosmjs/utils": "^0.31.0",
"@finschia/finschia-proto": "^2.0.0-rc1",
"cosmjs-types": "^0.7.1",
"cosmjs-types": "^0.8.0",
"long": "^4.0.0",
"pako": "^2.0.2",
"protobufjs": "~6.10.2",
Expand Down
115 changes: 30 additions & 85 deletions packages/finschia/src/finschiaclient.searchtx.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ describe("FinschiaClient.getTx and .searchTx", () => {
assert(sendSuccessful, "value must be set in beforeAll()");
const client = await FinschiaClient.connect(simapp.tendermintUrl);
const result = await client.getTx(sendSuccessful.hash);
assert(result);
expect(result).toEqual(
jasmine.objectContaining({
height: sendSuccessful.height,
Expand All @@ -183,6 +184,7 @@ describe("FinschiaClient.getTx and .searchTx", () => {
assert(sendUnsuccessful, "value must be set in beforeAll()");
const client = await FinschiaClient.connect(simapp.tendermintUrl);
const result = await client.getTx(sendUnsuccessful.hash);
assert(result);
expect(result).toEqual(
jasmine.objectContaining({
height: sendUnsuccessful.height,
Expand All @@ -207,7 +209,7 @@ describe("FinschiaClient.getTx and .searchTx", () => {
pendingWithoutSimapp();
assert(sendSuccessful, "value must be set in beforeAll()");
const client = await FinschiaClient.connect(simapp.tendermintUrl);
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 @@ -223,7 +225,7 @@ describe("FinschiaClient.getTx and .searchTx", () => {
pendingWithoutSimapp();
assert(sendUnsuccessful, "value must be set in beforeAll()");
const client = await FinschiaClient.connect(simapp.tendermintUrl);
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 @@ -241,7 +243,8 @@ describe("FinschiaClient.getTx and .searchTx", () => {
pendingWithoutSimapp();
assert(sendSuccessful, "value must be set in beforeAll()");
const client = await FinschiaClient.connect(simapp.tendermintUrl);
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 @@ -269,7 +272,7 @@ describe("FinschiaClient.getTx and .searchTx", () => {
pendingWithoutSimapp();
assert(sendSuccessful, "value must be set in beforeAll()");
const client = await FinschiaClient.connect(simapp.tendermintUrl);
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 @@ -292,89 +295,31 @@ describe("FinschiaClient.getTx and .searchTx", () => {
}),
);
});

it("can search by recipient and filter by minHeight", async () => {
pendingWithoutSimapp();
assert(sendSuccessful);
const client = await FinschiaClient.connect(simapp.tendermintUrl);
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 () => {
pendingWithoutSimapp();
assert(sendSuccessful);
const client = await FinschiaClient.connect(simapp.tendermintUrl);
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);
}
});
zemyblue marked this conversation as resolved.
Show resolved Hide resolved
});

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

// Check basic structure of all results
for (const result of results) {
const tx = decodeTxRaw(result.tx);
const msg = fromOneElementArray(tx.body.messages);
expect(msg.typeUrl).toEqual("/cosmos.bank.v1beta1.MsgSend");
const decoded = registry.decode(msg);
expect(decoded.toAddress).toEqual(sendSuccessful.recipient);
}
it("works with tags", async () => {
pendingWithoutSimapp();
assert(sendSuccessful, "value must be set in beforeAll()");
const client = await FinschiaClient.connect(simapp.tendermintUrl);
const results = await client.searchTx([{ key: "transfer.recipient", value: sendSuccessful.recipient }]);
expect(results.length).toBeGreaterThanOrEqual(1);

// Check basic structure of all results
for (const result of results) {
const tx = decodeTxRaw(result.tx);
const msg = fromOneElementArray(tx.body.messages);
expect(msg.typeUrl).toEqual("/cosmos.bank.v1beta1.MsgSend");
const decoded = registry.decode(msg);
expect(decoded.toAddress).toEqual(sendSuccessful.recipient);
}

// Check details of most recent result
expect(results[results.length - 1]).toEqual(
jasmine.objectContaining({
height: sendSuccessful.height,
hash: sendSuccessful.hash,
tx: sendSuccessful.tx,
}),
);
});
// Check details of most recent result
expect(results[results.length - 1]).toEqual(
jasmine.objectContaining({
height: sendSuccessful.height,
hash: sendSuccessful.hash,
tx: sendSuccessful.tx,
}),
);
});
});
Loading