stellar-base 0.5.0 → 0.6.0

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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/generated/stellar-base-generated.rb +8 -0
  4. data/generated/stellar/account_flags.rb +8 -4
  5. data/generated/stellar/account_merge_result_code.rb +9 -9
  6. data/generated/stellar/auth.rb +4 -2
  7. data/generated/stellar/auth_cert.rb +22 -0
  8. data/generated/stellar/authenticated_message.rb +22 -0
  9. data/generated/stellar/change_trust_result_code.rb +1 -0
  10. data/generated/stellar/curve25519_public.rb +18 -0
  11. data/generated/stellar/curve25519_secret.rb +18 -0
  12. data/generated/stellar/decorated_signature.rb +1 -1
  13. data/generated/stellar/envelope_type.rb +5 -3
  14. data/generated/stellar/error.rb +2 -2
  15. data/generated/stellar/error_code.rb +28 -0
  16. data/generated/stellar/hello.rb +2 -0
  17. data/generated/stellar/hmac_sha256_key.rb +18 -0
  18. data/generated/stellar/hmac_sha256_mac.rb +18 -0
  19. data/generated/stellar/ip_addr_type.rb +22 -0
  20. data/generated/stellar/ledger_header.rb +5 -1
  21. data/generated/stellar/ledger_upgrade.rb +8 -4
  22. data/generated/stellar/ledger_upgrade_type.rb +5 -3
  23. data/generated/stellar/manage_offer_result_code.rb +11 -7
  24. data/generated/stellar/path_payment_result.rb +6 -2
  25. data/generated/stellar/path_payment_result_code.rb +8 -6
  26. data/generated/stellar/payment_result_code.rb +3 -1
  27. data/generated/stellar/peer_address.rb +12 -2
  28. data/generated/stellar/peer_address/ip.rb +29 -0
  29. data/generated/stellar/stellar_value.rb +3 -2
  30. data/lib/stellar/base/version.rb +1 -1
  31. data/xdr/Stellar-ledger-entries.x +9 -5
  32. data/xdr/Stellar-ledger.x +10 -3
  33. data/xdr/Stellar-overlay.x +42 -3
  34. data/xdr/Stellar-transaction.x +21 -14
  35. data/xdr/Stellar-types.x +21 -0
  36. metadata +11 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f62dbbc8c4cfab0e7442158b874a6727b9a1587b
4
- data.tar.gz: 74c2fdc17920e243a5ff834fad189ee379d3d71c
3
+ metadata.gz: 6bb0c3ccb633b053ef522fe4838b4119efda1a74
4
+ data.tar.gz: 02e13516937fa18fb84ad1e13a1e2e3e34a38fee
5
5
  SHA512:
