stellar-base 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/low_level_transaction_post.rb +1 -1
- data/generated/stellar/payment_op.rb +1 -6
- data/generated/stellar/transaction.rb +4 -5
- data/lib/stellar/base/version.rb +1 -1
- data/lib/stellar/payment_op.rb +0 -2
- data/lib/stellar/transaction.rb +6 -6
- data/spec/lib/stellar/transaction_spec.rb +1 -1
- data/xdr/Stellar-transaction.x +2 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32763151cf45342771f5f3412ae9ff0967e5d0d5
|
4
|
+
data.tar.gz: 2f78674303fa257d37365a9df00dd42b3e1fbf9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cc19aa393dbb3be1b735dd08013d62e2eab150844fe85284207a58cae317e8d5a069632217714aee444d013819fa64660aa884bb6f1a2d70bf261184ba40155
|
7
|
+
data.tar.gz: 1bd52247f06363990f6752ef1aea8fd6a09418afae67c1e36fcb31323ac1859b566c8008508cb0af2f84179e01ed9772804c5859476a8ba6f0ff3d0cd548088e
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Automatically generated on 2015-05-
|
1
|
+
# Automatically generated on 2015-05-12T13:13:19-07:00
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
3
3
|
|
4
4
|
require 'xdr'
|
@@ -11,9 +11,6 @@ require 'xdr'
|
|
11
11
|
# Currency currency; // what they end up with
|
12
12
|
# int64 amount; // amount they end up with
|
13
13
|
#
|
14
|
-
# opaque memo<32>;
|
15
|
-
# opaque sourceMemo<32>; // used to return a payment
|
16
|
-
#
|
17
14
|
# // payment over path
|
18
15
|
# Currency path<5>; // what hops it must go through to get there
|
19
16
|
# int64 sendMax; // the maximum amount of the source currency (==path[0]) to
|
@@ -27,8 +24,6 @@ module Stellar
|
|
27
24
|
attribute :destination, AccountID
|
28
25
|
attribute :currency, Currency
|
29
26
|
attribute :amount, Int64
|
30
|
-
attribute :memo, XDR::VarOpaque[32]
|
31
|
-
attribute :source_memo, XDR::VarOpaque[32]
|
32
27
|
attribute :path, XDR::VarArray[Currency, 5]
|
33
28
|
attribute :send_max, Int64
|
34
29
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Automatically generated on 2015-05-
|
1
|
+
# Automatically generated on 2015-05-12T13:13:19-07:00
|
2
2
|
# DO NOT EDIT or your changes may be overwritten
|
3
3
|
|
4
4
|
require 'xdr'
|
@@ -10,9 +10,8 @@ require 'xdr'
|
|
10
10
|
# // account used to run the transaction
|
11
11
|
# AccountID sourceAccount;
|
12
12
|
#
|
13
|
-
# //
|
14
|
-
#
|
15
|
-
# int32 maxFee;
|
13
|
+
# // the fee the sourceAccount will pay
|
14
|
+
# int32 fee;
|
16
15
|
#
|
17
16
|
# // sequence number to consume in the account
|
18
17
|
# SequenceNumber seqNum;
|
@@ -30,7 +29,7 @@ require 'xdr'
|
|
30
29
|
module Stellar
|
31
30
|
class Transaction < XDR::Struct
|
32
31
|
attribute :source_account, AccountID
|
33
|
-
attribute :
|
32
|
+
attribute :fee, Int32
|
34
33
|
attribute :seq_num, SequenceNumber
|
35
34
|
attribute :min_ledger, Uint32
|
36
35
|
attribute :max_ledger, Uint32
|
data/lib/stellar/base/version.rb
CHANGED
data/lib/stellar/payment_op.rb
CHANGED
data/lib/stellar/transaction.rb
CHANGED
@@ -74,16 +74,16 @@ module Stellar
|
|
74
74
|
def self.for_account(attributes={})
|
75
75
|
account = attributes[:account]
|
76
76
|
sequence = attributes[:sequence]
|
77
|
-
|
77
|
+
fee = attributes[:fee]
|
78
78
|
|
79
79
|
raise ArgumentError, "Bad :account" unless account.is_a?(KeyPair) && account.sign?
|
80
80
|
raise ArgumentError, "Bad :sequence #{sequence}" unless sequence.is_a?(Integer)
|
81
|
-
raise ArgumentError, "Bad :
|
81
|
+
raise ArgumentError, "Bad :fee #{sequence}" if fee.present? && !fee.is_a?(Integer)
|
82
82
|
|
83
83
|
new.tap do |result|
|
84
|
-
result.seq_num
|
85
|
-
result.
|
86
|
-
result.source_account
|
84
|
+
result.seq_num = sequence
|
85
|
+
result.fee = fee
|
86
|
+
result.source_account = account.public_key
|
87
87
|
result.apply_defaults
|
88
88
|
end
|
89
89
|
end
|
@@ -132,7 +132,7 @@ module Stellar
|
|
132
132
|
|
133
133
|
def apply_defaults
|
134
134
|
self.operations ||= []
|
135
|
-
self.
|
135
|
+
self.fee ||= 10
|
136
136
|
self.min_ledger ||= 0
|
137
137
|
self.max_ledger ||= 2**32 - 1
|
138
138
|
self.memo ||= Memo.new(:memo_type_none)
|
data/xdr/Stellar-transaction.x
CHANGED
@@ -39,9 +39,6 @@ struct PaymentOp
|
|
39
39
|
Currency currency; // what they end up with
|
40
40
|
int64 amount; // amount they end up with
|
41
41
|
|
42
|
-
opaque memo<32>;
|
43
|
-
opaque sourceMemo<32>; // used to return a payment
|
44
|
-
|
45
42
|
// payment over path
|
46
43
|
Currency path<5>; // what hops it must go through to get there
|
47
44
|
int64 sendMax; // the maximum amount of the source currency (==path[0]) to
|
@@ -212,9 +209,8 @@ struct Transaction
|
|
212
209
|
// account used to run the transaction
|
213
210
|
AccountID sourceAccount;
|
214
211
|
|
215
|
-
//
|
216
|
-
|
217
|
-
int32 maxFee;
|
212
|
+
// the fee the sourceAccount will pay
|
213
|
+
int32 fee;
|
218
214
|
|
219
215
|
// sequence number to consume in the account
|
220
216
|
SequenceNumber seqNum;
|