open-core 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +15 -0
  3. data/.travis.yml +15 -0
  4. data/.yardopts +8 -0
  5. data/CONTRIBUTING.md +48 -0
  6. data/Gemfile +15 -0
  7. data/Guardfile +5 -0
  8. data/LICENSE.txt +202 -0
  9. data/README.md +83 -0
  10. data/Rakefile +4 -0
  11. data/examples/create_account.rb +26 -0
  12. data/examples/low_level_transaction_post.rb +46 -0
  13. data/examples/mid_level_transaction_post.rb +33 -0
  14. data/examples/non_native_payment.rb +60 -0
  15. data/examples/offer.rb +75 -0
  16. data/examples/transaction_merge.rb +23 -0
  17. data/generated/stellar-base-generated.rb +134 -0
  18. data/generated/stellar/account_entry.rb +53 -0
  19. data/generated/stellar/account_entry/ext.rb +24 -0
  20. data/generated/stellar/account_flags.rb +27 -0
  21. data/generated/stellar/account_merge_result.rb +26 -0
  22. data/generated/stellar/account_merge_result_code.rb +30 -0
  23. data/generated/stellar/allow_trust_op.rb +38 -0
  24. data/generated/stellar/allow_trust_op/asset.rb +33 -0
  25. data/generated/stellar/allow_trust_result.rb +25 -0
  26. data/generated/stellar/allow_trust_result_code.rb +31 -0
  27. data/generated/stellar/asset.rb +47 -0
  28. data/generated/stellar/asset/alpha_num12.rb +22 -0
  29. data/generated/stellar/asset/alpha_num4.rb +22 -0
  30. data/generated/stellar/asset_type.rb +24 -0
  31. data/generated/stellar/bucket_entry.rb +28 -0
  32. data/generated/stellar/bucket_entry_type.rb +22 -0
  33. data/generated/stellar/change_trust_op.rb +22 -0
  34. data/generated/stellar/change_trust_result.rb +25 -0
  35. data/generated/stellar/change_trust_result_code.rb +30 -0
  36. data/generated/stellar/claim_offer_atom.rb +33 -0
  37. data/generated/stellar/create_account_op.rb +20 -0
  38. data/generated/stellar/create_account_result.rb +25 -0
  39. data/generated/stellar/create_account_result_code.rb +32 -0
  40. data/generated/stellar/create_passive_offer_op.rb +24 -0
  41. data/generated/stellar/crypto_key_type.rb +20 -0
  42. data/generated/stellar/decorated_signature.rb +20 -0
  43. data/generated/stellar/dont_have.rb +20 -0
  44. data/generated/stellar/envelope_type.rb +22 -0
  45. data/generated/stellar/error.rb +20 -0
  46. data/generated/stellar/hello.rb +26 -0
  47. data/generated/stellar/inflation_payout.rb +20 -0
  48. data/generated/stellar/inflation_result.rb +26 -0
  49. data/generated/stellar/inflation_result_code.rb +24 -0
  50. data/generated/stellar/ledger_entry.rb +44 -0
  51. data/generated/stellar/ledger_entry/data.rb +33 -0
  52. data/generated/stellar/ledger_entry/ext.rb +24 -0
  53. data/generated/stellar/ledger_entry_change.rb +31 -0
  54. data/generated/stellar/ledger_entry_change_type.rb +24 -0
  55. data/generated/stellar/ledger_entry_type.rb +24 -0
  56. data/generated/stellar/ledger_header.rb +65 -0
  57. data/generated/stellar/ledger_header/ext.rb +24 -0
  58. data/generated/stellar/ledger_header_history_entry.rb +33 -0
  59. data/generated/stellar/ledger_header_history_entry/ext.rb +24 -0
  60. data/generated/stellar/ledger_key.rb +50 -0
  61. data/generated/stellar/ledger_key/account.rb +20 -0
  62. data/generated/stellar/ledger_key/offer.rb +22 -0
  63. data/generated/stellar/ledger_key/trust_line.rb +22 -0
  64. data/generated/stellar/ledger_upgrade.rb +27 -0
  65. data/generated/stellar/ledger_upgrade_type.rb +22 -0
  66. data/generated/stellar/manage_offer_effect.rb +24 -0
  67. data/generated/stellar/manage_offer_op.rb +28 -0
  68. data/generated/stellar/manage_offer_result.rb +26 -0
  69. data/generated/stellar/manage_offer_result_code.rb +48 -0
  70. data/generated/stellar/manage_offer_success_result.rb +34 -0
  71. data/generated/stellar/manage_offer_success_result/offer.rb +30 -0
  72. data/generated/stellar/memo.rb +38 -0
  73. data/generated/stellar/memo_type.rb +28 -0
  74. data/generated/stellar/message_type.rb +45 -0
  75. data/generated/stellar/offer_entry.rb +49 -0
  76. data/generated/stellar/offer_entry/ext.rb +24 -0
  77. data/generated/stellar/offer_entry_flags.rb +21 -0
  78. data/generated/stellar/operation.rb +51 -0
  79. data/generated/stellar/operation/body.rb +60 -0
  80. data/generated/stellar/operation_meta.rb +18 -0
  81. data/generated/stellar/operation_result.rb +53 -0
  82. data/generated/stellar/operation_result/tr.rb +61 -0
  83. data/generated/stellar/operation_result_code.rb +25 -0
  84. data/generated/stellar/operation_type.rb +38 -0
  85. data/generated/stellar/path_payment_op.rb +32 -0
  86. data/generated/stellar/path_payment_result.rb +34 -0
  87. data/generated/stellar/path_payment_result/success.rb +22 -0
  88. data/generated/stellar/path_payment_result_code.rb +45 -0
  89. data/generated/stellar/payment_op.rb +22 -0
  90. data/generated/stellar/payment_result.rb +25 -0
  91. data/generated/stellar/payment_result_code.rb +39 -0
  92. data/generated/stellar/peer_address.rb +22 -0
  93. data/generated/stellar/price.rb +20 -0
  94. data/generated/stellar/public_key.rb +23 -0
  95. data/generated/stellar/scp_ballot.rb +20 -0
  96. data/generated/stellar/scp_envelope.rb +20 -0
  97. data/generated/stellar/scp_nomination.rb +22 -0
  98. data/generated/stellar/scp_quorum_set.rb +22 -0
  99. data/generated/stellar/scp_statement.rb +59 -0
  100. data/generated/stellar/scp_statement/pledges.rb +64 -0
  101. data/generated/stellar/scp_statement/pledges/confirm.rb +28 -0
  102. data/generated/stellar/scp_statement/pledges/externalize.rb +28 -0
  103. data/generated/stellar/scp_statement/pledges/prepare.rb +32 -0
  104. data/generated/stellar/scp_statement_type.rb +26 -0
  105. data/generated/stellar/set_options_op.rb +41 -0
  106. data/generated/stellar/set_options_result.rb +25 -0
  107. data/generated/stellar/set_options_result_code.rb +38 -0
  108. data/generated/stellar/signer.rb +20 -0
  109. data/generated/stellar/simple_payment_result.rb +22 -0
  110. data/generated/stellar/stellar_message.rb +66 -0
  111. data/generated/stellar/stellar_value.rb +40 -0
  112. data/generated/stellar/stellar_value/ext.rb +24 -0
  113. data/generated/stellar/threshold_indexes.rb +26 -0
  114. data/generated/stellar/time_bounds.rb +20 -0
  115. data/generated/stellar/transaction.rb +50 -0
  116. data/generated/stellar/transaction/ext.rb +24 -0
  117. data/generated/stellar/transaction_envelope.rb +20 -0
  118. data/generated/stellar/transaction_history_entry.rb +33 -0
  119. data/generated/stellar/transaction_history_entry/ext.rb +24 -0
  120. data/generated/stellar/transaction_history_result_entry.rb +33 -0
  121. data/generated/stellar/transaction_history_result_entry/ext.rb +24 -0
  122. data/generated/stellar/transaction_meta.rb +31 -0
  123. data/generated/stellar/transaction_meta/v0.rb +22 -0
  124. data/generated/stellar/transaction_result.rb +43 -0
  125. data/generated/stellar/transaction_result/ext.rb +24 -0
  126. data/generated/stellar/transaction_result/result.rb +30 -0
  127. data/generated/stellar/transaction_result_code.rb +45 -0
  128. data/generated/stellar/transaction_result_pair.rb +20 -0
  129. data/generated/stellar/transaction_result_set.rb +18 -0
  130. data/generated/stellar/transaction_set.rb +20 -0
  131. data/generated/stellar/trust_line_entry.rb +41 -0
  132. data/generated/stellar/trust_line_entry/ext.rb +24 -0
  133. data/generated/stellar/trust_line_flags.rb +21 -0
  134. data/lib/stellar-base.rb +32 -0
  135. data/lib/stellar/account_flags.rb +28 -0
  136. data/lib/stellar/asset.rb +69 -0
  137. data/lib/stellar/base.rb +1 -0
  138. data/lib/stellar/base/version.rb +5 -0
  139. data/lib/stellar/convert.rb +32 -0
  140. data/lib/stellar/key_pair.rb +112 -0
  141. data/lib/stellar/networks.rb +45 -0
  142. data/lib/stellar/operation.rb +304 -0
  143. data/lib/stellar/path_payment_result.rb +17 -0
  144. data/lib/stellar/price.rb +32 -0
  145. data/lib/stellar/thresholds.rb +39 -0
  146. data/lib/stellar/transaction.rb +170 -0
  147. data/lib/stellar/transaction_envelope.rb +32 -0
  148. data/lib/stellar/util/continued_fraction.rb +96 -0
  149. data/lib/stellar/util/strkey.rb +43 -0
  150. data/open-core.gemspec +37 -0
  151. data/spec/lib/stellar/account_flags_spec.rb +19 -0
  152. data/spec/lib/stellar/asset_spec.rb +45 -0
  153. data/spec/lib/stellar/convert_spec.rb +61 -0
  154. data/spec/lib/stellar/key_pair_spec.rb +238 -0
  155. data/spec/lib/stellar/networks_spec.rb +77 -0
  156. data/spec/lib/stellar/path_payment_result_spec.rb +95 -0
  157. data/spec/lib/stellar/price_spec.rb +34 -0
  158. data/spec/lib/stellar/thresholds_spec.rb +62 -0
  159. data/spec/lib/stellar/transaction_envelope_spec.rb +93 -0
  160. data/spec/lib/stellar/transaction_spec.rb +54 -0
  161. data/spec/lib/stellar/util/strkey_spec.rb +46 -0
  162. data/spec/spec_helper.rb +16 -0
  163. data/spec/support/matchers/be_strkey.rb +9 -0
  164. data/spec/support/matchers/eq_bytes.rb +5 -0
  165. data/spec/support/matchers/have_length.rb +5 -0
  166. data/tasks/rspec.rake +6 -0
  167. data/tasks/travis.rake +1 -0
  168. data/tasks/xdr.rake +50 -0
  169. data/xdr/Stellar-SCP.x +87 -0
  170. data/xdr/Stellar-ledger-entries.x +222 -0
  171. data/xdr/Stellar-ledger.x +231 -0
  172. data/xdr/Stellar-overlay.x +87 -0
  173. data/xdr/Stellar-transaction.x +670 -0
  174. data/xdr/Stellar-types.x +34 -0
  175. metadata +444 -0
