For example, below script should be able to produce equivalent outcome of encode/decode when generated.
type Transaction struct {
SigningTransaction
ID codec.Hex `json:"id"`
size int `json:"-"`
Signatures []codec.Hex `json:"signatures" fieldNumber:"8"`
}
In case of the embedded struct is from another package, it can be ignored
Motivation
Sometimes, there are multiple version of types needs to be defined. For example, Transaction/Block header has signing block/transaction type and ones with signatures.
Currently, they are independent struct, but since properties are the same, it would be nice to be able to declare as an embedded struct
Additional Information
codec generation is parsing per file/package. Therefore, it cannot tell if struct from other package is encodable or not
Description
For example, below script should be able to produce equivalent outcome of encode/decode when generated.
Motivation
Sometimes, there are multiple version of types needs to be defined. For example, Transaction/Block header has signing block/transaction type and ones with signatures. Currently, they are independent struct, but since properties are the same, it would be nice to be able to declare as an embedded struct
Additional Information