@parity/api
Version:
The Parity Promise-based API library for interfacing with Ethereum over RPC
70 lines (69 loc) • 2.88 kB
JavaScript
;
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
/* eslint-disable no-unused-expressions */
var createHttpApi = require('../../test/e2e/ethapi').createHttpApi;
describe('ethapi.parity', function () {
var ethapi = createHttpApi();
describe('chainStatus', function () {
it('returns and translates the status', function () {
return ethapi.parity.chainStatus().then(function (value) {
expect(value).to.be.ok;
});
});
});
describe('gasFloorTarget', function () {
it('returns and translates the target', function () {
return ethapi.parity.gasFloorTarget().then(function (value) {
expect(value.gt(0)).to.be.true;
});
});
});
describe('gasPriceHistogram', function () {
it('returns and translates the target', function () {
return ethapi.parity.gasPriceHistogram().then(function (result) {
expect(Object.keys(result)).to.deep.equal(['bucketBounds', 'counts']);
expect(result.bucketBounds.length > 0).to.be.true;
expect(result.counts.length > 0).to.be.true;
});
});
});
describe('netChain', function () {
it('returns and the chain', function () {
return ethapi.parity.netChain().then(function (value) {
expect(value).to.equal('morden');
});
});
});
describe('netPort', function () {
it('returns and translates the port', function () {
return ethapi.parity.netPort().then(function (value) {
expect(value.gt(0)).to.be.true;
});
});
});
describe('transactionsLimit', function () {
it('returns and translates the limit', function () {
return ethapi.parity.transactionsLimit().then(function (value) {
expect(value.gt(0)).to.be.true;
});
});
});
describe('rpcSettings', function () {
it('returns and translates the settings', function () {
return ethapi.parity.rpcSettings().then(function (value) {
expect(value).to.be.ok;
});
});
});
});