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

Remove an unnecessary RPC request due to detectVersion method #1607

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions jasmine-global-variables.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const process = {
env: {
HTTPSERVER_ENABLED: 1,
SIMAPP44_ENABLED: 1,
SLOW_SIMAPP44_ENABLED: 1,
TENDERMINT_ENABLED: 1,
SOCKETSERVER_ENABLED: 1,
SKIP_BUILD: 1,
WASMD_ENABLED: 1
}
};
2 changes: 1 addition & 1 deletion packages/amino/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function (config) {
frameworks: ["jasmine"],

// list of files / patterns to load in the browser
files: ["dist/web/tests.js"],
files: ["../../jasmine-global-variables.js", "dist/web/tests.js"],

client: {
jasmine: {
Expand Down
2 changes: 1 addition & 1 deletion packages/cosmwasm-stargate/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function (config) {
frameworks: ["jasmine"],

// list of files / patterns to load in the browser
files: ["dist/web/tests.js"],
files: ["../../jasmine-global-variables.js", "dist/web/tests.js"],

client: {
jasmine: {
Expand Down
2 changes: 1 addition & 1 deletion packages/crypto/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function (config) {
frameworks: ["jasmine"],

// list of files / patterns to load in the browser
files: ["dist/web/tests.js"],
files: ["../../jasmine-global-variables.js", "dist/web/tests.js"],

client: {
jasmine: {
Expand Down
2 changes: 1 addition & 1 deletion packages/encoding/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function (config) {
frameworks: ["jasmine"],

// list of files / patterns to load in the browser
files: ["dist/web/tests.js"],
files: ["../../jasmine-global-variables.js", "dist/web/tests.js"],

client: {
jasmine: {
Expand Down
2 changes: 1 addition & 1 deletion packages/faucet-client/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function (config) {
frameworks: ["jasmine"],

// list of files / patterns to load in the browser
files: ["dist/web/tests.js"],
files: ["../../jasmine-global-variables.js", "dist/web/tests.js"],

client: {
jasmine: {
Expand Down
2 changes: 1 addition & 1 deletion packages/math/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function (config) {
frameworks: ["jasmine"],

// list of files / patterns to load in the browser
files: ["dist/web/tests.js"],
files: ["../../jasmine-global-variables.js", "dist/web/tests.js"],

client: {
jasmine: {
Expand Down
2 changes: 1 addition & 1 deletion packages/proto-signing/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function (config) {
frameworks: ["jasmine"],

// list of files / patterns to load in the browser
files: ["dist/web/tests.js"],
files: ["../../jasmine-global-variables.js", "dist/web/tests.js"],

client: {
jasmine: {
Expand Down
2 changes: 1 addition & 1 deletion packages/socket/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function (config) {
frameworks: ["jasmine"],

// list of files / patterns to load in the browser
files: ["dist/web/tests.js"],
files: ["../../jasmine-global-variables.js", "dist/web/tests.js"],

client: {
jasmine: {
Expand Down
2 changes: 1 addition & 1 deletion packages/stargate/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function (config) {
frameworks: ["jasmine"],

// list of files / patterns to load in the browser
files: ["dist/web/tests.js"],
files: ["../../jasmine-global-variables.js", "dist/web/tests.js"],

client: {
jasmine: {
Expand Down
2 changes: 1 addition & 1 deletion packages/stream/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function (config) {
frameworks: ["jasmine"],

// list of files / patterns to load in the browser
files: ["dist/web/tests.js"],
files: ["../../jasmine-global-variables.js", "dist/web/tests.js"],

client: {
jasmine: {
Expand Down
2 changes: 1 addition & 1 deletion packages/tendermint-rpc/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function (config) {
frameworks: ["jasmine"],

// list of files / patterns to load in the browser
files: ["dist/web/tests.js"],
files: ["../../jasmine-global-variables.js", "dist/web/tests.js"],

client: {
jasmine: {
Expand Down
6 changes: 5 additions & 1 deletion packages/tendermint-rpc/src/comet38/comet38client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ export class Comet38Client {
// (our CI) when skipping the status call before doing other queries. Sleeping a little
// while did not help. Thus we query the version as a way to say "hi" to the backend,
// even in cases where we don't use the result.
const _version = await this.detectVersion(rpcClient);
// However we can run this code only inside our CI, so we don't have to run this code inside the prod build,
// this avoids an unnecessary request to the RPC nodes
if (process.env.TENDERMINT_ENABLED) {
const _version = await this.detectVersion(rpcClient);
}

return Comet38Client.create(rpcClient);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ export class Tendermint34Client {
// (our CI) when skipping the status call before doing other queries. Sleeping a little
// while did not help. Thus we query the version as a way to say "hi" to the backend,
// even in cases where we don't use the result.
const _version = await this.detectVersion(rpcClient);
// However we can run this code only inside our CI, so we don't have to run this code inside the prod build,
// this avoids an unnecessary request to the RPC nodes
if (process.env.TENDERMINT_ENABLED) {
const _version = await this.detectVersion(rpcClient);
}

return Tendermint34Client.create(rpcClient);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ export class Tendermint37Client {
// (our CI) when skipping the status call before doing other queries. Sleeping a little
// while did not help. Thus we query the version as a way to say "hi" to the backend,
// even in cases where we don't use the result.
const _version = await this.detectVersion(rpcClient);
// However we can run this code only inside our CI, so we don't have to run this code inside the prod build,
// this avoids an unnecessary request to the RPC nodes
if (process.env.TENDERMINT_ENABLED) {
const _version = await this.detectVersion(rpcClient);
}

return Tendermint37Client.create(rpcClient);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function (config) {
frameworks: ["jasmine"],

// list of files / patterns to load in the browser
files: ["dist/web/tests.js"],
files: ["../../jasmine-global-variables.js", "dist/web/tests.js"],

client: {
jasmine: {
Expand Down
Loading