Skip to content

Commit

Permalink
feat: agent context is public readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
simonas-notcat committed Jan 25, 2021
1 parent db41f9c commit e9ed18b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/core/src/__tests__/agent.test.ts
Expand Up @@ -97,6 +97,8 @@ describe('core agent', () => {
{ foo: 'bar' },
{ agent, authorizedDid: 'did:example:123' },
)

expect(agent.context?.authorizedDid).toEqual('did:example:123')
})

it.todo('createAgent should return instance of Agent')
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/agent.ts
Expand Up @@ -94,7 +94,7 @@ export class Agent implements IAgent {

private schema: IAgentPluginSchema
private schemaValidation: boolean
private context?: Record<string, any>
public readonly context?: Record<string, any>
private protectedMethods = ['execute', 'availableMethods', 'emit']

private readonly eventBus: EventEmitter = new EventEmitter()
Expand Down

0 comments on commit e9ed18b

Please sign in to comment.