-
Notifications
You must be signed in to change notification settings - Fork 3
chore: remove references to any in src/keri/core directory #12
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
base: feat/agenting_type_hints
Are you sure you want to change the base?
chore: remove references to any in src/keri/core directory #12
Conversation
647c35e
to
03cad8d
Compare
src/keri/app/controller.ts
Outdated
const sn = new CesrNumber({}, undefined, this.serder.sad['s']).num + 1; | ||
const anchor = { i: _agent.pre, s: seqner.snh, d: _agent.said! }; | ||
const sn = | ||
new CesrNumber({}, undefined, String(this.serder.sad['s'])).num + 1; |
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.
@Sotatek-Patrick-Vu is currently working on the typing for ee
Serders (establishment events). I think we could narrow the typing here and we'd know exactly the format of sad
so we'd know sad.s
is a string. That'd be better but requires some coordination.
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.
What's the status here?
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.
Updated
src/keri/app/controller.ts
Outdated
pre: this.serder.pre, | ||
dig: this.serder.sad['d'], | ||
pre: this.serder.pre!, | ||
dig: this.serder.sad['d']!, |
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.
Same for these !
values
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.
Updated
src/keri/core/eventing.ts
Outdated
i: string; | ||
t: string; | ||
p: string; | ||
a: InteractEventData[]; |
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.
as mentioned in previous comment, a
can be Record<string, unknown>[];
. SealSourceTriple
is just a common one that's used
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.
I'm using the type from generated type of Patrick. He told me he will update this.
src/keri/core/eventing.ts
Outdated
s: string; | ||
d: string; | ||
} | ||
export interface InteractEventSAD extends BaseSAD { |
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.
Patrick will also have ixn
src/keri/core/eventing.ts
Outdated
a: ReplyData; | ||
} | ||
|
||
export interface SealData { |
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.
ah guess this is the SealSourceTriple
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.
Updated.
67cc8d0
to
50384d4
Compare
src/keri/app/delegating.ts
Outdated
async approve(name: string, data?: any): Promise<EventResult> { | ||
async approve( | ||
name: string, | ||
data: { i: string; s: string; d: string } |
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.
This can use the SealSourceTriple
src/keri/app/delegating.ts
Outdated
async approve(name: string, data?: any): Promise<EventResult> { | ||
async approve( | ||
name: string, | ||
data?: { i: string; s: string; d: string } |
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.
Yes please
src/keri/core/eventing.ts
Outdated
a: Record<string, unknown>[]; | ||
} | ||
|
||
export type InteractEventData = components['schemas']['Seal']; |
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.
Lets call it SealSourceTriple
- I believe in this case, ['schemas']['Seal']
is the specific i,s,d one right?
src/keri/app/controller.ts
Outdated
const sn = new CesrNumber({}, undefined, this.serder.sad['s']).num + 1; | ||
const anchor = { i: _agent.pre, s: seqner.snh, d: _agent.said! }; | ||
const sn = | ||
new CesrNumber({}, undefined, String(this.serder.sad['s'])).num + 1; |
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.
What's the status here?
eid?: string; | ||
} | ||
|
||
export interface RotateEventSAD extends BaseSAD, Record<string, unknown> { |
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.
Good point, I forgot there was 2 dimension fractions too. cc @Sotatek-Patrick-Vu
eid?: string; | ||
} | ||
|
||
export interface RotateEventSAD extends BaseSAD, Record<string, unknown> { |
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.
Can we get these types from openapi though?
src/keri/core/eventing.ts
Outdated
} | ||
|
||
export type Seal< | ||
T extends components['schemas']['Seal'] = components['schemas']['Seal'], |
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.
A seal can have any attributes at all - so essentially Record<string, unknown>
. SealSourceTriple
is components['schemas']['Seal']
right? If so, maybe we should rename @Sotatek-Patrick-Vu
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.
SealSourceTriple is components['schemas']['Seal'] right?
Yes
bc7e842
to
7ffb639
Compare
7ffb639
to
65186c9
Compare
Remove references to any in src/keri/core directory
Issue: WebOfTrust#340