-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ec9070
commit eced6fd
Showing
4 changed files
with
55 additions
and
15 deletions.
There are no files selected for viewing
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,29 @@ | ||
// Copyright 2019 the lean-helix-go authors | ||
// This file is part of the lean-helix-go library in the Orbs project. | ||
// | ||
// This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. | ||
// The above notice should be included in all copies or substantial portions of the software. | ||
|
||
package test | ||
|
||
import ( | ||
"github.com/orbs-network/lean-helix-go/services/blockheight" | ||
"github.com/orbs-network/lean-helix-go/services/interfaces" | ||
"github.com/orbs-network/lean-helix-go/spec/types/go/primitives" | ||
"github.com/orbs-network/lean-helix-go/test/mocks" | ||
"github.com/stretchr/testify/require" | ||
"testing" | ||
) | ||
|
||
func TestGenesisBlockHeight(t *testing.T) { | ||
actual := blockheight.GetBlockHeight(interfaces.GenesisBlock) | ||
require.Equal(t, primitives.BlockHeight(0), actual) | ||
} | ||
|
||
func TestBasicBlockHeight(t *testing.T) { | ||
block1 := mocks.ABlock(interfaces.GenesisBlock) | ||
block2 := mocks.ABlock(block1) | ||
block3 := mocks.ABlock(block2) | ||
actual := blockheight.GetBlockHeight(block3) | ||
require.Equal(t, primitives.BlockHeight(3), actual) | ||
} |
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
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