Retrieve block headers only for header-only info (#5480)
* Add parity_getBlockHeaderByNumber * Use parity_getBlockHeaderByNumber for retrieval
This commit is contained in:
@@ -14,10 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import {
|
||||
inAddress, inAddresses, inData, inHex, inNumber16, inOptions, inBlockNumber, inDeriveHash, inDeriveIndex
|
||||
} from '../../format/input';
|
||||
import { outAccountInfo, outAddress, outAddresses, outChainStatus, outHistogram, outHwAccountInfo, outNodeKind, outNumber, outPeers, outRecentDapps, outTransaction, outVaultMeta } from '../../format/output';
|
||||
import { inAddress, inAddresses, inBlockNumber, inData, inDeriveHash, inDeriveIndex, inHex, inNumber16, inOptions } from '../../format/input';
|
||||
import { outAccountInfo, outAddress, outAddresses, outBlock, outChainStatus, outHistogram, outHwAccountInfo, outNodeKind, outNumber, outPeers, outRecentDapps, outTransaction, outVaultMeta } from '../../format/output';
|
||||
|
||||
export default class Parity {
|
||||
constructor (transport) {
|
||||
@@ -189,6 +187,12 @@ export default class Parity {
|
||||
.execute('parity_generateSecretPhrase');
|
||||
}
|
||||
|
||||
getBlockHeaderByNumber (blockNumber = 'latest') {
|
||||
return this._transport
|
||||
.execute('parity_getBlockHeaderByNumber', inBlockNumber(blockNumber))
|
||||
.then(outBlock);
|
||||
}
|
||||
|
||||
getDappAddresses (dappId) {
|
||||
return this._transport
|
||||
.execute('parity_getDappAddresses', dappId)
|
||||
|
||||
Reference in New Issue
Block a user