-
Notifications
You must be signed in to change notification settings - Fork 248
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
Changes to serialization + NEPs 5 & 8 #56
Conversation
[AddKeyTransaction, 'addKey'], | ||
[DeleteKeyTransaction, 'deleteKey'], | ||
]); | ||
class Enum { |
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.
it's strange to have Enum under transaction. is there some other name that would work, or at least a comment on what this means?
@@ -12,3 +13,216 @@ export function base_encode(value: Uint8Array | string): string { | |||
export function base_decode(value: string): Uint8Array { | |||
return bs58.decode(value); | |||
} | |||
|
|||
const INITIAL_LENGTH = 1024; |
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.
It would be helpful to have a comment here what this means, and what happens if the data is smaller than this value
@@ -0,0 +1,41 @@ | |||
|
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.
Are there deserialize tests too?
The pipeline is failing due to lint errors (most likely easy fix by npm run fix) and also tests are failing. test/serialize.test.js is actually failing -- is that because we don't have a node with the nearcore changes yet? |
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.
Left comments.
Looks good to go to staging to unblock testing.
src.ts/transaction.ts
Outdated
[fieldName]: transaction, | ||
}); | ||
const SCHEMA = { | ||
'Signature': {kind: 'struct', fields: [['keyType', 'u8'], ['data', [32]]]}, |
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.
It would be very useful to document this.
Also changes required for