xrpl-ruby 0.9.1 → 0.9.2
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -0
- data/README.md +5 -6
- data/lib/binary-codec/serdes/binary_serializer.rb +3 -2
- data/lib/binary-codec/types/account_id.rb +32 -3
- data/lib/xrpl/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ee2463ebb26de37ec88b1c796591a4088f97452dd59bd50bd8d813f431ec45cf
|
|
4
|
+
data.tar.gz: b52c8745a69f90af16f2ac61bf8693e165d5dfccbae5ace43262835a030e4440
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1a534a34eb4a9d1ae3ad38e3c2c12051b99f515cbfeaff4b14d217b7a200594fb6b611c617bc9815f50d78ce86378ea717558329f3682da36215a0b9fe0fac8a
|
|
7
|
+
data.tar.gz: 13e6f490edfec2457e31aa305d6c2ce890cde6f774c5fa9eec331e35f16bc8021762037b6bf9d9f0c46e000b282a7ff6e7222563ce114bd323069f7b196c388a
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.9.2] - 2026-11-09
|
|
11
|
+
|
|
12
|
+
A patch release with one codec fix: an account field of length zero now keeps
|
|
13
|
+
its bytes through decoding and encoding, as in rippled. The README's advice on
|
|
14
|
+
`PaymentBurn` is updated too. Codec fixtures 39/39 and 263/263, both ways; all
|
|
15
|
+
10 Testnet specs pass on the release commit.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- **`PaymentBurn` delegation.** The README no longer advises against it on
|
|
20
|
+
Mainnet and Testnet, where `fixCleanup3_4_0` is now enabled. On a network
|
|
21
|
+
without the amendment the warning still applies.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- **An unset account field.** An account field of length zero, as in a pseudo
|
|
26
|
+
transaction, decoded as the zero account and encoded back as 20 zero bytes,
|
|
27
|
+
which changes the bytes and the hash. Both directions now follow rippled's
|
|
28
|
+
`STAccount`: an empty field reads as `''`, and `''` writes an empty field.
|
|
29
|
+
The zero account `rrrrrrrrrrrrrrrrrrrrrhoLvTp` and accounts in fixed-width
|
|
30
|
+
positions (an issuer, a path step) are unchanged. If you passed `''` to mean
|
|
31
|
+
the zero account, pass `rrrrrrrrrrrrrrrrrrrrrhoLvTp` instead.
|
|
32
|
+
|
|
10
33
|
## [0.9.1] - 2026-11-02
|
|
11
34
|
|
|
12
35
|
A patch release with one fix: codec types now produce valid JSON inside
|
data/README.md
CHANGED
|
@@ -218,12 +218,11 @@ permissions. A permission is either a transaction type, such as `"Payment"`,
|
|
|
218
218
|
or one of the granular permissions, such as `"TrustlineAuthorize"` or
|
|
219
219
|
`"PaymentMint"`. The codec translates both names.
|
|
220
220
|
|
|
221
|
-
>
|
|
222
|
-
> enabled
|
|
223
|
-
> `PaymentBurn` can in certain circumstances also mint
|
|
224
|
-
> (trust line tokens or MPTs). The `feature` method of a node
|
|
225
|
-
> whether it is enabled there
|
|
226
|
-
> has the Mainnet status. Source:
|
|
221
|
+
> **`"PaymentBurn"` is safe to delegate only where the `fixCleanup3_4_0`
|
|
222
|
+
> amendment is enabled.** It is on Mainnet and Testnet. On a network without
|
|
223
|
+
> it, a delegate holding `PaymentBurn` can in certain circumstances also mint
|
|
224
|
+
> fungible tokens (trust line tokens or MPTs). The `feature` method of a node
|
|
225
|
+
> reports whether it is enabled there. Source:
|
|
227
226
|
> [Permission Values](https://xrpl.org/docs/references/protocol/data-types/permission-values).
|
|
228
227
|
|
|
229
228
|
```ruby
|
|
@@ -73,8 +73,9 @@ module BinaryCodec
|
|
|
73
73
|
def write_length_encoded(value, is_unl_modify_workaround = false)
|
|
74
74
|
bytes = BytesList.new
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
# An unset account field and the Account field in a UNLModify transaction
|
|
77
|
+
# have no bytes.
|
|
78
|
+
unless is_unl_modify_workaround || (value.is_a?(AccountId) && value.unset?)
|
|
78
79
|
value.to_byte_sink(bytes)
|
|
79
80
|
end
|
|
80
81
|
|
|
@@ -1,11 +1,40 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module BinaryCodec
|
|
4
|
+
# An account field can be unset, which is not the zero account: empty on the
|
|
5
|
+
# wire instead of 20 zero bytes, and '' in JSON instead of
|
|
6
|
+
# rrrrrrrrrrrrrrrrrrrrrhoLvTp. This follows STAccount in rippled, which keeps
|
|
7
|
+
# 20 zero bytes and a flag, so a value in a fixed width position, such as the
|
|
8
|
+
# issuer of an Amount, stays 20 bytes long.
|
|
4
9
|
class AccountId < Hash160
|
|
5
10
|
@width = 20
|
|
6
11
|
|
|
7
|
-
def initialize(bytes = nil)
|
|
12
|
+
def initialize(bytes = nil, unset: false)
|
|
8
13
|
super(bytes)
|
|
14
|
+
@unset = unset
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Creates an unset account field.
|
|
18
|
+
# @return [AccountId] The created instance.
|
|
19
|
+
def self.unset
|
|
20
|
+
new(unset: true)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Creates an AccountId from a parser.
|
|
24
|
+
# @param parser [BinaryParser] The parser to read from.
|
|
25
|
+
# @param hint [Integer, nil] The length of the field, nil at a fixed width position.
|
|
26
|
+
# @return [AccountId] The created instance.
|
|
27
|
+
def self.from_parser(parser, hint = nil)
|
|
28
|
+
return unset if hint == 0
|
|
29
|
+
|
|
30
|
+
super
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Whether this is an unset field rather than an account, the zero account
|
|
34
|
+
# included. The serializer writes such a field with length zero.
|
|
35
|
+
# @return [Boolean]
|
|
36
|
+
def unset?
|
|
37
|
+
@unset
|
|
9
38
|
end
|
|
10
39
|
|
|
11
40
|
# Creates a new AccountId instance from a value.
|
|
@@ -15,7 +44,7 @@ module BinaryCodec
|
|
|
15
44
|
return value if value.is_a?(AccountId)
|
|
16
45
|
|
|
17
46
|
if value.is_a?(String)
|
|
18
|
-
return
|
|
47
|
+
return unset if value.empty?
|
|
19
48
|
|
|
20
49
|
if valid_hex?(value)
|
|
21
50
|
return new(hex_to_bytes(value))
|
|
@@ -46,7 +75,7 @@ module BinaryCodec
|
|
|
46
75
|
end
|
|
47
76
|
|
|
48
77
|
def to_json(_definitions = nil, _field_name = nil)
|
|
49
|
-
to_base58
|
|
78
|
+
unset? ? '' : to_base58
|
|
50
79
|
end
|
|
51
80
|
|
|
52
81
|
# Returns the base58 representation of the account ID.
|
data/lib/xrpl/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: xrpl-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alexander Busse
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|