Example #1
0
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
}
Example #2
0
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
}
Example #3
0
func (tx *CallTx) Sign(chainID string, privAccount *acm.PrivAccount) {
	tx.Input.PubKey = privAccount.PubKey
	tx.Input.Signature = privAccount.Sign(chainID, tx)
}
Example #4
0
func (tx *RebondTx) Sign(chainID string, privAccount *acm.PrivAccount) {
	tx.Signature = privAccount.Sign(chainID, tx).(acm.SignatureEd25519)
}