mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-19 03:35:49 +00:00
refactor: move everything out of the common folder (#1629)
* remove common/constants (all in models now) * remove common/txFlags (all in models now) * move ecdsa from src/common to src * move errors from src/common to src, export at top level
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { ValidationError } from 'xrpl-local'
|
||||
import { Transaction } from 'xrpl-local/models/transactions'
|
||||
|
||||
import rippled from '../fixtures/rippled'
|
||||
|
||||
@@ -3,17 +3,16 @@ import net from 'net'
|
||||
import { assert } from 'chai'
|
||||
import _ from 'lodash'
|
||||
|
||||
import { Client } from 'xrpl-local'
|
||||
import { Connection } from 'xrpl-local/client'
|
||||
|
||||
import {
|
||||
Client,
|
||||
ConnectionError,
|
||||
DisconnectedError,
|
||||
NotConnectedError,
|
||||
ResponseFormatError,
|
||||
XrplError,
|
||||
TimeoutError,
|
||||
} from '../src/common/errors'
|
||||
} from 'xrpl-local'
|
||||
import { Connection } from 'xrpl-local/client'
|
||||
|
||||
import rippled from './fixtures/rippled'
|
||||
import { setupClient, teardownClient } from './setupClient'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { RippledError } from '../src/common/errors'
|
||||
import { RippledError } from 'xrpl-local'
|
||||
|
||||
import { setupClient, teardownClient } from './setupClient'
|
||||
import { assertRejects } from './testUtils'
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateAccountDelete, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateAccountDelete, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* AccountDelete Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateAccountSet, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateAccountSet, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* AccountSet Transaction Verification Testing.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { ValidationError } from 'xrpl-local'
|
||||
import { validateBaseTransaction } from 'xrpl-local/models/transactions/common'
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateCheckCancel, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateCheckCancel, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* CheckCancel Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateCheckCash, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateCheckCash, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* CheckCash Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateCheckCreate, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateCheckCreate, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* CheckCreate Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateDepositPreauth, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateDepositPreauth, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* DepositPreauth Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateEscrowCancel, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateEscrowCancel, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateEscrowCreate, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateEscrowCreate, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* EscrowCreate Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateEscrowFinish, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateEscrowFinish, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* EscrowFinish Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateOfferCancel, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateOfferCancel, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* OfferCancel Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateOfferCreate, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateOfferCreate, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* OfferCreate Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validatePayment, validate, PaymentTransactionFlags } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import {
|
||||
validatePayment,
|
||||
validate,
|
||||
PaymentTransactionFlags,
|
||||
ValidationError,
|
||||
} from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* PaymentTransaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validatePaymentChannelClaim, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import {
|
||||
validatePaymentChannelClaim,
|
||||
validate,
|
||||
ValidationError,
|
||||
} from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* PaymentChannelClaim Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validatePaymentChannelCreate, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import {
|
||||
validatePaymentChannelCreate,
|
||||
validate,
|
||||
ValidationError,
|
||||
} from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* PaymentChannelCreate Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validatePaymentChannelFund, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import {
|
||||
validatePaymentChannelFund,
|
||||
validate,
|
||||
ValidationError,
|
||||
} from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* PaymentChannelFund Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validate, validateSetRegularKey } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validate, validateSetRegularKey, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* SetRegularKey Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validate, validateSignerListSet } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validate, validateSignerListSet, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* SignerListSet Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateTicketCreate, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateTicketCreate, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* TicketCreate Transaction Verification Testing.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { validateTrustSet, validate } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { validateTrustSet, validate, ValidationError } from 'xrpl-local'
|
||||
|
||||
/**
|
||||
* TrustSet Transaction Verification Testing.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { ValidationError, XrplError } from '../../src/common/errors'
|
||||
import { ValidationError, XrplError } from 'xrpl-local'
|
||||
import { computeLedgerHash } from '../../src/utils'
|
||||
import requests from '../fixtures/requests'
|
||||
import responses from '../fixtures/responses'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import ECDSA from '../../src/common/ecdsa'
|
||||
import { UnexpectedError } from '../../src/common/errors'
|
||||
import ECDSA from '../../src/ecdsa'
|
||||
import { UnexpectedError } from 'xrpl-local'
|
||||
import {
|
||||
generateXAddress,
|
||||
GenerateAddressOptions,
|
||||
|
||||
@@ -4,8 +4,7 @@ import path from 'path'
|
||||
import { assert } from 'chai'
|
||||
import { encode } from 'ripple-binary-codec'
|
||||
|
||||
import { OfferCreate, Transaction } from 'xrpl-local'
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { OfferCreate, Transaction, ValidationError } from 'xrpl-local'
|
||||
|
||||
import {
|
||||
computeStateTreeHash,
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { assert } from 'chai'
|
||||
import { decode } from 'ripple-binary-codec/dist'
|
||||
|
||||
import ECDSA from '../../src/common/ecdsa'
|
||||
import { Transaction } from '../../src/models/transactions'
|
||||
import Wallet from '../../src/wallet'
|
||||
import { Transaction } from 'xrpl-local'
|
||||
import ECDSA from 'xrpl-local/ecdsa'
|
||||
import Wallet from 'xrpl-local/wallet'
|
||||
|
||||
import requests from '../fixtures/requests'
|
||||
import responses from '../fixtures/responses'
|
||||
|
||||
|
||||
@@ -2,16 +2,14 @@ import { assert } from 'chai'
|
||||
import { decode, encode } from 'ripple-binary-codec/dist'
|
||||
import { JsonObject } from 'ripple-binary-codec/dist/types/serialized-type'
|
||||
|
||||
import { Transaction } from 'xrpl-local'
|
||||
|
||||
import { ValidationError } from '../../src/common/errors'
|
||||
import Wallet from '../../src/wallet'
|
||||
import { Transaction, ValidationError } from 'xrpl-local'
|
||||
import Wallet from 'xrpl-local/wallet'
|
||||
import {
|
||||
sign,
|
||||
authorizeChannel,
|
||||
multisign,
|
||||
verifySignature,
|
||||
} from '../../src/wallet/signer'
|
||||
} from 'xrpl-local/wallet/signer'
|
||||
|
||||
const publicKey =
|
||||
'030E58CDD076E798C84755590AAF6237CA8FAE821070A59F648B517A30DC6F589D'
|
||||
|
||||
Reference in New Issue
Block a user