Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frankie/issue clean up #261

Merged
merged 2 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
#programReadOnly: boolean
#allReadOnly: boolean
/** A promise that resolves once chacha20poly1305 cryptoLib has been loaded */
ready: Promise<void>
ready: Promise<boolean>
public sigRequestPublicKey?: string
public programModPublicKey?: string
registrationManager: RegistrationManager
Expand Down Expand Up @@ -103,7 +103,7 @@
signer: programModKeyPair as Signer || this.account.sigRequestKey,
})
if (this.#programReadOnly || this.#allReadOnly) this.programs.set = async () => { throw new Error('Programs is in a read only state: Must pass a valid key pair in initialization.') }
this.#ready()
this.#ready(true)
this.isRegistered = this.registrationManager.checkRegistrationStatus.bind(
this.registrationManager
)
Expand Down Expand Up @@ -198,7 +198,7 @@
* request that needs signing. It does so by obtaining validator information based on the hash,
* formatting transaction requests for these validators, and then submitting these requests for the
* validators to sign.
*

Check warning on line 201 in src/index.ts

View workflow job for this annotation

GitHub Actions / Build, test, and lint

Do not use "@ts-ignore" because it alters compilation errors
* The process in detail:
* 1. The method removes any hex prefix from the request hash.
* 2. Determines a set of validators corresponding to the stripped request hash. These validators
Expand Down
2 changes: 1 addition & 1 deletion src/utils/crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async function verifySignature (message: string, signature: string, address: str
export async function loadCryptoLib () {
if (isImported) return cryptoLib

if (typeof window === 'undefined') {
if (!globalThis.window) {
cryptoLib = await import('@entropyxyz/x25519-chacha20poly1305-nodejs')
} else {
cryptoLib = await import('@entropyxyz/x25519-chacha20poly1305-web')
Expand Down
Loading