OSDN Git Service

edit config (#200)
[bytom/vapor.git] / config / genesis.go
index e27e733..cbf98db 100644 (file)
@@ -6,7 +6,6 @@ import (
        log "github.com/sirupsen/logrus"
 
        "github.com/vapor/consensus"
-       "github.com/vapor/crypto"
        "github.com/vapor/crypto/ed25519/chainkd"
        "github.com/vapor/protocol/bc"
        "github.com/vapor/protocol/bc/types"
@@ -14,20 +13,13 @@ import (
 )
 
 func FederationProgrom(c *Config) []byte {
-       pubKeys := chainkd.XPubKeys(c.Federation.Xpubs)
-       fedpegScript, err := vmutil.P2SPMultiSigProgram(pubKeys, c.Federation.Quorum)
+       xpubs := c.Federation.Xpubs
+       fedpegScript, err := vmutil.P2SPMultiSigProgram(chainkd.XPubKeys(xpubs), c.Federation.Quorum)
        if err != nil {
-               log.Panicf("Failed generate federation scirpt  for federation")
+               log.Panicf("fail to generate federation scirpt for federation: %v", err)
        }
 
-       scriptHash := crypto.Sha256(fedpegScript)
-
-       control, err := vmutil.P2WSHProgram(scriptHash)
-       if err != nil {
-               log.Panicf("Fail converts scriptHash to program on FederationProgrom: %v", err)
-       }
-
-       return control
+       return fedpegScript
 }
 
 func GenesisTx() *types.Tx {
@@ -44,7 +36,7 @@ func GenesisTx() *types.Tx {
                        types.NewCoinbaseInput(coinbaseInput[:]),
                },
                Outputs: []*types.TxOutput{
-                       types.NewIntraChainOutput(*consensus.BTMAssetID, consensus.InitialBlockSubsidy, contract),
+                       types.NewIntraChainOutput(*consensus.BTMAssetID, consensus.BlockSubsidy(0), contract),
                },
        }
        return types.NewTx(txData)
@@ -70,7 +62,7 @@ func mainNetGenesisBlock() *types.Block {
                BlockHeader: types.BlockHeader{
                        Version:   1,
                        Height:    0,
-                       Timestamp: 1524549600000,
+                       Timestamp: 1561000000002,
                        BlockCommitment: types.BlockCommitment{
                                TransactionsMerkleRoot: merkleRoot,
                                TransactionStatusHash:  txStatusHash,
@@ -101,7 +93,7 @@ func testNetGenesisBlock() *types.Block {
                BlockHeader: types.BlockHeader{
                        Version:   1,
                        Height:    0,
-                       Timestamp: 1528945000000,
+                       Timestamp: 1561000000001,
                        BlockCommitment: types.BlockCommitment{
                                TransactionsMerkleRoot: merkleRoot,
                                TransactionStatusHash:  txStatusHash,
@@ -132,7 +124,7 @@ func soloNetGenesisBlock() *types.Block {
                BlockHeader: types.BlockHeader{
                        Version:   1,
                        Height:    0,
-                       Timestamp: 1528945000000,
+                       Timestamp: 1561000000000,
                        BlockCommitment: types.BlockCommitment{
                                TransactionsMerkleRoot: merkleRoot,
                                TransactionStatusHash:  txStatusHash,