lib/zold/id.rb in zold-0.16.17 vs lib/zold/id.rb in zold-0.16.18
- old
+ new
@@ -29,9 +29,10 @@
class Id
def initialize(id = nil)
if id.nil?
@id = rand(2**32..2**64 - 1)
else
+ raise "Invalid wallet ID type: #{id.class.name}" unless id.is_a?(String)
raise "Invalid wallet ID: #{id}" unless id =~ /^[0-9a-fA-F]{16}$/
@id = Integer("0x#{id}", 16)
end
end