lib/bitcoin/payment_code.rb in bitcoinrb-0.5.0 vs lib/bitcoin/payment_code.rb in bitcoinrb-0.6.0

- old
+ new

@@ -59,11 +59,11 @@ payment_code = hex[0...-8] raise ArgumentError, 'invalid version byte' unless hex[0..1] == VERSION_BYTE raise ArgumentError, 'invalid version' unless PaymentCode.support_version?(version) raise ArgumentError, 'invalid sign' unless PaymentCode.support_sign?(sign) - raise ArgumentError, 'invalid public key' unless Bitcoin::Key.new(priv_key: nil, pubkey: sign + public_key).fully_valid_pubkey? - raise ArgumentError, 'invalid checksum' unless Bitcoin.calc_checksum(payment_code) == hex[-8..-1] + raise ArgumentError, Errors::Messages::INVALID_PUBLIC_KEY unless Bitcoin::Key.new(priv_key: nil, pubkey: sign + public_key).fully_valid_pubkey? + raise ArgumentError, Errors::Messages::INVALID_CHECKSUM unless Bitcoin.calc_checksum(payment_code) == hex[-8..-1] x_value = payment_code[8..71] chain_code_hex = payment_code[72..135] payment_code_pubkey = PaymentCode.new \ No newline at end of file