2019-02-25 22:44:14 +00:00
|
|
|
package transaction
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
|
|
|
|
"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
|
|
|
// Issue represents an issue transaction on the neo network
|
2019-02-25 22:44:14 +00:00
|
|
|
type Issue struct {
|
|
|
|
*Base
|
|
|
|
}
|
|
|
|
|
2019-03-17 18:26:35 +00:00
|
|
|
//NewIssue returns an issue transaction
|
2019-02-25 22:44:14 +00:00
|
|
|
func NewIssue(ver version.TX) *Issue {
|
|
|
|
basicTrans := createBaseTransaction(types.Issue, ver)
|
|
|
|
|
|
|
|
Issue := &Issue{
|
|
|
|
basicTrans,
|
|
|
|
}
|
|
|
|
Issue.encodeExclusive = Issue.encodeExcl
|
|
|
|
Issue.decodeExclusive = Issue.decodeExcl
|
|
|
|
return Issue
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *Issue) encodeExcl(bw *util.BinWriter) {
|
|
|
|
if c.Version > 1 {
|
|
|
|
bw.Err = errors.New("Version Number Invalid, Issue cannot be more than 0")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-17 18:26:35 +00:00
|
|
|
func (c *Issue) decodeExcl(br *util.BinReader) {}
|