Avoid manipulating the $protobuf object

This commit is contained in:
Simon Warta 2020-08-13 10:48:43 +02:00
parent ab72909e60
commit db2969d924
4 changed files with 10 additions and 2 deletions

View File

@ -28,3 +28,7 @@ yarn pbjs \
"$TENDERMINT_PROTO_DIR/crypto/merkle/merkle.proto" \
"$TENDERMINT_PROTO_DIR/libs/kv/types.proto" \
"$GOOGLE_PROTO_DIR/protobuf/any.proto"
# Work around https://github.com/protobufjs/protobuf.js/issues/1477
# shellcheck disable=SC2016
sed -i "" -e 's/^const \$root =.*$/const \$root = {};/' "$GENERATED_DIR/codecimpl.js"

View File

@ -5,7 +5,7 @@ var $protobuf = require("protobufjs/minimal");
const $Reader = $protobuf.Reader,
$Writer = $protobuf.Writer,
$util = $protobuf.util;
const $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
const $root = {};
exports.cosmos = $root.cosmos = (() => {
const cosmos = {};
cosmos.Coin = (function () {

View File

@ -30,3 +30,7 @@ yarn pbjs \
"$TENDERMINT_PROTO_DIR/crypto/merkle/merkle.proto" \
"$TENDERMINT_PROTO_DIR/libs/kv/types.proto" \
"$GOOGLE_PROTO_DIR/protobuf/any.proto"
# Work around https://github.com/protobufjs/protobuf.js/issues/1477
# shellcheck disable=SC2016
sed -i "" -e 's/^const \$root =.*$/const \$root = {};/' "$GENERATED_DIR/codecimpl.js"

View File

@ -5,7 +5,7 @@ var $protobuf = require("protobufjs/minimal");
const $Reader = $protobuf.Reader,
$Writer = $protobuf.Writer,
$util = $protobuf.util;
const $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
const $root = {};
exports.cosmos = $root.cosmos = (() => {
const cosmos = {};
cosmos.Coin = (function () {