Class: Transaction

Inherits:
ApplicationRecord show all
Includes:
ActiveModel::Validations
Defined in:
app/models/transaction.rb

Instance Method Summary collapse

Instance Method Details

#create_contractObject



22
23
24
# File 'app/models/transaction.rb', line 22

def create_contract
  Contract.create(blk_transaction: self)
end

#receiverObject



18
19
20
# File 'app/models/transaction.rb', line 18

def receiver
  Wallet.find_by(pr_key: receiver_key).user.username
end

#senderObject



14
15
16
# File 'app/models/transaction.rb', line 14

def sender
  Wallet.find_by(pv_key: sender_key).user.username
end