6
- metadata.gz: 196a2a877e503b619e1e0983b31f4cb7e3c3ad96670fa22e57715ce517a58d42694173e2cfcce465a7492dbac267d00ede455a2390bd1b7c938ffcc441a1c0e1
7
- data.tar.gz: 12fac317f0a5528ba79c45317193e7aa8d4635acc1969569b47ca38bfbf8f12163ca4fed77ad376c14c31c670c43fd3e8f916786ddd526fe3939700039f15bfc
6
+ metadata.gz: 646414d50bd9b14fdec073247c8e5171a61ecec7435ea4cc2ada6c67134d57f017fa5b4598305d57bb3a84fc6c64d8ebd7c43995506f31f2a7acafb408b95d0b
7
+ data.tar.gz: 7d02f22bebd1727fc28cdb42267119cb219ca69d00256ee6a6eba7d59c081456667defe927c86c84e12a3ffe1ccab5f22605c1d22f64f856fa8d37e01677a5c2
data/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@ file. This project adheres to [Semantic Versioning](http://semver.org/).
6
6
  As this project is pre 1.0, breaking changes may happen for minor version
7
7
  bumps. A breaking change will get clearly notified in this log.
8
8
 
9
+ ## [0.6.0](https://github.com/stellar/ruby-stellar-base/compare/v0.5.0...v0.6.0)
10
+
11
+ ### Changed
12
+
13
+ - Update to latest xdr (stellar-core commit ad22bccafbbc14a358f05a989f7b95714dc9d4c6)
14
+
9
15
  ## [0.5.0](https://github.com/stellar/ruby-stellar-base/compare/v0.4.0...v0.5.0)
10
16
 
11
17
  ### Changed
@@ -17,6 +17,10 @@ module Stellar
17
17
  Signature = XDR::VarOpaque[64]
18
18
  SignatureHint = XDR::Opaque[4]
19
19
  NodeID = PublicKey
20
+ autoload :Curve25519Secret
21
+ autoload :Curve25519Public
22
+ autoload :HmacSha256Key
23
+ autoload :HmacSha256Mac
20
24
  end
21
25
  module Stellar
22
26
  include XDR::Namespace
@@ -114,13 +118,17 @@ end
114
118
  module Stellar
115
119
  include XDR::Namespace
116
120
 
121
+ autoload :ErrorCode
117
122
  autoload :Error
123
+ autoload :AuthCert
118
124
  autoload :Hello
119
125
  autoload :Auth
126
+ autoload :IPAddrType
120
127
  autoload :PeerAddress
121
128
  autoload :MessageType
122
129
  autoload :DontHave
123
130
  autoload :StellarMessage
131
+ autoload :AuthenticatedMessage
124
132
  end
125
133
  module Stellar
126
134
  include XDR::Namespace
@@ -8,12 +8,15 @@ require 'xdr'
8
8
  # enum AccountFlags
9
9
  # { // masks for each flag
10
10
  #
11
- # // if set, TrustLines are created with authorized set to "false"
12
- # // requiring the issuer to set it for each TrustLine
11
+ # // Flags set on issuer accounts
12
+ # // TrustLines are created with authorized set to "false" requiring
13
+ # // the issuer to set it for each TrustLine
13
14
  # AUTH_REQUIRED_FLAG = 0x1,
14
- # // if set, the authorized flag in TrustLines can be cleared
15
+ # // If set, the authorized flag in TrustLines can be cleared
15
16
  # // otherwise, authorization cannot be revoked
16
- # AUTH_REVOCABLE_FLAG = 0x2
17
+ # AUTH_REVOCABLE_FLAG = 0x2,
18
+ # // Once set, causes all AUTH_* flags to be read-only
19
+ # AUTH_IMMUTABLE_FLAG = 0x4
17
20
  # };
18
21
  #
19
22
  # ===========================================================================
@@ -21,6 +24,7 @@ module Stellar
21
24
  class AccountFlags < XDR::Enum
22
25
  member :auth_required_flag, 1
23
26
  member :auth_revocable_flag, 2
27
+ member :auth_immutable_flag, 4
24
28
 
25
29
  seal
26
30
  end
@@ -10,20 +10,20 @@ require 'xdr'
10
10
  # // codes considered as "success" for the operation
11
11
  # ACCOUNT_MERGE_SUCCESS = 0,
12
12
  # // codes considered as "failure" for the operation
13
- # ACCOUNT_MERGE_MALFORMED = -1, // can't merge onto itself
14
- # ACCOUNT_MERGE_NO_ACCOUNT = -2, // destination does not exist
15
- # ACCOUNT_MERGE_HAS_CREDIT = -3, // account has active trust lines
16
- # ACCOUNT_MERGE_CREDIT_HELD = -4 // an issuer cannot be merged if used
13
+ # ACCOUNT_MERGE_MALFORMED = -1, // can't merge onto itself
14
+ # ACCOUNT_MERGE_NO_ACCOUNT = -2, // destination does not exist
15
+ # ACCOUNT_MERGE_IMMUTABLE_SET = -3, // source account has AUTH_IMMUTABLE set
16
+ # ACCOUNT_MERGE_HAS_SUB_ENTRIES = -4 // account has trust lines/offers
17
17
  # };
18
18
  #
19
19
  # ===========================================================================
20
20
  module Stellar
21
21
  class AccountMergeResultCode < XDR::Enum
22
- member :account_merge_success, 0
23
- member :account_merge_malformed, -1
24
- member :account_merge_no_account, -2
25
- member :account_merge_has_credit, -3
26
- member :account_merge_credit_held, -4
22
+ member :account_merge_success, 0
23
+ member :account_merge_malformed, -1
24
+ member :account_merge_no_account, -2
25
+ member :account_merge_immutable_set, -3
26
+ member :account_merge_has_sub_entries, -4
27
27
 
28
28
  seal
29
29
  end
@@ -7,12 +7,14 @@ require 'xdr'
7
7
  #
8
8
  # struct Auth
9
9
  # {
10
- # Signature signature;
10
+ # // Empty message, just to confirm
11
+ # // establishment of MAC keys.
12
+ # int unused;
11
13
  # };
12
14
  #
13
15
  # ===========================================================================
14
16
  module Stellar
15
17
  class Auth < XDR::Struct
16
- attribute :signature, Signature
18
+ attribute :unused, XDR::Int
17
19
  end
18
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 AuthCert
9
+ # {
10
+ # Curve25519Public pubkey;
11
+ # uint64 expiration;
12
+ # Signature sig;
13
+ # };
14
+ #
15
+ # ===========================================================================
16
+ module Stellar
17
+ class AuthCert < XDR::Struct
18
+ attribute :pubkey, Curve25519Public
19
+ attribute :expiration, Uint64
20
+ attribute :sig, Signature
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 AuthenticatedMessage
9
+ # {
10
+ # uint64 sequence;
11
+ # StellarMessage message;
12
+ # HmacSha256Mac mac;
13
+ # };
14
+ #
15
+ # ===========================================================================
16
+ module Stellar
17
+ class AuthenticatedMessage < XDR::Struct
18
+ attribute :sequence, Uint64
19
+ attribute :message, StellarMessage
20
+ attribute :mac, HmacSha256Mac
21
+ end
22
+ end
@@ -13,6 +13,7 @@ require 'xdr'
13
13
  # CHANGE_TRUST_MALFORMED = -1, // bad input
14
14
  # CHANGE_TRUST_NO_ISSUER = -2, // could not find issuer
15
15
  # CHANGE_TRUST_INVALID_LIMIT = -3, // cannot drop limit below balance
16
+ # // cannot create with a limit of 0
16
17
  # CHANGE_TRUST_LOW_RESERVE = -4 // not enough funds to create a new trust line
17
18
  # };
18
19
  #
@@ -0,0 +1,18 @@
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 Curve25519Public
9
+ # {
10
+ # opaque key[32];
11
+ # };
12
+ #
13
+ # ===========================================================================
14
+ module Stellar
15
+ class Curve25519Public < XDR::Struct
16
+ attribute :key, XDR::Opaque[32]
17
+ end
18
+ end
@@ -0,0 +1,18 @@
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 Curve25519Secret
9
+ # {
10
+ # opaque key[32];
11
+ # };
12
+ #
13
+ # ===========================================================================
14
+ module Stellar
15
+ class Curve25519Secret < XDR::Struct
16
+ attribute :key, XDR::Opaque[32]
17
+ end
18
+ end
@@ -7,7 +7,7 @@ require 'xdr'
7
7
  #
8
8
  # struct DecoratedSignature
9
9
  # {
10
- # SignatureHint hint; // first 4 bytes of the public key, used as a hint
10
+ # SignatureHint hint; // last 4 bytes of the public key, used as a hint
11
11
  # Signature signature; // actual signature
12
12
  # };
13
13
  #
@@ -8,14 +8,16 @@ require 'xdr'
8
8
  # enum EnvelopeType
9
9
  # {
10
10
  # ENVELOPE_TYPE_SCP = 1,
11
- # ENVELOPE_TYPE_TX = 2
11
+ # ENVELOPE_TYPE_TX = 2,
12
+ # ENVELOPE_TYPE_AUTH = 3
12
13
  # };
13
14
  #
14
15
  # ===========================================================================
15
16
  module Stellar
16
17
  class EnvelopeType < XDR::Enum
17
- member :envelope_type_scp, 1
18
- member :envelope_type_tx, 2
18
+ member :envelope_type_scp, 1
19
+ member :envelope_type_tx, 2
20
+ member :envelope_type_auth, 3
19
21
 
20
22
  seal
21
23
  end
@@ -7,14 +7,14 @@ require 'xdr'
7
7
  #
8
8
  # struct Error
9
9
  # {
10
- # int code;
10
+ # ErrorCode code;
11
11
  # string msg<100>;
12
12
  # };
13
13
  #
14
14
  # ===========================================================================
15
15
  module Stellar
16
16
  class Error < XDR::Struct
17
- attribute :code, XDR::Int
17
+ attribute :code, ErrorCode
18
18
  attribute :msg, XDR::String[100]
19
19
  end
20
20
  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
+ # enum ErrorCode
9
+ # {
10
+ # ERR_MISC = 0, // Unspecific error
11
+ # ERR_DATA = 1, // Malformed data
12
+ # ERR_CONF = 2, // Misconfiguration error
13
+ # ERR_AUTH = 3, // Authentication failure
14
+ # ERR_LOAD = 4 // System overloaded
15
+ # };
16
+ #
17
+ # ===========================================================================
18
+ module Stellar
19
+ class ErrorCode < XDR::Enum
20
+ member :err_misc, 0
21
+ member :err_data, 1
22
+ member :err_conf, 2
23
+ member :err_auth, 3
24
+ member :err_load, 4
25
+
26
+ seal
27
+ end
28
+ end
@@ -13,6 +13,7 @@ require 'xdr'
13
13
  # string versionStr<100>;
14
14
  # int listeningPort;
15
15
  # NodeID peerID;
16
+ # AuthCert cert;
16
17
  # uint256 nonce;
17
18
  # };
18
19
  #
@@ -25,6 +26,7 @@ module Stellar
25
26
  attribute :version_str, XDR::String[100]
26
27
  attribute :listening_port, XDR::Int
27
28
  attribute :peer_id, NodeID
29
+ attribute :cert, AuthCert
28
30
  attribute :nonce, Uint256
29
31
  end
30
32
  end
@@ -0,0 +1,18 @@
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 HmacSha256Key
9
+ # {
10
+ # opaque key[32];
11
+ # };
12
+ #
13
+ # ===========================================================================
14
+ module Stellar
15
+ class HmacSha256Key < XDR::Struct
16
+ attribute :key, XDR::Opaque[32]
17
+ end
18
+ end
@@ -0,0 +1,18 @@
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 HmacSha256Mac
9
+ # {
10
+ # opaque mac[32];
11
+ # };
12
+ #
13
+ # ===========================================================================
14
+ module Stellar
15
+ class HmacSha256Mac < XDR::Struct
16
+ attribute :mac, XDR::Opaque[32]
17
+ end
18
+ 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
+ # enum IPAddrType
9
+ # {
10
+ # IPv4 = 0,
11
+ # IPv6 = 1
12
+ # };
13
+ #
14
+ # ===========================================================================
15
+ module Stellar
16
+ class IPAddrType < XDR::Enum
17
+ member :i_pv4, 0
18
+ member :i_pv6, 1
19
+
20
+ seal
21
+ end
22
+ end
@@ -15,7 +15,8 @@ require 'xdr'
15
15
  #
16
16
  # uint32 ledgerSeq; // sequence number of this ledger
17
17
  #
18
- # int64 totalCoins; // total number of stroops in existence
18
+ # int64 totalCoins; // total number of stroops in existence.
19
+ # // 10,000,000 stroops in 1 XLM
19
20
  #
20
21
  # int64 feePool; // fees burned since last inflation run
21
22
  # uint32 inflationSeq; // inflation sequence number
@@ -25,6 +26,8 @@ require 'xdr'
25
26
  # uint32 baseFee; // base fee per operation in stroops
26
27
  # uint32 baseReserve; // account base reserve in stroops
27
28
  #
29
+ # uint32 maxTxSetSize; // maximum size a transaction set can be
30
+ #
28
31
  # Hash skipList[4]; // hashes of ledgers in the past. allows you to jump back
29
32
  # // in time without walking the chain back ledger by ledger
30
33
  # // each slot contains the oldest ledger that is mod of
@@ -59,6 +62,7 @@ module Stellar
59
62
  attribute :id_pool, Uint64
60
63
  attribute :base_fee, Uint32
61
64
  attribute :base_reserve, Uint32
65
+ attribute :max_tx_set_size, Uint32
62
66
  attribute :skip_list, XDR::Array[Hash, 4]
63
67
  attribute :ext, Ext
64
68
  end
@@ -11,6 +11,8 @@ require 'xdr'
11
11
  # uint32 newLedgerVersion; // update ledgerVersion
12
12
  # case LEDGER_UPGRADE_BASE_FEE:
13
13
  # uint32 newBaseFee; // update baseFee
14
+ # case LEDGER_UPGRADE_MAX_TX_SET_SIZE:
15
+ # uint32 newMaxTxSetSize; // update maxTxSetSize
14
16
  # };
15
17
  #
16
18
  # ===========================================================================
@@ -18,10 +20,12 @@ module Stellar
18
20
  class LedgerUpgrade < XDR::Union
19
21
  switch_on LedgerUpgradeType, :type
20
22
 
21
- switch :ledger_upgrade_version, :new_ledger_version
22
- switch :ledger_upgrade_base_fee, :new_base_fee
23
+ switch :ledger_upgrade_version, :new_ledger_version
24
+ switch :ledger_upgrade_base_fee, :new_base_fee
25
+ switch :ledger_upgrade_max_tx_set_size, :new_max_tx_set_size
23
26
 
24
- attribute :new_ledger_version, Uint32
25
- attribute :new_base_fee, Uint32
27
+ attribute :new_ledger_version, Uint32
28
+ attribute :new_base_fee, Uint32
29
+ attribute :new_max_tx_set_size, Uint32
26
30
  end
27
31
  end
@@ -8,14 +8,16 @@ require 'xdr'
8
8
  # enum LedgerUpgradeType
9
9
  # {
10
10
  # LEDGER_UPGRADE_VERSION = 1,
11
- # LEDGER_UPGRADE_BASE_FEE = 2
11
+ # LEDGER_UPGRADE_BASE_FEE = 2,
12
+ # LEDGER_UPGRADE_MAX_TX_SET_SIZE = 3
12
13
  # };
13
14
  #
14
15
  # ===========================================================================
15
16
  module Stellar
16
17
  class LedgerUpgradeType < XDR::Enum
17
- member :ledger_upgrade_version, 1
18
- member :ledger_upgrade_base_fee, 2
18
+ member :ledger_upgrade_version, 1
19
+ member :ledger_upgrade_base_fee, 2
20
+ member :ledger_upgrade_max_tx_set_size, 3
19
21
 
20
22
  seal
21
23
  end
@@ -16,14 +16,16 @@ require 'xdr'
16
16
  # MANAGE_OFFER_BUY_NO_TRUST = -3, // no trust line for what we're buying
17
17
  # MANAGE_OFFER_SELL_NOT_AUTHORIZED = -4, // not authorized to sell
18
18
  # MANAGE_OFFER_BUY_NOT_AUTHORIZED = -5, // not authorized to buy
19
- # MANAGE_OFFER_LINE_FULL = -6, // can't receive more of what it's buying
20
- # MANAGE_OFFER_UNDERFUNDED = -7, // doesn't hold what it's trying to sell
21
- # MANAGE_OFFER_CROSS_SELF = -8, // would cross an offer from the same user
19
+ # MANAGE_OFFER_LINE_FULL = -6, // can't receive more of what it's buying
20
+ # MANAGE_OFFER_UNDERFUNDED = -7, // doesn't hold what it's trying to sell
21
+ # MANAGE_OFFER_CROSS_SELF = -8, // would cross an offer from the same user
22
+ # MANAGE_OFFER_SELL_NO_ISSUER = -9, // no issuer for what we're selling
23
+ # MANAGE_OFFER_BUY_NO_ISSUER = -10, // no issuer for what we're buying
22
24
  #
23
25
  # // update errors
24
- # MANAGE_OFFER_NOT_FOUND = -9, // offerID does not match an existing offer
26
+ # MANAGE_OFFER_NOT_FOUND = -11, // offerID does not match an existing offer
25
27
  #
26
- # MANAGE_OFFER_LOW_RESERVE = -10 // not enough funds to create a new Offer
28
+ # MANAGE_OFFER_LOW_RESERVE = -12 // not enough funds to create a new Offer
27
29
  # };
28
30
  #
29
31
  # ===========================================================================
@@ -38,8 +40,10 @@ module Stellar
38
40
  member :manage_offer_line_full, -6
39
41
  member :manage_offer_underfunded, -7
40
42
  member :manage_offer_cross_self, -8
41
- member :manage_offer_not_found, -9
42
- member :manage_offer_low_reserve, -10
43
+ member :manage_offer_sell_no_issuer, -9
44
+ member :manage_offer_buy_no_issuer, -10
45
+ member :manage_offer_not_found, -11
46
+ member :manage_offer_low_reserve, -12
43
47
 
44
48
  seal
45
49
  end
@@ -13,6 +13,8 @@ require 'xdr'
13
13
  # ClaimOfferAtom offers<>;
14
14
  # SimplePaymentResult last;
15
15
  # } success;
16
+ # case PATH_PAYMENT_NO_ISSUER:
17
+ # Asset noIssuer; // the asset that caused the error
16
18
  # default:
17
19
  # void;
18
20
  # };
@@ -26,9 +28,11 @@ module Stellar
26
28
 
27
29
  switch_on PathPaymentResultCode, :code
28
30
 
29
- switch :path_payment_success, :success
31
+ switch :path_payment_success, :success
32
+ switch :path_payment_no_issuer, :no_issuer
30
33
  switch :default
31
34
 
32
- attribute :success, Success
35
+ attribute :success, Success
36
+ attribute :no_issuer, Asset
33
37
  end
34
38
  end
@@ -19,9 +19,10 @@ require 'xdr'
19
19
  # PATH_PAYMENT_NO_TRUST = -6, // dest missing a trust line for asset
20
20
  # PATH_PAYMENT_NOT_AUTHORIZED = -7, // dest not authorized to hold asset
21
21
  # PATH_PAYMENT_LINE_FULL = -8, // dest would go above their limit
22
- # PATH_PAYMENT_TOO_FEW_OFFERS = -9, // not enough offers to satisfy path
23
- # PATH_PAYMENT_OFFER_CROSS_SELF = -10, // would cross one of its own offers
24
- # PATH_PAYMENT_OVER_SENDMAX = -11 // could not satisfy sendmax
22
+ # PATH_PAYMENT_NO_ISSUER = -9, // missing issuer on one asset
23
+ # PATH_PAYMENT_TOO_FEW_OFFERS = -10, // not enough offers to satisfy path
24
+ # PATH_PAYMENT_OFFER_CROSS_SELF = -11, // would cross one of its own offers
25
+ # PATH_PAYMENT_OVER_SENDMAX = -12 // could not satisfy sendmax
25
26
  # };
26
27
  #
27
28
  # ===========================================================================
@@ -36,9 +37,10 @@ module Stellar
36
37
  member :path_payment_no_trust, -6
37
38
  member :path_payment_not_authorized, -7
38
39
  member :path_payment_line_full, -8
39
- member :path_payment_too_few_offers, -9
40
- member :path_payment_offer_cross_self, -10
41
- member :path_payment_over_sendmax, -11
40
+ member :path_payment_no_issuer, -9
41
+ member :path_payment_too_few_offers, -10
42
+ member :path_payment_offer_cross_self, -11
43
+ member :path_payment_over_sendmax, -12
42
44
 
43
45
  seal
44
46
  end
@@ -18,7 +18,8 @@ require 'xdr'
18
18
  # PAYMENT_NO_DESTINATION = -5, // destination account does not exist
19
19
  # PAYMENT_NO_TRUST = -6, // destination missing a trust line for asset
20
20
  # PAYMENT_NOT_AUTHORIZED = -7, // destination not authorized to hold asset
21
- # PAYMENT_LINE_FULL = -8 // destination would go above their limit
21
+ # PAYMENT_LINE_FULL = -8, // destination would go above their limit
22
+ # PAYMENT_NO_ISSUER = -9 // missing issuer on asset
22
23
  # };
23
24
  #
24
25
  # ===========================================================================
@@ -33,6 +34,7 @@ module Stellar
33
34
  member :payment_no_trust, -6
34
35
  member :payment_not_authorized, -7
35
36
  member :payment_line_full, -8
37
+ member :payment_no_issuer, -9
36
38
 
37
39
  seal
38
40
  end
@@ -7,7 +7,13 @@ require 'xdr'
7
7
  #
8
8
  # struct PeerAddress
9
9
  # {
10
- # opaque ip[4];
10
+ # union switch (IPAddrType type)
11
+ # {
12
+ # case IPv4:
13
+ # opaque ipv4[4];
14
+ # case IPv6:
15
+ # opaque ipv6[16];
16
+ # } ip;
11
17
  # uint32 port;
12
18
  # uint32 numFailures;
13
19
  # };
@@ -15,7 +21,11 @@ require 'xdr'
15
21
  # ===========================================================================
16
22
  module Stellar
17
23
  class PeerAddress < XDR::Struct
18
- attribute :ip, XDR::Opaque[4]
24
+ include XDR::Namespace
25
+
26
+ autoload :Ip
27
+
28
+ attribute :ip, Ip
19
29
  attribute :port, Uint32
20
30
  attribute :num_failures, Uint32
21
31
  end
@@ -0,0 +1,29 @@
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 (IPAddrType type)
9
+ # {
10
+ # case IPv4:
11
+ # opaque ipv4[4];
12
+ # case IPv6:
13
+ # opaque ipv6[16];
14
+ # }
15
+ #
16
+ # ===========================================================================
17
+ module Stellar
18
+ class PeerAddress
19
+ class Ip < XDR::Union
20
+ switch_on IPAddrType, :type
21
+
22
+ switch :i_pv4, :ipv4
23
+ switch :i_pv6, :ipv6
24
+
25
+ attribute :ipv4, XDR::Opaque[4]
26
+ attribute :ipv6, XDR::Opaque[16]
27
+ end
28
+ end
29
+ end
@@ -14,7 +14,8 @@ require 'xdr'
14
14
  # // this is a vector of encoded 'LedgerUpgrade' so that nodes can drop
15
15
  # // unknown steps during consensus if needed.
16
16
  # // see notes below on 'LedgerUpgrade' for more detail
17
- # UpgradeType upgrades<4>;
17
+ # // max size is dictated by number of upgrade types (+ room for future)
18
+ # UpgradeType upgrades<6>;
18
19
  #
19
20
  # // reserved for future use
20
21
  # union switch (int v)
@@ -34,7 +35,7 @@ module Stellar
34
35
 
35
36
  attribute :tx_set_hash, Hash
36
37
  attribute :close_time, Uint64
37
- attribute :upgrades, XDR::VarArray[UpgradeType, 4]
38
+ attribute :upgrades, XDR::VarArray[UpgradeType, 6]
38
39
  attribute :ext, Ext
39
40
  end
40
41
  end
@@ -1,5 +1,5 @@
1
1
  module Stellar
2
2
  module Base
3
- VERSION = "0.5.0"
3
+ VERSION = "0.6.0"
4
4
  end
5
5
  end
@@ -74,12 +74,15 @@ struct Signer
74
74
  enum AccountFlags
75
75
  { // masks for each flag
76
76
 
77
- // if set, TrustLines are created with authorized set to "false"
78
- // requiring the issuer to set it for each TrustLine
77
+ // Flags set on issuer accounts
78
+ // TrustLines are created with authorized set to "false" requiring
79
+ // the issuer to set it for each TrustLine
79
80
  AUTH_REQUIRED_FLAG = 0x1,
80
- // if set, the authorized flag in TrustLines can be cleared
81
+ // If set, the authorized flag in TrustLines can be cleared
81
82
  // otherwise, authorization cannot be revoked
82
- AUTH_REVOCABLE_FLAG = 0x2
83
+ AUTH_REVOCABLE_FLAG = 0x2,
84
+ // Once set, causes all AUTH_* flags to be read-only
85
+ AUTH_IMMUTABLE_FLAG = 0x4
83
86
  };
84
87
 
85
88
  /* AccountEntry
@@ -217,6 +220,7 @@ struct LedgerEntry
217
220
  enum EnvelopeType
218
221
  {
219
222
  ENVELOPE_TYPE_SCP = 1,
220
- ENVELOPE_TYPE_TX = 2
223
+ ENVELOPE_TYPE_TX = 2,
224
+ ENVELOPE_TYPE_AUTH = 3
221
225
  };
222
226
  }
data/xdr/Stellar-ledger.x CHANGED
@@ -20,7 +20,8 @@ struct StellarValue
20
20
  // this is a vector of encoded 'LedgerUpgrade' so that nodes can drop
21
21
  // unknown steps during consensus if needed.
22
22
  // see notes below on 'LedgerUpgrade' for more detail
23
- UpgradeType upgrades<4>;
23
+ // max size is dictated by number of upgrade types (+ room for future)
24
+ UpgradeType upgrades<6>;
24
25
 
25
26
  // reserved for future use
26
27
  union switch (int v)
@@ -44,7 +45,8 @@ struct LedgerHeader
44
45
 
45
46
  uint32 ledgerSeq; // sequence number of this ledger
46
47
 
47
- int64 totalCoins; // total number of stroops in existence
48
+ int64 totalCoins; // total number of stroops in existence.
49
+ // 10,000,000 stroops in 1 XLM
48
50
 
49
51
  int64 feePool; // fees burned since last inflation run
50
52
  uint32 inflationSeq; // inflation sequence number
@@ -54,6 +56,8 @@ struct LedgerHeader
54
56
  uint32 baseFee; // base fee per operation in stroops
55
57
  uint32 baseReserve; // account base reserve in stroops
56
58
 
59
+ uint32 maxTxSetSize; // maximum size a transaction set can be
60
+
57
61
  Hash skipList[4]; // hashes of ledgers in the past. allows you to jump back
58
62
  // in time without walking the chain back ledger by ledger
59
63
  // each slot contains the oldest ledger that is mod of
@@ -77,7 +81,8 @@ in ascending order
77
81
  enum LedgerUpgradeType
78
82
  {
79
83
  LEDGER_UPGRADE_VERSION = 1,
80
- LEDGER_UPGRADE_BASE_FEE = 2
84
+ LEDGER_UPGRADE_BASE_FEE = 2,
85
+ LEDGER_UPGRADE_MAX_TX_SET_SIZE = 3
81
86
  };
82
87
 
83
88
  union LedgerUpgrade switch (LedgerUpgradeType type)
@@ -86,6 +91,8 @@ case LEDGER_UPGRADE_VERSION:
86
91
  uint32 newLedgerVersion; // update ledgerVersion
87
92
  case LEDGER_UPGRADE_BASE_FEE:
88
93
  uint32 newBaseFee; // update baseFee
94
+ case LEDGER_UPGRADE_MAX_TX_SET_SIZE:
95
+ uint32 newMaxTxSetSize; // update maxTxSetSize
89
96
  };
90
97
 
91
98
  /* Entries used to define the bucket list */
@@ -7,12 +7,28 @@
7
7
  namespace stellar
8
8
  {
9
9
 
10
+ enum ErrorCode
11
+ {
12
+ ERR_MISC = 0, // Unspecific error
13
+ ERR_DATA = 1, // Malformed data
14
+ ERR_CONF = 2, // Misconfiguration error
15
+ ERR_AUTH = 3, // Authentication failure
16
+ ERR_LOAD = 4 // System overloaded
17
+ };
18
+
10
19
  struct Error
11
20
  {
12
- int code;
21
+ ErrorCode code;
13
22
  string msg<100>;
14
23
  };
15
24
 
25
+ struct AuthCert
26
+ {
27
+ Curve25519Public pubkey;
28
+ uint64 expiration;
29
+ Signature sig;
30
+ };
31
+
16
32
  struct Hello
17
33
  {
18
34
  uint32 ledgerVersion;
@@ -21,17 +37,32 @@ struct Hello
21
37
  string versionStr<100>;
22
38
  int listeningPort;
23
39
  NodeID peerID;
40
+ AuthCert cert;
24
41
  uint256 nonce;
25
42
  };
26
43
 
27
44
  struct Auth
28
45
  {
29
- Signature signature;
46
+ // Empty message, just to confirm
47
+ // establishment of MAC keys.
48
+ int unused;
49
+ };
50
+
51
+ enum IPAddrType
52
+ {
53
+ IPv4 = 0,
54
+ IPv6 = 1
30
55
  };
31
56
 
32
57
  struct PeerAddress
33
58
  {
34
- opaque ip[4];
59
+ union switch (IPAddrType type)
60
+ {
61
+ case IPv4:
62
+ opaque ipv4[4];
63
+ case IPv6:
64
+ opaque ipv6[16];
65
+ } ip;
35
66
  uint32 port;
36
67
  uint32 numFailures;
37
68
  };
@@ -94,4 +125,12 @@ case SCP_QUORUMSET:
94
125
  case SCP_MESSAGE:
95
126
  SCPEnvelope envelope;
96
127
  };
128
+
129
+ struct AuthenticatedMessage
130
+ {
131
+ uint64 sequence;
132
+ StellarMessage message;
133
+ HmacSha256Mac mac;
134
+ };
135
+
97
136
  }
