MCPcopy Create free account
hub / github.com/MinterTeam/minter-go-node / EncodeToBytes

Function EncodeToBytes

rlp/encode.go:70–78  ·  view source on GitHub ↗

EncodeToBytes returns the RLP encoding of val. Please see package-level documentation for the encoding rules.

(val interface{})

Source from the content-addressed store, hash-verified

68// EncodeToBytes returns the RLP encoding of val.
69// Please see package-level documentation for the encoding rules.
70func EncodeToBytes(val interface{}) ([]byte, error) {
71 eb := encbufPool.Get().(*encbuf)
72 defer encbufPool.Put(eb)
73 eb.reset()
74 if err := eb.encode(val); err != nil {
75 return nil, err
76 }
77 return eb.toBytes(), nil
78}
79
80// EncodeToReader returns a reader from which the RLP encoding of val
81// can be read. The returned size is the total size of the encoded

Callers 15

CreateAddressFunction · 0.92
CreateTxFunction · 0.92
SignTxFunction · 0.92
TestBlockchain_SendTxFunction · 0.92
CommitMethod · 0.92
CommitMethod · 0.92
CommitMethod · 0.92

Calls 5

resetMethod · 0.80
toBytesMethod · 0.80
GetMethod · 0.65
PutMethod · 0.45
encodeMethod · 0.45