xrbp 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/examples/nodestore1.rb +3 -1
  3. data/lib/xrbp/common.rb +6 -0
  4. data/lib/xrbp/core_ext.rb +21 -0
  5. data/lib/xrbp/nodestore/format.rb +76 -26
  6. data/lib/xrbp/nodestore/ledger.rb +46 -14
  7. data/lib/xrbp/nodestore/parser.rb +47 -14
  8. data/lib/xrbp/nodestore/protocol/indexes.rb +11 -8
  9. data/lib/xrbp/nodestore/protocol/issue.rb +15 -0
  10. data/lib/xrbp/nodestore/protocol/rate.rb +13 -1
  11. data/lib/xrbp/nodestore/shamap/node_factory.rb +6 -1
  12. data/lib/xrbp/nodestore/shamap/node_id.rb +2 -2
  13. data/lib/xrbp/nodestore/sle/st_amount.rb +46 -181
  14. data/lib/xrbp/nodestore/sle/st_amount_arithmatic.rb +126 -0
  15. data/lib/xrbp/nodestore/sle/st_amount_comparison.rb +49 -0
  16. data/lib/xrbp/nodestore/sle/st_amount_conversion.rb +203 -0
  17. data/lib/xrbp/nodestore/sqldb.rb +69 -4
  18. data/lib/xrbp/overlay/handshake.rb +1 -1
  19. data/lib/xrbp/version.rb +1 -1
  20. data/spec/xrbp/crypto/account_spec.rb +7 -2
  21. data/spec/xrbp/nodestore/amendments_spec.rb +11 -0
  22. data/spec/xrbp/nodestore/db_parser.rb +64 -1
  23. data/spec/xrbp/nodestore/fees_spec.rb +3 -0
  24. data/spec/xrbp/nodestore/ledger_access.rb +87 -2
  25. data/spec/xrbp/nodestore/protocol/indexes_spec.rb +43 -0
  26. data/spec/xrbp/nodestore/protocol/rate_spec.rb +12 -0
  27. data/spec/xrbp/nodestore/shamap/inner_node_spec.rb +44 -0
  28. data/spec/xrbp/nodestore/shamap/node_factory_spec.rb +9 -0
  29. data/spec/xrbp/nodestore/shamap/node_id_spec.rb +6 -0
  30. data/spec/xrbp/nodestore/shamap/node_spec.rb +25 -0
  31. data/spec/xrbp/nodestore/shamap_spec.rb +144 -0
  32. data/spec/xrbp/nodestore/sle/st_amount_arithmatic_spec.rb +7 -0
  33. data/spec/xrbp/nodestore/sle/st_amount_comparison_spec.rb +11 -0
  34. data/spec/xrbp/nodestore/sle/st_amount_conversion_spec.rb +64 -0
  35. data/spec/xrbp/nodestore/sle/st_amount_spec.rb +47 -0
  36. data/spec/xrbp/nodestore/sle/st_ledger_entry_spec.rb +5 -0
  37. data/spec/xrbp/nodestore/sle/st_object_spec.rb +29 -0
  38. metadata +20 -2
