-
Notifications
You must be signed in to change notification settings - Fork 86
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
Implement basic TLV functionality #1847
Conversation
import scodec.bits.ByteVector | ||
|
||
sealed trait TLV extends NetworkElement { | ||
def tpe: BigSizeUInt |
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.
type
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.
reserved word, in scala the convention is to use tpe
for this reason
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 yeah, forgot
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.
`type`
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.
or tlvType
|
||
def forIgnored(ignored: ByteVector): PongTLV = { | ||
new PongTLV(ignored) | ||
} |
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 more types we should define?
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.
Do you mean for TLV? We can certainly add more later but these are more or less just to test things out and define conventions.
* Defined BigSizeUInt as in BOLT 1 * Introduced UInt16 and TLV types * Responded to review * Responded to review
Introduced basic TLV types (Ping, Pong, Error, Unknown)