@@ -9,7 +9,7 @@ namespace stellar
9
9
 
10
10
  struct DecoratedSignature
11
11
  {
12
- SignatureHint hint; // first 4 bytes of the public key, used as a hint
12
+ SignatureHint hint; // last 4 bytes of the public key, used as a hint
13
13
  Signature signature; // actual signature
14
14
  };
15
15
 
@@ -366,7 +366,8 @@ enum PaymentResultCode
366
366
  PAYMENT_NO_DESTINATION = -5, // destination account does not exist
367
367
  PAYMENT_NO_TRUST = -6, // destination missing a trust line for asset
368
368
  PAYMENT_NOT_AUTHORIZED = -7, // destination not authorized to hold asset
369
- PAYMENT_LINE_FULL = -8 // destination would go above their limit
369
+ PAYMENT_LINE_FULL = -8, // destination would go above their limit
370
+ PAYMENT_NO_ISSUER = -9 // missing issuer on asset
370
371
  };
371
372
 
372
373
  union PaymentResult switch (PaymentResultCode code)
@@ -393,9 +394,10 @@ enum PathPaymentResultCode
393
394
  PATH_PAYMENT_NO_TRUST = -6, // dest missing a trust line for asset
394
395
  PATH_PAYMENT_NOT_AUTHORIZED = -7, // dest not authorized to hold asset
