mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 01:43:16 +01:00
63e86b72c5
In this commit, we add a new type, `RecordT[T, V]` to reduce some of the common boiler plate for TLV types. This type lets you take either a primitive type, or an existing Record, and gain common methods used to create tlv streams. It also serves as extra type annotation as well, since wire structs can use this to wrap any existing type and gain the relevant record methods. This implementation ensures that the very definition of the field also binds the TLV type value. It does this by using the generated code to map a struct like TlvType1 to an actually Type like Type(1).
25 lines
759 B
Modula-2
25 lines
759 B
Modula-2
module github.com/lightningnetwork/lnd/tlv
|
|
|
|
require (
|
|
github.com/btcsuite/btcd v0.23.3
|
|
github.com/btcsuite/btcd/btcec/v2 v2.1.3
|
|
github.com/davecgh/go-spew v1.1.1
|
|
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1
|
|
github.com/lightningnetwork/lnd/fn v1.0.0
|
|
github.com/stretchr/testify v1.8.2
|
|
golang.org/x/exp v0.0.0-20231006140011-7918f672742d
|
|
)
|
|
|
|
require (
|
|
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect
|
|
github.com/kr/pretty v0.3.0 // indirect
|
|
github.com/pmezard/go-difflib v1.0.0 // indirect
|
|
github.com/rogpeppe/go-internal v1.9.0 // indirect
|
|
golang.org/x/crypto v0.7.0 // indirect
|
|
golang.org/x/sys v0.13.0 // indirect
|
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
|
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
|
)
|
|
|
|
go 1.19
|