lib/stellar/transaction.rb in stellar-base-0.10.0 vs lib/stellar/transaction.rb in stellar-base-0.11.0
- old
+ new
@@ -60,10 +60,16 @@
def self.inflation(attributes={})
make :inflation, attributes
end
#
+ # @see Stellar::Operation.manage_data
+ def self.manage_data(attributes={})
+ make :manage_data, attributes
+ end
+
+ #
# Helper method to create a transaction with a single
# operation of the provided type. See class methods
# on Stellar::Operation for available values for
# operation_type.
#
@@ -92,11 +98,11 @@
def self.for_account(attributes={})
account = attributes[:account]
sequence = attributes[:sequence]
fee = attributes[:fee]
- raise ArgumentError, "Bad :account" unless account.is_a?(KeyPair) && account.sign?
+ raise ArgumentError, "Bad :account" unless account.is_a?(KeyPair)
raise ArgumentError, "Bad :sequence #{sequence}" unless sequence.is_a?(Integer)
raise ArgumentError, "Bad :fee #{sequence}" if fee.present? && !fee.is_a?(Integer)
new.tap do |result|
result.seq_num = sequence
@@ -130,10 +136,10 @@
Stellar.current_network_id + Stellar::EnvelopeType.to_xdr(val)
end
def to_envelope(*key_pairs)
- signatures = key_pairs.map(&method(:sign_decorated))
+ signatures = (key_pairs || []).map(&method(:sign_decorated))
TransactionEnvelope.new({
:signatures => signatures,
:tx => self
})