mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 01:41:48 +00:00
Merge pull request #601 from nspcc-dev/refactoring/core
core: refactor out Block, BlockBase and Header, closes #597.
This commit is contained in:
commit
32213b1454
36 changed files with 327 additions and 232 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
|
||||
"github.com/CityOfZion/neo-go/config"
|
||||
"github.com/CityOfZion/neo-go/pkg/core"
|
||||
"github.com/CityOfZion/neo-go/pkg/core/mempool"
|
||||
"github.com/CityOfZion/neo-go/pkg/core/storage"
|
||||
"github.com/CityOfZion/neo-go/pkg/core/transaction"
|
||||
"github.com/CityOfZion/neo-go/pkg/crypto/keys"
|
||||
|
@ -21,7 +22,7 @@ func TestNewService(t *testing.T) {
|
|||
Type: transaction.MinerType,
|
||||
Data: &transaction.MinerTX{Nonce: 12345},
|
||||
}
|
||||
item := core.NewPoolItem(tx, new(feer))
|
||||
item := mempool.NewPoolItem(tx, new(feer))
|
||||
srv.Chain.GetMemPool().TryAdd(tx.Hash(), item)
|
||||
|
||||
var txx []block.Transaction
|
||||
|
@ -39,7 +40,7 @@ func TestService_GetVerified(t *testing.T) {
|
|||
newMinerTx(4),
|
||||
}
|
||||
pool := srv.Chain.GetMemPool()
|
||||
item := core.NewPoolItem(txs[3], new(feer))
|
||||
item := mempool.NewPoolItem(txs[3], new(feer))
|
||||
|
||||
require.True(t, pool.TryAdd(txs[3].Hash(), item))
|
||||
|
||||
|
@ -66,7 +67,7 @@ func TestService_GetVerified(t *testing.T) {
|
|||
|
||||
t.Run("more than half of the last proposal will be reused", func(t *testing.T) {
|
||||
for _, tx := range txs[:2] {
|
||||
item := core.NewPoolItem(tx, new(feer))
|
||||
item := mempool.NewPoolItem(tx, new(feer))
|
||||
require.True(t, pool.TryAdd(tx.Hash(), item))
|
||||
}
|
||||
|
||||
|
@ -115,7 +116,7 @@ func TestService_getTx(t *testing.T) {
|
|||
|
||||
require.Equal(t, nil, srv.getTx(h))
|
||||
|
||||
item := core.NewPoolItem(tx, new(feer))
|
||||
item := mempool.NewPoolItem(tx, new(feer))
|
||||
srv.Chain.GetMemPool().TryAdd(h, item)
|
||||
|
||||
got := srv.getTx(h)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue