Skip to content

Design: Remove *Length variables #136

@andy-shi88

Description

@andy-shi88

Description

In several data model we have *Length variable to define the length of the next variable in the bytes. @capt4ce bring a good point of wether we need the *Length or not.

  • Proposal:
    We should use the length only in the TransactionBytes like
length := len(tx.SenderAddressLength)
buffer.Write(length)
buffer.Write(tx.SenderAddress)
(`[....1,0,0,0, ...]`) 

instead of in the proto structure like

Transaction {
    SenderAccountAddressLength uint32
    SenderAddress string
}

buffer.Write(tx.SenderAddressLength)
buffer.Write(tx.SenderAddress)

Breakdown

  • Remove *length variable in
    Transaction.*AccountAddress
    Transaction.TransactionBodyLength
    NodeRegistration.NodeAddressLength

Additional Diagram / File

Put additional diagram or file

Metadata

Metadata

Assignees

No one assigned

    Labels

    COREcore functionalitiesDOCImprovements or additions to documentationFEATURENew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions