Skip to content
This repository has been archived by the owner on Jun 27, 2022. It is now read-only.

[VG-2685] Get blockchain name from folder name #775

Merged
merged 1 commit into from
Jan 31, 2022
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const {
} = require("../../../packages/cryptoassets/lib/currencies");

const inferChainId = (common, folder) =>
getCryptoCurrencyById(common.blockchain_name).ethereumLikeInfo.chainId;
getCryptoCurrencyById(path.basename(path.dirname(folder))).ethereumLikeInfo.chainId;

const asUint4be = (n) => {
const b = Buffer.alloc(4);
Expand Down
6 changes: 3 additions & 3 deletions script/crypto-assets-importer/importers/erc20full.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const {
getCryptoCurrencyById,
} = require("../../../packages/cryptoassets/lib/currencies");

const inferParentCurrency = (common) =>
getCryptoCurrencyById(common.blockchain_name).id;
const inferParentCurrency = (common, folder) =>
getCryptoCurrencyById(path.basename(path.dirname(folder))).id;

const withoutExtraComma = (str) => {
const m = str.match(/,+$/);
Expand Down Expand Up @@ -112,7 +112,7 @@ ${data
const ticker = common.ticker.toUpperCase();
const magnitude = common.decimals;
const contractAddress = common.contract_address;
const parentCurrency = inferParentCurrency(common);
const parentCurrency = inferParentCurrency(common, folder);
const disableCountervalue = !!common.disable_countervalue;
const delisted = !!common.delisted;
const countervalueTicker = common.countervalue_ticker;
Expand Down