示例#1
0
文件: tx_utils.go 项目: intfrr/mindy
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
0
文件: tx_utils.go 项目: intfrr/mindy
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
0
文件: tx_utils.go 项目: intfrr/mindy
func (tx *CallTx) Sign(chainID string, privAccount *acm.PrivAccount) {
	tx.Input.PubKey = privAccount.PubKey
	tx.Input.Signature = privAccount.Sign(chainID, tx)
}
示例#4
0
文件: tx_utils.go 项目: intfrr/mindy
func (tx *RebondTx) Sign(chainID string, privAccount *acm.PrivAccount) {
	tx.Signature = privAccount.Sign(chainID, tx).(acm.SignatureEd25519)
}