lib/stellar/transaction.rb in stellar-base-0.21.0 vs lib/stellar/transaction.rb in stellar-base-0.22.0

- old
+ new

@@ -90,10 +90,18 @@ def self.bump_sequence(attributes={}) make :bump_sequence, attributes end # + # DEPRECATED + # + # All methods calling make() have been deprecated in favor of Stellar::TransactionBuilder. + # These functions only create single-operation transactions and essentially duplicate the + # methods provided by Stellar::Operation. Stellar::TransactionBuilder enables the construction + # of multi-operation transactions and mirrors the functionality provided by the Python and + # JavaScript SDKs. + # # 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. # @@ -102,9 +110,12 @@ # @param operation_type [Symbol] the operation to use # @param attributes={} [Hash] attributes to use for both the transaction and the operation # # @return [Stellar::Transaction] the resulting transaction def self.make(operation_type, attributes={}) + Stellar::Deprecation.warn( + "Transaction.#{operation_type.to_s} is deprecated. Use Stellar::TransactionBuilder instead." + ) for_account(attributes).tap do |result| result.operations << Operation.send(operation_type, attributes) end end