Class: Glueby::Internal::Wallet::AR::Wallet
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Glueby::Internal::Wallet::AR::Wallet
- Defined in:
- lib/glueby/internal/wallet/active_record/wallet.rb
Instance Method Summary collapse
Instance Method Details
#sign(tx, prevtxs = [], sighashtype: ) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/glueby/internal/wallet/active_record/wallet.rb', line 17 def sign(tx, prevtxs = [], sighashtype: Tapyrus::SIGHASH_TYPE[:all]) validate_sighashtype!(sighashtype) tx.inputs.each.with_index do |input, index| script_pubkey = script_for_input(input, prevtxs) next unless script_pubkey key = keys.key_for_script(script_pubkey) next unless key sign_tx_for_p2pkh(tx, index, key, script_pubkey, sighashtype) end tx end |