github.com/bytom/bytom@v1.1.2-0.20221014091027-bbcba3df6075/protocol/bc/vote_output.go (about) 1 package bc 2 3 import "io" 4 5 func (VoteOutput) typ() string { return "voteOutput1" } 6 func (o *VoteOutput) writeForHash(w io.Writer) { 7 mustWriteForHash(w, o.Source) 8 mustWriteForHash(w, o.ControlProgram) 9 mustWriteForHash(w, o.Vote) 10 mustWriteForHash(w, o.StateData) 11 } 12 13 // NewCrossChainOutput creates a new CrossChainOutput. 14 func NewVoteOutput(source *ValueSource, controlProgram *Program, stateData [][]byte, ordinal uint64, vote []byte) *VoteOutput { 15 return &VoteOutput{ 16 Source: source, 17 ControlProgram: controlProgram, 18 Ordinal: ordinal, 19 Vote: vote, 20 StateData: stateData, 21 } 22 }