return utxos, nil
}
-func (m *Manager) buildBtmTxChain(utxos []*UTXO, signer *signers.Signer) ([]*txbuilder.Template, *UTXO, error) {
+func (m *Manager) BuildBtmTxChain(utxos []*UTXO, signer *signers.Signer) ([]*txbuilder.Template, *UTXO, error) {
if len(utxos) == 0 {
return nil, nil, errors.New("mergeSpendActionUTXO utxos num 0")
}
if !ok {
return nil, errors.New("fail to convert the spend action")
}
+
if *act.AssetId != *consensus.BTMAssetID {
return nil, errors.New("spend chain action only support BTM")
}
return nil, err
}
- tpls, utxo, err := act.accounts.buildBtmTxChain(utxos, acct.Signer)
+ tpls, utxo, err := act.accounts.BuildBtmTxChain(utxos, acct.Signer)
if err != nil {
return nil, err
}
if err != nil {
return nil, nil, err
}
+
if u.Address == "" {
sigInst.AddWitnessKeys(signer.XPubs, path, signer.Quorum)
return txInput, sigInst, nil
if len(acps) == 0 {
return nil
}
+
return m.SaveControlPrograms(acps...)
})
}