Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
shamilovtim committed Aug 26, 2024
1 parent 4bfee3b commit e6fcab1
Show file tree
Hide file tree
Showing 3 changed files with 4,164 additions and 7,910 deletions.
2 changes: 1 addition & 1 deletion packages/api/src/web5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ export class Web5 {
// Attempts to process the connected grants to be used by the delegateDID
// If the process fails, we want to clean up the identity
// the connected grants will return a de-duped array of protocol URIs that are used to register sync for those protocols
connectedProtocols = await this.processConnectedGrants({ agent, delegateDid: delegateDid.uri, grants: delegateGrants });
connectedProtocols = await this.processConnectedGrants({ agent, delegateDid: delegatePortableDid.uri, grants: delegateGrants });
} catch (error:any) {
// clean up the DID and Identity if import fails and throw
// TODO: Implement the ability to purge all of our messages as a tenant
Expand Down
24 changes: 12 additions & 12 deletions packages/api/tests/web5.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,9 @@ describe('web5 api', () => {

// stub the walletInit method
sinon.stub(WalletConnect, 'initClient').resolves({
delegateGrants : [ writeGrant.message, readGrant.message, messagesQueryGrant.message, messagesReadGrant.message ],
delegateDid : await app.export(),
connectedDid : alice.did.uri
delegateGrants : [ writeGrant.message, readGrant.message, messagesQueryGrant.message, messagesReadGrant.message ],
delegatePortableDid : await app.export(),
connectedDid : alice.did.uri
});

const appTestHarness = await PlatformAgentTestHarness.setup({
Expand Down Expand Up @@ -649,9 +649,9 @@ describe('web5 api', () => {

// stub the walletInit method of the Connect placeholder class
sinon.stub(WalletConnect, 'initClient').resolves({
delegateGrants : [ writeGrant.message, readGrant.message ],
delegateDid : await app.export(),
connectedDid : alice.did.uri
delegateGrants : [ writeGrant.message, readGrant.message ],
delegatePortableDid : await app.export(),
connectedDid : alice.did.uri
});

const appTestHarness = await PlatformAgentTestHarness.setup({
Expand Down Expand Up @@ -725,9 +725,9 @@ describe('web5 api', () => {
it('throws an error if walletConnectOptions are provided and sync is set to `off`', async () => {
// stub the walletInit method
sinon.stub(WalletConnect, 'initClient').resolves({
delegateGrants : [ ],
delegateDid : {} as any,
connectedDid : ''
delegateGrants : [ ],
delegatePortableDid : {} as any,
connectedDid : ''
});

// stub the create method of the Web5UserAgent to use the test harness agent
Expand Down Expand Up @@ -768,9 +768,9 @@ describe('web5 api', () => {

// stub the walletInit method
sinon.stub(WalletConnect, 'initClient').resolves({
delegateGrants : [ ],
delegateDid : await app.export(),
connectedDid : alice.did.uri
delegateGrants : [ ],
delegatePortableDid : await app.export(),
connectedDid : alice.did.uri
});

// stub the create method of the Web5UserAgent to use the test harness agent
Expand Down
Loading

0 comments on commit e6fcab1

Please sign in to comment.