spec/bitcoin/secp256k1_spec.rb in bitcoin-ruby-0.0.7 vs spec/bitcoin/secp256k1_spec.rb in bitcoin-ruby-0.0.8
- old
+ new
@@ -13,9 +13,17 @@
priv, pub = Bitcoin::Secp256k1.generate_key_pair(compressed = false)
[priv, pub].map(&:bytesize).should == [32, 65]
["\x04"].include?(pub[0]).should == true
end
+ it 'generate key' do
+ key = Bitcoin::Secp256k1.generate_key(compressed = true)
+ key.compressed.should == true
+
+ key = Bitcoin::Secp256k1.generate_key(compressed = false)
+ key.compressed.should == false
+ end
+
it 'sign and verify' do
priv, pub = Bitcoin::Secp256k1.generate_key_pair
signature = Bitcoin::Secp256k1.sign("derp", priv)
Bitcoin::Secp256k1.verify("derp", signature, pub).should == true
end