spec/bitcoin/bitcoin_spec.rb in bitcoin-ruby-0.0.15 vs spec/bitcoin/bitcoin_spec.rb in bitcoin-ruby-0.0.16
- old
+ new
@@ -190,9 +190,17 @@
Bitcoin.address_type("1D3KpY5kXnYhTbdCbZ9kXb2ZY7ZapD85cW").should == :hash160
Bitcoin.address_type("mpXwg4jMtRhuSpVq4xS3HFHmCmWp9NyGKt").should == nil
Bitcoin.address_type("bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4").should == :witness_v0_keyhash
Bitcoin.address_type("bc1qw508d6qejxtdg4y5r3zarvayr0c5xw7kv8f3t4").should == nil
Bitcoin.address_type("bc1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qccfmv3").should == :witness_v0_scripthash
+
+ # address_type recognizes Litecoin addresses encoded with the legacy P2SH version byte
+ Bitcoin.network = :litecoin
+ Bitcoin.address_type("3CkxTG25waxsmd13FFgRChPuGYba3ar36B").should == :p2sh
+ Bitcoin.address_type("MJy6m9S3thpJa8GwM8fm2LeJbFC22w18Vx").should == :p2sh
+ Bitcoin.address_type("2MyLngQnhzjzatKsB7XfHYoP9e2XUXSiBMM").should == nil
+
+ Bitcoin.network = :bitcoin
end
it 'Bitcoin#checksum' do
Bitcoin.checksum("0062e907b15cbf27d5425399ebf6f0fb50ebb88f18").should == "c29b7d93"
end