From 50f3c9eb75bd700a4d2453cc74e4257fc0078ad7 Mon Sep 17 00:00:00 2001 From: Mahdi Yari <m.yary16@gmail.com> Date: Tue, 30 Jun 2020 17:10:37 +0430 Subject: [PATCH] fix import --- src/api/index.js | 6 +++--- src/auth/serializer/src/operations.js | 6 +++--- src/auth/serializer/src/types.js | 10 +++++----- src/formatter.js | 6 +++--- test/Crypto.js | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index c23eb7b..ec606f0 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,6 +1,6 @@ import EventEmitter from 'events'; import Promise from 'bluebird'; -import Config from '../config'; +import config from '../config'; import methods from './methods'; import transports from './transports'; import {RPCError} from './transports/http' @@ -197,7 +197,7 @@ class Hive extends EventEmitter { this.transport.setOptions(options); if( options.hasOwnProperty('useTestNet') ) { - Config.set( 'address_prefix', options.useTestNet ? 'TST' : 'STM' ) + config.set( 'address_prefix', options.useTestNet ? 'TST' : 'STM' ) } if (options.hasOwnProperty('url')) @@ -408,6 +408,6 @@ class Hive extends EventEmitter { } // Export singleton instance -const hive = new Hive(Config); +const hive = new Hive(config); exports = module.exports = hive; exports.Hive = Hive; diff --git a/src/auth/serializer/src/operations.js b/src/auth/serializer/src/operations.js index 545896e..149fdb5 100644 --- a/src/auth/serializer/src/operations.js +++ b/src/auth/serializer/src/operations.js @@ -33,10 +33,10 @@ static_variant [ import types from "./types" import SerializerImpl from "./serializer" -import Config from "../../../config" +import config from "../../../config" -const hiveVar = Config.get("rebranded_api") ? "hive" : "steem" -const hbdVar = Config.get("rebranded_api") ? "hbd" : "sbd" +const hiveVar = config.get("rebranded_api") ? "hive" : "steem" +const hbdVar = config.get("rebranded_api") ? "hbd" : "sbd" const { //id_type, diff --git a/src/auth/serializer/src/types.js b/src/auth/serializer/src/types.js index 6e1d18e..0296773 100644 --- a/src/auth/serializer/src/types.js +++ b/src/auth/serializer/src/types.js @@ -10,7 +10,7 @@ const chain_types = require('./ChainTypes') import { PublicKey, Address, ecc_config } from "../../ecc" import { fromImpliedDecimal } from "./number_utils" -import Config from "../../../config.js" +import config from "../../../config.js" const Types = {} module.exports = Types @@ -132,11 +132,11 @@ Types.asset = { { case "@@000000021": precision = 3 - symbol = Config.get( "address_prefix" ) == "STM" ? "STEEM" : "TESTS" + symbol = config.get( "address_prefix" ) == "STM" ? "STEEM" : "TESTS" break case "@@000000013": precision = 3 - symbol = Config.get( "address_prefix" ) == "STM" ? "SBD" : "TBD" + symbol = config.get( "address_prefix" ) == "STM" ? "SBD" : "TBD" break case "@@000000037": precision = 6 @@ -252,11 +252,11 @@ Types.asset_symbol = { { case "@@000000021": precision = 3 - symbol = Config.get( "address_prefix" ) == "STM" ? "STEEM" : "TESTS" + symbol = config.get( "address_prefix" ) == "STM" ? "STEEM" : "TESTS" break case "@@000000013": precision = 3 - symbol = Config.get( "address_prefix" ) == "STM" ? "SBD" : "TBD" + symbol = config.get( "address_prefix" ) == "STM" ? "SBD" : "TBD" break case "@@000000037": precision = 6 diff --git a/src/formatter.js b/src/formatter.js index 261c8bf..aee5c57 100644 --- a/src/formatter.js +++ b/src/formatter.js @@ -1,9 +1,9 @@ import get from "lodash/get"; import { key_utils } from "./auth/ecc"; -import Config from "./config" +import config from "./config" -const HiveVar = Config.get("rebranded_api") ? "hive" : "steem" -const HbdVar = Config.get("rebranded_api") ? "hbd" : "sbd" +const HiveVar = config.get("rebranded_api") ? "hive" : "steem" +const HbdVar = config.get("rebranded_api") ? "hbd" : "sbd" module.exports = hiveAPI => { function numberWithCommas(x) { diff --git a/test/Crypto.js b/test/Crypto.js index 4fabdbb..a508bc0 100644 --- a/test/Crypto.js +++ b/test/Crypto.js @@ -1,4 +1,4 @@ -import Config from "../src/config" +import config from "../src/config" import { Aes, PrivateKey, PublicKey, Signature } from "../src/auth/ecc" import assert from "assert" @@ -27,7 +27,7 @@ describe("steem.auth: Crypto", function() { }) describe("steem.auth: derives", ()=> { - let prefix = Config.get("address_prefix") + let prefix = config.get("address_prefix") let one_time_private = PrivateKey.fromHex("8fdfdde486f696fd7c6313325e14d3ff0c34b6e2c390d1944cbfe150f4457168") let to_public = PublicKey.fromStringOrThrow(prefix + "7vbxtK1WaZqXsiCHPcjVFBewVj8HFRd5Z5XZDpN6Pvb2dZcMqK") let secret = one_time_private.get_shared_secret( to_public ) -- GitLab