OSDN Git Service

Merge pull request #519 from Bytom/dev
[bytom/bytom.git] / protocol / bc / types / coinbase.go
1 package types
2
3 // CoinbaseInput is record the coinbase message
4 type CoinbaseInput struct {
5         Arbitrary []byte
6 }
7
8 // IsIssuance is the interface function for return the struct type
9 func (cb *CoinbaseInput) IsIssuance() bool { return false }
10
11 // IsCoinbase is the interface function for return the struct type
12 func (cb *CoinbaseInput) IsCoinbase() bool { return true }
13
14 // NewCoinbaseInput create a new coinbase input struct
15 func NewCoinbaseInput(arbitrary []byte) *TxInput {
16         return &TxInput{
17                 AssetVersion:  1,
18                 TypedInput: &CoinbaseInput{
19                         Arbitrary: arbitrary,
20                 },
21         }
22 }