395
396
  PATH_PAYMENT_LINE_FULL = -8, // dest would go above their limit
396
- PATH_PAYMENT_TOO_FEW_OFFERS = -9, // not enough offers to satisfy path
397
- PATH_PAYMENT_OFFER_CROSS_SELF = -10, // would cross one of its own offers
398
- PATH_PAYMENT_OVER_SENDMAX = -11 // could not satisfy sendmax
397
+ PATH_PAYMENT_NO_ISSUER = -9, // missing issuer on one asset
398
+ PATH_PAYMENT_TOO_FEW_OFFERS = -10, // not enough offers to satisfy path
399
+ PATH_PAYMENT_OFFER_CROSS_SELF = -11, // would cross one of its own offers
400
+ PATH_PAYMENT_OVER_SENDMAX = -12 // could not satisfy sendmax
399
401
  };
400
402
 
401
403
  struct SimplePaymentResult
@@ -413,6 +415,8 @@ case PATH_PAYMENT_SUCCESS:
413
415
  ClaimOfferAtom offers<>;
414
416
  SimplePaymentResult last;
415
417
  } success;
418
+ case PATH_PAYMENT_NO_ISSUER:
419
+ Asset noIssuer; // the asset that caused the error
416
420
  default:
417
421
  void;
418
422
  };
