-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix panic when fetching block with empty block id from ChainManager (#…
…133)
- Loading branch information
1 parent
a28e868
commit 6881993
Showing
3 changed files
with
28 additions
and
3 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
.changeset/fix_panic_when_fetching_block_with_empty_block_id_from_chainmanager.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
default: patch | ||
--- | ||
|
||
# Fix panic when fetching block with empty block id from ChainManager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package chain_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"go.sia.tech/core/types" | ||
"go.sia.tech/coreutils/chain" | ||
"go.sia.tech/coreutils/testutil" | ||
) | ||
|
||
func TestGetEmptyBlockID(t *testing.T) { | ||
n, genesisBlock := testutil.V2Network() | ||
store, tipState, err := chain.NewDBStore(chain.NewMemDB(), n, genesisBlock) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
cm := chain.NewManager(store, tipState) | ||
_, _ = cm.Block(types.BlockID{}) | ||
} |