@cosmjs/tendermint-rpc
Advanced tools
Comparing version 0.26.4 to 0.26.5
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
488504
6607
+ Added@cosmjs/crypto@0.26.5(transitive)
+ Added@cosmjs/encoding@0.26.5(transitive)
+ Added@cosmjs/json-rpc@0.26.5(transitive)
+ Added@cosmjs/math@0.26.5(transitive)
+ Added@cosmjs/socket@0.26.5(transitive)
+ Added@cosmjs/stream@0.26.5(transitive)
+ Added@cosmjs/utils@0.26.5(transitive)
- Removed@cosmjs/crypto@0.26.4(transitive)
- Removed@cosmjs/encoding@0.26.4(transitive)
- Removed@cosmjs/json-rpc@0.26.4(transitive)
- Removed@cosmjs/math@0.26.4(transitive)
- Removed@cosmjs/socket@0.26.4(transitive)
- Removed@cosmjs/stream@0.26.4(transitive)
- Removed@cosmjs/utils@0.26.4(transitive)
Updated@cosmjs/crypto@0.26.5
Updated@cosmjs/encoding@0.26.5
Updated@cosmjs/json-rpc@0.26.5
Updated@cosmjs/math@0.26.5
Updated@cosmjs/socket@0.26.5
Updated@cosmjs/stream@0.26.5