Official Go implementation of the Bytom protocol
Révision | a4e1e96ee2b2e308f98b6d15a4651aae9c339d57 (tree) |
---|---|
l'heure | 2021-07-15 15:02:53 |
Auteur | hauson <875095736@qq.c...> |
Commiter | hauson |
feat(add genesis tx btm issue amount): add genesis tx btm issue amount
@@ -1,8 +1,6 @@ | ||
1 | 1 | package config |
2 | 2 | |
3 | 3 | import ( |
4 | - "encoding/hex" | |
5 | - | |
6 | 4 | log "github.com/sirupsen/logrus" |
7 | 5 | |
8 | 6 | "github.com/bytom/bytom/consensus" |
@@ -10,24 +8,6 @@ import ( | ||
10 | 8 | "github.com/bytom/bytom/protocol/bc/types" |
11 | 9 | ) |
12 | 10 | |
13 | -func GenesisTx() *types.Tx { | |
14 | - contract, err := hex.DecodeString("00148c9d063ff74ee6d9ffa88d83aeb038068366c4c4") | |
15 | - if err != nil { | |
16 | - log.Panicf("fail on decode genesis tx output control program") | |
17 | - } | |
18 | - | |
19 | - txData := types.TxData{ | |
20 | - Version: 1, | |
21 | - Inputs: []*types.TxInput{ | |
22 | - types.NewCoinbaseInput([]byte("Information is power. -- Jan/11/2013. Computing is power. -- Apr/24/2018.")), | |
23 | - }, | |
24 | - Outputs: []*types.TxOutput{ | |
25 | - types.NewOriginalTxOutput(*consensus.BTMAssetID, 0, contract, nil), | |
26 | - }, | |
27 | - } | |
28 | - return types.NewTx(txData) | |
29 | -} | |
30 | - | |
31 | 11 | func mainNetGenesisBlock() *types.Block { |
32 | 12 | tx := GenesisTx() |
33 | 13 | merkleRoot, err := types.TxMerkleRoot([]*bc.Tx{tx.Tx}) |
@@ -0,0 +1,29 @@ | ||
1 | +package config | |
2 | + | |
3 | +import ( | |
4 | + "encoding/hex" | |
5 | + | |
6 | + log "github.com/sirupsen/logrus" | |
7 | + | |
8 | + "github.com/bytom/bytom/consensus" | |
9 | + "github.com/bytom/bytom/protocol/bc/types" | |
10 | +) | |
11 | + | |
12 | +// GenesisTx make genesis block txs | |
13 | +func GenesisTx() *types.Tx { | |
14 | + contract, err := hex.DecodeString("00148c9d063ff74ee6d9ffa88d83aeb038068366c4c4") | |
15 | + if err != nil { | |
16 | + log.Panicf("fail on decode genesis tx output control program") | |
17 | + } | |
18 | + | |
19 | + txData := types.TxData{ | |
20 | + Version: 1, | |
21 | + Inputs: []*types.TxInput{ | |
22 | + types.NewCoinbaseInput([]byte("Information is power. -- Jan/11/2013. Computing is power. -- Apr/24/2018.")), | |
23 | + }, | |
24 | + Outputs: []*types.TxOutput{ | |
25 | + types.NewOriginalTxOutput(*consensus.BTMAssetID, 167959666678580395, contract, nil), | |
26 | + }, | |
27 | + } | |
28 | + return types.NewTx(txData) | |
29 | +} |