-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new block with producer address #249
new block with producer address #249
Conversation
blockchain/blockchain.go
Outdated
@@ -707,7 +707,7 @@ func (bc *blockchain) MintNewSecretBlock( | |||
bc.mu.RLock() | |||
defer bc.mu.RUnlock() | |||
|
|||
blk := NewSecretBlock(bc.config.Chain.ID, bc.tipHeight+1, bc.tipHash, bc.now(), secretProposals, secretWitness) | |||
blk := NewSecretBlock(bc.config.Chain.ID, bc.tipHeight+1, bc.tipHash, bc.now(), producer.PublicKey, secretProposals, secretWitness) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line is 132 characters
blockchain/block_test.go
Outdated
@@ -250,7 +251,7 @@ func TestWrongNonce(t *testing.T) { | |||
require.NoError(err) | |||
require.NoError(action.Sign(tsf1, ta.Addrinfo["producer"].PrivateKey)) | |||
hash := tsf1.Hash() | |||
blk := NewBlock(cfg.Chain.ID, 3, hash, testutil.TimestampNow(), []action.Action{coinbaseTsf, tsf1}) | |||
blk := NewBlock(cfg.Chain.ID, 3, hash, testutil.TimestampNow(), ta.Addrinfo["producer"].PublicKey, []action.Action{coinbaseTsf, tsf1}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line is 135 characters
blockchain/block_test.go
Outdated
@@ -265,7 +266,7 @@ func TestWrongNonce(t *testing.T) { | |||
require.NoError(err) | |||
require.NoError(action.Sign(tsf2, ta.Addrinfo["producer"].PrivateKey)) | |||
hash = tsf1.Hash() | |||
blk = NewBlock(cfg.Chain.ID, 3, hash, testutil.TimestampNow(), []action.Action{coinbaseTsf, tsf1, tsf2}) | |||
blk = NewBlock(cfg.Chain.ID, 3, hash, testutil.TimestampNow(), ta.Addrinfo["producer"].PublicKey, []action.Action{coinbaseTsf, tsf1, tsf2}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line is 140 characters
blockchain/block_test.go
Outdated
@@ -275,7 +276,7 @@ func TestWrongNonce(t *testing.T) { | |||
require.NoError(err) | |||
require.NoError(action.Sign(vote, ta.Addrinfo["producer"].PrivateKey)) | |||
hash = tsf1.Hash() | |||
blk = NewBlock(cfg.Chain.ID, 3, hash, testutil.TimestampNow(), []action.Action{coinbaseTsf, vote}) | |||
blk = NewBlock(cfg.Chain.ID, 3, hash, testutil.TimestampNow(), ta.Addrinfo["producer"].PublicKey, []action.Action{coinbaseTsf, vote}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line is 134 characters
blockchain/block_test.go
Outdated
@@ -290,7 +291,7 @@ func TestWrongNonce(t *testing.T) { | |||
require.NoError(err) | |||
require.NoError(action.Sign(tsf4, ta.Addrinfo["producer"].PrivateKey)) | |||
hash = tsf1.Hash() | |||
blk = NewBlock(cfg.Chain.ID, 3, hash, testutil.TimestampNow(), []action.Action{coinbaseTsf, tsf3, tsf4}) | |||
blk = NewBlock(cfg.Chain.ID, 3, hash, testutil.TimestampNow(), ta.Addrinfo["producer"].PublicKey, []action.Action{coinbaseTsf, tsf3, tsf4}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line is 140 characters
blocksync/buffer_test.go
Outdated
moved, re = b.Flush(blk) | ||
assert.Equal(false, moved) | ||
assert.Equal(bCheckinLower, re) | ||
|
||
blk = blockchain.NewBlock(uint32(123), uint64(5), hash.Hash32B{}, testutil.TimestampNow(), nil) | ||
blk = blockchain.NewBlock(uint32(123), uint64(5), hash.Hash32B{}, testutil.TimestampNow(), ta.Addrinfo["producer"].PublicKey, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line is 131 characters
blocksync/buffer_test.go
Outdated
moved, re = b.Flush(blk) | ||
assert.Equal(false, moved) | ||
assert.Equal(bCheckinValid, re) | ||
|
||
blk = blockchain.NewBlock(uint32(123), uint64(5), hash.Hash32B{}, testutil.TimestampNow(), nil) | ||
blk = blockchain.NewBlock(uint32(123), uint64(5), hash.Hash32B{}, testutil.TimestampNow(), ta.Addrinfo["producer"].PublicKey, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line is 131 characters
blocksync/buffer_test.go
Outdated
moved, re = b.Flush(blk) | ||
assert.Equal(false, moved) | ||
assert.Equal(bCheckinExisting, re) | ||
|
||
blk = blockchain.NewBlock(uint32(123), uint64(500), hash.Hash32B{}, testutil.TimestampNow(), nil) | ||
blk = blockchain.NewBlock(uint32(123), uint64(500), hash.Hash32B{}, testutil.TimestampNow(), ta.Addrinfo["producer"].PublicKey, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line is 133 characters
blocksync/buffer_test.go
Outdated
@@ -118,19 +118,19 @@ func TestBlockBufferGetBlocksIntervalsToSync(t *testing.T) { | |||
require.Equal(uint64(1), out[0].Start) | |||
require.Equal(uint64(10), out[0].End) | |||
|
|||
blk := blockchain.NewBlock(uint32(123), uint64(2), hash.Hash32B{}, testutil.TimestampNow(), nil) | |||
blk := blockchain.NewBlock(uint32(123), uint64(2), hash.Hash32B{}, testutil.TimestampNow(), ta.Addrinfo["producer"].PublicKey, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line is 132 characters
blocksync/buffer_test.go
Outdated
b.Flush(blk) | ||
blk = blockchain.NewBlock(uint32(123), uint64(14), hash.Hash32B{}, testutil.TimestampNow(), nil) | ||
blk = blockchain.NewBlock(uint32(123), uint64(14), hash.Hash32B{}, testutil.TimestampNow(), ta.Addrinfo["producer"].PublicKey, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line is 132 characters
f082a2c
to
5e16e59
Compare
blocksync/blocksync_test.go
Outdated
@@ -91,7 +91,7 @@ func TestNewBlockSyncer(t *testing.T) { | |||
// TipHeight return ERROR | |||
mBc.EXPECT().TipHeight().AnyTimes().Return(uint64(0)) | |||
mBc.EXPECT().ChainID().AnyTimes().Return(config.Default.Chain.ID) | |||
blk := bc.NewBlock(uint32(123), uint64(0), hash.Hash32B{}, testutil.TimestampNow(), nil) | |||
blk := bc.NewBlock(uint32(123), uint64(0), hash.Hash32B{}, testutil.TimestampNow(), ta.Addrinfo["producer"].PublicKey, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line is 124 characters
Codecov Report
@@ Coverage Diff @@
## master #249 +/- ##
==========================================
- Coverage 67.01% 66.78% -0.24%
==========================================
Files 100 100
Lines 9640 9648 +8
==========================================
- Hits 6460 6443 -17
- Misses 2365 2388 +23
- Partials 815 817 +2
Continue to review full report at Codecov.
|
2dc535f
to
e92f3bd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it's better to use builder pattern for those structs that have a long list of params?
e92f3bd
to
ef8d7cc
Compare
No description provided.