lib/stellar/transaction_builder.rb in stellar-base-0.30.0 vs lib/stellar/transaction_builder.rb in stellar-base-0.31.0
- old
+ new
@@ -14,11 +14,11 @@
return super unless Operation.respond_to?(method_name)
op = Operation.send(
method_name,
**kwargs.except(
- :source_account, :sequence_number, :base_fee, :time_bounds, :memo, :enable_muxed_accounts
+ :source_account, :sequence_number, :base_fee, :time_bounds, :memo
)
)
new(**kwargs).add_operation(op).build
end
@@ -32,22 +32,20 @@
source_account:,
sequence_number:,
base_fee: 100,
time_bounds: nil,
memo: nil,
- enable_muxed_accounts: false,
**_ # ignore any additional parameters without errors
)
raise ArgumentError, "Bad :sequence_number" unless sequence_number.is_a?(Integer) && sequence_number >= 0
raise ArgumentError, "Bad :time_bounds" unless time_bounds.is_a?(Stellar::TimeBounds) || time_bounds.nil?
raise ArgumentError, "Bad :base_fee" unless base_fee.is_a?(Integer) && base_fee >= 100
@source_account = Account(source_account)
@sequence_number = sequence_number
@base_fee = base_fee
@time_bounds = time_bounds
- @enable_muxed_accounts = enable_muxed_accounts
set_timeout(0) if time_bounds.nil?
@memo = make_memo(memo)
@operations = []
@@ -61,11 +59,11 @@
elsif @time_bounds.max_time != 0 && @time_bounds.min_time > @time_bounds.max_time
raise "Timebounds.max_time must be greater than min_time"
end
attrs = {
- source_account: source_muxed_account,
+ source_account: @source_account.muxed_account,
fee: @base_fee * @operations.length,
seq_num: @sequence_number,
time_bounds: @time_bounds,
memo: @memo,
operations: @operations,
@@ -92,11 +90,11 @@
if @base_fee < inner_base_fee_rate
raise "Insufficient base_fee, it should be at least #{inner_base_fee_rate} stroops."
end
Stellar::FeeBumpTransaction.new(
- fee_source: source_muxed_account,
+ fee_source: @source_account.muxed_account,
fee: @base_fee * (inner_ops.length + 1),
inner_tx: Stellar::FeeBumpTransaction::InnerTx.new(:envelope_type_tx, inner_txe.v1!),
ext: Stellar::FeeBumpTransaction::Ext.new(0)
)
end
@@ -163,20 +161,8 @@
t, val = *memo
Memo.new(:"memo_#{t}", val)
else
raise ArgumentError, "Bad :memo"
end
- end
-
- def source_muxed_account
- if with_muxed_accounts?
- @source_account.muxed_account
- else
- @source_account.base_account
- end
- end
-
- def with_muxed_accounts?
- @enable_muxed_accounts
end
end
end