本文整理匯總了Golang中github.com/eris-ltd/toadserver/Godeps/_workspace/src/github.com/tendermint/tendermint/account.PrivAccount類的典型用法代碼示例。如果您正苦於以下問題:Golang PrivAccount類的具體用法?Golang PrivAccount怎麽用?Golang PrivAccount使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了PrivAccount類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: SignInput
func (tx *SendTx) SignInput(chainID string, i int, privAccount *acm.PrivAccount) error {
if i >= len(tx.Inputs) {
return fmt.Errorf("Index %v is greater than number of inputs (%v)", i, len(tx.Inputs))
}
tx.Inputs[i].PubKey = privAccount.PubKey
tx.Inputs[i].Signature = privAccount.Sign(chainID, tx)
return nil
}
示例2: SignBond
func (tx *BondTx) SignBond(chainID string, privAccount *acm.PrivAccount) error {
sig := privAccount.Sign(chainID, tx)
sigEd, ok := sig.(acm.SignatureEd25519)
if !ok {
return fmt.Errorf("Bond signer must be ED25519")
}
tx.Signature = sigEd
return nil
}
示例3: Sign
func (tx *CallTx) Sign(chainID string, privAccount *acm.PrivAccount) {
tx.Input.PubKey = privAccount.PubKey
tx.Input.Signature = privAccount.Sign(chainID, tx)
}