OSDN Git Service

Merge pull request #41 from Bytom/dev
[bytom/vapor.git] / protocol / bc / claim.go
1 package bc
2
3 import "io"
4
5 func (Claim) typ() string { return "claim1" }
6 func (c *Claim) writeForHash(w io.Writer) {
7         mustWriteForHash(w, c.Peginwitness)
8 }
9
10 // SetDestination is support function for map tx
11 func (c *Claim) SetDestination(id *Hash, val *AssetAmount, pos uint64) {
12         c.WitnessDestination = &ValueDestination{
13                 Ref:      id,
14                 Value:    val,
15                 Position: pos,
16         }
17 }
18
19 func NewClaim(spentOutputID *Hash, ordinal uint64, peginwitness [][]byte) *Claim {
20         return &Claim{
21                 SpentOutputId: spentOutputID,
22                 Ordinal:       ordinal,
23                 Peginwitness:  peginwitness,
24         }
25 }