Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cosmjs/tendermint-rpc

Package Overview
Dependencies
Maintainers
3
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cosmjs/tendermint-rpc - npm Package Compare versions

Comparing version 0.26.4 to 0.26.5

4

build/tendermint33/adaptor/responses.js

@@ -54,3 +54,3 @@ "use strict";

function decodeEvents(events) {
return encodings_1.assertArray(events).map(decodeEvent);
return encodings_1.assertArray(events !== null && events !== void 0 ? events : []).map(decodeEvent);
}

@@ -356,3 +356,3 @@ function decodeTxData(data) {

static decodeBroadcastTxAsync(response) {
return this.decodeBroadcastTxSync(response);
return Responses.decodeBroadcastTxSync(response);
}

@@ -359,0 +359,0 @@ static decodeBroadcastTxCommit(response) {

@@ -57,17 +57,42 @@ "use strict";

});
it("can broadcast a transaction", async () => {
testutil_spec_1.pendingWithoutTendermint();
const client = await tendermint33client_1.Tendermint33Client.create(rpcFactory());
const tx = testutil_spec_1.buildKvTx(testutil_spec_1.randomString(), testutil_spec_1.randomString());
const response = await client.broadcastTxCommit({ tx: tx });
expect(response.height).toBeGreaterThan(2);
expect(response.hash).toBeTruthy();
// verify success
expect(response.checkTx.code).toBeFalsy();
expect(response.deliverTx).toBeTruthy();
if (response.deliverTx) {
expect(response.deliverTx.code).toBeFalsy();
}
client.disconnect();
describe("broadcastTxCommit", () => {
it("can broadcast a transaction", async () => {
testutil_spec_1.pendingWithoutTendermint();
const client = await tendermint33client_1.Tendermint33Client.create(rpcFactory());
const tx = testutil_spec_1.buildKvTx(testutil_spec_1.randomString(), testutil_spec_1.randomString());
const response = await client.broadcastTxCommit({ tx: tx });
expect(response.height).toBeGreaterThan(2);
expect(response.hash).toBeTruthy();
// verify success
expect(response.checkTx.code).toBeFalsy();
expect(response.deliverTx).toBeTruthy();
if (response.deliverTx) {
expect(response.deliverTx.code).toBeFalsy();
}
client.disconnect();
});
});
describe("broadcastTxSync", () => {
it("can broadcast a transaction", async () => {
testutil_spec_1.pendingWithoutTendermint();
const client = await tendermint33client_1.Tendermint33Client.create(rpcFactory());
const tx = testutil_spec_1.buildKvTx(testutil_spec_1.randomString(), testutil_spec_1.randomString());
const response = await client.broadcastTxSync({ tx: tx });
expect(response.hash.length).toEqual(32);
// verify success
expect(response.code).toBeFalsy();
client.disconnect();
});
});
describe("broadcastTxAsync", () => {
it("can broadcast a transaction", async () => {
testutil_spec_1.pendingWithoutTendermint();
const client = await tendermint33client_1.Tendermint33Client.create(rpcFactory());
const tx = testutil_spec_1.buildKvTx(testutil_spec_1.randomString(), testutil_spec_1.randomString());
const response = await client.broadcastTxAsync({ tx: tx });
// TODO: Remove any cast after https://github.com/cosmos/cosmjs/issues/938
expect(response.hash.length).toEqual(32);
client.disconnect();
});
});
it("gets the same tx hash from backend as calculated locally", async () => {

@@ -74,0 +99,0 @@ testutil_spec_1.pendingWithoutTendermint();

@@ -383,3 +383,3 @@ "use strict";

static decodeBroadcastTxAsync(response) {
return this.decodeBroadcastTxSync(response);
return Responses.decodeBroadcastTxSync(response);
}

@@ -386,0 +386,0 @@ static decodeBroadcastTxCommit(response) {

@@ -57,17 +57,43 @@ "use strict";

});
it("can broadcast a transaction", async () => {
testutil_spec_1.pendingWithoutTendermint();
const client = await tendermint34client_1.Tendermint34Client.create(rpcFactory());
const tx = testutil_spec_1.buildKvTx(testutil_spec_1.randomString(), testutil_spec_1.randomString());
const response = await client.broadcastTxCommit({ tx: tx });
expect(response.height).toBeGreaterThan(2);
expect(response.hash).toBeTruthy();
// verify success
expect(response.checkTx.code).toBeFalsy();
expect(response.deliverTx).toBeTruthy();
if (response.deliverTx) {
expect(response.deliverTx.code).toBeFalsy();
}
client.disconnect();
describe("broadcastTxCommit", () => {
it("can broadcast a transaction", async () => {
testutil_spec_1.pendingWithoutTendermint();
const client = await tendermint34client_1.Tendermint34Client.create(rpcFactory());
const tx = testutil_spec_1.buildKvTx(testutil_spec_1.randomString(), testutil_spec_1.randomString());
const response = await client.broadcastTxCommit({ tx: tx });
expect(response.height).toBeGreaterThan(2);
expect(response.hash).toBeTruthy();
// verify success
expect(response.checkTx.code).toBeFalsy();
expect(response.deliverTx).toBeTruthy();
if (response.deliverTx) {
expect(response.deliverTx.code).toBeFalsy();
}
client.disconnect();
});
});
describe("broadcastTxSync", () => {
it("can broadcast a transaction", async () => {
testutil_spec_1.pendingWithoutTendermint();
const client = await tendermint34client_1.Tendermint34Client.create(rpcFactory());
const tx = testutil_spec_1.buildKvTx(testutil_spec_1.randomString(), testutil_spec_1.randomString());
const response = await client.broadcastTxSync({ tx: tx });
expect(response.hash.length).toEqual(32);
// verify success
expect(response.code).toBeFalsy();
expect(response.codeSpace).toBeFalsy();
client.disconnect();
});
});
describe("broadcastTxAsync", () => {
it("can broadcast a transaction", async () => {
testutil_spec_1.pendingWithoutTendermint();
const client = await tendermint34client_1.Tendermint34Client.create(rpcFactory());
const tx = testutil_spec_1.buildKvTx(testutil_spec_1.randomString(), testutil_spec_1.randomString());
const response = await client.broadcastTxAsync({ tx: tx });
// TODO: Remove any cast after https://github.com/cosmos/cosmjs/issues/938
expect(response.hash.length).toEqual(32);
client.disconnect();
});
});
it("gets the same tx hash from backend as calculated locally", async () => {

@@ -74,0 +100,0 @@ testutil_spec_1.pendingWithoutTendermint();

{
"name": "@cosmjs/tendermint-rpc",
"version": "0.26.4",
"version": "0.26.5",
"description": "Tendermint RPC clients",

@@ -45,8 +45,8 @@ "contributors": [

"dependencies": {
"@cosmjs/crypto": "0.26.4",
"@cosmjs/encoding": "0.26.4",
"@cosmjs/json-rpc": "0.26.4",
"@cosmjs/math": "0.26.4",
"@cosmjs/socket": "0.26.4",
"@cosmjs/stream": "0.26.4",
"@cosmjs/crypto": "0.26.5",
"@cosmjs/encoding": "0.26.5",
"@cosmjs/json-rpc": "0.26.5",
"@cosmjs/math": "0.26.5",
"@cosmjs/socket": "0.26.5",
"@cosmjs/stream": "0.26.5",
"axios": "^0.21.2",

@@ -57,3 +57,3 @@ "readonly-date": "^1.0.0",

"devDependencies": {
"@cosmjs/utils": "0.26.4",
"@cosmjs/utils": "0.26.5",
"@istanbuljs/nyc-config-typescript": "^1.0.1",

@@ -85,3 +85,3 @@ "@types/eslint-plugin-prettier": "^3",

"nyc": "^15.1.0",
"prettier": "^2.3.2",
"prettier": "^2.4.1",
"ses": "^0.11.0",

@@ -88,0 +88,0 @@ "source-map-support": "^0.5.19",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc