lib/zold/commands/pay.rb in zold-0.22.6 vs lib/zold/commands/pay.rb in zold-0.22.7
- old
+ new
@@ -58,10 +58,13 @@
require: true,
default: File.expand_path('~/.ssh/id_rsa')
o.bool '--force',
'Ignore all validations',
default: false
+ o.string '--time',
+ "Time of transaction (default: #{Time.now.utc.iso8601})",
+ default: Time.now.utc.iso8601
o.bool '--tolerate-edges',
'Don\'t fail if only "edge" (not "master" ones) nodes have the wallet',
default: false
o.integer '--tolerate-quorum',
'The minimum number of nodes required for a successful fetch (default: 4)',
@@ -119,10 +122,10 @@
if !from.root? && from.balance < amount
raise "There is not enough funds in #{from} to send #{amount}, only #{from.balance} left"
end
end
key = Zold::Key.new(file: opts['private-key'])
- txn = from.sub(amount, invoice, key, details)
+ txn = from.sub(amount, invoice, key, details, time: Txn.parse_time(opts['time']))
@log.debug("#{amount} sent from #{from} to #{txn.bnf}: #{details}")
@log.debug("Don't forget to do 'zold push #{from}'")
@log.info(txn.id)
tax = Tax.new(from)
@log.info("The tax debt of #{from.mnemo} is #{tax.debt} \