Skip to content

Commit

Permalink
Rename buildEIP6492Signature
Browse files Browse the repository at this point in the history
  • Loading branch information
ScreamingHawk committed Dec 5, 2024
1 parent fc97408 commit e8cbccd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
14 changes: 1 addition & 13 deletions packages/passkeys/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,19 +258,7 @@ export class SequencePasskeySigner implements signers.SapientSigner {
return signatureBytes
}

async buildValidationSignature(signatureBytes: string): Promise<string | undefined> {
console.log('passkey buildValidationSignature', signatureBytes)
try {
if (await this.isDeployed()) {
return undefined
}
} catch (e) {
// Ignore. Assume not deployed
}
return this.buildEIP6492Signature(signatureBytes)
}

private async buildEIP6492Signature(signature: string): Promise<string> {
async buildEIP6492Signature(signature: string): Promise<string> {
const deployTransactions = await this.buildDeployTransaction()
if (!deployTransactions || deployTransactions?.transactions.length === 0) {
throw new Error('Cannot build EIP-6492 signature without deploy transaction')
Expand Down
4 changes: 2 additions & 2 deletions packages/signhub/src/orchestrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ export class Orchestrator {
.then(async signature => {
const suffix = s.suffix()
let validationSignature
if (s.buildValidationSignature) {
if (s.buildEIP6492Signature) {
try {
validationSignature = await s.buildValidationSignature(signature)
validationSignature = await s.buildEIP6492Signature(signature)
} catch (e) {
// Log and ignore
console.warn(`signer ${saddr} failed to build validation signature: ${e}`)
Expand Down
2 changes: 1 addition & 1 deletion packages/signhub/src/signers/signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface SapientSigner {
/**
* Build a validation signature for an undeployed contract signer.
*/
buildValidationSignature?(signatureBytes: ethers.BytesLike): Promise<ethers.BytesLike | undefined>;
buildEIP6492Signature?(signature: ethers.BytesLike): Promise<ethers.BytesLike | undefined>;

/**
* Notify the signer of a status change.
Expand Down
2 changes: 1 addition & 1 deletion packages/signhub/tests/orchestrator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ describe('Orchestrator', () => {
suffix(): ethers.BytesLike {
return new Uint8Array([2])
}
async buildValidationSignature(signature: string) {
async buildEIP6492Signature(signature: string) {
return signature + 'validation'
}
}
Expand Down

0 comments on commit e8cbccd

Please sign in to comment.