xrbp 0.1.7 → 0.1.8
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/examples/sandbox.rb +3 -2
- data/lib/xrbp/nodestore/backends/nudb.rb +1 -0
- data/lib/xrbp/nodestore/db.rb +14 -5
- data/lib/xrbp/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: '096cdf11861212228f99c1f93fca43c0ca503107bbd4602356e55991397a29a9'
|
4
|
+
data.tar.gz: b6178472d0dd06f47fb38632d5458ea7ffa86720a657e03e3e9c1cc640d2d4e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67870bc15932d4b2877ac4fffd4bf07221c8ef4834f0a41f72bffa621f246239f5194922c1d9fbb4933d83054eb88c8bffef93f0b95a9940a1389cb74fab69fd
|
7
|
+
data.tar.gz: 1afd32b1bdf8b9b5be99337da2fc4fd91f29d6dbd8c5deb90a3bf14cbeb9d4a479177c26e4040edf3310b18b11d9d79e1d1532af2855eeefad5b50710211d44b
|
data/examples/sandbox.rb
CHANGED
@@ -5,9 +5,10 @@ require 'xrbp/nodestore/backends/nudb'
|
|
5
5
|
db = XRBP::NodeStore::Backends::NuDB.new "/var/lib/rippled/nudb/"
|
6
6
|
store = db.instance_variable_get(:@store)
|
7
7
|
|
8
|
-
key = [
|
8
|
+
key = [47, 126, 65, 231, 47, 167, 3, 91, 161, 174, 133, 152, 2, 230, 171, 139, 209, 40, 100, 217, 100, 131, 160, 49, 186, 119, 31, 84, 75, 116, 125, 81].pack("C*")
|
9
9
|
val = store.fetch(key).first
|
10
|
-
puts val.unpack("C*").join " "
|
10
|
+
#puts val.unpack("C*").join " "
|
11
11
|
decompressed = db.send(:decompress, val)
|
12
12
|
puts decompressed.unpack("C*").join " "
|
13
13
|
type, obj = db.send(:infer_type, decompressed)
|
14
|
+
puts obj
|
data/lib/xrbp/nodestore/db.rb
CHANGED
@@ -99,7 +99,7 @@ module XRBP
|
|
99
99
|
|
100
100
|
def parse_fields(fields)
|
101
101
|
parsed = {}
|
102
|
-
until fields == "" || fields.nil?
|
102
|
+
until fields == "" || fields == "\0" || fields.nil?
|
103
103
|
encoding, fields = parse_encoding(fields)
|
104
104
|
return parsed if encoding.first.nil?
|
105
105
|
|
@@ -249,7 +249,7 @@ module XRBP
|
|
249
249
|
end
|
250
250
|
|
251
251
|
def parse_pathset(data)
|
252
|
-
pathset = []
|
252
|
+
pathset = [[]]
|
253
253
|
until data == "" || data.nil?
|
254
254
|
segment = data.unpack("C").first
|
255
255
|
data = data[1..-1]
|
@@ -258,18 +258,27 @@ module XRBP
|
|
258
258
|
if segment == 0xFF # path boundry
|
259
259
|
pathset << []
|
260
260
|
else
|
261
|
+
account, current, issuer = nil
|
262
|
+
|
263
|
+
path = {}
|
264
|
+
|
261
265
|
if (segment & 0x01) != 0 # path account
|
262
|
-
|
266
|
+
account, data = parse_account(data, 20)
|
267
|
+
path[:account] = account
|
263
268
|
end
|
264
269
|
|
265
|
-
if (segment &
|
270
|
+
if (segment & 0x10) != 0 # path currency
|
266
271
|
currency = Format::CURRENCY_CODE.decode(data)
|
267
272
|
data = data[Format::CURRENCY_CODE.size..-1]
|
273
|
+
path[:currency] = currency
|
268
274
|
end
|
269
275
|
|
270
|
-
if (segment &
|
276
|
+
if (segment & 0x20) != 0 # path issuer
|
271
277
|
issuer, data = parse_account(data, 20)
|
278
|
+
path[:issuer] = issuer
|
272
279
|
end
|
280
|
+
|
281
|
+
pathset.last << path
|
273
282
|
end
|
274
283
|
end
|
275
284
|
|
data/lib/xrbp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xrbp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dev Null Productions
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|