@@ -0,0 +1,23 @@
1
+ # This code was automatically generated using xdrgen
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # union PublicKey switch (CryptoKeyType type)
9
+ # {
10
+ # case KEY_TYPE_ED25519:
11
+ # uint256 ed25519;
12
+ # };
13
+ #
14
+ # ===========================================================================
15
+ module Stellar
16
+ class PublicKey < XDR::Union
17
+ switch_on CryptoKeyType, :type
18
+
19
+ switch :key_type_ed25519, :ed25519
20
+
21
+ attribute :ed25519, Uint256
22
+ end
23
+ end
@@ -0,0 +1,20 @@
1
+ # This code was automatically generated using xdrgen
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct SCPBallot
9
+ # {
10
+ # uint32 counter; // n
11
+ # Value value; // x
12
+ # };
13
+ #
14
+ # ===========================================================================
15
+ module Stellar
16
+ class SCPBallot < XDR::Struct
17
+ attribute :counter, Uint32
18
+ attribute :value, Value
19
+ end
20
+ end
@@ -0,0 +1,20 @@
1
+ # This code was automatically generated using xdrgen
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct SCPEnvelope
9
+ # {
10
+ # SCPStatement statement;
11
+ # Signature signature;
12
+ # };
13
+ #
14
+ # ===========================================================================
15
+ module Stellar
16
+ class SCPEnvelope < XDR::Struct
17
+ attribute :statement, SCPStatement
18
+ attribute :signature, Signature
19
+ end
20
+ end
@@ -0,0 +1,22 @@
1
+ # This code was automatically generated using xdrgen
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct SCPNomination
9
+ # {
10
+ # Hash quorumSetHash; // D
11
+ # Value votes<>; // X
12
+ # Value accepted<>; // Y
13
+ # };
14
+ #
15
+ # ===========================================================================
16
+ module Stellar
17
+ class SCPNomination < XDR::Struct
18
+ attribute :quorum_set_hash, Hash
19
+ attribute :votes, XDR::VarArray[Value]
20
+ attribute :accepted, XDR::VarArray[Value]
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ # This code was automatically generated using xdrgen
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct SCPQuorumSet
9
+ # {
10
+ # uint32 threshold;
11
+ # PublicKey validators<>;
12
+ # SCPQuorumSet innerSets<>;
13
+ # };
14
+ #
15
+ # ===========================================================================
16
+ module Stellar
17
+ class SCPQuorumSet < XDR::Struct
18
+ attribute :threshold, Uint32
19
+ attribute :validators, XDR::VarArray[PublicKey]
20
+ attribute :inner_sets, XDR::VarArray[SCPQuorumSet]
21
+ end
22
+ end
@@ -0,0 +1,59 @@
1
+ # This code was automatically generated using xdrgen
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct SCPStatement
9
+ # {
10
+ # NodeID nodeID; // v
11
+ # uint64 slotIndex; // i
12
+ #
13
+ # union switch (SCPStatementType type)
14
+ # {
15
+ # case SCP_ST_PREPARE:
16
+ # struct
17
+ # {
18
+ # Hash quorumSetHash; // D
19
+ # SCPBallot ballot; // b
20
+ # SCPBallot* prepared; // p
21
+ # SCPBallot* preparedPrime; // p'
22
+ # uint32 nC; // n_c
23
+ # uint32 nP; // n_P
24
+ # } prepare;
25
+ # case SCP_ST_CONFIRM:
26
+ # struct
27
+ # {
28
+ # Hash quorumSetHash; // D
29
+ # uint32 nPrepared; // n_p
30
+ # SCPBallot commit; // c
31
+ # uint32 nP; // n_P
32
+ # } confirm;
33
+ # case SCP_ST_EXTERNALIZE:
34
+ # struct
35
+ # {
36
+ # SCPBallot commit; // c
37
+ # uint32 nP; // n_P
38
+ # // not from the paper, but useful to build tooling to
39
+ # // traverse the graph based off only the latest statement
40
+ # Hash commitQuorumSetHash; // D used before EXTERNALIZE
41
+ # } externalize;
42
+ # case SCP_ST_NOMINATE:
43
+ # SCPNomination nominate;
44
+ # }
45
+ # pledges;
46
+ # };
47
+ #
48
+ # ===========================================================================
49
+ module Stellar
50
+ class SCPStatement < XDR::Struct
51
+ include XDR::Namespace
52
+
53
+ autoload :Pledges
54
+
55
+ attribute :node_id, NodeID
56
+ attribute :slot_index, Uint64
57
+ attribute :pledges, Pledges
58
+ end
59
+ end
@@ -0,0 +1,64 @@
1
+ # This code was automatically generated using xdrgen
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # union switch (SCPStatementType type)
9
+ # {
10
+ # case SCP_ST_PREPARE:
11
+ # struct
12
+ # {
13
+ # Hash quorumSetHash; // D
14
+ # SCPBallot ballot; // b
15
+ # SCPBallot* prepared; // p
16
+ # SCPBallot* preparedPrime; // p'
17
+ # uint32 nC; // n_c
18
+ # uint32 nP; // n_P
19
+ # } prepare;
20
+ # case SCP_ST_CONFIRM:
21
+ # struct
22
+ # {
23
+ # Hash quorumSetHash; // D
24
+ # uint32 nPrepared; // n_p
25
+ # SCPBallot commit; // c
26
+ # uint32 nP; // n_P
27
+ # } confirm;
28
+ # case SCP_ST_EXTERNALIZE:
29
+ # struct
30
+ # {
31
+ # SCPBallot commit; // c
32
+ # uint32 nP; // n_P
33
+ # // not from the paper, but useful to build tooling to
34
+ # // traverse the graph based off only the latest statement
35
+ # Hash commitQuorumSetHash; // D used before EXTERNALIZE
36
+ # } externalize;
37
+ # case SCP_ST_NOMINATE:
38
+ # SCPNomination nominate;
39
+ # }
40
+ #
41
+ # ===========================================================================
42
+ module Stellar
43
+ class SCPStatement
44
+ class Pledges < XDR::Union
45
+ include XDR::Namespace
46
+
47
+ autoload :Prepare
48
+ autoload :Confirm
49
+ autoload :Externalize
50
+
51
+ switch_on SCPStatementType, :type
52
+
53
+ switch :scp_st_prepare, :prepare
54
+ switch :scp_st_confirm, :confirm
55
+ switch :scp_st_externalize, :externalize
56
+ switch :scp_st_nominate, :nominate
57
+
58
+ attribute :prepare, Prepare
59
+ attribute :confirm, Confirm
60
+ attribute :externalize, Externalize
61
+ attribute :nominate, SCPNomination
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,28 @@
1
+ # This code was automatically generated using xdrgen
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct
9
+ # {
10
+ # Hash quorumSetHash; // D
11
+ # uint32 nPrepared; // n_p
12
+ # SCPBallot commit; // c
13
+ # uint32 nP; // n_P
14
+ # }
15
+ #
16
+ # ===========================================================================
17
+ module Stellar
18
+ class SCPStatement
19
+ class Pledges
20
+ class Confirm < XDR::Struct
21
+ attribute :quorum_set_hash, Hash
22
+ attribute :n_prepared, Uint32
23
+ attribute :commit, SCPBallot
24
+ attribute :n_p, Uint32
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ # This code was automatically generated using xdrgen
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct
9
+ # {
10
+ # SCPBallot commit; // c
11
+ # uint32 nP; // n_P
12
+ # // not from the paper, but useful to build tooling to
13
+ # // traverse the graph based off only the latest statement
14
+ # Hash commitQuorumSetHash; // D used before EXTERNALIZE
15
+ # }
16
+ #
17
+ # ===========================================================================
18
+ module Stellar
19
+ class SCPStatement
20
+ class Pledges
21
+ class Externalize < XDR::Struct
22
+ attribute :commit, SCPBallot
23
+ attribute :n_p, Uint32
24
+ attribute :commit_quorum_set_hash, Hash
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,32 @@
1
+ # This code was automatically generated using xdrgen
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct
9
+ # {
10
+ # Hash quorumSetHash; // D
11
+ # SCPBallot ballot; // b
12
+ # SCPBallot* prepared; // p
13
+ # SCPBallot* preparedPrime; // p'
14
+ # uint32 nC; // n_c
15
+ # uint32 nP; // n_P
16
+ # }
17
+ #
18
+ # ===========================================================================
19
+ module Stellar
20
+ class SCPStatement
21
+ class Pledges
22
+ class Prepare < XDR::Struct
23
+ attribute :quorum_set_hash, Hash
24
+ attribute :ballot, SCPBallot
25
+ attribute :prepared, XDR::Option[SCPBallot]
26
+ attribute :prepared_prime, XDR::Option[SCPBallot]
27
+ attribute :n_c, Uint32
28
+ attribute :n_p, Uint32
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,26 @@
1
+ # This code was automatically generated using xdrgen
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # enum SCPStatementType
9
+ # {
10
+ # SCP_ST_PREPARE = 0,
11
+ # SCP_ST_CONFIRM = 1,
12
+ # SCP_ST_EXTERNALIZE = 2,
13
+ # SCP_ST_NOMINATE = 3
14
+ # };
15
+ #
16
+ # ===========================================================================
17
+ module Stellar
18
+ class SCPStatementType < XDR::Enum
19
+ member :scp_st_prepare, 0
20
+ member :scp_st_confirm, 1
21
+ member :scp_st_externalize, 2
22
+ member :scp_st_nominate, 3
23
+
24
+ seal
25
+ end
26
+ end
@@ -0,0 +1,41 @@
1
+ # This code was automatically generated using xdrgen
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # struct SetOptionsOp
9
+ # {
10
+ # AccountID* inflationDest; // sets the inflation destination
11
+ #
12
+ # uint32* clearFlags; // which flags to clear
13
+ # uint32* setFlags; // which flags to set
14
+ #
15
+ # // account threshold manipulation
16
+ # uint32* masterWeight; // weight of the master account
17
+ # uint32* lowThreshold;
18
+ # uint32* medThreshold;
19
+ # uint32* highThreshold;
20
+ #
21
+ # string32* homeDomain; // sets the home domain
22
+ #
23
+ # // Add, update or remove a signer for the account
24
+ # // signer is deleted if the weight is 0
25
+ # Signer* signer;
26
+ # };
27
+ #
28
+ # ===========================================================================
29
+ module Stellar
30
+ class SetOptionsOp < XDR::Struct
31
+ attribute :inflation_dest, XDR::Option[AccountID]
32
+ attribute :clear_flags, XDR::Option[Uint32]
33
+ attribute :set_flags, XDR::Option[Uint32]
34
+ attribute :master_weight, XDR::Option[Uint32]
35
+ attribute :low_threshold, XDR::Option[Uint32]
36
+ attribute :med_threshold, XDR::Option[Uint32]
37
+ attribute :high_threshold, XDR::Option[Uint32]
38
+ attribute :home_domain, XDR::Option[String32]
39
+ attribute :signer, XDR::Option[Signer]
40
+ end
41
+ end
@@ -0,0 +1,25 @@
1
+ # This code was automatically generated using xdrgen
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # union SetOptionsResult switch (SetOptionsResultCode code)
9
+ # {
10
+ # case SET_OPTIONS_SUCCESS:
11
+ # void;
12
+ # default:
13
+ # void;
14
+ # };
15
+ #
16
+ # ===========================================================================
17
+ module Stellar
18
+ class SetOptionsResult < XDR::Union
19
+ switch_on SetOptionsResultCode, :code
20
+
21
+ switch :set_options_success
22
+ switch :default
23
+
24
+ end
25
+ end
@@ -0,0 +1,38 @@
1
+ # This code was automatically generated using xdrgen
2
+ # DO NOT EDIT or your changes may be overwritten
3
+
4
+ require 'xdr'
5
+
6
+ # === xdr source ============================================================
7
+ #
8
+ # enum SetOptionsResultCode
9
+ # {
10
+ # // codes considered as "success" for the operation
11
+ # SET_OPTIONS_SUCCESS = 0,
12
+ # // codes considered as "failure" for the operation
13
+ # SET_OPTIONS_LOW_RESERVE = -1, // not enough funds to add a signer
14
+ # SET_OPTIONS_TOO_MANY_SIGNERS = -2, // max number of signers already reached
15
+ # SET_OPTIONS_BAD_FLAGS = -3, // invalid combination of clear/set flags
16
+ # SET_OPTIONS_INVALID_INFLATION = -4, // inflation account does not exist
17
+ # SET_OPTIONS_CANT_CHANGE = -5, // can no longer change this option
18
+ # SET_OPTIONS_UNKNOWN_FLAG = -6, // can't set an unknown flag
19
+ # SET_OPTIONS_THRESHOLD_OUT_OF_RANGE = -7, // bad value for weight/threshold
20
+ # SET_OPTIONS_BAD_SIGNER = -8 // signer cannot be masterkey
21
+ # };
22
+ #
23
+ # ===========================================================================
24
+ module Stellar
25
+ class SetOptionsResultCode < XDR::Enum
26
+ member :set_options_success, 0
27
+ member :set_options_low_reserve, -1
28
+ member :set_options_too_many_signers, -2
29
+ member :set_options_bad_flags, -3
30
+ member :set_options_invalid_inflation, -4
31
+ member :set_options_cant_change, -5
32
+ member :set_options_unknown_flag, -6
33
+ member :set_options_threshold_out_of_range, -7
34
+ member :set_options_bad_signer, -8
35
+
36
+ seal
37
+ end
38
+ end