Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

Order objects consistent with 0.2.6 #96

Merged
merged 81 commits into from
Aug 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
b497c3e
rewrote enums in TS
natenichols Jun 26, 2020
3bbef14
linted changes
natenichols Jun 26, 2020
045c13b
added resolveJSONModule
natenichols Jun 26, 2020
0f1788c
changed field to types instead of class
natenichols Jun 30, 2020
bdf13f7
renamed enums to definitions
natenichols Jun 30, 2020
e76e34f
renamed enums -> definitions
natenichols Jun 30, 2020
3446499
refactored binary-parser
natenichols Jun 30, 2020
4a93464
rewrote ./src/serdes
natenichols Jul 1, 2020
878cd2f
merged master into dev to stay up to date
natenichols Jul 1, 2020
c25f515
added documentation
natenichols Jul 1, 2020
62eca89
Changed definitions -> enums
natenichols Jul 1, 2020
af28355
changed parameter names
natenichols Jul 6, 2020
c095367
renamed arrays to bytesArray
natenichols Jul 6, 2020
7f594fd
updated readFieldValue() documentation
natenichols Jul 6, 2020
10942dc
Merge branch 'master' into dev
natenichols Jul 6, 2020
cb62ee0
added checking for type and field codes
natenichols Jul 6, 2020
a16441f
tested scenarios where type and field codes were invalid
natenichols Jul 6, 2020
e160c3a
added test where both field and type code out of range
natenichols Jul 6, 2020
941347b
resolved merge conflict
natenichols Jul 6, 2020
f24fd33
ran linter
natenichols Jul 7, 2020
577aa50
changed field back to nth
natenichols Jul 7, 2020
e6fe5a5
Merge branch 'master' into dev
natenichols Jul 7, 2020
8f98b22
refactored hash and all derived classes
natenichols Jul 8, 2020
cdf5b7d
refactored src/types/blob
natenichols Jul 8, 2020
0caec5e
doc-ed SerializedType
natenichols Jul 8, 2020
1d1e11a
doc-ed SerializedType
natenichols Jul 8, 2020
e0dbd9f
doc-ed SerializedType
natenichols Jul 8, 2020
47de9af
added documentation for types
natenichols Jul 8, 2020
8930f2a
changed toBeNull to toBeUndefined
natenichols Jul 8, 2020
6ad5e5c
Updated for Pull Request comments
natenichols Jul 9, 2020
b9e891d
added readonly to SerializeTypeClass.bytes
natenichols Jul 9, 2020
b2fd4f9
flagged _iso private
natenichols Jul 9, 2020
dfc5ead
refactored UInt and derived classes
natenichols Jul 10, 2020
598e511
Merge branch 'master' into dev
natenichols Jul 10, 2020
d264ac3
added docs
natenichols Jul 10, 2020
75734b2
made UInt abstract
natenichols Jul 10, 2020
a28e97d
refactored ./src/path-set
natenichols Jul 13, 2020
a77a2d2
linted code
natenichols Jul 13, 2020
fd082a3
removed linting comment
natenichols Jul 13, 2020
a79476d
added documenation for PathSet
natenichols Jul 13, 2020
baeae1e
merged master into dev
natenichols Jul 13, 2020
cce6fc0
removed a console.log that was used to debug
natenichols Jul 13, 2020
b7d3f9d
switching branches
natenichols Jul 13, 2020
6f98ea0
refactored for PR
natenichols Jul 13, 2020
13e2174
added brackets to if
natenichols Jul 13, 2020
8343c81
added linter to put space before comments
natenichols Jul 13, 2020
18d3416
merge branch working on STArray
natenichols Jul 13, 2020
4e09893
refactored STArray
natenichols Jul 14, 2020
7bb9bf8
documented STArray Class
natenichols Jul 14, 2020
6b2c66a
Merge branch 'dev' of https://github.com/ripple/ripple-binary-codec i…
natenichols Jul 14, 2020
92c9247
refactored Amount.ts
natenichols Jul 15, 2020
c07744d
switching branches
natenichols Jul 16, 2020
f34af9b
refactored STObject
natenichols Jul 16, 2020
58b0c4b
renamed base classes
natenichols Jul 16, 2020
b27d6c1
added .prototype to test
natenichols Jul 16, 2020
60588dd
merged stobject-refactor into dev
natenichols Jul 16, 2020
d08df74
Documented STObject class
natenichols Jul 16, 2020
9e4a6b4
removed commented out code
natenichols Jul 16, 2020
3ad960a
removed commented out code
natenichols Jul 16, 2020
efa7141
Merge branch 'dev' of https://github.com/ripple/ripple-binary-codec i…
natenichols Jul 16, 2020
e40cfa6
ran linter
natenichols Jul 16, 2020
4f95b78
changed string literals to constants
natenichols Jul 20, 2020
a9102f1
got rid of ./utils
natenichols Jul 20, 2020
55e39ef
finished refactor
natenichols Jul 21, 2020
0881fd0
merged master into dev
natenichols Jul 21, 2020
170abc9
updated exports
natenichols Jul 21, 2020
2728f31
updated exports
natenichols Jul 21, 2020
146e19d
removed partial application of function
natenichols Jul 21, 2020
fdaa576
removed unknown types
natenichols Jul 27, 2020
58a3569
documented index
natenichols Jul 28, 2020
1589c79
add JSON recursive type
natenichols Jul 29, 2020
57b4701
add JSON recursive type
natenichols Jul 29, 2020
f1301c1
Merge branch 'dev' of https://github.com/ripple/ripple-binary-codec i…
natenichols Jul 29, 2020
68b5aff
make .from methods accept generics
natenichols Jul 30, 2020
dc55040
Merge branch 'dev' of https://github.com/ripple/ripple-binary-codec i…
natenichols Jul 30, 2020
8a25d41
prepare for 1.0.0-rc1
natenichols Aug 18, 2020
f564c20
prepare for 1.0.0-rc1
natenichols Aug 18, 2020
5f3fbd4
version to 1.0.0-rc1
natenichols Aug 18, 2020
cd12341
modified API to take object types
natenichols Aug 18, 2020
23c381c
Update order of Hop and Amount objects
natenichols Aug 19, 2020
92e9ed1
update version to 1.0.0-rc3
natenichols Aug 19, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ripple-binary-codec",
"version": "1.0.0-rc2",
"version": "1.0.0-rc3",
"description": "XRP Ledger binary codec",
"files": [
"dist/*",
Expand Down
8 changes: 4 additions & 4 deletions src/types/amount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ class Amount extends SerializedType {
Amount.assertIouIsValid(value);

return {
issuer: issuer.toJSON(),
currency: currency.toJSON(),
value: value.toString(),
currency: currency.toJSON(),
issuer: issuer.toJSON(),
};
}
}
Expand All @@ -175,13 +175,13 @@ class Amount extends SerializedType {
*/
private static assertXrpIsValid(amount: string): void {
if (amount.indexOf(".") !== -1) {
throw new Error("XRP amounts must be integer");
throw new Error(`${amount.toString()} is an illegal amount`);
}

const decimal = new Decimal(amount);
if (!decimal.isZero()) {
if (decimal.lt(MIN_XRP) || decimal.gt(MAX_DROPS)) {
throw new Error("Invalid XRP amount");
throw new Error(`${amount.toString()} is an illegal amount`);
}
}
}
Expand Down
16 changes: 10 additions & 6 deletions src/types/path-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,20 +116,24 @@ class Hop extends SerializedType {
const hopParser = new BinaryParser(this.bytes.toString("hex"));
const type = hopParser.readUInt8();

const result: HopObject = {};
let account, currency, issuer: string | undefined = undefined
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, oops

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait, so this was a regression, not one of my oopses

if (type & TYPE_ACCOUNT) {
result.account = (AccountID.fromParser(hopParser) as AccountID).toJSON();
account = (AccountID.fromParser(hopParser) as AccountID).toJSON();
}

if (type & TYPE_CURRENCY) {
result.currency = (Currency.fromParser(hopParser) as Currency).toJSON();
currency = (Currency.fromParser(hopParser) as Currency).toJSON();
}

if (type & TYPE_ISSUER) {
result.issuer = (AccountID.fromParser(hopParser) as AccountID).toJSON();
issuer = (AccountID.fromParser(hopParser) as AccountID).toJSON();
}

return result;

return {
account: account,
issuer: issuer,
currency: currency,
};
}

/**
Expand Down