1
0
Fork 0

Add AddAddressToWalletJob

master
Alex Kotov 2 years ago
parent 307a1bedfa
commit 376d148034
  1. 13
      app/jobs/add_address_to_wallet_job.rb
  2. 7
      test/jobs/add_address_to_wallet_job_test.rb

@ -0,0 +1,13 @@
class AddAddressToWalletJob < ApplicationJob
queue_as :default
def perform(address)
return if address.added_to_wallet?
success = %x[dash-cli importaddress '#{address.value}' '' true]
raise 'dash-cli importaddress failed' unless success
address.update! added_to_wallet: true
end
end

@ -0,0 +1,7 @@
require "test_helper"
class AddAddressToWalletJobTest < ActiveJob::TestCase
# test "the truth" do
# assert true
# end
end