Skip to content

Commit

Permalink
Merge pull request #412 from klim0v/v1.2
Browse files Browse the repository at this point in the history
add tmAddress test
danil-lashin authored Sep 29, 2020
2 parents a2cb786 + 314931e commit 6704512
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/state/candidates/candidate_test.go
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ import (
"github.com/MinterTeam/minter-go-node/core/types"
"github.com/MinterTeam/minter-go-node/helpers"
"github.com/MinterTeam/minter-go-node/tree"
"github.com/tendermint/tendermint/crypto/ed25519"
db "github.com/tendermint/tm-db"
"math/big"
"strconv"
@@ -155,6 +156,13 @@ func TestCandidates_Commit_changePubKeyAndCheckBlockList(t *testing.T) {
if candidate == nil {
t.Fatal("candidate not found")
}
var pubkey ed25519.PubKeyEd25519
copy(pubkey[:], types.Pubkey{5}.Bytes())
var address types.TmAddress
copy(address[:], pubkey.Address().Bytes())
if *(candidate.tmAddress) != address {
t.Fatal("tmAddress not change")
}
if candidates.PubKey(candidate.ID) != [32]byte{5} {
t.Fatal("candidate map ids and pubKeys invalid")
}

0 comments on commit 6704512

Please sign in to comment.