Conversation
annieke
reviewed
Feb 16, 2021
Comment on lines
+197
to
+199
| function encode(data) { | ||
| // TODO(annieke): establish API for how to decide which type | ||
| const type = 1 // parseInt(data.slice(0, 2), 16) |
Contributor
There was a problem hiding this comment.
@tynes the data transport layer only generic decodes which you've written for already - for encode, what's the preferred way to established which type we should encode to? or is there a way to tell from the decoded tx?
Contributor
Author
There was a problem hiding this comment.
I think we need to add a type field to this object:
const eip155TxData = {
sig: {
v: 1,
r: '0x' + '11'.repeat(32),
s: '0x' + '22'.repeat(32),
},
gasLimit: 500,
gasPrice: 100,
nonce: 100,
target: '0x' + '12'.repeat(20),
data: '0x' + '99'.repeat(10),
}So that this encode function could look at the type and pass through to the appropriate coder. We may need to update a typescript type so that typescript builds
Contributor
Author
|
Closing this in favor of the non-monorepo version of this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is a WIP pull request, trying to deduplicate logic across services into the npm packages. This adds a generalized way to
encodeanddecodethe sequencer ctc elementsMetadata
Fixes
Contributing Agreement