Skip to content

Commit

Permalink
blockchain: cleanup deprecated methods
Browse files Browse the repository at this point in the history
Deprecation details are in CHANGELOG.md
  • Loading branch information
braydonf committed May 15, 2019
1 parent 372b9f9 commit 662a68c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 202 deletions.
84 changes: 0 additions & 84 deletions lib/blockchain/chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -1948,75 +1948,6 @@ class Chain extends AsyncEmitter {
return this.db.getBlockView(block);
}

/**
* Get a transaction with metadata.
* @param {Hash} hash
* @returns {Promise} - Returns {@link TXMeta}.
*/

getMeta(hash) {
return this.db.getMeta(hash);
}

/**
* Retrieve a transaction.
* @param {Hash} hash
* @returns {Promise} - Returns {@link TX}.
*/

getTX(hash) {
return this.db.getTX(hash);
}

/**
* @param {Hash} hash
* @returns {Promise} - Returns Boolean.
*/

hasTX(hash) {
return this.db.hasTX(hash);
}

/**
* Get all coins pertinent to an address.
* @param {Address[]} addrs
* @returns {Promise} - Returns {@link Coin}[].
*/

getCoinsByAddress(addrs) {
return this.db.getCoinsByAddress(addrs);
}

/**
* Get all transaction hashes to an address.
* @param {Address[]} addrs
* @returns {Promise} - Returns {@link Hash}[].
*/

getHashesByAddress(addrs) {
return this.db.getHashesByAddress(addrs);
}

/**
* Get all transactions pertinent to an address.
* @param {Address[]} addrs
* @returns {Promise} - Returns {@link TX}[].
*/

getTXByAddress(addrs) {
return this.db.getTXByAddress(addrs);
}

/**
* Get all transactions pertinent to an address.
* @param {Address[]} addrs
* @returns {Promise} - Returns {@link TXMeta}[].
*/

getMetaByAddress(addrs) {
return this.db.getMetaByAddress(addrs);
}

/**
* Get an orphan block.
* @param {Hash} hash
Expand Down Expand Up @@ -2057,21 +1988,6 @@ class Chain extends AsyncEmitter {
return this.db.getCoinView(tx);
}

/**
* Get coin viewpoint (spent).
* @param {TXMeta} meta
* @returns {Promise} - Returns {@link CoinView}.
*/

async getSpentView(meta) {
const unlock = await this.locker.lock();
try {
return await this.db.getSpentView(meta);
} finally {
unlock();
}
}

/**
* Test the chain to see if it is synced.
* @returns {Boolean}
Expand Down
118 changes: 0 additions & 118 deletions lib/blockchain/chaindb.js
Original file line number Diff line number Diff line change
Expand Up @@ -962,20 +962,6 @@ class ChainDB {
return view;
}

/**
* Get coin viewpoint (historical).
* @param {TXMeta} meta
* @returns {Promise} - Returns {@link CoinView}.
*/

async getSpentView(meta) {
process.emitWarning(
'deprecated, use node.txindex.getSpentView',
'DeprecationWarning'
);
return null;
}

/**
* Get coins necessary to be resurrected during a reorg.
* @param {Hash} hash
Expand Down Expand Up @@ -1052,110 +1038,6 @@ class ChainDB {
return view;
}

/**
* Get a transaction with metadata.
* @param {Hash} hash
* @deprecated
* @returns {Promise} - Returns {@link TXMeta}.
*/

async getMeta(hash) {
process.emitWarning(
'deprecated, use node.txindex.getMeta',
'DeprecationWarning'
);
return null;
}

/**
* Retrieve a transaction.
* @param {Hash} hash
* @deprecated
* @returns {Promise} - Returns {@link TX}.
*/

async getTX(hash) {
process.emitWarning(
'deprecated, use node.txindex.getTX',
'DeprecationWarning'
);
return null;
}

/**
* @param {Hash} hash
* @deprecated
* @returns {Promise} - Returns Boolean.
*/

async hasTX(hash) {
process.emitWarning(
'deprecated, use node.txindex.hasTX',
'DeprecationWarning'
);
return false;
}

/**
* Get all coins pertinent to an address.
* @param {Address[]} addrs
* @deprecated
* @returns {Promise} - Returns {@link Coin}[].
*/

async getCoinsByAddress(addrs) {
process.emitWarning(
'deprecated, use node.addrindex.getCoinsByAddress',
'DeprecationWarning'
);
return [];
}

/**
* Get all transaction hashes to an address.
* @param {Address[]} addrs
* @deprecated
* @returns {Promise} - Returns {@link Hash}[].
*/

async getHashesByAddress(addrs) {
process.emitWarning(
'deprecated, use node.addrindex.getHashesByAddress',
'DeprecationWarning'
);
return [];
}

/**
* Get all transactions pertinent to an address.
* @param {Address[]} addrs
* @deprecated
* @returns {Promise} - Returns {@link TX}[].
*/

async getTXByAddress(addrs) {
process.emitWarning(
'deprecated, use node.addrindex.getHashesByAddress',
'DeprecationWarning'
);
return [];
}

/**
* Get all transactions pertinent to an address.
* @param {Address[]} addrs
* @deprecated
* @returns {Promise} - Returns {@link TXMeta}[].
*/

async getMetaByAddress(addrs) {
process.emitWarning(
'deprecated, use node.addrindex.getMetaByAddress',
'DeprecationWarning'
);
return [];
}

/**
* Scan the blockchain for transactions containing specified address hashes.
* @param {Hash} start - Block hash to start at.
Expand Down

0 comments on commit 662a68c

Please sign in to comment.