Compare commits
1 Commits
feature/ru
...
03bd5203ca
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
03bd5203ca
|
@@ -13,8 +13,6 @@ module Nostr
|
|||||||
#
|
#
|
||||||
# @param [String] key_kind The kind of key that is invalid (public or private)
|
# @param [String] key_kind The kind of key that is invalid (public or private)
|
||||||
#
|
#
|
||||||
def initialize(key_kind)
|
def initialize(key_kind) = super("Invalid #{key_kind} key type")
|
||||||
super("Invalid #{key_kind} key type")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -79,9 +79,7 @@ module Nostr
|
|||||||
#
|
#
|
||||||
# @return [String] The bech32 string representation of the key
|
# @return [String] The bech32 string representation of the key
|
||||||
#
|
#
|
||||||
def to_bech32
|
def to_bech32 = Bech32.encode(hrp: self.class.hrp, data: self)
|
||||||
Bech32.encode(hrp: self.class.hrp, data: self)
|
|
||||||
end
|
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ module Nostr
|
|||||||
def get_key_pair_from_private_key(private_key)
|
def get_key_pair_from_private_key(private_key)
|
||||||
validate_private_key(private_key)
|
validate_private_key(private_key)
|
||||||
public_key = extract_public_key(private_key)
|
public_key = extract_public_key(private_key)
|
||||||
KeyPair.new(private_key: private_key, public_key: public_key)
|
KeyPair.new(private_key:, public_key:)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
@@ -62,10 +62,10 @@ module Nostr
|
|||||||
)
|
)
|
||||||
event = Event.new(
|
event = Event.new(
|
||||||
pubkey: keypair.public_key,
|
pubkey: keypair.public_key,
|
||||||
kind: kind,
|
kind:,
|
||||||
content: content,
|
content:,
|
||||||
created_at: created_at,
|
created_at:,
|
||||||
tags: tags
|
tags:
|
||||||
)
|
)
|
||||||
event.sign(keypair.private_key)
|
event.sign(keypair.private_key)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user