"testing"
"time"
- "github.com/vapor/account"
- "github.com/vapor/blockchain/pseudohsm"
- "github.com/vapor/blockchain/signers"
- "github.com/vapor/blockchain/txbuilder"
- "github.com/vapor/config"
- "github.com/vapor/consensus"
- "github.com/vapor/crypto/ed25519/chainkd"
- "github.com/vapor/database"
- dbm "github.com/vapor/database/leveldb"
- "github.com/vapor/database/storage"
- "github.com/vapor/event"
- "github.com/vapor/proposal"
- "github.com/vapor/protocol"
- "github.com/vapor/protocol/bc"
- "github.com/vapor/protocol/bc/types"
- "github.com/vapor/protocol/state"
+ "github.com/bytom/vapor/account"
+ "github.com/bytom/vapor/blockchain/pseudohsm"
+ "github.com/bytom/vapor/blockchain/signers"
+ "github.com/bytom/vapor/blockchain/txbuilder"
+ "github.com/bytom/vapor/config"
+ "github.com/bytom/vapor/consensus"
+ "github.com/bytom/vapor/crypto/ed25519/chainkd"
+ "github.com/bytom/vapor/database"
+ dbm "github.com/bytom/vapor/database/leveldb"
+ "github.com/bytom/vapor/database/storage"
+ "github.com/bytom/vapor/event"
+ "github.com/bytom/vapor/proposal"
+ "github.com/bytom/vapor/protocol"
+ "github.com/bytom/vapor/protocol/bc"
+ "github.com/bytom/vapor/protocol/bc/types"
+ "github.com/bytom/vapor/protocol/state"
)
func BenchmarkChain_CoinBaseTx_NoAsset(b *testing.B) {
// init UtxoViewpoint
utxoView := state.NewUtxoViewpoint()
- utxoEntry := storage.NewUtxoEntry(false, 1, false)
+ utxoEntry := storage.NewUtxoEntry(storage.NormalUTXOType, 1, false)
for _, tx := range txs {
for _, id := range tx.SpentOutputIDs {
utxoView.Entries[id] = utxoEntry
}
}
- block, err := proposal.NewBlockTemplate(chain, txPool, nil)
+ block, err := proposal.NewBlockTemplate(chain, txPool, nil, uint64(time.Now().UnixNano()/1e6))
if err != nil {
return err
}
//-------------------------Mock actual transaction----------------------------------
func MockTxsP2PKH(keyDirPath string, testDB dbm.DB, txNumber, otherAssetNum int) ([]*types.Tx, error) {
- accountManager := account.NewManager(testDB, nil)
+ accountStore := database.NewAccountStore(testDB)
+ accountManager := account.NewManager(accountStore, nil)
hsm, err := pseudohsm.New(keyDirPath)
if err != nil {
return nil, err
}
func MockTxsP2SH(keyDirPath string, testDB dbm.DB, txNumber, otherAssetNum int) ([]*types.Tx, error) {
- accountManager := account.NewManager(testDB, nil)
+ accountStore := database.NewAccountStore(testDB)
+ accountManager := account.NewManager(accountStore, nil)
hsm, err := pseudohsm.New(keyDirPath)
if err != nil {
return nil, err
}
func MockTxsMultiSign(keyDirPath string, testDB dbm.DB, txNumber, otherAssetNum int) ([]*types.Tx, error) {
- accountManager := account.NewManager(testDB, nil)
+ accountStore := database.NewAccountStore(testDB)
+ accountManager := account.NewManager(accountStore, nil)
hsm, err := pseudohsm.New(keyDirPath)
if err != nil {
return nil, err