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