@@ -430,14 +434,16 @@ enum ManageOfferResultCode
430
434
  MANAGE_OFFER_BUY_NO_TRUST = -3, // no trust line for what we're buying
431
435
  MANAGE_OFFER_SELL_NOT_AUTHORIZED = -4, // not authorized to sell
432
436
  MANAGE_OFFER_BUY_NOT_AUTHORIZED = -5, // not authorized to buy
433
- MANAGE_OFFER_LINE_FULL = -6, // can't receive more of what it's buying
434
- MANAGE_OFFER_UNDERFUNDED = -7, // doesn't hold what it's trying to sell
435
- MANAGE_OFFER_CROSS_SELF = -8, // would cross an offer from the same user
437
+ MANAGE_OFFER_LINE_FULL = -6, // can't receive more of what it's buying
438
+ MANAGE_OFFER_UNDERFUNDED = -7, // doesn't hold what it's trying to sell
439
+ MANAGE_OFFER_CROSS_SELF = -8, // would cross an offer from the same user
440
+ MANAGE_OFFER_SELL_NO_ISSUER = -9, // no issuer for what we're selling
441
+ MANAGE_OFFER_BUY_NO_ISSUER = -10, // no issuer for what we're buying
436
442
 
437
443
  // update errors
438
- MANAGE_OFFER_NOT_FOUND = -9, // offerID does not match an existing offer
444
+ MANAGE_OFFER_NOT_FOUND = -11, // offerID does not match an existing offer
439
445
 