@@ -0,0 +1,47 @@
1
+ describe XRBP::NodeStore::STAmount do
2
+ it "provides access to #zero amount"
3
+
4
+ it "returns amount from quality"
5
+
6
+ context "quality rate = 0" do
7
+ it "returns default STAmount"
8
+ end
9
+
10
+ describe "default STAmount" do
11
+ describe "issue" do
12
+ it "is nil"
13
+ end
14
+
15
+ describe "mantissa" do
16
+ it "is zero"
17
+ end
18
+
19
+ describe "exponent" do
20
+ it "is zero"
21
+ end
22
+
23
+ it "is not negative"
24
+ end
25
+
26
+ it "canonicalizes data"
27
+
28
+ describe "#native?" do
29
+ context "native issuer" do
30
+ it "returns true"
31
+ end
32
+
33
+ context "non native issuer" do
34
+ it "returns false"
35
+ end
36
+ end
37
+
38
+ describe "zero?" do
39
+ context "mantissa is zero" do
40
+ it "returns true"
41
+ end
42
+
43
+ context "mantissa is not zero" do
44
+ it "returns false"
45
+ end
46
+ end
47
+ end # describe XRBP::NodeStore::STAmount
@@ -0,0 +1,5 @@
1
+ describe XRBP::NodeStore::STLedgerEntry do
2
+ it "returns type code"
3
+
4
+ it "returns type"
5
+ end
@@ -0,0 +1,29 @@
1
+ describe XRBP::NodeStore::STObject do
2
+ it "returns object flags"
3
+
4
+ describe "#flag?" do
5
+ context "flag is set" do
6
+ it "returns true"
7
+ end
8
+
9
+ context "flag is not set" do
10
+ it "returns false"
11
+ end
12
+ end
13
+
14
+ describe "#field?" do
15
+ context "field is set" do
16
+ it "returns true"
17
+ end
18
+
19
+ context "field is not set" do
20
+ it "returns false"
21
+ end
22
+ end
23
+
24
+ it "provide access to field"
25
+
26
+ it "provide access to amount field"
27
+
28
+ it "provide access to account field"
29
+ end
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.2.2
4
+ version: 0.2.3
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-10-18 00:00:00.000000000 Z
11
+ date: 2019-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -257,6 +257,9 @@ files:
257
257
  - lib/xrbp/nodestore/sle.rb
258
258
  - lib/xrbp/nodestore/sle/st_account.rb
259
259
  - lib/xrbp/nodestore/sle/st_amount.rb
260
+ - lib/xrbp/nodestore/sle/st_amount_arithmatic.rb
261
+ - lib/xrbp/nodestore/sle/st_amount_comparison.rb
262
+ - lib/xrbp/nodestore/sle/st_amount_conversion.rb
260
263
  - lib/xrbp/nodestore/sle/st_ledger_entry.rb
261
264
  - lib/xrbp/nodestore/sle/st_object.rb
262
265
  - lib/xrbp/nodestore/sqldb.rb
@@ -318,11 +321,26 @@ files:
318
321
  - spec/xrbp/crypto/key_spec.rb
319
322
  - spec/xrbp/crypto/node_spec.rb
320
323
  - spec/xrbp/crypto/seed_spec.rb
324
+ - spec/xrbp/nodestore/amendments_spec.rb
321
325
  - spec/xrbp/nodestore/backends/db_access.rb
322
326
  - spec/xrbp/nodestore/backends/nudb_spec.rb
323
327
  - spec/xrbp/nodestore/backends/rocksdb_spec.rb
324
328
  - spec/xrbp/nodestore/db_parser.rb
329
+ - spec/xrbp/nodestore/fees_spec.rb
325
330
  - spec/xrbp/nodestore/ledger_access.rb
331
+ - spec/xrbp/nodestore/protocol/indexes_spec.rb
332
+ - spec/xrbp/nodestore/protocol/rate_spec.rb
333
+ - spec/xrbp/nodestore/shamap/inner_node_spec.rb
334
+ - spec/xrbp/nodestore/shamap/node_factory_spec.rb
335
+ - spec/xrbp/nodestore/shamap/node_id_spec.rb
336
+ - spec/xrbp/nodestore/shamap/node_spec.rb
337
+ - spec/xrbp/nodestore/shamap_spec.rb
338
+ - spec/xrbp/nodestore/sle/st_amount_arithmatic_spec.rb
339
+ - spec/xrbp/nodestore/sle/st_amount_comparison_spec.rb
340
+ - spec/xrbp/nodestore/sle/st_amount_conversion_spec.rb
341
+ - spec/xrbp/nodestore/sle/st_amount_spec.rb
342
+ - spec/xrbp/nodestore/sle/st_ledger_entry_spec.rb
343
+ - spec/xrbp/nodestore/sle/st_object_spec.rb
326
344
  - spec/xrbp/websocket/client_spec.rb
327
345
  - spec/xrbp/websocket/command_spec.rb
328
346
  - spec/xrbp/websocket/connection_spec.rb