2019-02-25 22:44:14 +00:00
|
|
|
package transaction
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/CityOfZion/neo-go/pkg/wire/payload/transaction/types"
|
|
|
|
"github.com/CityOfZion/neo-go/pkg/wire/payload/transaction/version"
|
|
|
|
"github.com/CityOfZion/neo-go/pkg/wire/util"
|
|
|
|
)
|
|
|
|
|
2019-03-17 18:26:35 +00:00
|
|
|
//Enrollment represents an Enrollment transaction on the neo network
|
2019-02-25 22:44:14 +00:00
|
|
|
type Enrollment struct {
|
|
|
|
*Base
|
|
|
|
Key PublicKey
|
|
|
|
}
|
|
|
|
|
2019-03-17 18:26:35 +00:00
|
|
|
//NewEnrollment returns an Enrollment transaction
|
2019-02-25 22:44:14 +00:00
|
|
|
func NewEnrollment(ver version.TX) *Enrollment {
|
|
|
|
basicTrans := createBaseTransaction(types.Enrollment, ver)
|
|
|
|
|
2019-03-17 18:26:35 +00:00
|
|
|
enrollment := &Enrollment{
|
|
|
|
Base: basicTrans,
|
|
|
|
}
|
|
|
|
enrollment.encodeExclusive = enrollment.encodeExcl
|
|
|
|
enrollment.decodeExclusive = enrollment.decodeExcl
|
|
|
|
return enrollment
|
2019-02-25 22:44:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (e *Enrollment) encodeExcl(bw *util.BinWriter) {
|
|
|
|
e.Key.Encode(bw)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *Enrollment) decodeExcl(br *util.BinReader) {
|
|
|
|
e.Key.Decode(br)
|
|
|
|
}
|