github.com/line/ostracon@v1.0.10-0.20230328032236-7f20145f065d/abci/types/pubkey.go (about)

     1  package types
     2  
     3  import (
     4  	"github.com/tendermint/tendermint/abci/types"
     5  
     6  	"github.com/line/ostracon/crypto"
     7  	cryptoenc "github.com/line/ostracon/crypto/encoding"
     8  )
     9  
    10  func NewValidatorUpdate(pk crypto.PubKey, power int64) types.ValidatorUpdate {
    11  	pkp, err := cryptoenc.PubKeyToProto(pk)
    12  	if err != nil {
    13  		panic(err)
    14  	}
    15  
    16  	return types.ValidatorUpdate{
    17  		// Address:
    18  		PubKey: pkp,
    19  		Power:  power,
    20  	}
    21  }