440
- MANAGE_OFFER_LOW_RESERVE = -10 // not enough funds to create a new Offer
446
+ MANAGE_OFFER_LOW_RESERVE = -12 // not enough funds to create a new Offer
441
447
  };
442
448
 
443
449
  enum ManageOfferEffect
@@ -507,6 +513,7 @@ enum ChangeTrustResultCode
507
513
  CHANGE_TRUST_MALFORMED = -1, // bad input
508
514
  CHANGE_TRUST_NO_ISSUER = -2, // could not find issuer
509
515
  CHANGE_TRUST_INVALID_LIMIT = -3, // cannot drop limit below balance
516
+ // cannot create with a limit of 0
510
517
  CHANGE_TRUST_LOW_RESERVE = -4 // not enough funds to create a new trust line
511
518
  };
512
519
 
@@ -547,10 +554,10 @@ enum AccountMergeResultCode
547
554
  // codes considered as "success" for the operation
548
555
  ACCOUNT_MERGE_SUCCESS = 0,
549
556
  // codes considered as "failure" for the operation
550
- ACCOUNT_MERGE_MALFORMED = -1, // can't merge onto itself
551
- ACCOUNT_MERGE_NO_ACCOUNT = -2, // destination does not exist
552
- ACCOUNT_MERGE_HAS_CREDIT = -3, // account has active trust lines
553
- ACCOUNT_MERGE_CREDIT_HELD = -4 // an issuer cannot be merged if used
557
+ ACCOUNT_MERGE_MALFORMED = -1, // can't merge onto itself
558
+ ACCOUNT_MERGE_NO_ACCOUNT = -2, // destination does not exist
559
+ ACCOUNT_MERGE_IMMUTABLE_SET = -3, // source account has AUTH_IMMUTABLE set
560
+ ACCOUNT_MERGE_HAS_SUB_ENTRIES = -4 // account has trust lines/offers
554
561
  };
