-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ffi(nostr): fix tokio runtime for async functions
* Specify tokio runtime for NIP-05 and NIP-11 functions Signed-off-by: Yuki Kishimoto <[email protected]>
- Loading branch information
Showing
5 changed files
with
33 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
uniffi::build_foreign_language_testcases!("tests/test_equality.py"); | ||
uniffi::build_foreign_language_testcases!("tests/test_equality.py", "tests/test_nip05.py"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import asyncio | ||
from nostr_ffi import * | ||
|
||
async def main(): | ||
nip_05 = "[email protected]" | ||
public_key = PublicKey.parse("npub1drvpzev3syqt0kjrls50050uzf25gehpz9vgdw08hvex7e0vgfeq0eseet") | ||
proxy = None | ||
if await verify_nip05(public_key, nip_05, proxy): | ||
print(f" '{nip_05}' verified, for {public_key.to_bech32()}") | ||
else: | ||
print(f" Unable to verify NIP-05, for {public_key.to_bech32()}") | ||
|
||
if __name__ == '__main__': | ||
asyncio.run(main()) |