Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Commit

Permalink
Update rust-nostr
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Jan 19, 2024
1 parent 3249a40 commit dba03dc
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 84 deletions.
110 changes: 32 additions & 78 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ lightning-invoice = { git = 'https://github.com/MutinyWallet/rust-lightning.git'
lightning-rapid-gossip-sync = { git = 'https://github.com/MutinyWallet/rust-lightning.git', rev = "686a84236f54bf8d7270a5fbec07801e5281691f" }
lightning-background-processor = { git = 'https://github.com/MutinyWallet/rust-lightning.git', rev = "686a84236f54bf8d7270a5fbec07801e5281691f" }
lightning-transaction-sync = { git = 'https://github.com/MutinyWallet/rust-lightning.git', rev = "686a84236f54bf8d7270a5fbec07801e5281691f" }
nostr = { git = 'https://github.com/benthecarman/nostr.git', rev = "7195b8d537db5fe0612b3d94794893bc0021aa11" }
nostr-sdk = { git = 'https://github.com/benthecarman/nostr.git', rev = "7195b8d537db5fe0612b3d94794893bc0021aa11" }
4 changes: 2 additions & 2 deletions mutiny-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ futures-util = { version = "0.3", default-features = false }
reqwest = { version = "0.11", default-features = false, features = ["json"] }
async-trait = "0.1.68"
url = { version = "2.3.1", features = ["serde"] }
nostr = { version = "0.26.0", default-features = false, features = ["nip05", "nip47"] }
nostr-sdk = { version = "0.26.0", default-features = false }
nostr = { version = "0.27.0", default-features = false, features = ["nip05", "nip47"] }
nostr-sdk = { version = "0.27.0", default-features = false }
cbc = { version = "0.1", features = ["alloc"] }
aes = { version = "0.8" }
jwt-compact = { version = "0.8.0-beta.1", features = ["es256k"] }
Expand Down
1 change: 1 addition & 0 deletions mutiny-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,7 @@ impl<S: MutinyStorage> MutinyWallet<S> {
public_key: zap_npub,
relay_url: None,
alias: None,
uppercase: false,
},
Tag::Amount {
millisats: msats,
Expand Down
3 changes: 3 additions & 0 deletions mutiny-core/src/nostr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ impl<S: MutinyStorage> NostrManager<S> {
public_key: inv.pubkey,
relay_url: None,
alias: None,
uppercase: false,
};
let e_tag = Tag::Event {
event_id: inv.event_id,
Expand Down Expand Up @@ -718,6 +719,7 @@ impl<S: MutinyStorage> NostrManager<S> {
public_key: inv.pubkey,
relay_url: None,
alias: None,
uppercase: false,
};
let e_tag = Tag::Event {
event_id: inv.event_id,
Expand Down Expand Up @@ -855,6 +857,7 @@ impl<S: MutinyStorage> NostrManager<S> {
public_key: nwc.public_key,
relay_url: None,
alias: None,
uppercase: false,
};
let request_event =
EventBuilder::new(Kind::WalletConnectRequest, encrypted, [p_tag]).to_event(&secret)?;
Expand Down
5 changes: 5 additions & 0 deletions mutiny-core/src/nostr/nwc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ impl NostrWalletConnect {
public_key: event.pubkey,
relay_url: None,
alias: None,
uppercase: false,
};
let e_tag = Tag::Event {
event_id: event.id,
Expand Down Expand Up @@ -625,6 +626,7 @@ impl NostrWalletConnect {
public_key: event.pubkey,
relay_url: None,
alias: None,
uppercase: false,
};
let e_tag = Tag::Event {
event_id: event.id,
Expand Down Expand Up @@ -794,6 +796,7 @@ impl NostrWalletConnect {
public_key: event.pubkey,
relay_url: None,
alias: None,
uppercase: false,
};
let e_tag = Tag::Event {
event_id: event.id,
Expand Down Expand Up @@ -1318,6 +1321,7 @@ mod wasm_test {
public_key: uri.public_key,
relay_url: None,
alias: None,
uppercase: false,
};
EventBuilder::new(Kind::WalletConnectRequest, encrypted, [p_tag])
.to_event(&Keys::new(uri.secret))
Expand Down Expand Up @@ -1346,6 +1350,7 @@ mod wasm_test {
public_key: uri.public_key,
relay_url: None,
alias: None,
uppercase: false,
};
EventBuilder::new(Kind::WalletConnectRequest, encrypted, [p_tag])
.to_event(&Keys::new(uri.secret))
Expand Down
1 change: 1 addition & 0 deletions mutiny-core/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ pub fn create_nwc_request(nwc: &NostrWalletConnectURI, invoice: String) -> Event
public_key: nwc.public_key,
relay_url: None,
alias: None,
uppercase: false,
};

EventBuilder::new(Kind::WalletConnectRequest, encrypted, [p_tag])
Expand Down
2 changes: 1 addition & 1 deletion mutiny-core/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ pub(crate) fn parse_profile_metadata(data: Vec<Value>) -> HashMap<XOnlyPublicKey
.filter_map(|v| {
Event::from_value(v)
.ok()
.and_then(|e| Metadata::from_json(e.content).ok().map(|m| (e.pubkey, m)))
.and_then(|e| Metadata::from_json(&e.content).ok().map(|m| (e.pubkey, m)))
})
.collect()
}
Expand Down
2 changes: 1 addition & 1 deletion mutiny-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ lightning-invoice = { version = "0.26.0" }
thiserror = "1.0"
instant = { version = "0.1", features = ["wasm-bindgen"] }
lnurl-rs = { version = "0.3.1", default-features = false }
nostr = { version = "0.26.0", default-features = false }
nostr = { version = "0.27.0", default-features = false }
wasm-logger = "0.2.0"
log = "0.4.17"
rexie = "0.5.0"
Expand Down

0 comments on commit dba03dc

Please sign in to comment.