mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-06 17:27:59 +00:00
boost coverage to almost 100%
This commit is contained in:
committed by
Chris Clark
parent
4f86691fb8
commit
995606b1e6
9
test/fixtures/requests/get-orderbook-with-xrp.json
vendored
Normal file
9
test/fixtures/requests/get-orderbook-with-xrp.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"base": {
|
||||
"currency": "USD",
|
||||
"counterparty": "rp8rJYTpodf8qbSCHVTNacf8nSW8mRakFw"
|
||||
},
|
||||
"counter": {
|
||||
"currency": "XRP"
|
||||
}
|
||||
}
|
||||
16
test/fixtures/requests/getpaths/invalid.json
vendored
Normal file
16
test/fixtures/requests/getpaths/invalid.json
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"source": {
|
||||
"address": "rwBYyfufTzk77zUSKEu4MvixfarC35av1J",
|
||||
"amount": {
|
||||
"value": "1000002",
|
||||
"currency": "USD"
|
||||
}
|
||||
},
|
||||
"destination": {
|
||||
"address": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"amount": {
|
||||
"value": "1000002",
|
||||
"currency": "USD"
|
||||
}
|
||||
}
|
||||
}
|
||||
16
test/fixtures/requests/getpaths/issuer.json
vendored
Normal file
16
test/fixtures/requests/getpaths/issuer.json
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"source": {
|
||||
"address": "rwBYyfufTzk77zUSKEu4MvixfarC35av1J",
|
||||
"amount": {
|
||||
"value": "1000002",
|
||||
"currency": "USD",
|
||||
"counterparty": "rwBYyfufTzk77zUSKEu4MvixfarC35av1J"
|
||||
}
|
||||
},
|
||||
"destination": {
|
||||
"address": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"amount": {
|
||||
"currency": "USD"
|
||||
}
|
||||
}
|
||||
}
|
||||
19
test/fixtures/requests/index.js
vendored
19
test/fixtures/requests/index.js
vendored
@@ -8,18 +8,30 @@ module.exports = {
|
||||
},
|
||||
prepareOrderCancellation: require('./prepare-order-cancellation'),
|
||||
preparePayment: require('./prepare-payment'),
|
||||
preparePaymentMinAmountXRP: require('./prepare-payment-min-xrp'),
|
||||
preparePaymentMinAmount: require('./prepare-payment-min'),
|
||||
preparePaymentWrongAddress: require('./prepare-payment-wrong-address'),
|
||||
preparePaymentWrongAmount: require('./prepare-payment-wrong-amount'),
|
||||
preparePaymentWrongPartial: require('./prepare-payment-wrong-partial'),
|
||||
preparePaymentAllOptions: require('./prepare-payment-all-options'),
|
||||
preparePaymentNoCounterparty: require('./prepare-payment-no-counterparty'),
|
||||
prepareSettings: require('./prepare-settings'),
|
||||
prepareSuspendedPaymentCreation:
|
||||
require('./prepare-suspended-payment-creation'),
|
||||
prepareSuspendedPaymentCreationFull:
|
||||
require('./prepare-suspended-payment-creation-full'),
|
||||
prepareSuspendedPaymentExecution:
|
||||
require('./prepare-suspended-payment-execution'),
|
||||
prepareSuspendedPaymentExecutionSimple:
|
||||
require('./prepare-suspended-payment-execution-simple'),
|
||||
prepareSuspendedPaymentCancellation:
|
||||
require('./prepare-suspended-payment-cancellation'),
|
||||
prepareSuspendedPaymentCancellationMemos:
|
||||
require('./prepare-suspended-payment-cancellation-memos'),
|
||||
prepareTrustline: {
|
||||
simple: require('./prepare-trustline-simple'),
|
||||
complex: require('./prepare-trustline')
|
||||
complex: require('./prepare-trustline'),
|
||||
frozen: require('./prepare-trustline-frozen.json')
|
||||
},
|
||||
sign: require('./sign'),
|
||||
signSuspended: require('./sign-suspended.json'),
|
||||
@@ -31,9 +43,12 @@ module.exports = {
|
||||
NotAcceptCurrency: require('./getpaths/not-accept-currency'),
|
||||
NoPaths: require('./getpaths/no-paths'),
|
||||
NoPathsWithCurrencies: require('./getpaths/no-paths-with-currencies'),
|
||||
sendAll: require('./getpaths/send-all')
|
||||
sendAll: require('./getpaths/send-all'),
|
||||
invalid: require('./getpaths/invalid'),
|
||||
issuer: require('./getpaths/issuer')
|
||||
},
|
||||
getOrderbook: require('./get-orderbook'),
|
||||
getOrderbookWithXRP: require('./get-orderbook-with-xrp'),
|
||||
computeLedgerHash: {
|
||||
header: require('./compute-ledger-hash'),
|
||||
transactions: require('./compute-ledger-hash-transactions')
|
||||
|
||||
3
test/fixtures/requests/prepare-order.json
vendored
3
test/fixtures/requests/prepare-order.json
vendored
@@ -9,5 +9,6 @@
|
||||
"currency": "XRP",
|
||||
"value": "2"
|
||||
},
|
||||
"immediateOrCancel": true
|
||||
"passive": true,
|
||||
"fillOrKill": true
|
||||
}
|
||||
|
||||
17
test/fixtures/requests/prepare-payment-min-xrp.json
vendored
Normal file
17
test/fixtures/requests/prepare-payment-min-xrp.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"source": {
|
||||
"address": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"amount": {
|
||||
"value": "0.01",
|
||||
"currency": "USD",
|
||||
"counterparty": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM"
|
||||
}
|
||||
},
|
||||
"destination": {
|
||||
"address": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo",
|
||||
"minAmount": {
|
||||
"value": "0.01",
|
||||
"currency": "XRP"
|
||||
}
|
||||
}
|
||||
}
|
||||
17
test/fixtures/requests/prepare-payment-min.json
vendored
Normal file
17
test/fixtures/requests/prepare-payment-min.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"source": {
|
||||
"address": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"amount": {
|
||||
"value": "0.01",
|
||||
"currency": "XRP",
|
||||
"counterparty": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM"
|
||||
}
|
||||
},
|
||||
"destination": {
|
||||
"address": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo",
|
||||
"minAmount": {
|
||||
"value": "0.01",
|
||||
"currency": "XRP"
|
||||
}
|
||||
}
|
||||
}
|
||||
17
test/fixtures/requests/prepare-payment-wrong-address.json
vendored
Normal file
17
test/fixtures/requests/prepare-payment-wrong-address.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"source": {
|
||||
"address": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM",
|
||||
"amount": {
|
||||
"value": "0.01",
|
||||
"currency": "USD",
|
||||
"counterparty": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM"
|
||||
}
|
||||
},
|
||||
"destination": {
|
||||
"address": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo",
|
||||
"minAmount": {
|
||||
"value": "0.01",
|
||||
"currency": "XRP"
|
||||
}
|
||||
}
|
||||
}
|
||||
17
test/fixtures/requests/prepare-payment-wrong-amount.json
vendored
Normal file
17
test/fixtures/requests/prepare-payment-wrong-amount.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"source": {
|
||||
"address": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"maxAmount": {
|
||||
"value": "0.01",
|
||||
"currency": "USD",
|
||||
"counterparty": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM"
|
||||
}
|
||||
},
|
||||
"destination": {
|
||||
"address": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo",
|
||||
"minAmount": {
|
||||
"value": "0.01",
|
||||
"currency": "XRP"
|
||||
}
|
||||
}
|
||||
}
|
||||
17
test/fixtures/requests/prepare-payment-wrong-partial.json
vendored
Normal file
17
test/fixtures/requests/prepare-payment-wrong-partial.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"source": {
|
||||
"address": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"amount": {
|
||||
"value": "0.01",
|
||||
"currency": "XRP"
|
||||
}
|
||||
},
|
||||
"destination": {
|
||||
"address": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo",
|
||||
"minAmount": {
|
||||
"value": "0.01",
|
||||
"currency": "XRP"
|
||||
}
|
||||
},
|
||||
"allowPartialPayment": true
|
||||
}
|
||||
11
test/fixtures/requests/prepare-suspended-payment-cancellation-memos.json
vendored
Normal file
11
test/fixtures/requests/prepare-suspended-payment-cancellation-memos.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"owner": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"suspensionSequence": 1234,
|
||||
"memos": [
|
||||
{
|
||||
"type": "test",
|
||||
"format": "plain/text",
|
||||
"data": "texted data"
|
||||
}
|
||||
]
|
||||
}
|
||||
28
test/fixtures/requests/prepare-suspended-payment-creation-full.json
vendored
Normal file
28
test/fixtures/requests/prepare-suspended-payment-creation-full.json
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"source": {
|
||||
"address": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"maxAmount": {
|
||||
"value": "0.01",
|
||||
"currency": "USD",
|
||||
"counterparty": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM"
|
||||
},
|
||||
"tag": 1
|
||||
},
|
||||
"destination": {
|
||||
"address": "rpZc4mVfWUif9CRoHRKKcmhu1nx2xktxBo",
|
||||
"amount": {
|
||||
"value": "0.01",
|
||||
"currency": "USD",
|
||||
"counterparty": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM"
|
||||
},
|
||||
"tag": 2
|
||||
},
|
||||
"digest": "8F434346648F6B96DF89DDA901C5176B10A6D83961DD3C1AC88B59B2DC327AA4",
|
||||
"allowExecuteAfter": "2014-09-24T21:21:50.000Z",
|
||||
"memos": [
|
||||
{
|
||||
"type": "test",
|
||||
"data": "texted data"
|
||||
}
|
||||
]
|
||||
}
|
||||
11
test/fixtures/requests/prepare-suspended-payment-execution-simple.json
vendored
Normal file
11
test/fixtures/requests/prepare-suspended-payment-execution-simple.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"owner": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"suspensionSequence": 1234,
|
||||
"memos": [
|
||||
{
|
||||
"type": "test",
|
||||
"format": "plain/text",
|
||||
"data": "texted data"
|
||||
}
|
||||
]
|
||||
}
|
||||
8
test/fixtures/requests/prepare-trustline-frozen.json
vendored
Normal file
8
test/fixtures/requests/prepare-trustline-frozen.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"currency": "BTC",
|
||||
"counterparty": "rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM",
|
||||
"limit": "0.1",
|
||||
"authorized": true,
|
||||
"ripplingDisabled": false,
|
||||
"frozen": true
|
||||
}
|
||||
2
test/fixtures/requests/sign.json
vendored
2
test/fixtures/requests/sign.json
vendored
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"txJSON": "{\"Flags\":2147483648,\"TransactionType\":\"AccountSet\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Domain\":\"726970706C652E636F6D\",\"LastLedgerSequence\":8820051,\"Fee\":\"12\",\"Sequence\":23}",
|
||||
"txJSON": "{\"Flags\":2147483648,\"TransactionType\":\"AccountSet\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"Domain\":\"726970706C652E636F6D\",\"LastLedgerSequence\":8820051,\"Fee\":\"12\",\"Sequence\":23,\"SigningPubKey\":\"02F89EAEC7667B30F33D0687BBA86C3FE2A08CCA40A9186C5BDE2DAA6FA97A37D8\"}",
|
||||
"instructions": {
|
||||
"fee": "0.000012",
|
||||
"sequence": 23,
|
||||
|
||||
Reference in New Issue
Block a user