OSDN Git Service

edit the map code (#1950)
[bytom/bytom.git] / protocol / bc / types / coinbase.go
1 package types
2
3 import (
4         "github.com/bytom/bytom/protocol/bc"
5 )
6
7 // CoinbaseInput records the coinbase message
8 type CoinbaseInput struct {
9         Arbitrary []byte
10 }
11
12 // NewCoinbaseInput creates a new coinbase input struct
13 func NewCoinbaseInput(arbitrary []byte) *TxInput {
14         return &TxInput{
15                 AssetVersion: 1,
16                 TypedInput:   &CoinbaseInput{Arbitrary: arbitrary},
17         }
18 }
19
20 // AssetID implement the TypedInput.
21 func (cb *CoinbaseInput) AssetID() bc.AssetID {
22         return bc.AssetID{}
23 }
24
25 // InputType is the interface function for return the input type
26 func (cb *CoinbaseInput) InputType() uint8 { return CoinbaseInputType }