mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-27 03:58:06 +00:00
d1a4e43c48
Further simplifies error handling.
28 lines
642 B
Go
28 lines
642 B
Go
package transaction
|
|
|
|
import (
|
|
"github.com/CityOfZion/neo-go/pkg/io"
|
|
)
|
|
|
|
// ClaimTX represents a claim transaction.
|
|
type ClaimTX struct {
|
|
Claims []*Input
|
|
}
|
|
|
|
// DecodeBinary implements Serializable interface.
|
|
func (tx *ClaimTX) DecodeBinary(br *io.BinReader) {
|
|
lenClaims := br.ReadVarUint()
|
|
tx.Claims = make([]*Input, lenClaims)
|
|
for i := 0; i < int(lenClaims); i++ {
|
|
tx.Claims[i] = &Input{}
|
|
tx.Claims[i].DecodeBinary(br)
|
|
}
|
|
}
|
|
|
|
// EncodeBinary implements Serializable interface.
|
|
func (tx *ClaimTX) EncodeBinary(bw *io.BinWriter) {
|
|
bw.WriteVarUint(uint64(len(tx.Claims)))
|
|
for _, claim := range tx.Claims {
|
|
claim.EncodeBinary(bw)
|
|
}
|
|
}
|