stellar-base 0.22.0 → 0.23.0.pre1
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/{LICENSE.txt → LICENSE} +0 -0
- data/README.md +2 -3
- data/generated/stellar-base-generated.rb +10 -1
- data/generated/stellar/allow_trust_op.rb +3 -2
- data/generated/stellar/authenticated_message.rb +4 -4
- data/generated/stellar/authenticated_message/v0.rb +4 -4
- data/generated/stellar/change_trust_result_code.rb +1 -1
- data/generated/stellar/crypto_key_type.rb +8 -4
- data/generated/stellar/curve25519_public.rb +1 -1
- data/generated/stellar/curve25519_secret.rb +1 -1
- data/generated/stellar/envelope_type.rb +9 -5
- data/generated/stellar/fee_bump_transaction.rb +39 -0
- data/generated/stellar/fee_bump_transaction/ext.rb +24 -0
- data/generated/stellar/fee_bump_transaction/inner_tx.rb +25 -0
- data/generated/stellar/fee_bump_transaction_envelope.rb +22 -0
- data/generated/stellar/hmac_sha256_key.rb +1 -1
- data/generated/stellar/hmac_sha256_mac.rb +1 -1
- data/generated/stellar/inner_transaction_result.rb +56 -0
- data/generated/stellar/inner_transaction_result/ext.rb +24 -0
- data/generated/stellar/inner_transaction_result/result.rb +52 -0
- data/generated/stellar/inner_transaction_result_pair.rb +20 -0
- data/generated/stellar/ledger_close_meta.rb +1 -1
- data/generated/stellar/manage_buy_offer_result_code.rb +5 -4
- data/generated/stellar/manage_sell_offer_result_code.rb +12 -8
- data/generated/stellar/muxed_account.rb +35 -0
- data/generated/stellar/muxed_account/med25519.rb +22 -0
- data/generated/stellar/operation.rb +3 -3
- data/generated/stellar/operation/body.rb +2 -2
- data/generated/stellar/operation_result.rb +1 -1
- data/generated/stellar/operation_result/tr.rb +1 -1
- data/generated/stellar/operation_result_code.rb +3 -3
- data/generated/stellar/path_payment_strict_receive_op.rb +4 -4
- data/generated/stellar/path_payment_strict_receive_result_code.rb +21 -12
- data/generated/stellar/path_payment_strict_send_op.rb +6 -6
- data/generated/stellar/path_payment_strict_send_result_code.rb +20 -12
- data/generated/stellar/payment_op.rb +4 -4
- data/generated/stellar/survey_response_body.rb +2 -2
- data/generated/stellar/transaction.rb +2 -2
- data/generated/stellar/transaction_envelope.rb +17 -8
- data/generated/stellar/transaction_result.rb +3 -0
- data/generated/stellar/transaction_result/result.rb +9 -3
- data/generated/stellar/transaction_result_code.rb +21 -14
- data/generated/stellar/transaction_signature_payload.rb +3 -1
- data/generated/stellar/transaction_signature_payload/tagged_transaction.rb +7 -3
- data/generated/stellar/transaction_v0.rb +39 -0
- data/generated/stellar/transaction_v0/ext.rb +24 -0
- data/generated/stellar/transaction_v0_envelope.rb +22 -0
- data/generated/stellar/transaction_v1_envelope.rb +22 -0
- data/generated/stellar/trust_line_flags.rb +6 -2
- data/lib/stellar-base.rb +27 -25
- data/lib/stellar/account_flags.rb +2 -4
- data/lib/stellar/asset.rb +6 -6
- data/lib/stellar/base.rb +1 -1
- data/lib/stellar/{base/compat.rb → compat.rb} +6 -7
- data/lib/stellar/concerns/transaction.rb +49 -0
- data/lib/stellar/convert.rb +2 -2
- data/lib/stellar/factories.rb +1 -3
- data/lib/stellar/fee_bump_transaction.rb +21 -0
- data/lib/stellar/key_pair.rb +9 -6
- data/lib/stellar/networks.rb +5 -7
- data/lib/stellar/operation.rb +421 -416
- data/lib/stellar/path_payment_strict_receive_result.rb +1 -2
- data/lib/stellar/price.rb +2 -4
- data/lib/stellar/signer_key.rb +4 -8
- data/lib/stellar/thresholds.rb +5 -7
- data/lib/stellar/transaction.rb +154 -198
- data/lib/stellar/transaction_builder.rb +66 -23
- data/lib/stellar/transaction_envelope.rb +40 -8
- data/lib/stellar/transaction_v0.rb +39 -0
- data/lib/stellar/util/continued_fraction.rb +19 -19
- data/lib/stellar/util/strkey.rb +39 -14
- data/lib/stellar/{base/version.rb → version.rb} +1 -1
- metadata +33 -203
- data/.gitignore +0 -17
- data/.travis.yml +0 -16
- data/.yardopts +0 -8
- data/CHANGELOG.md +0 -149
- data/CONTRIBUTING.md +0 -48
- data/Gemfile +0 -9
- data/Guardfile +0 -5
- data/Rakefile +0 -4
- data/examples/allow_trust.rb +0 -51
- data/examples/create_account.rb +0 -26
- data/examples/low_level_transaction_post.rb +0 -46
- data/examples/mid_level_transaction_post.rb +0 -33
- data/examples/non_native_payment.rb +0 -60
- data/examples/offer.rb +0 -75
- data/examples/transaction_merge.rb +0 -23
- data/ruby-stellar-base.gemspec +0 -34
- data/spec/lib/stellar/account_flags_spec.rb +0 -19
- data/spec/lib/stellar/asset_spec.rb +0 -45
- data/spec/lib/stellar/convert_spec.rb +0 -61
- data/spec/lib/stellar/key_pair_spec.rb +0 -251
- data/spec/lib/stellar/networks_spec.rb +0 -77
- data/spec/lib/stellar/operation_spec.rb +0 -131
- data/spec/lib/stellar/path_payment_strict_receive_result_spec.rb +0 -95
- data/spec/lib/stellar/price_spec.rb +0 -34
- data/spec/lib/stellar/signer_key_spec.rb +0 -26
- data/spec/lib/stellar/thresholds_spec.rb +0 -62
- data/spec/lib/stellar/transaction_builder_spec.rb +0 -263
- data/spec/lib/stellar/transaction_envelope_spec.rb +0 -93
- data/spec/lib/stellar/transaction_spec.rb +0 -132
- data/spec/lib/stellar/util/strkey_spec.rb +0 -54
- data/spec/spec_helper.rb +0 -16
- data/spec/support/matchers/be_strkey.rb +0 -9
- data/spec/support/matchers/eq_bytes.rb +0 -5
- data/spec/support/matchers/have_length.rb +0 -5
- data/tasks/rspec.rake +0 -6
- data/tasks/travis.rake +0 -1
- data/tasks/xdr.rake +0 -45
- data/xdr/Stellar-SCP.x +0 -86
- data/xdr/Stellar-ledger-entries.x +0 -295
- data/xdr/Stellar-ledger.x +0 -372
- data/xdr/Stellar-overlay.x +0 -229
- data/xdr/Stellar-transaction.x +0 -901
- data/xdr/Stellar-types.x +0 -81
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9440334161a80fd870e800622135c71620b4feb002d34cb0ec6513428a653f29
|
|
4
|
+
data.tar.gz: 565fd8ffb469d9137470bf36a821bea1072427f38044d3a8cc402ece154fbbb2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 55fb594fa92e0842f738e93e52420aa05a39fefc279d23793bfa9227ce263d52a75f50db61d8cdc6eff5fdf19acdcb36b9f8cdb04c9c6c8373ca368e39a52d4e
|
|
7
|
+
data.tar.gz: 79968fe2b3075e1bc6ecdc6c82d6ccad9c74406810a8b0a429e64c48d81acf14a1c48ef5665362051cf147afc6e7d347ad75ddf7fe435fea091cd3d30d285fd9
|
data/{LICENSE.txt → LICENSE}
RENAMED
|
File without changes
|
data/README.md
CHANGED
|
@@ -12,15 +12,14 @@ Add this line to your application's Gemfile:
|
|
|
12
12
|
|
|
13
13
|
```ruby
|
|
14
14
|
gem 'stellar-base'
|
|
15
|
+
gem 'xdr', git: 'https://github.com/stellar/ruby-xdr.git', tag: 'v3.0.1'
|
|
15
16
|
```
|
|
16
17
|
|
|
17
18
|
And then execute:
|
|
18
19
|
|
|
19
20
|
$ bundle
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
$ gem install stellar-base
|
|
22
|
+
**Note** we need to add such explicit xdr dependency, because version 3.0.1 is not on RubyGems yet. When it's published, you can remove this line
|
|
24
23
|
|
|
25
24
|
Also requires libsodium. Installable via `brew install libsodium` on OS X.
|
|
26
25
|
|
|
@@ -49,6 +49,7 @@ module Stellar
|
|
|
49
49
|
autoload :AccountEntry
|
|
50
50
|
autoload :TrustLineFlags
|
|
51
51
|
MASK_TRUSTLINE_FLAGS = 1
|
|
52
|
+
MASK_TRUSTLINE_FLAGS_V13 = 3
|
|
52
53
|
autoload :TrustLineEntry
|
|
53
54
|
autoload :OfferEntryFlags
|
|
54
55
|
MASK_OFFERENTRY_FLAGS = 1
|
|
@@ -60,6 +61,7 @@ end
|
|
|
60
61
|
module Stellar
|
|
61
62
|
include XDR::Namespace
|
|
62
63
|
|
|
64
|
+
autoload :MuxedAccount
|
|
63
65
|
autoload :DecoratedSignature
|
|
64
66
|
autoload :OperationType
|
|
65
67
|
autoload :CreateAccountOp
|
|
@@ -79,9 +81,14 @@ module Stellar
|
|
|
79
81
|
autoload :Memo
|
|
80
82
|
autoload :TimeBounds
|
|
81
83
|
MAX_OPS_PER_TX = 100
|
|
84
|
+
autoload :TransactionV0
|
|
85
|
+
autoload :TransactionV0Envelope
|
|
82
86
|
autoload :Transaction
|
|
83
|
-
autoload :
|
|
87
|
+
autoload :TransactionV1Envelope
|
|
88
|
+
autoload :FeeBumpTransaction
|
|
89
|
+
autoload :FeeBumpTransactionEnvelope
|
|
84
90
|
autoload :TransactionEnvelope
|
|
91
|
+
autoload :TransactionSignaturePayload
|
|
85
92
|
autoload :ClaimOfferAtom
|
|
86
93
|
autoload :CreateAccountResultCode
|
|
87
94
|
autoload :CreateAccountResult
|
|
@@ -116,6 +123,8 @@ module Stellar
|
|
|
116
123
|
autoload :OperationResultCode
|
|
117
124
|
autoload :OperationResult
|
|
118
125
|
autoload :TransactionResultCode
|
|
126
|
+
autoload :InnerTransactionResult
|
|
127
|
+
autoload :InnerTransactionResultPair
|
|
119
128
|
autoload :TransactionResult
|
|
120
129
|
end
|
|
121
130
|
module Stellar
|
|
@@ -21,7 +21,8 @@ require 'xdr'
|
|
|
21
21
|
# }
|
|
22
22
|
# asset;
|
|
23
23
|
#
|
|
24
|
-
#
|
|
24
|
+
# // 0, or any bitwise combination of TrustLineFlags
|
|
25
|
+
# uint32 authorize;
|
|
25
26
|
# };
|
|
26
27
|
#
|
|
27
28
|
# ===========================================================================
|
|
@@ -33,6 +34,6 @@ module Stellar
|
|
|
33
34
|
|
|
34
35
|
attribute :trustor, AccountID
|
|
35
36
|
attribute :asset, Asset
|
|
36
|
-
attribute :authorize,
|
|
37
|
+
attribute :authorize, Uint32
|
|
37
38
|
end
|
|
38
39
|
end
|
|
@@ -6,10 +6,10 @@ require 'xdr'
|
|
|
6
6
|
# === xdr source ============================================================
|
|
7
7
|
#
|
|
8
8
|
# struct
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
9
|
+
# {
|
|
10
|
+
# uint64 sequence;
|
|
11
|
+
# StellarMessage message;
|
|
12
|
+
# HmacSha256Mac mac;
|
|
13
13
|
# }
|
|
14
14
|
#
|
|
15
15
|
# ===========================================================================
|
|
@@ -16,7 +16,7 @@ require 'xdr'
|
|
|
16
16
|
# // cannot create with a limit of 0
|
|
17
17
|
# CHANGE_TRUST_LOW_RESERVE =
|
|
18
18
|
# -4, // not enough funds to create a new trust line,
|
|
19
|
-
# CHANGE_TRUST_SELF_NOT_ALLOWED = -5
|
|
19
|
+
# CHANGE_TRUST_SELF_NOT_ALLOWED = -5 // trusting self is not allowed
|
|
20
20
|
# };
|
|
21
21
|
#
|
|
22
22
|
# ===========================================================================
|
|
@@ -9,15 +9,19 @@ require 'xdr'
|
|
|
9
9
|
# {
|
|
10
10
|
# KEY_TYPE_ED25519 = 0,
|
|
11
11
|
# KEY_TYPE_PRE_AUTH_TX = 1,
|
|
12
|
-
# KEY_TYPE_HASH_X = 2
|
|
12
|
+
# KEY_TYPE_HASH_X = 2,
|
|
13
|
+
# // MUXED enum values for supported type are derived from the enum values
|
|
14
|
+
# // above by ORing them with 0x100
|
|
15
|
+
# KEY_TYPE_MUXED_ED25519 = 0x100
|
|
13
16
|
# };
|
|
14
17
|
#
|
|
15
18
|
# ===========================================================================
|
|
16
19
|
module Stellar
|
|
17
20
|
class CryptoKeyType < XDR::Enum
|
|
18
|
-
member :key_type_ed25519,
|
|
19
|
-
member :key_type_pre_auth_tx,
|
|
20
|
-
member :key_type_hash_x,
|
|
21
|
+
member :key_type_ed25519, 0
|
|
22
|
+
member :key_type_pre_auth_tx, 1
|
|
23
|
+
member :key_type_hash_x, 2
|
|
24
|
+
member :key_type_muxed_ed25519, 256
|
|
21
25
|
|
|
22
26
|
seal
|
|
23
27
|
end
|
|
@@ -7,19 +7,23 @@ require 'xdr'
|
|
|
7
7
|
#
|
|
8
8
|
# enum EnvelopeType
|
|
9
9
|
# {
|
|
10
|
+
# ENVELOPE_TYPE_TX_V0 = 0,
|
|
10
11
|
# ENVELOPE_TYPE_SCP = 1,
|
|
11
12
|
# ENVELOPE_TYPE_TX = 2,
|
|
12
13
|
# ENVELOPE_TYPE_AUTH = 3,
|
|
13
|
-
# ENVELOPE_TYPE_SCPVALUE = 4
|
|
14
|
+
# ENVELOPE_TYPE_SCPVALUE = 4,
|
|
15
|
+
# ENVELOPE_TYPE_TX_FEE_BUMP = 5
|
|
14
16
|
# };
|
|
15
17
|
#
|
|
16
18
|
# ===========================================================================
|
|
17
19
|
module Stellar
|
|
18
20
|
class EnvelopeType < XDR::Enum
|
|
19
|
-
member :
|
|
20
|
-
member :
|
|
21
|
-
member :
|
|
22
|
-
member :
|
|
21
|
+
member :envelope_type_tx_v0, 0
|
|
22
|
+
member :envelope_type_scp, 1
|
|
23
|
+
member :envelope_type_tx, 2
|
|
24
|
+
member :envelope_type_auth, 3
|
|
25
|
+
member :envelope_type_scpvalue, 4
|
|
26
|
+
member :envelope_type_tx_fee_bump, 5
|
|
23
27
|
|
|
24
28
|
seal
|
|
25
29
|
end
|
|
@@ -0,0 +1,39 @@
|
|
|
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 FeeBumpTransaction
|
|
9
|
+
# {
|
|
10
|
+
# MuxedAccount feeSource;
|
|
11
|
+
# int64 fee;
|
|
12
|
+
# union switch (EnvelopeType type)
|
|
13
|
+
# {
|
|
14
|
+
# case ENVELOPE_TYPE_TX:
|
|
15
|
+
# TransactionV1Envelope v1;
|
|
16
|
+
# }
|
|
17
|
+
# innerTx;
|
|
18
|
+
# union switch (int v)
|
|
19
|
+
# {
|
|
20
|
+
# case 0:
|
|
21
|
+
# void;
|
|
22
|
+
# }
|
|
23
|
+
# ext;
|
|
24
|
+
# };
|
|
25
|
+
#
|
|
26
|
+
# ===========================================================================
|
|
27
|
+
module Stellar
|
|
28
|
+
class FeeBumpTransaction < XDR::Struct
|
|
29
|
+
include XDR::Namespace
|
|
30
|
+
|
|
31
|
+
autoload :InnerTx
|
|
32
|
+
autoload :Ext
|
|
33
|
+
|
|
34
|
+
attribute :fee_source, MuxedAccount
|
|
35
|
+
attribute :fee, Int64
|
|
36
|
+
attribute :inner_tx, InnerTx
|
|
37
|
+
attribute :ext, Ext
|
|
38
|
+
end
|
|
39
|
+
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 FeeBumpTransaction
|
|
17
|
+
class Ext < XDR::Union
|
|
18
|
+
switch_on XDR::Int, :v
|
|
19
|
+
|
|
20
|
+
switch 0
|
|
21
|
+
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
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 switch (EnvelopeType type)
|
|
9
|
+
# {
|
|
10
|
+
# case ENVELOPE_TYPE_TX:
|
|
11
|
+
# TransactionV1Envelope v1;
|
|
12
|
+
# }
|
|
13
|
+
#
|
|
14
|
+
# ===========================================================================
|
|
15
|
+
module Stellar
|
|
16
|
+
class FeeBumpTransaction
|
|
17
|
+
class InnerTx < XDR::Union
|
|
18
|
+
switch_on EnvelopeType, :type
|
|
19
|
+
|
|
20
|
+
switch :envelope_type_tx, :v1
|
|
21
|
+
|
|
22
|
+
attribute :v1, TransactionV1Envelope
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
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 FeeBumpTransactionEnvelope
|
|
9
|
+
# {
|
|
10
|
+
# FeeBumpTransaction tx;
|
|
11
|
+
# /* Each decorated signature is a signature over the SHA256 hash of
|
|
12
|
+
# * a TransactionSignaturePayload */
|
|
13
|
+
# DecoratedSignature signatures<20>;
|
|
14
|
+
# };
|
|
15
|
+
#
|
|
16
|
+
# ===========================================================================
|
|
17
|
+
module Stellar
|
|
18
|
+
class FeeBumpTransactionEnvelope < XDR::Struct
|
|
19
|
+
attribute :tx, FeeBumpTransaction
|
|
20
|
+
attribute :signatures, XDR::VarArray[DecoratedSignature, 20]
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
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 InnerTransactionResult
|
|
9
|
+
# {
|
|
10
|
+
# // Always 0. Here for binary compatibility.
|
|
11
|
+
# int64 feeCharged;
|
|
12
|
+
#
|
|
13
|
+
# union switch (TransactionResultCode code)
|
|
14
|
+
# {
|
|
15
|
+
# // txFEE_BUMP_INNER_SUCCESS is not included
|
|
16
|
+
# case txSUCCESS:
|
|
17
|
+
# case txFAILED:
|
|
18
|
+
# OperationResult results<>;
|
|
19
|
+
# case txTOO_EARLY:
|
|
20
|
+
# case txTOO_LATE:
|
|
21
|
+
# case txMISSING_OPERATION:
|
|
22
|
+
# case txBAD_SEQ:
|
|
23
|
+
# case txBAD_AUTH:
|
|
24
|
+
# case txINSUFFICIENT_BALANCE:
|
|
25
|
+
# case txNO_ACCOUNT:
|
|
26
|
+
# case txINSUFFICIENT_FEE:
|
|
27
|
+
# case txBAD_AUTH_EXTRA:
|
|
28
|
+
# case txINTERNAL_ERROR:
|
|
29
|
+
# case txNOT_SUPPORTED:
|
|
30
|
+
# // txFEE_BUMP_INNER_FAILED is not included
|
|
31
|
+
# void;
|
|
32
|
+
# }
|
|
33
|
+
# result;
|
|
34
|
+
#
|
|
35
|
+
# // reserved for future use
|
|
36
|
+
# union switch (int v)
|
|
37
|
+
# {
|
|
38
|
+
# case 0:
|
|
39
|
+
# void;
|
|
40
|
+
# }
|
|
41
|
+
# ext;
|
|
42
|
+
# };
|
|
43
|
+
#
|
|
44
|
+
# ===========================================================================
|
|
45
|
+
module Stellar
|
|
46
|
+
class InnerTransactionResult < XDR::Struct
|
|
47
|
+
include XDR::Namespace
|
|
48
|
+
|
|
49
|
+
autoload :Result
|
|
50
|
+
autoload :Ext
|
|
51
|
+
|
|
52
|
+
attribute :fee_charged, Int64
|
|
53
|
+
attribute :result, Result
|
|
54
|
+
attribute :ext, Ext
|
|
55
|
+
end
|
|
56
|
+
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 InnerTransactionResult
|
|
17
|
+
class Ext < XDR::Union
|
|
18
|
+
switch_on XDR::Int, :v
|
|
19
|
+
|
|
20
|
+
switch 0
|
|
21
|
+
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
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 (TransactionResultCode code)
|
|
9
|
+
# {
|
|
10
|
+
# // txFEE_BUMP_INNER_SUCCESS is not included
|
|
11
|
+
# case txSUCCESS:
|
|
12
|
+
# case txFAILED:
|
|
13
|
+
# OperationResult results<>;
|
|
14
|
+
# case txTOO_EARLY:
|
|
15
|
+
# case txTOO_LATE:
|
|
16
|
+
# case txMISSING_OPERATION:
|
|
17
|
+
# case txBAD_SEQ:
|
|
18
|
+
# case txBAD_AUTH:
|
|
19
|
+
# case txINSUFFICIENT_BALANCE:
|
|
20
|
+
# case txNO_ACCOUNT:
|
|
21
|
+
# case txINSUFFICIENT_FEE:
|
|
22
|
+
# case txBAD_AUTH_EXTRA:
|
|
23
|
+
# case txINTERNAL_ERROR:
|
|
24
|
+
# case txNOT_SUPPORTED:
|
|
25
|
+
# // txFEE_BUMP_INNER_FAILED is not included
|
|
26
|
+
# void;
|
|
27
|
+
# }
|
|
28
|
+
#
|
|
29
|
+
# ===========================================================================
|
|
30
|
+
module Stellar
|
|
31
|
+
class InnerTransactionResult
|
|
32
|
+
class Result < XDR::Union
|
|
33
|
+
switch_on TransactionResultCode, :code
|
|
34
|
+
|
|
35
|
+
switch :tx_success, :results
|
|
36
|
+
switch :tx_failed, :results
|
|
37
|
+
switch :tx_too_early
|
|
38
|
+
switch :tx_too_late
|
|
39
|
+
switch :tx_missing_operation
|
|
40
|
+
switch :tx_bad_seq
|
|
41
|
+
switch :tx_bad_auth
|
|
42
|
+
switch :tx_insufficient_balance
|
|
43
|
+
switch :tx_no_account
|
|
44
|
+
switch :tx_insufficient_fee
|
|
45
|
+
switch :tx_bad_auth_extra
|
|
46
|
+
switch :tx_internal_error
|
|
47
|
+
switch :tx_not_supported
|
|
48
|
+
|
|
49
|
+
attribute :results, XDR::VarArray[OperationResult]
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|