Remove ledger methods from Connection (#1543)

* remove ledger subscription from connection

* remove more client ledger stuff

* resolve TS concerns

* fix all tests except broadcast tests

* fix broadcast tests

* clean up more ledger stuff in testing

* respond to comments
This commit is contained in:
Mayukha Vadari
2021-08-23 15:18:21 -04:00
parent 0b08de5956
commit 52f1789ecd
23 changed files with 237 additions and 503 deletions

View File

@@ -2,10 +2,8 @@ import assert from 'assert-diff'
import _ from 'lodash'
import {Client} from 'xrpl-local'
import {RecursiveData} from 'xrpl-local/ledger/utils'
import {assertRejects, assertResultMatch} from './utils'
import {assertRejects} from './utils'
import addresses from './fixtures/addresses.json'
import responses from './fixtures/responses'
import ledgerClosed from './fixtures/rippled/ledger-close-newer.json'
import setupClient from './setup-client'
const {validate, schemaValidator, ledgerUtils} = Client._PRIVATE
@@ -44,14 +42,6 @@ describe('Client', function () {
// to test that connect() times out after 2 seconds.
})
it('ledger closed event', function (done) {
this.client.on('ledger', (message) => {
assertResultMatch(message, responses.ledgerEvent, 'ledgerEvent')
done()
})
this.client.connection._ws.emit('message', JSON.stringify(ledgerClosed))
})
describe('[private] schema-validator', function () {
it('valid', function () {
assert.doesNotThrow(function () {