-
Notifications
You must be signed in to change notification settings - Fork 122
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
feat: add republish record to ipns #745
base: main
Are you sure you want to change the base?
Conversation
* | ||
* The public key is optional if the record has an embedded public key. | ||
*/ | ||
republishRecord(record: IPNSRecord, pubKey?: PublicKey, options?: RepublishRecordOptions): Promise<void> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stick pubKey into RepublishRecordOptions
object?
@@ -707,6 +721,33 @@ class DefaultIPNS implements IPNS { | |||
|
|||
return unmarshalIPNSRecord(record) | |||
} | |||
|
|||
async republishRecord (record: IPNSRecord, pubKey?: PublicKey, options: RepublishRecordOptions = {}): Promise<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
testCid = CID.parse('QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn') | ||
rsaKey = await generateKeyPair('RSA') // RSA will embed the public key in the record | ||
ed25519Key = await generateKeyPair('Ed25519') | ||
rsaRecord = await createIPNSRecord(rsaKey, testCid, 1n, 24 * 60 * 60 * 1000) | ||
ed25519Record = await createIPNSRecord(ed25519Key, testCid, 1n, 24 * 60 * 60 * 1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to create all of these before each test? could we create them in the tests that use them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a nit here, but testCid could probably be moved up into the describe block, and then the records and keys could be moved into individual tests
What
Fixes #744
Change checklist