stellar-base 0.0.18 → 0.0.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/generated/stellar-base-generated.rb +56 -102
- data/generated/stellar/account_entry.rb +18 -5
- data/generated/stellar/account_entry/ext.rb +24 -0
- data/generated/stellar/account_flags.rb +2 -2
- data/generated/stellar/account_merge_result.rb +2 -2
- data/generated/stellar/account_merge_result_code.rb +2 -2
- data/generated/stellar/allow_trust_op.rb +2 -2
- data/generated/stellar/allow_trust_op/currency.rb +2 -2
- data/generated/stellar/allow_trust_result.rb +2 -2
- data/generated/stellar/allow_trust_result_code.rb +2 -2
- data/generated/stellar/bucket_entry.rb +2 -2
- data/generated/stellar/bucket_entry_type.rb +2 -2
- data/generated/stellar/change_trust_op.rb +2 -2
- data/generated/stellar/change_trust_result.rb +2 -2
- data/generated/stellar/change_trust_result_code.rb +2 -2
- data/generated/stellar/claim_offer_atom.rb +2 -2
- data/generated/stellar/create_account_op.rb +2 -2
- data/generated/stellar/create_account_result.rb +2 -2
- data/generated/stellar/create_account_result_code.rb +10 -10
- data/generated/stellar/create_passive_offer_op.rb +2 -2
- data/generated/stellar/crypto_key_type.rb +20 -0
- data/generated/stellar/currency.rb +2 -2
- data/generated/stellar/currency/alpha_num.rb +2 -2
- data/generated/stellar/currency_type.rb +2 -2
- data/generated/stellar/decorated_signature.rb +6 -6
- data/generated/stellar/dont_have.rb +2 -2
- data/generated/stellar/envelope_type.rb +22 -0
- data/generated/stellar/error.rb +2 -2
- data/generated/stellar/hello.rb +10 -8
- data/generated/stellar/inflation_payout.rb +3 -3
- data/generated/stellar/inflation_result.rb +3 -3
- data/generated/stellar/inflation_result_code.rb +2 -2
- data/generated/stellar/ledger_entry.rb +2 -4
- data/generated/stellar/ledger_entry_change.rb +2 -2
- data/generated/stellar/ledger_entry_change_type.rb +2 -2
- data/generated/stellar/ledger_entry_type.rb +2 -2
- data/generated/stellar/ledger_header.rb +28 -12
- data/generated/stellar/ledger_header/ext.rb +24 -0
- data/generated/stellar/ledger_header_history_entry.rb +15 -2
- data/generated/stellar/ledger_header_history_entry/ext.rb +24 -0
- data/generated/stellar/ledger_key.rb +2 -2
- data/generated/stellar/ledger_key/account.rb +2 -2
- data/generated/stellar/ledger_key/offer.rb +2 -2
- data/generated/stellar/ledger_key/trust_line.rb +2 -2
- data/generated/stellar/ledger_upgrade.rb +27 -0
- data/generated/stellar/ledger_upgrade_type.rb +22 -0
- data/generated/stellar/manage_offer_effect.rb +2 -2
- data/generated/stellar/manage_offer_op.rb +2 -2
- data/generated/stellar/manage_offer_result.rb +2 -2
- data/generated/stellar/manage_offer_result_code.rb +25 -21
- data/generated/stellar/manage_offer_success_result.rb +2 -2
- data/generated/stellar/manage_offer_success_result/offer.rb +2 -2
- data/generated/stellar/memo.rb +2 -2
- data/generated/stellar/memo_type.rb +2 -2
- data/generated/stellar/message_type.rb +2 -2
- data/generated/stellar/offer_entry.rb +15 -2
- data/generated/stellar/offer_entry/ext.rb +24 -0
- data/generated/stellar/offer_entry_flags.rb +2 -2
- data/generated/stellar/operation.rb +4 -4
- data/generated/stellar/operation/body.rb +4 -4
- data/generated/stellar/operation_result.rb +2 -2
- data/generated/stellar/operation_result/tr.rb +2 -2
- data/generated/stellar/operation_result_code.rb +2 -2
- data/generated/stellar/operation_type.rb +2 -2
- data/generated/stellar/path_payment_op.rb +2 -2
- data/generated/stellar/path_payment_result.rb +2 -2
- data/generated/stellar/path_payment_result/success.rb +2 -2
- data/generated/stellar/path_payment_result_code.rb +23 -20
- data/generated/stellar/payment_op.rb +2 -2
- data/generated/stellar/payment_result.rb +2 -2
- data/generated/stellar/payment_result_code.rb +19 -15
- data/generated/stellar/peer_address.rb +2 -2
- data/generated/stellar/price.rb +2 -2
- data/generated/stellar/public_key.rb +23 -0
- data/generated/stellar/scp_ballot.rb +2 -2
- data/generated/stellar/scp_envelope.rb +2 -4
- data/generated/stellar/scp_nomination.rb +22 -0
- data/generated/stellar/scp_quorum_set.rb +4 -4
- data/generated/stellar/scp_statement.rb +33 -16
- data/generated/stellar/scp_statement/pledges.rb +38 -14
- data/generated/stellar/scp_statement/pledges/confirm.rb +28 -0
- data/generated/stellar/scp_statement/pledges/externalize.rb +28 -0
- data/generated/stellar/scp_statement/pledges/prepare.rb +14 -6
- data/generated/stellar/scp_statement_type.rb +10 -10
- data/generated/stellar/set_options_op.rb +11 -4
- data/generated/stellar/set_options_result.rb +2 -2
- data/generated/stellar/set_options_result_code.rb +16 -12
- data/generated/stellar/signer.rb +4 -4
- data/generated/stellar/simple_payment_result.rb +2 -2
- data/generated/stellar/stellar_message.rb +2 -2
- data/generated/stellar/stellar_value.rb +40 -0
- data/generated/stellar/stellar_value/ext.rb +24 -0
- data/generated/stellar/threshold_indexes.rb +26 -0
- data/generated/stellar/time_bounds.rb +2 -2
- data/generated/stellar/transaction.rb +17 -4
- data/generated/stellar/transaction/ext.rb +24 -0
- data/generated/stellar/transaction_envelope.rb +2 -2
- data/generated/stellar/transaction_history_entry.rb +15 -2
- data/generated/stellar/transaction_history_entry/ext.rb +24 -0
- data/generated/stellar/transaction_history_result_entry.rb +15 -2
- data/generated/stellar/transaction_history_result_entry/ext.rb +24 -0
- data/generated/stellar/transaction_meta.rb +2 -2
- data/generated/stellar/transaction_result.rb +12 -2
- data/generated/stellar/transaction_result/ext.rb +24 -0
- data/generated/stellar/transaction_result/result.rb +2 -2
- data/generated/stellar/transaction_result_code.rb +2 -2
- data/generated/stellar/transaction_result_pair.rb +2 -2
- data/generated/stellar/transaction_result_set.rb +4 -4
- data/generated/stellar/transaction_set.rb +4 -4
- data/generated/stellar/trust_line_entry.rb +15 -2
- data/generated/stellar/trust_line_entry/ext.rb +24 -0
- data/generated/stellar/trust_line_flags.rb +2 -2
- data/lib/stellar/base/version.rb +1 -1
- data/lib/stellar/currency.rb +1 -1
- data/lib/stellar/key_pair.rb +14 -5
- data/lib/stellar/operation.rb +7 -7
- data/lib/stellar/transaction.rb +15 -3
- data/lib/stellar/transaction_envelope.rb +1 -1
- data/ruby-stellar-base.gemspec +1 -1
- data/spec/lib/stellar/key_pair_spec.rb +40 -9
- data/spec/lib/stellar/transaction_envelope_spec.rb +2 -2
- data/spec/lib/stellar/transaction_spec.rb +6 -6
- data/tasks/xdr.rake +11 -8
- data/xdr/Stellar-SCP.x +87 -0
- data/xdr/Stellar-ledger-entries.x +80 -6
- data/xdr/Stellar-ledger.x +87 -8
- data/xdr/Stellar-overlay.x +3 -16
- data/xdr/Stellar-transaction.x +66 -39
- data/xdr/Stellar-types.x +17 -29
- data/xdr/StellarXDR.x +1 -1
- metadata +25 -7
- data/generated/stellar/stellar_ballot.rb +0 -22
- data/generated/stellar/stellar_ballot_value.rb +0 -22
- data/xdr/SCPXDR.x +0 -67
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# This code was automatically generated using xdrgen
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
3
|
-
|
3
|
+
|
4
4
|
require 'xdr'
|
5
5
|
|
6
6
|
# === xdr source ============================================================
|
@@ -11,21 +11,21 @@ require 'xdr'
|
|
11
11
|
# CREATE_ACCOUNT_SUCCESS = 0, // account was created
|
12
12
|
#
|
13
13
|
# // codes considered as "failure" for the operation
|
14
|
-
# CREATE_ACCOUNT_MALFORMED = 1, // invalid destination
|
15
|
-
# CREATE_ACCOUNT_UNDERFUNDED = 2, // not enough funds in source account
|
14
|
+
# CREATE_ACCOUNT_MALFORMED = -1, // invalid destination
|
15
|
+
# CREATE_ACCOUNT_UNDERFUNDED = -2, // not enough funds in source account
|
16
16
|
# CREATE_ACCOUNT_LOW_RESERVE =
|
17
|
-
# 3, // would create an account below the min reserve
|
18
|
-
# CREATE_ACCOUNT_ALREADY_EXIST = 4 // account already exists
|
17
|
+
# -3, // would create an account below the min reserve
|
18
|
+
# CREATE_ACCOUNT_ALREADY_EXIST = -4 // account already exists
|
19
19
|
# };
|
20
20
|
#
|
21
21
|
# ===========================================================================
|
22
22
|
module Stellar
|
23
23
|
class CreateAccountResultCode < XDR::Enum
|
24
24
|
member :create_account_success, 0
|
25
|
-
member :create_account_malformed, 1
|
26
|
-
member :create_account_underfunded, 2
|
27
|
-
member :create_account_low_reserve, 3
|
28
|
-
member :create_account_already_exist, 4
|
25
|
+
member :create_account_malformed, -1
|
26
|
+
member :create_account_underfunded, -2
|
27
|
+
member :create_account_low_reserve, -3
|
28
|
+
member :create_account_already_exist, -4
|
29
29
|
|
30
30
|
seal
|
31
31
|
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
|
+
# enum CryptoKeyType
|
9
|
+
# {
|
10
|
+
# KEY_TYPES_ED25519 = 0
|
11
|
+
# };
|
12
|
+
#
|
13
|
+
# ===========================================================================
|
14
|
+
module Stellar
|
15
|
+
class CryptoKeyType < XDR::Enum
|
16
|
+
member :key_types_ed25519, 0
|
17
|
+
|
18
|
+
seal
|
19
|
+
end
|
20
|
+
end
|
@@ -1,20 +1,20 @@
|
|
1
|
-
#
|
1
|
+
# This code was automatically generated using xdrgen
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
3
|
-
|
3
|
+
|
4
4
|
require 'xdr'
|
5
5
|
|
6
6
|
# === xdr source ============================================================
|
7
7
|
#
|
8
8
|
# struct DecoratedSignature
|
9
9
|
# {
|
10
|
-
#
|
11
|
-
#
|
10
|
+
# SignatureHint hint; // first 4 bytes of the public key, used as a hint
|
11
|
+
# Signature signature; // actual signature
|
12
12
|
# };
|
13
13
|
#
|
14
14
|
# ===========================================================================
|
15
15
|
module Stellar
|
16
16
|
class DecoratedSignature < XDR::Struct
|
17
|
-
attribute :hint,
|
18
|
-
attribute :signature,
|
17
|
+
attribute :hint, SignatureHint
|
18
|
+
attribute :signature, Signature
|
19
19
|
end
|
20
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
|
+
# enum EnvelopeType
|
9
|
+
# {
|
10
|
+
# ENVELOPE_TYPE_SCP = 1,
|
11
|
+
# ENVELOPE_TYPE_TX = 2
|
12
|
+
# };
|
13
|
+
#
|
14
|
+
# ===========================================================================
|
15
|
+
module Stellar
|
16
|
+
class EnvelopeType < XDR::Enum
|
17
|
+
member :envelope_type_scp, 1
|
18
|
+
member :envelope_type_tx, 2
|
19
|
+
|
20
|
+
seal
|
21
|
+
end
|
22
|
+
end
|
data/generated/stellar/error.rb
CHANGED
data/generated/stellar/hello.rb
CHANGED
@@ -1,24 +1,26 @@
|
|
1
|
-
#
|
1
|
+
# This code was automatically generated using xdrgen
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
3
|
-
|
3
|
+
|
4
4
|
require 'xdr'
|
5
5
|
|
6
6
|
# === xdr source ============================================================
|
7
7
|
#
|
8
8
|
# struct Hello
|
9
9
|
# {
|
10
|
-
#
|
10
|
+
# uint32 ledgerVersion;
|
11
|
+
# uint32 overlayVersion;
|
11
12
|
# string versionStr<100>;
|
12
13
|
# int listeningPort;
|
13
|
-
#
|
14
|
+
# NodeID peerID;
|
14
15
|
# };
|
15
16
|
#
|
16
17
|
# ===========================================================================
|
17
18
|
module Stellar
|
18
19
|
class Hello < XDR::Struct
|
19
|
-
attribute :
|
20
|
-
attribute :
|
21
|
-
attribute :
|
22
|
-
attribute :
|
20
|
+
attribute :ledger_version, Uint32
|
21
|
+
attribute :overlay_version, Uint32
|
22
|
+
attribute :version_str, XDR::String[100]
|
23
|
+
attribute :listening_port, XDR::Int
|
24
|
+
attribute :peer_id, NodeID
|
23
25
|
end
|
24
26
|
end
|
@@ -1,11 +1,11 @@
|
|
1
|
-
#
|
1
|
+
# This code was automatically generated using xdrgen
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
3
|
-
|
3
|
+
|
4
4
|
require 'xdr'
|
5
5
|
|
6
6
|
# === xdr source ============================================================
|
7
7
|
#
|
8
|
-
# struct
|
8
|
+
# struct InflationPayout // or use PaymentResultAtom to limit types?
|
9
9
|
# {
|
10
10
|
# AccountID destination;
|
11
11
|
# int64 amount;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# This code was automatically generated using xdrgen
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
3
|
-
|
3
|
+
|
4
4
|
require 'xdr'
|
5
5
|
|
6
6
|
# === xdr source ============================================================
|
@@ -8,7 +8,7 @@ require 'xdr'
|
|
8
8
|
# union InflationResult switch (InflationResultCode code)
|
9
9
|
# {
|
10
10
|
# case INFLATION_SUCCESS:
|
11
|
-
#
|
11
|
+
# InflationPayout payouts<>;
|
12
12
|
# default:
|
13
13
|
# void;
|
14
14
|
# };
|
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# This code was automatically generated using xdrgen
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
3
|
-
|
3
|
+
|
4
4
|
require 'xdr'
|
5
5
|
|
6
6
|
# === xdr source ============================================================
|
@@ -9,10 +9,8 @@ require 'xdr'
|
|
9
9
|
# {
|
10
10
|
# case ACCOUNT:
|
11
11
|
# AccountEntry account;
|
12
|
-
#
|
13
12
|
# case TRUSTLINE:
|
14
13
|
# TrustLineEntry trustLine;
|
15
|
-
#
|
16
14
|
# case OFFER:
|
17
15
|
# OfferEntry offer;
|
18
16
|
# };
|
@@ -1,19 +1,19 @@
|
|
1
|
-
#
|
1
|
+
# This code was automatically generated using xdrgen
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
3
|
-
|
3
|
+
|
4
4
|
require 'xdr'
|
5
5
|
|
6
6
|
# === xdr source ============================================================
|
7
7
|
#
|
8
8
|
# struct LedgerHeader
|
9
9
|
# {
|
10
|
+
# uint32 ledgerVersion; // the protocol version of the ledger
|
10
11
|
# Hash previousLedgerHash; // hash of the previous ledger header
|
11
|
-
#
|
12
|
+
# StellarValue scpValue; // what consensus agreed to
|
12
13
|
# Hash txSetResultHash; // the TransactionResultSet that led to this ledger
|
13
14
|
# Hash bucketListHash; // hash of the ledger state
|
14
15
|
#
|
15
16
|
# uint32 ledgerSeq; // sequence number of this ledger
|
16
|
-
# uint64 closeTime; // network close time
|
17
17
|
#
|
18
18
|
# int64 totalCoins; // total number of stroops in existence
|
19
19
|
#
|
@@ -22,28 +22,44 @@ require 'xdr'
|
|
22
22
|
#
|
23
23
|
# uint64 idPool; // last used global ID, used for generating objects
|
24
24
|
#
|
25
|
-
#
|
26
|
-
#
|
25
|
+
# uint32 baseFee; // base fee per operation in stroops
|
26
|
+
# uint32 baseReserve; // account base reserve in stroops
|
27
|
+
#
|
28
|
+
# Hash skipList[4]; // hashes of ledgers in the past. allows you to jump back
|
29
|
+
# // in time without walking the chain back ledger by ledger
|
30
|
+
# // each slot contains the oldest ledger that is mod of
|
31
|
+
# // either 50 5000 50000 or 500000 depending on index
|
32
|
+
# // skipList[0] mod(50), skipList[1] mod(5000), etc
|
27
33
|
#
|
28
|
-
#
|
29
|
-
#
|
34
|
+
# // reserved for future use
|
35
|
+
# union switch (int v)
|
36
|
+
# {
|
37
|
+
# case 0:
|
38
|
+
# void;
|
39
|
+
# }
|
40
|
+
# ext;
|
30
41
|
# };
|
31
42
|
#
|
32
43
|
# ===========================================================================
|
33
44
|
module Stellar
|
34
45
|
class LedgerHeader < XDR::Struct
|
46
|
+
include XDR::Namespace
|
47
|
+
|
48
|
+
autoload :Ext
|
49
|
+
|
50
|
+
attribute :ledger_version, Uint32
|
35
51
|
attribute :previous_ledger_hash, Hash
|
36
|
-
attribute :
|
52
|
+
attribute :scp_value, StellarValue
|
37
53
|
attribute :tx_set_result_hash, Hash
|
38
54
|
attribute :bucket_list_hash, Hash
|
39
55
|
attribute :ledger_seq, Uint32
|
40
|
-
attribute :close_time, Uint64
|
41
56
|
attribute :total_coins, Int64
|
42
57
|
attribute :fee_pool, Int64
|
43
58
|
attribute :inflation_seq, Uint32
|
44
59
|
attribute :id_pool, Uint64
|
45
|
-
attribute :base_fee,
|
46
|
-
attribute :base_reserve,
|
60
|
+
attribute :base_fee, Uint32
|
61
|
+
attribute :base_reserve, Uint32
|
47
62
|
attribute :skip_list, XDR::Array[Hash, 4]
|
63
|
+
attribute :ext, Ext
|
48
64
|
end
|
49
65
|
end
|
@@ -0,0 +1,24 @@
|
|
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 (int v)
|
9
|
+
# {
|
10
|
+
# case 0:
|
11
|
+
# void;
|
12
|
+
# }
|
13
|
+
#
|
14
|
+
# ===========================================================================
|
15
|
+
module Stellar
|
16
|
+
class LedgerHeader
|
17
|
+
class Ext < XDR::Union
|
18
|
+
switch_on XDR::Int, :v
|
19
|
+
|
20
|
+
switch 0
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# This code was automatically generated using xdrgen
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
3
|
-
|
3
|
+
|
4
4
|
require 'xdr'
|
5
5
|
|
6
6
|
# === xdr source ============================================================
|
@@ -9,12 +9,25 @@ require 'xdr'
|
|
9
9
|
# {
|
10
10
|
# Hash hash;
|
11
11
|
# LedgerHeader header;
|
12
|
+
#
|
13
|
+
# // reserved for future use
|
14
|
+
# union switch (int v)
|
15
|
+
# {
|
16
|
+
# case 0:
|
17
|
+
# void;
|
18
|
+
# }
|
19
|
+
# ext;
|
12
20
|
# };
|
13
21
|
#
|
14
22
|
# ===========================================================================
|
15
23
|
module Stellar
|
16
24
|
class LedgerHeaderHistoryEntry < XDR::Struct
|
25
|
+
include XDR::Namespace
|
26
|
+
|
27
|
+
autoload :Ext
|
28
|
+
|
17
29
|
attribute :hash, Hash
|
18
30
|
attribute :header, LedgerHeader
|
31
|
+
attribute :ext, Ext
|
19
32
|
end
|
20
33
|
end
|