555
562
 
556
563
  union AccountMergeResult switch (AccountMergeResultCode code)
data/xdr/Stellar-types.x CHANGED
@@ -31,4 +31,25 @@ typedef opaque Signature<64>;
31
31
  typedef opaque SignatureHint[4];
32
32
 
33
33
  typedef PublicKey NodeID;
34
+
35
+ struct Curve25519Secret
36
+ {
37
+ opaque key[32];
38
+ };
39
+
40
+ struct Curve25519Public
41
+ {
42
+ opaque key[32];
43
+ };
44
+
45
+ struct HmacSha256Key
46
+ {
47
+ opaque key[32];
48
+ };
49
+
50
+ struct HmacSha256Mac
51
+ {
52
+ opaque mac[32];
53
+ };
54
+
34
55
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stellar-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Fleckenstein
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-17 00:00:00.000000000 Z
11
+ date: 2015-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xdr
@@ -258,6 +258,8 @@ files:
258
258
  - generated/stellar/asset/alpha_num4.rb
259
259
  - generated/stellar/asset_type.rb
260
260
  - generated/stellar/auth.rb
261
+ - generated/stellar/auth_cert.rb
262
+ - generated/stellar/authenticated_message.rb
261
263
  - generated/stellar/bucket_entry.rb
262
264
  - generated/stellar/bucket_entry_type.rb
