-
Notifications
You must be signed in to change notification settings - Fork 6
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
refactor(crypto-transaction): use RLP for serialization #800
base: develop
Are you sure you want to change the base?
Conversation
@@ -31,12 +31,12 @@ export const transactionBaseSchema: SchemaObject = { | |||
network: { $ref: "networkByte" }, | |||
|
|||
nonce: { bignumber: { minimum: 0 } }, | |||
|
|||
r: { type: "string" }, // TODO: prefixed hex |
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.
limit length (64 or 65 with prefix)
|
||
if (!signature || !senderPublicKey) { | ||
if (!v || !r || !s || !senderPublicKey) { |
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.
If v
can be 0 then this also evaluates to false. Double check
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 am using 27 & 28 values. 27 => false, 28 => true.
@@ -66,4 +67,75 @@ export const prepareSandbox = async (context) => { | |||
context.sandbox.app.bind(Identifiers.Cryptography.Block.Deserializer).to(Deserializer); | |||
context.sandbox.app.bind(Identifiers.Cryptography.Block.IDFactory).to(IDFactory); | |||
context.sandbox.app.bind(Identifiers.Cryptography.Block.Factory).to(BlockFactory); | |||
|
|||
const builder = context.sandbox.app.resolve(EvmCallBuilder); |
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.
Code below just for debugging? (if so, can be removed)
@@ -120,18 +120,18 @@ describe<{ | |||
assert.string(block.serialized); | |||
}); | |||
|
|||
it("#fromData - should create a block with transactions instance from an object", async (context) => { | |||
const block = await context.factory.fromData(blockDataWithTransactions); | |||
it.skip("#fromData - should create a block with transactions instance from an object", async (context) => { |
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.
All tests should be fixed instead of skipped (also remove .only
)
@@ -270,7 +270,8 @@ export class Sync implements Contracts.ApiSync.Service { | |||
senderAddress: data.senderAddress, | |||
senderPublicKey: data.senderPublicKey, | |||
sequence: data.sequence as unknown as number, | |||
signature: data.signature, | |||
// signature: data.signature, |
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.
We can concatenate the r,s,v
components
@@ -273,7 +273,8 @@ export class Restore { | |||
senderAddress: data.senderAddress, | |||
senderPublicKey: data.senderPublicKey, | |||
sequence: data.sequence as unknown as number, | |||
signature: data.signature, | |||
// signature: data.signature, |
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.
We can concatenate the r,s,v
components
changing to draft to prevent accidental merge |
Summary
Make transactions EVM compatible.
Checklist