blockchain: cleanup deprecated methods
Deprecation details are in CHANGELOG.md
This commit is contained in:
parent
372b9f9803
commit
662a68cf10
@ -1948,75 +1948,6 @@ class Chain extends AsyncEmitter {
|
|||||||
return this.db.getBlockView(block);
|
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.
|
* Get an orphan block.
|
||||||
* @param {Hash} hash
|
* @param {Hash} hash
|
||||||
@ -2057,21 +1988,6 @@ class Chain extends AsyncEmitter {
|
|||||||
return this.db.getCoinView(tx);
|
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.
|
* Test the chain to see if it is synced.
|
||||||
* @returns {Boolean}
|
* @returns {Boolean}
|
||||||
|
|||||||
@ -962,20 +962,6 @@ class ChainDB {
|
|||||||
return view;
|
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.
|
* Get coins necessary to be resurrected during a reorg.
|
||||||
* @param {Hash} hash
|
* @param {Hash} hash
|
||||||
@ -1052,110 +1038,6 @@ class ChainDB {
|
|||||||
return view;
|
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.
|
* Scan the blockchain for transactions containing specified address hashes.
|
||||||
* @param {Hash} start - Block hash to start at.
|
* @param {Hash} start - Block hash to start at.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user