Skip to content
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

Merged
merged 4 commits into from
Aug 20, 2020
Merged

Implement basic TLV functionality #1847

merged 4 commits into from
Aug 20, 2020

Conversation

nkohen
Copy link
Collaborator

@nkohen nkohen commented Aug 17, 2020

Introduced basic TLV types (Ping, Pong, Error, Unknown)

@nkohen nkohen added node work for the node project core work for the core project dlc labels Aug 17, 2020
@nkohen nkohen changed the title WIP: Implement basic TLV functionality Implement basic TLV functionality Aug 18, 2020
import scodec.bits.ByteVector

sealed trait TLV extends NetworkElement {
def tpe: BigSizeUInt
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type

Copy link
Collaborator Author

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah, forgot

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`type`

Copy link
Contributor

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)
}
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

@Christewart Christewart merged commit 2a1c399 into bitcoin-s:master Aug 20, 2020
Christewart pushed a commit that referenced this pull request May 1, 2021
* Defined BigSizeUInt as in BOLT 1

* Introduced UInt16 and TLV types

* Responded to review

* Responded to review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core work for the core project dlc node work for the node project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants