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

update imports for [email protected] #188

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@rsksmart/nod3": "^0.5.0",
"@rsksmart/rsk-contract-parser": "^1.0.4",
"@rsksmart/rsk-js-cli": "^1.0.0",
"@rsksmart/rsk-utils": "^1.1.0",
"@rsksmart/rsk-utils": "^2.0.5",
"bignumber.js": "^7.2.1",
"body-parser": "^1.19.0",
"bunyan": "^2.0.4",
Expand Down
3 changes: 2 additions & 1 deletion src/api/lib/blocksMetadata.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import { newBigNumber, add0x } from '../../lib/utils'
import { newBigNumber } from '../../lib/utils'
import { add0x } from '@rsksmart/rsk-utils'
export const BLOCK_METADATA_FIELD = '_metadata'

export function addMetadataToBlocks (blocks) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/NativeContracts.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isAddress } from './utils'
import { isAddress } from '@rsksmart/rsk-utils'

export const nativeContracts = {
bridge: '0x0000000000000000000000000000000001000006',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/btcUtils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import crypto from 'crypto'
import * as bs58 from 'bs58'
import { remove0x, add0x, keccak256 } from './utils'
import { remove0x, add0x, keccak256 } from '@rsksmart/rsk-utils'
import secp256k1 from 'secp256k1'

const PREFIXES = {
Expand Down
3 changes: 2 additions & 1 deletion src/lib/ids.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { isTxOrBlockHash, isBlockHash } from './utils'
import { isBlockHash } from './utils'
import { isTxOrBlockHash } from '@rsksmart/rsk-utils'

const checkNumbers = payload => {
for (let name in payload) {
Expand Down
1 change: 0 additions & 1 deletion src/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { BigNumber } from 'bignumber.js'
import { BIG_NUMBER } from './types'
import { remove0x, toBuffer, isAddress } from '@rsksmart/rsk-utils'
import crypto from 'crypto'
export * from '@rsksmart/rsk-utils'

export function convertUnixTimestampToISO (unixTimestamp) {
return new Date(unixTimestamp * 1000).toISOString()
Expand Down
2 changes: 1 addition & 1 deletion src/repositories/token.repository.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { rawTokenToEntity, tokenEntityToRaw, tokensByAddressEntityToRaw } from '../converters/token.converters'
import { addressRelatedTables } from './includeRelatedTables'
import { generateFindQuery } from './utils'
import { isAddress } from '@rsksmart/rsk-utils/dist/addresses'
import { isAddress } from '@rsksmart/rsk-utils'

export function getTokenRepository (prismaClient) {
return {
Expand Down
4 changes: 2 additions & 2 deletions src/services/classes/Address.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { BcThing } from './BcThing'
import { isBlockObject, isNullData, isAddress, isValidBlockNumber } from '../../lib/utils'
import { isBlockObject, isValidBlockNumber } from '../../lib/utils'
import { isAddress, isNullData, isZeroAddress } from '@rsksmart/rsk-utils'
import { fields, addrTypes } from '../../lib/types'
import Contract from './Contract'
import { BcSearch } from '@rsksmart/rsk-contract-parser'
import { createTxObject } from './Tx'
import { InternalTx, checkInternalTransactionData } from './InternalTx'
import { isZeroAddress } from '@rsksmart/rsk-utils'
import { getNativeContractName, isNativeContract } from '../../lib/NativeContracts'

export class Address extends BcThing {
Expand Down
2 changes: 1 addition & 1 deletion src/services/classes/Addresses.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Address from './Address'
import { isAddress } from '../../lib/utils'
import { isAddress } from '@rsksmart/rsk-utils'

export class Addresses {
constructor ({ nod3, initConfig }) {
Expand Down
3 changes: 2 additions & 1 deletion src/services/classes/BcThing.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { isAddress, serialize, isTxOrBlockHash, isBlockHash } from '../../lib/utils'
import { serialize, isBlockHash } from '../../lib/utils'
import { isAddress, isTxOrBlockHash } from '@rsksmart/rsk-utils'
import { REPOSITORIES } from '../../repositories'
export class BcThing {
constructor ({ nod3, initConfig, log, name } = {}) {
Expand Down
2 changes: 1 addition & 1 deletion src/services/classes/BlockSummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Tx from './Tx'
import BlockTrace from './BlockTrace'
import { BlockAddresses } from './BlockAddresses'
import { isBlockHash } from '../../lib/utils'
import { isAddress } from '@rsksmart/rsk-utils/dist/addresses'
import { isAddress } from '@rsksmart/rsk-utils'
import config from '../../lib/config'

export class BlockSummary extends BcThing {
Expand Down
3 changes: 2 additions & 1 deletion src/services/classes/Contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { BcThing } from './BcThing'
import ContractParser from '@rsksmart/rsk-contract-parser'
import { NULL_BALANCE, tokensInterfaces } from '../../lib/types'
import TokenAddress from './TokenAddress'
import { chunkArray, hasValue } from '../../lib/utils'
import { chunkArray } from '../../lib/utils'
import { hasValue } from '@rsksmart/rsk-utils'
import { REPOSITORIES } from '../../repositories'
import { isNativeContract } from '../../lib/NativeContracts'
import config from '../../lib/config'
Expand Down
3 changes: 2 additions & 1 deletion src/services/classes/InternalTx.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BcThing } from './BcThing'
import { generateId } from '../../lib/ids'
import { isBlockHash, isAddress, convertUnixTimestampToISO } from '../../lib/utils'
import { isBlockHash, convertUnixTimestampToISO } from '../../lib/utils'
import { isAddress } from '@rsksmart/rsk-utils'

const ITX_FIELDS = {
blockNumber: null,
Expand Down
4 changes: 2 additions & 2 deletions src/services/classes/TokenAddress.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BcThing } from './BcThing'
import Contract from './Contract'
import { isBlockObject, isAddress } from '../../lib/utils'
import { isZeroAddress } from '@rsksmart/rsk-utils'
import { isBlockObject } from '../../lib/utils'
import { isZeroAddress, isAddress } from '@rsksmart/rsk-utils'

export class TokenAddress extends BcThing {
constructor (tokenAddress, contract) {
Expand Down
3 changes: 2 additions & 1 deletion src/services/classes/TxPool.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import BlocksBase from '../../lib/BlocksBase'
import { isHexString, base64toHex, convertUnixTimestampToISO } from '../../lib/utils'
import { convertUnixTimestampToISO } from '../../lib/utils'
import { isHexString, base64toHex } from '@rsksmart/rsk-utils'
import { REPOSITORIES } from '../../repositories'
export class TxPool extends BlocksBase {
constructor (options) {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/getContractDeploymentBlock.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isAddress } from '@rsksmart/rsk-utils/dist/addresses'
import { isAddress } from '@rsksmart/rsk-utils'
import nod3 from '../lib/nod3Connect'
import { BcSearch } from '@rsksmart/rsk-contract-parser'

Expand Down
Loading