263
265
  - generated/stellar/change_trust_op.rb
@@ -269,14 +271,20 @@ files:
269
271
  - generated/stellar/create_account_result_code.rb
270
272
  - generated/stellar/create_passive_offer_op.rb
271
273
  - generated/stellar/crypto_key_type.rb
274
+ - generated/stellar/curve25519_public.rb
275
+ - generated/stellar/curve25519_secret.rb
272
276
  - generated/stellar/decorated_signature.rb
273
277
  - generated/stellar/dont_have.rb
274
278
  - generated/stellar/envelope_type.rb
275
279
  - generated/stellar/error.rb
280
+ - generated/stellar/error_code.rb
276
281
  - generated/stellar/hello.rb
282
+ - generated/stellar/hmac_sha256_key.rb
283
+ - generated/stellar/hmac_sha256_mac.rb
277
284
  - generated/stellar/inflation_payout.rb
278
285
  - generated/stellar/inflation_result.rb
279
286
  - generated/stellar/inflation_result_code.rb
287
+ - generated/stellar/ip_addr_type.rb
280
288
  - generated/stellar/ledger_entry.rb
281
289
  - generated/stellar/ledger_entry/data.rb
282
290
  - generated/stellar/ledger_entry/ext.rb
@@ -320,6 +328,7 @@ files:
320
328
  - generated/stellar/payment_result.rb
321
329
  - generated/stellar/payment_result_code.rb
322
330
  - generated/stellar/peer_address.rb
331
+ - generated/stellar/peer_address/ip.rb
323
332
  - generated/stellar/price.rb
324
333
  - generated/stellar/public_key.rb
325
334
  - generated/stellar/scp_ballot.rb