Make ScriptSig anonymous struct an exported type.
The previous commit modified the Vin ScriptSig field to be a pointer to an anonymous struct so it could be properly omitted. However, the callers need to be able to create a new object to assign to the field, so this commit makes the previous anonymous struct an exported type named ScriptSig.
This commit is contained in:
parent
509bf830b1
commit
d3b76da919
1 changed files with 13 additions and 8 deletions
13
jsonapi.go
13
jsonapi.go
|
@ -88,16 +88,21 @@ type TxRawDecodeResult struct {
|
|||
Vout []Vout `json:"vout"`
|
||||
}
|
||||
|
||||
// ScriptSig models a signature script. It is defined seperately since it only
|
||||
// applies to non-coinbase. Therefore the field in the Vin structure needs
|
||||
// to be a pointer.
|
||||
type ScriptSig struct {
|
||||
Asm string `json:"asm"`
|
||||
Hex string `json:"hex"`
|
||||
}
|
||||
|
||||
// Vin models parts of the tx data. It is defined seperately since both
|
||||
// getrawtransaction and decoderawtransaction use the same structure.
|
||||
type Vin struct {
|
||||
Coinbase string `json:"coinbase,omitempty"`
|
||||
Txid string `json:"txid,omitempty"`
|
||||
Vout int `json:"vout,omitempty"`
|
||||
ScriptSig *struct {
|
||||
Asm string `json:"asm"`
|
||||
Hex string `json:"hex"`
|
||||
} `json:"scriptSig,omitempty"`
|
||||
ScriptSig *ScriptSig `json:"scriptSig,omitempty"`
|
||||
Sequence float64 `json:"sequence"`
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue