@ledgerhq/coin-xrp 0.9.2 → 1.0.0-nightly.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +2 -2
- package/CHANGELOG.md +11 -10
- package/lib/api/index.d.ts.map +1 -1
- package/lib/api/index.integ.test.js +35 -36
- package/lib/api/index.integ.test.js.map +1 -1
- package/lib/api/index.js +65 -50
- package/lib/api/index.js.map +1 -1
- package/lib/api/index.test.js +66 -44
- package/lib/api/index.test.js.map +1 -1
- package/lib/bridge/broadcast.js +3 -12
- package/lib/bridge/broadcast.js.map +1 -1
- package/lib/bridge/estimateMaxSpendable.js +9 -14
- package/lib/bridge/estimateMaxSpendable.js.map +1 -1
- package/lib/bridge/getTransactionStatus.js +4 -13
- package/lib/bridge/getTransactionStatus.js.map +1 -1
- package/lib/bridge/prepareTransaction.js +4 -13
- package/lib/bridge/prepareTransaction.js.map +1 -1
- package/lib/bridge/signOperation.js +60 -68
- package/lib/bridge/signOperation.js.map +1 -1
- package/lib/bridge/synchronization.js +32 -45
- package/lib/bridge/synchronization.js.map +1 -1
- package/lib/bridge/synchronization.test.js +21 -17
- package/lib/bridge/synchronization.test.js.map +1 -1
- package/lib/bridge/transaction.js +16 -4
- package/lib/bridge/transaction.js.map +1 -1
- package/lib/logic/broadcast.js +8 -19
- package/lib/logic/broadcast.js.map +1 -1
- package/lib/logic/broadcast.test.js +6 -15
- package/lib/logic/broadcast.test.js.map +1 -1
- package/lib/logic/combine.js +2 -2
- package/lib/logic/combine.js.map +1 -1
- package/lib/logic/craftTransaction.js +28 -34
- package/lib/logic/craftTransaction.js.map +1 -1
- package/lib/logic/craftTransaction.test.js +8 -17
- package/lib/logic/craftTransaction.test.js.map +1 -1
- package/lib/logic/estimateFees.js +17 -28
- package/lib/logic/estimateFees.js.map +1 -1
- package/lib/logic/estimateFees.test.js +10 -19
- package/lib/logic/estimateFees.test.js.map +1 -1
- package/lib/logic/getBalance.js +3 -14
- package/lib/logic/getBalance.js.map +1 -1
- package/lib/logic/getBalance.test.js +4 -13
- package/lib/logic/getBalance.test.js.map +1 -1
- package/lib/logic/lastBlock.js +7 -18
- package/lib/logic/lastBlock.js.map +1 -1
- package/lib/logic/listOperations.d.ts +15 -5
- package/lib/logic/listOperations.d.ts.map +1 -1
- package/lib/logic/listOperations.js +84 -71
- package/lib/logic/listOperations.js.map +1 -1
- package/lib/logic/listOperations.test.js +66 -62
- package/lib/logic/listOperations.test.js.map +1 -1
- package/lib/logic/utils.js +9 -18
- package/lib/logic/utils.js.map +1 -1
- package/lib/logic/utils.test.js +9 -18
- package/lib/logic/utils.test.js.map +1 -1
- package/lib/network/index.d.ts +6 -3
- package/lib/network/index.d.ts.map +1 -1
- package/lib/network/index.js +40 -48
- package/lib/network/index.js.map +1 -1
- package/lib/network/index.test.js +9 -18
- package/lib/network/index.test.js.map +1 -1
- package/lib/network/types.d.ts +5 -0
- package/lib/network/types.d.ts.map +1 -1
- package/lib/network/types.js.map +1 -1
- package/lib/signer/getAddress.js +3 -12
- package/lib/signer/getAddress.js.map +1 -1
- package/lib/test/cli.js +5 -1
- package/lib/test/cli.js.map +1 -1
- package/lib-es/api/index.d.ts.map +1 -1
- package/lib-es/api/index.integ.test.js +35 -36
- package/lib-es/api/index.integ.test.js.map +1 -1
- package/lib-es/api/index.js +65 -50
- package/lib-es/api/index.js.map +1 -1
- package/lib-es/api/index.test.js +66 -44
- package/lib-es/api/index.test.js.map +1 -1
- package/lib-es/bridge/broadcast.js +3 -12
- package/lib-es/bridge/broadcast.js.map +1 -1
- package/lib-es/bridge/estimateMaxSpendable.js +9 -14
- package/lib-es/bridge/estimateMaxSpendable.js.map +1 -1
- package/lib-es/bridge/getTransactionStatus.js +4 -13
- package/lib-es/bridge/getTransactionStatus.js.map +1 -1
- package/lib-es/bridge/prepareTransaction.js +4 -13
- package/lib-es/bridge/prepareTransaction.js.map +1 -1
- package/lib-es/bridge/signOperation.js +60 -68
- package/lib-es/bridge/signOperation.js.map +1 -1
- package/lib-es/bridge/synchronization.js +32 -45
- package/lib-es/bridge/synchronization.js.map +1 -1
- package/lib-es/bridge/synchronization.test.js +21 -17
- package/lib-es/bridge/synchronization.test.js.map +1 -1
- package/lib-es/bridge/transaction.js +16 -4
- package/lib-es/bridge/transaction.js.map +1 -1
- package/lib-es/logic/broadcast.js +8 -19
- package/lib-es/logic/broadcast.js.map +1 -1
- package/lib-es/logic/broadcast.test.js +6 -15
- package/lib-es/logic/broadcast.test.js.map +1 -1
- package/lib-es/logic/combine.js +2 -2
- package/lib-es/logic/combine.js.map +1 -1
- package/lib-es/logic/craftTransaction.js +28 -34
- package/lib-es/logic/craftTransaction.js.map +1 -1
- package/lib-es/logic/craftTransaction.test.js +8 -17
- package/lib-es/logic/craftTransaction.test.js.map +1 -1
- package/lib-es/logic/estimateFees.js +17 -28
- package/lib-es/logic/estimateFees.js.map +1 -1
- package/lib-es/logic/estimateFees.test.js +10 -19
- package/lib-es/logic/estimateFees.test.js.map +1 -1
- package/lib-es/logic/getBalance.js +3 -14
- package/lib-es/logic/getBalance.js.map +1 -1
- package/lib-es/logic/getBalance.test.js +4 -13
- package/lib-es/logic/getBalance.test.js.map +1 -1
- package/lib-es/logic/lastBlock.js +7 -18
- package/lib-es/logic/lastBlock.js.map +1 -1
- package/lib-es/logic/listOperations.d.ts +15 -5
- package/lib-es/logic/listOperations.d.ts.map +1 -1
- package/lib-es/logic/listOperations.js +84 -71
- package/lib-es/logic/listOperations.js.map +1 -1
- package/lib-es/logic/listOperations.test.js +66 -62
- package/lib-es/logic/listOperations.test.js.map +1 -1
- package/lib-es/logic/utils.js +9 -18
- package/lib-es/logic/utils.js.map +1 -1
- package/lib-es/logic/utils.test.js +9 -18
- package/lib-es/logic/utils.test.js.map +1 -1
- package/lib-es/network/index.d.ts +6 -3
- package/lib-es/network/index.d.ts.map +1 -1
- package/lib-es/network/index.js +39 -47
- package/lib-es/network/index.js.map +1 -1
- package/lib-es/network/index.test.js +9 -18
- package/lib-es/network/index.test.js.map +1 -1
- package/lib-es/network/types.d.ts +5 -0
- package/lib-es/network/types.d.ts.map +1 -1
- package/lib-es/network/types.js.map +1 -1
- package/lib-es/signer/getAddress.js +3 -12
- package/lib-es/signer/getAddress.js.map +1 -1
- package/lib-es/test/cli.js +5 -1
- package/lib-es/test/cli.js.map +1 -1
- package/package.json +7 -6
- package/src/api/index.integ.test.ts +12 -6
- package/src/api/index.test.ts +119 -75
- package/src/api/index.ts +62 -10
- package/src/bridge/synchronization.test.ts +31 -15
- package/src/logic/listOperations.test.ts +104 -85
- package/src/logic/listOperations.ts +47 -34
- package/src/network/index.ts +21 -8
- package/src/network/types.ts +6 -0
- package/tsconfig.json +0 -1
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.listOperations = listOperations;
|
|
13
4
|
const network_1 = require("../network");
|
|
@@ -15,63 +6,77 @@ const utils_1 = require("./utils");
|
|
|
15
6
|
/**
|
|
16
7
|
* Returns list of "Payment" Operations associated to an account.
|
|
17
8
|
* @param address Account address
|
|
18
|
-
* @param
|
|
19
|
-
*
|
|
9
|
+
* @param minHeight retrieve operations from a specific block height until top most (inclusive)
|
|
10
|
+
* if not provided, it will start from the oldest possible history.
|
|
11
|
+
* The result is not guaranteed to contain all operations until top height (it depends of the underlying explorer),
|
|
12
|
+
* so you might need to call this function multiple times to get all operations.
|
|
13
|
+
* @param order whether to return operations from the top block or from the oldest block
|
|
14
|
+
* it defaults to "desc" (newest first)
|
|
15
|
+
* it doesn't control the order of the operations in the result list.
|
|
16
|
+
* this parameter is added as a workaround for the issue LIVE-16705
|
|
17
|
+
* @returns a list of operations is descending order and a token to be used for pagination
|
|
20
18
|
*/
|
|
21
|
-
function listOperations(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
async function listOperations(address, { limit, minHeight, token, order, }) {
|
|
20
|
+
const serverInfo = await (0, network_1.getServerInfos)();
|
|
21
|
+
const ledgers = serverInfo.info.complete_ledgers.split("-");
|
|
22
|
+
const minLedgerVersion = Number(ledgers[0]);
|
|
23
|
+
// by default the explorer queries the transactions in descending order (newest first)
|
|
24
|
+
let forward = false;
|
|
25
|
+
if (order && order === "asc") {
|
|
26
|
+
forward = true;
|
|
27
|
+
}
|
|
28
|
+
let options = {
|
|
29
|
+
forward: forward,
|
|
30
|
+
};
|
|
31
|
+
if (limit) {
|
|
32
|
+
options = {
|
|
33
|
+
...options,
|
|
34
|
+
limit,
|
|
30
35
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// then user misses some txs that doesn't fit the page size limit
|
|
58
|
-
// because the "next token" is a block height (solution is to use an opaque token instead)
|
|
59
|
-
let [txShortage, nextOptions, transactions] = yield getPaymentTransactions(address, options);
|
|
60
|
-
const isEnough = () => txShortage || (limit && transactions.length >= limit);
|
|
61
|
-
// We need to call the node RPC multiple times to get the desired number of transactions by the limiter.
|
|
62
|
-
while (nextOptions.limit && !isEnough()) {
|
|
63
|
-
const [newTxShortage, newNextOptions, newTransactions] = yield getPaymentTransactions(address, nextOptions);
|
|
64
|
-
txShortage = newTxShortage;
|
|
65
|
-
nextOptions = newNextOptions;
|
|
66
|
-
transactions = transactions.concat(newTransactions);
|
|
36
|
+
}
|
|
37
|
+
if (token) {
|
|
38
|
+
options = {
|
|
39
|
+
...options,
|
|
40
|
+
marker: JSON.parse(token),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
if (minHeight !== undefined) {
|
|
44
|
+
options = {
|
|
45
|
+
...options,
|
|
46
|
+
// if there is no ops, it might be after a clear and we prefer to pull from the oldest possible history
|
|
47
|
+
ledger_index_min: Math.max(minHeight, minLedgerVersion),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
async function getPaymentTransactions(address, options) {
|
|
51
|
+
const response = await (0, network_1.getTransactions)(address, options);
|
|
52
|
+
const txs = response.transactions;
|
|
53
|
+
const marker = response.marker;
|
|
54
|
+
// Filter out the transactions that are not "Payment" type because the filter on "tx_type" of the node RPC is not working as expected.
|
|
55
|
+
const paymentTxs = txs.filter(tx => tx.tx_json.TransactionType === "Payment");
|
|
56
|
+
const shortage = (options.limit && txs.length < options.limit) || false;
|
|
57
|
+
const nextOptions = { ...options };
|
|
58
|
+
if (marker) {
|
|
59
|
+
nextOptions.marker = marker;
|
|
60
|
+
if (nextOptions.limit)
|
|
61
|
+
nextOptions.limit -= paymentTxs.length;
|
|
67
62
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
63
|
+
return [shortage, nextOptions, paymentTxs];
|
|
64
|
+
}
|
|
65
|
+
let [txShortage, nextOptions, transactions] = await getPaymentTransactions(address, options);
|
|
66
|
+
const isEnough = () => txShortage || (limit && transactions.length >= limit);
|
|
67
|
+
// We need to call the node RPC multiple times to get the desired number of transactions by the limiter.
|
|
68
|
+
while (nextOptions.limit && !isEnough()) {
|
|
69
|
+
const [newTxShortage, newNextOptions, newTransactions] = await getPaymentTransactions(address, nextOptions);
|
|
70
|
+
txShortage = newTxShortage;
|
|
71
|
+
nextOptions = newNextOptions;
|
|
72
|
+
transactions = transactions.concat(newTransactions);
|
|
73
|
+
}
|
|
74
|
+
// the order is reversed so that the results are always sorted by newest tx first element of the list
|
|
75
|
+
if (order === "asc")
|
|
76
|
+
transactions.reverse();
|
|
77
|
+
// the next index to start the pagination from
|
|
78
|
+
const next = nextOptions.marker ? JSON.stringify(nextOptions.marker) : "";
|
|
79
|
+
return [transactions.map(convertToCoreOperation(address)), next];
|
|
75
80
|
}
|
|
76
81
|
const convertToCoreOperation = (address) => (operation) => {
|
|
77
82
|
const { ledger_hash, hash, close_time_iso, meta: { delivered_amount }, tx_json: { TransactionType, Fee, date, Account, Destination, DestinationTag, Sequence, Memos, ledger_index, }, } = operation;
|
|
@@ -88,20 +93,25 @@ const convertToCoreOperation = (address) => (operation) => {
|
|
|
88
93
|
const toEpochDate = (utils_1.RIPPLE_EPOCH + date) * 1000;
|
|
89
94
|
let details = {};
|
|
90
95
|
if (DestinationTag) {
|
|
91
|
-
details =
|
|
96
|
+
details = {
|
|
97
|
+
...details,
|
|
98
|
+
destinationTag: DestinationTag,
|
|
99
|
+
};
|
|
92
100
|
}
|
|
93
|
-
const memos = Memos
|
|
94
|
-
var _a, _b, _c;
|
|
101
|
+
const memos = Memos?.map(m => {
|
|
95
102
|
const memo = {
|
|
96
|
-
data:
|
|
97
|
-
format:
|
|
98
|
-
type:
|
|
103
|
+
data: m?.Memo?.MemoData,
|
|
104
|
+
format: m?.Memo?.MemoFormat,
|
|
105
|
+
type: m?.Memo?.MemoType,
|
|
99
106
|
};
|
|
100
107
|
// Remove `undefined` properties
|
|
101
108
|
return Object.fromEntries(Object.entries(memo).filter(([, v]) => v));
|
|
102
109
|
});
|
|
103
110
|
if (memos) {
|
|
104
|
-
details =
|
|
111
|
+
details = {
|
|
112
|
+
...details,
|
|
113
|
+
memos,
|
|
114
|
+
};
|
|
105
115
|
}
|
|
106
116
|
let op = {
|
|
107
117
|
blockTime: new Date(close_time_iso),
|
|
@@ -119,7 +129,10 @@ const convertToCoreOperation = (address) => (operation) => {
|
|
|
119
129
|
transactionSequenceNumber: Sequence,
|
|
120
130
|
};
|
|
121
131
|
if (Object.keys(details).length != 0) {
|
|
122
|
-
op =
|
|
132
|
+
op = {
|
|
133
|
+
...op,
|
|
134
|
+
details,
|
|
135
|
+
};
|
|
123
136
|
}
|
|
124
137
|
return op;
|
|
125
138
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listOperations.js","sourceRoot":"","sources":["../../src/logic/listOperations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"listOperations.js","sourceRoot":"","sources":["../../src/logic/listOperations.ts"],"names":[],"mappings":";;AAmBA,wCAyFC;AA5GD,wCAAqF;AAGrF,mCAAuC;AAGvC;;;;;;;;;;;;GAYG;AACI,KAAK,UAAU,cAAc,CAClC,OAAe,EACf,EACE,KAAK,EACL,SAAS,EACT,KAAK,EACL,KAAK,GAQN;IAED,MAAM,UAAU,GAAG,MAAM,IAAA,wBAAc,GAAE,CAAC;IAC1C,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC5D,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAE5C,sFAAsF;IACtF,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,IAAI,KAAK,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;QAC7B,OAAO,GAAG,IAAI,CAAC;IACjB,CAAC;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AG,OAAO;YACV,KAAK;SACN,CAAC;IACJ,CAAC;IAED,IAAI,EAAE,GAAiB;QACrB,SAAS,EAAE,IAAI,IAAI,CAAC,cAAc,CAAC;QACnC,SAAS,EAAE,WAAW;QACtB,IAAI;QACJ,OAAO;QACP,IAAI,EAAE,eAAe;QACrB,UAAU,EAAE,IAAI;QAChB,KAAK;QACL,GAAG;QACH,WAAW,EAAE,YAAY;QACzB,OAAO,EAAE,CAAC,OAAO,CAAC;QAClB,UAAU,EAAE,CAAC,WAAW,CAAC;QACzB,IAAI,EAAE,IAAI,IAAI,CAAC,WAAW,CAAC;QAC3B,yBAAyB,EAAE,QAAQ;KACpC,CAAC;IAEF,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QACrC,EAAE,GAAG;YACH,GAAG,EAAE;YACL,OAAO;SACR,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC"}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
const console_1 = require("console");
|
|
13
4
|
const listOperations_1 = require("./listOperations");
|
|
@@ -19,41 +10,55 @@ const mockGetServerInfos = jest.fn().mockResolvedValue({
|
|
|
19
10
|
complete_ledgers: `${minHeight}-${maxHeight}`,
|
|
20
11
|
},
|
|
21
12
|
});
|
|
22
|
-
const
|
|
13
|
+
const mockNetworkGetTransactions = jest.fn();
|
|
23
14
|
jest.mock("../network", () => ({
|
|
24
15
|
getServerInfos: () => mockGetServerInfos(),
|
|
25
|
-
getTransactions: () =>
|
|
16
|
+
getTransactions: () => mockNetworkGetTransactions(),
|
|
26
17
|
}));
|
|
27
18
|
describe("listOperations", () => {
|
|
28
19
|
afterEach(() => {
|
|
29
20
|
mockGetServerInfos.mockClear();
|
|
30
|
-
|
|
21
|
+
mockNetworkGetTransactions.mockClear();
|
|
31
22
|
});
|
|
32
|
-
|
|
23
|
+
const someMarker = { ledger: 1, seq: 1 };
|
|
24
|
+
function mockNetworkTxs(txs) {
|
|
25
|
+
return {
|
|
26
|
+
account: "account",
|
|
27
|
+
ledger_index_max: 1,
|
|
28
|
+
ledger_index_min: 1,
|
|
29
|
+
limit: 1,
|
|
30
|
+
validated: false,
|
|
31
|
+
transactions: txs,
|
|
32
|
+
marker: someMarker,
|
|
33
|
+
error: "",
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
it("when there are no transactions then the result is empty", async () => {
|
|
33
37
|
// Given
|
|
34
|
-
|
|
38
|
+
mockNetworkGetTransactions.mockResolvedValue(mockNetworkTxs([]));
|
|
35
39
|
// When
|
|
36
|
-
const [results, token] =
|
|
40
|
+
const [results, token] = await (0, listOperations_1.listOperations)("any address", { minHeight: 0 });
|
|
37
41
|
// Then
|
|
38
42
|
expect(mockGetServerInfos).toHaveBeenCalledTimes(1);
|
|
39
|
-
expect(
|
|
43
|
+
expect(mockNetworkGetTransactions).toHaveBeenCalledTimes(1);
|
|
40
44
|
expect(results).toEqual([]);
|
|
41
|
-
expect(token).toEqual(
|
|
42
|
-
})
|
|
43
|
-
it("when there are no transactions and a limit then the result is empty", () =>
|
|
45
|
+
expect(JSON.parse(token)).toEqual(someMarker);
|
|
46
|
+
});
|
|
47
|
+
it("when there are no transactions and a limit then the result is empty", async () => {
|
|
44
48
|
// Given
|
|
45
|
-
|
|
49
|
+
mockNetworkGetTransactions.mockResolvedValue(mockNetworkTxs([]));
|
|
46
50
|
// When
|
|
47
|
-
const [results, token] =
|
|
51
|
+
const [results, token] = await (0, listOperations_1.listOperations)("any address", { minHeight: 0, limit: 1 });
|
|
48
52
|
// Then
|
|
49
53
|
expect(mockGetServerInfos).toHaveBeenCalledTimes(1);
|
|
50
|
-
expect(
|
|
54
|
+
expect(mockNetworkGetTransactions).toHaveBeenCalledTimes(1);
|
|
51
55
|
expect(results).toEqual([]);
|
|
52
|
-
expect(token).toEqual(
|
|
53
|
-
})
|
|
56
|
+
expect(JSON.parse(token)).toEqual(someMarker);
|
|
57
|
+
});
|
|
54
58
|
const paymentTx = {
|
|
55
59
|
ledger_hash: "HASH_VALUE_BLOCK",
|
|
56
60
|
hash: "HASH_VALUE",
|
|
61
|
+
validated: true,
|
|
57
62
|
close_time_iso: "2000-01-01T00:00:01Z",
|
|
58
63
|
meta: { delivered_amount: "100" },
|
|
59
64
|
tx_json: {
|
|
@@ -66,45 +71,44 @@ describe("listOperations", () => {
|
|
|
66
71
|
Sequence: 1,
|
|
67
72
|
},
|
|
68
73
|
};
|
|
69
|
-
const otherTx =
|
|
70
|
-
it("should only list operations of type payment", () =>
|
|
74
|
+
const otherTx = { ...paymentTx, tx_json: { ...paymentTx.tx_json, TransactionType: "Other" } };
|
|
75
|
+
it("should only list operations of type payment", async () => {
|
|
71
76
|
// Given
|
|
72
77
|
const lastTransaction = paymentTx;
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
const txs = [paymentTx, otherTx, lastTransaction];
|
|
79
|
+
mockNetworkGetTransactions.mockResolvedValueOnce(mockNetworkTxs(txs));
|
|
80
|
+
mockNetworkGetTransactions.mockResolvedValue(mockNetworkTxs([])); // subsequent calls
|
|
75
81
|
// When
|
|
76
|
-
const [results, token] =
|
|
82
|
+
const [results, token] = await (0, listOperations_1.listOperations)("any address", { minHeight: 0, limit: 3 });
|
|
77
83
|
// Then
|
|
78
84
|
expect(mockGetServerInfos).toHaveBeenCalledTimes(1);
|
|
79
85
|
// it's called twice because first call yields only 2 transactions, and 3 are asked
|
|
80
|
-
expect(
|
|
86
|
+
expect(mockNetworkGetTransactions).toHaveBeenCalledTimes(2);
|
|
81
87
|
expect(results.length).toEqual(2);
|
|
82
|
-
expect(token).toEqual(
|
|
83
|
-
})
|
|
84
|
-
it("should make enough calls so that the limit requested is satified", () =>
|
|
85
|
-
const lastTransaction = otherTx;
|
|
88
|
+
expect(JSON.parse(token)).toEqual(someMarker);
|
|
89
|
+
});
|
|
90
|
+
it("should make enough calls so that the limit requested is satified", async () => {
|
|
86
91
|
const txs = [paymentTx, paymentTx, otherTx, otherTx, otherTx, otherTx, otherTx, otherTx];
|
|
87
92
|
(0, console_1.assert)(txs.length === 8);
|
|
88
|
-
|
|
89
|
-
const [results, token] =
|
|
93
|
+
mockNetworkGetTransactions.mockResolvedValue(mockNetworkTxs(txs));
|
|
94
|
+
const [results, token] = await (0, listOperations_1.listOperations)("any address", { minHeight: 0, limit: 8 });
|
|
90
95
|
expect(mockGetServerInfos).toHaveBeenCalledTimes(1);
|
|
91
96
|
// it's called 4 times because each call yields only 2 transactions, and 8 are asked
|
|
92
|
-
expect(
|
|
97
|
+
expect(mockNetworkGetTransactions).toHaveBeenCalledTimes(4);
|
|
93
98
|
expect(results.length).toEqual(8);
|
|
94
|
-
expect(token).toEqual(
|
|
95
|
-
})
|
|
96
|
-
it("should make enough calls, even if there is not enough txs to satisfy the limit", () =>
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
const [results, token] = yield (0, listOperations_1.listOperations)("any address", { minHeight: 0, limit: 4 });
|
|
99
|
+
expect(JSON.parse(token)).toEqual(someMarker);
|
|
100
|
+
});
|
|
101
|
+
it("should make enough calls, even if there is not enough txs to satisfy the limit", async () => {
|
|
102
|
+
mockNetworkGetTransactions.mockResolvedValueOnce(mockNetworkTxs([otherTx, otherTx, otherTx, otherTx]));
|
|
103
|
+
mockNetworkGetTransactions.mockResolvedValueOnce(mockNetworkTxs([paymentTx, paymentTx]));
|
|
104
|
+
mockNetworkGetTransactions.mockResolvedValue([]); // subsequent calls
|
|
105
|
+
const [results, token] = await (0, listOperations_1.listOperations)("any address", { minHeight: 0, limit: 4 });
|
|
102
106
|
expect(mockGetServerInfos).toHaveBeenCalledTimes(1);
|
|
103
107
|
// it's called 2 times because the second call is a shortage of txs
|
|
104
|
-
expect(
|
|
108
|
+
expect(mockNetworkGetTransactions).toHaveBeenCalledTimes(2);
|
|
105
109
|
expect(results.length).toEqual(2);
|
|
106
|
-
expect(token).toEqual(
|
|
107
|
-
})
|
|
110
|
+
expect(JSON.parse(token)).toEqual(someMarker);
|
|
111
|
+
});
|
|
108
112
|
it.each([
|
|
109
113
|
{
|
|
110
114
|
address: "WHATEVER_ADDRESS",
|
|
@@ -118,11 +122,11 @@ describe("listOperations", () => {
|
|
|
118
122
|
opDestination: "destination_addr",
|
|
119
123
|
expectedType: "OUT",
|
|
120
124
|
},
|
|
121
|
-
])("should return the list of operations associated to an account",
|
|
125
|
+
])("should return the list of operations associated to an account", async ({ address, opSender, opDestination, expectedType }) => {
|
|
122
126
|
// Given
|
|
123
127
|
const deliveredAmount = 100;
|
|
124
128
|
const fee = 10;
|
|
125
|
-
|
|
129
|
+
mockNetworkGetTransactions.mockResolvedValue(mockNetworkTxs([
|
|
126
130
|
{
|
|
127
131
|
ledger_hash: "HASH_VALUE_BLOCK",
|
|
128
132
|
hash: "HASH_VALUE",
|
|
@@ -177,12 +181,12 @@ describe("listOperations", () => {
|
|
|
177
181
|
Sequence: 1,
|
|
178
182
|
},
|
|
179
183
|
},
|
|
180
|
-
]);
|
|
184
|
+
]));
|
|
181
185
|
// When
|
|
182
|
-
const [results, _] =
|
|
186
|
+
const [results, _] = await (0, listOperations_1.listOperations)(address, { minHeight: 0, order: "asc" });
|
|
183
187
|
// Then
|
|
184
188
|
expect(mockGetServerInfos).toHaveBeenCalledTimes(1);
|
|
185
|
-
expect(
|
|
189
|
+
expect(mockNetworkGetTransactions).toHaveBeenCalledTimes(1);
|
|
186
190
|
// if expectedType is "OUT", compute value with fees (i.e. delivered_amount + Fee)
|
|
187
191
|
const expectedValue = expectedType === "IN" ? BigInt(deliveredAmount) : BigInt(deliveredAmount + fee);
|
|
188
192
|
expect(results).toEqual([
|
|
@@ -200,6 +204,14 @@ describe("listOperations", () => {
|
|
|
200
204
|
recipients: [opDestination],
|
|
201
205
|
date: new Date(1000000 + utils_1.RIPPLE_EPOCH * 1000),
|
|
202
206
|
transactionSequenceNumber: 1,
|
|
207
|
+
details: {
|
|
208
|
+
memos: [
|
|
209
|
+
{
|
|
210
|
+
type: "687474703a2f2f6578616d706c652e636f6d2f6d656d6f2f67656e65726963",
|
|
211
|
+
data: "72656e74",
|
|
212
|
+
},
|
|
213
|
+
],
|
|
214
|
+
},
|
|
203
215
|
},
|
|
204
216
|
{
|
|
205
217
|
hash: "HASH_VALUE",
|
|
@@ -233,16 +245,8 @@ describe("listOperations", () => {
|
|
|
233
245
|
recipients: [opDestination],
|
|
234
246
|
date: new Date(1000000 + utils_1.RIPPLE_EPOCH * 1000),
|
|
235
247
|
transactionSequenceNumber: 1,
|
|
236
|
-
details: {
|
|
237
|
-
memos: [
|
|
238
|
-
{
|
|
239
|
-
type: "687474703a2f2f6578616d706c652e636f6d2f6d656d6f2f67656e65726963",
|
|
240
|
-
data: "72656e74",
|
|
241
|
-
},
|
|
242
|
-
],
|
|
243
|
-
},
|
|
244
248
|
},
|
|
245
249
|
]);
|
|
246
|
-
})
|
|
250
|
+
});
|
|
247
251
|
});
|
|
248
252
|
//# sourceMappingURL=listOperations.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listOperations.test.js","sourceRoot":"","sources":["../../src/logic/listOperations.test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"listOperations.test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,UAAU,EAAE,CAAC,aAAa,CAAC;gBAC3B,IAAI,EAAE,IAAI,IAAI,CAAC,OAAO,GAAG,oBAAY,GAAG,IAAI,CAAC;gBAC7C,yBAAyB,EAAE,CAAC;gBAC5B,OAAO,EAAE;oBACP,cAAc,EAAE,MAAM;iBACvB;aACF;YACD;gBACE,IAAI,EAAE,YAAY;gBAClB,OAAO;gBACP,IAAI,EAAE,SAAS;gBACf,UAAU,EAAE,YAAY;gBACxB,KAAK,EAAE,aAAa;gBACpB,GAAG,EAAE,MAAM,CAAC,EAAE,CAAC;gBACf,WAAW,EAAE,CAAC;gBACd,SAAS,EAAE,kBAAkB;gBAC7B,SAAS,EAAE,IAAI,IAAI,CAAC,sBAAsB,CAAC;gBAC3C,OAAO,EAAE,CAAC,QAAQ,CAAC;gBACnB,UAAU,EAAE,CAAC,aAAa,CAAC;gBAC3B,IAAI,EAAE,IAAI,IAAI,CAAC,OAAO,GAAG,oBAAY,GAAG,IAAI,CAAC;gBAC7C,yBAAyB,EAAE,CAAC;aAC7B;SACF,CAAC,CAAC;IACL,CAAC,CACF,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
package/lib/logic/utils.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -23,27 +14,27 @@ const validateTag = (tag) => {
|
|
|
23
14
|
return (!tag.isNaN() && tag.isFinite() && tag.isInteger() && tag.isPositive() && tag.lte(exports.UINT32_MAX));
|
|
24
15
|
};
|
|
25
16
|
exports.validateTag = validateTag;
|
|
26
|
-
const getNextValidSequence = (address) =>
|
|
27
|
-
const accInfo =
|
|
17
|
+
const getNextValidSequence = async (address) => {
|
|
18
|
+
const accInfo = await (0, network_1.getAccountInfo)(address, true);
|
|
28
19
|
return accInfo.sequence;
|
|
29
|
-
}
|
|
20
|
+
};
|
|
30
21
|
exports.getNextValidSequence = getNextValidSequence;
|
|
31
22
|
function isRecipientValid(recipient) {
|
|
32
23
|
return (0, ripple_address_codec_1.isValidClassicAddress)(recipient);
|
|
33
24
|
}
|
|
34
|
-
const recipientIsNew = (recipient) =>
|
|
25
|
+
const recipientIsNew = async (recipient) => {
|
|
35
26
|
if (!isRecipientValid(recipient))
|
|
36
27
|
return false;
|
|
37
|
-
const info =
|
|
28
|
+
const info = await (0, network_1.getAccountInfo)(recipient);
|
|
38
29
|
return info.isNewAccount;
|
|
39
|
-
}
|
|
30
|
+
};
|
|
40
31
|
const cacheRecipientsNew = {};
|
|
41
|
-
const cachedRecipientIsNew = (recipient) =>
|
|
32
|
+
const cachedRecipientIsNew = async (recipient) => {
|
|
42
33
|
if (recipient in cacheRecipientsNew)
|
|
43
34
|
return cacheRecipientsNew[recipient];
|
|
44
|
-
cacheRecipientsNew[recipient] =
|
|
35
|
+
cacheRecipientsNew[recipient] = await recipientIsNew(recipient);
|
|
45
36
|
return cacheRecipientsNew[recipient];
|
|
46
|
-
}
|
|
37
|
+
};
|
|
47
38
|
exports.cachedRecipientIsNew = cachedRecipientIsNew;
|
|
48
39
|
const removeCachedRecipientIsNew = (recipient) => {
|
|
49
40
|
delete cacheRecipientsNew[recipient];
|
package/lib/logic/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/logic/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/logic/utils.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AACrC,+DAA6D;AAC7D,wCAA4C;AAE/B,QAAA,UAAU,GAAG,IAAI,sBAAS,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAE5D,kEAAkE;AACrD,QAAA,YAAY,GAAG,SAAS,CAAC;AAE/B,MAAM,WAAW,GAAG,CAAC,GAAc,EAAE,EAAE;IAC5C,OAAO,CACL,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,GAAG,CAAC,QAAQ,EAAE,IAAI,GAAG,CAAC,SAAS,EAAE,IAAI,GAAG,CAAC,UAAU,EAAE,IAAI,GAAG,CAAC,GAAG,CAAC,kBAAU,CAAC,CAC7F,CAAC;AACJ,CAAC,CAAC;AAJW,QAAA,WAAW,eAItB;AAEK,MAAM,oBAAoB,GAAG,KAAK,EAAE,OAAe,EAAE,EAAE;IAC5D,MAAM,OAAO,GAAG,MAAM,IAAA,wBAAc,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACpD,OAAO,OAAO,CAAC,QAAQ,CAAC;AAC1B,CAAC,CAAC;AAHW,QAAA,oBAAoB,wBAG/B;AAEF,SAAS,gBAAgB,CAAC,SAAiB;IACzC,OAAO,IAAA,4CAAqB,EAAC,SAAS,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,cAAc,GAAG,KAAK,EAAE,SAAiB,EAAoB,EAAE;IACnE,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC;QAAE,OAAO,KAAK,CAAC;IAE/C,MAAM,IAAI,GAAG,MAAM,IAAA,wBAAc,EAAC,SAAS,CAAC,CAAC;IAC7C,OAAO,IAAI,CAAC,YAAY,CAAC;AAC3B,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAA4B,EAAE,CAAC;AAChD,MAAM,oBAAoB,GAAG,KAAK,EAAE,SAAiB,EAAE,EAAE;IAC9D,IAAI,SAAS,IAAI,kBAAkB;QAAE,OAAO,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAC1E,kBAAkB,CAAC,SAAS,CAAC,GAAG,MAAM,cAAc,CAAC,SAAS,CAAC,CAAC;IAChE,OAAO,kBAAkB,CAAC,SAAS,CAAC,CAAC;AACvC,CAAC,CAAC;AAJW,QAAA,oBAAoB,wBAI/B;AACK,MAAM,0BAA0B,GAAG,CAAC,SAAiB,EAAE,EAAE;IAC9D,OAAO,kBAAkB,CAAC,SAAS,CAAC,CAAC;AACvC,CAAC,CAAC;AAFW,QAAA,0BAA0B,8BAErC"}
|
package/lib/logic/utils.test.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
const utils_1 = require("./utils");
|
|
13
4
|
jest.mock("ripple-address-codec", () => ({
|
|
@@ -21,7 +12,7 @@ describe("cachedRecipientIsNew", () => {
|
|
|
21
12
|
afterEach(() => {
|
|
22
13
|
mockGetAccountInfo.mockClear();
|
|
23
14
|
});
|
|
24
|
-
it("returns true when network returns a new empty account", () =>
|
|
15
|
+
it("returns true when network returns a new empty account", async () => {
|
|
25
16
|
// Given
|
|
26
17
|
mockGetAccountInfo.mockResolvedValueOnce({
|
|
27
18
|
isNewAccount: true,
|
|
@@ -30,12 +21,12 @@ describe("cachedRecipientIsNew", () => {
|
|
|
30
21
|
sequence: 0,
|
|
31
22
|
});
|
|
32
23
|
// When
|
|
33
|
-
const result =
|
|
24
|
+
const result = await (0, utils_1.cachedRecipientIsNew)("address1");
|
|
34
25
|
// Then
|
|
35
26
|
expect(mockGetAccountInfo).toHaveBeenCalledTimes(1);
|
|
36
27
|
expect(result).toBeTruthy();
|
|
37
|
-
})
|
|
38
|
-
it("returns false when network a valid AccountInfo", () =>
|
|
28
|
+
});
|
|
29
|
+
it("returns false when network a valid AccountInfo", async () => {
|
|
39
30
|
// Given
|
|
40
31
|
mockGetAccountInfo.mockResolvedValueOnce({
|
|
41
32
|
isNewAccount: false,
|
|
@@ -44,19 +35,19 @@ describe("cachedRecipientIsNew", () => {
|
|
|
44
35
|
sequence: 999441667919804,
|
|
45
36
|
});
|
|
46
37
|
// When
|
|
47
|
-
const result =
|
|
38
|
+
const result = await (0, utils_1.cachedRecipientIsNew)("address2");
|
|
48
39
|
// Then
|
|
49
40
|
expect(mockGetAccountInfo).toHaveBeenCalledTimes(1);
|
|
50
41
|
expect(result).toBeFalsy();
|
|
51
|
-
})
|
|
52
|
-
it("throws an error when network throws an error", () =>
|
|
42
|
+
});
|
|
43
|
+
it("throws an error when network throws an error", async () => {
|
|
53
44
|
// Given
|
|
54
45
|
mockGetAccountInfo.mockImplementationOnce(() => {
|
|
55
46
|
throw new Error("Malformed address");
|
|
56
47
|
});
|
|
57
48
|
// When & Then
|
|
58
|
-
|
|
49
|
+
await expect((0, utils_1.cachedRecipientIsNew)("address3")).rejects.toThrow("Malformed address");
|
|
59
50
|
expect(mockGetAccountInfo).toHaveBeenCalledTimes(1);
|
|
60
|
-
})
|
|
51
|
+
});
|
|
61
52
|
});
|
|
62
53
|
//# sourceMappingURL=utils.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.test.js","sourceRoot":"","sources":["../../src/logic/utils.test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.test.js","sourceRoot":"","sources":["../../src/logic/utils.test.ts"],"names":[],"mappings":";;AAAA,mCAA+C;AAE/C,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,CAAC;IACvC,qBAAqB,EAAE,GAAG,EAAE,CAAC,IAAI;CAClC,CAAC,CAAC,CAAC;AACJ,MAAM,kBAAkB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AACrC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC;IAC7B,cAAc,EAAE,CAAC,OAAe,EAAE,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC;CACjE,CAAC,CAAC,CAAC;AAEJ,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,SAAS,CAAC,GAAG,EAAE;QACb,kBAAkB,CAAC,SAAS,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uDAAuD,EAAE,KAAK,IAAI,EAAE;QACrE,QAAQ;QACR,kBAAkB,CAAC,qBAAqB,CAAC;YACvC,YAAY,EAAE,IAAI;YAClB,OAAO,EAAE,GAAG;YACZ,UAAU,EAAE,CAAC;YACb,QAAQ,EAAE,CAAC;SACZ,CAAC,CAAC;QAEH,OAAO;QACP,MAAM,MAAM,GAAG,MAAM,IAAA,4BAAoB,EAAC,UAAU,CAAC,CAAC;QAEtD,OAAO;QACP,MAAM,CAAC,kBAAkB,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QACpD,MAAM,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gDAAgD,EAAE,KAAK,IAAI,EAAE;QAC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