Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: return error when upload to ipfs fails #350

Merged
merged 3 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion chains/btc/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ func (e *Executor) executeResourceProps(props []*BtcTransferProposal, resource c
// we need to sign each input individually
tssProcesses := make([]tss.TssProcess, len(tx.TxIn))
for i := range tx.TxIn {
sessionID := fmt.Sprintf("%s-%d", sessionID, i)
signingHash, err := txscript.CalcTaprootSignatureHash(sigHashes, txscript.SigHashDefault, tx, i, prevOutputFetcher)
sessionID := hex.EncodeToString(signingHash)
if err != nil {
return err
}
Expand Down Expand Up @@ -304,13 +304,15 @@ func (e *Executor) outputs(tx *wire.MsgTx, proposals []*BtcTransferProposal) (ui
cid, err := e.uploader.Upload(dataToUpload)
if err != nil {
log.Error().Err(err).Msg("Error occured while uploading metadata to ipfs")
return 0, err
}

// Store the CID in OP_RETURN
opReturnData := []byte("syg_" + cid)
opReturnScript, err := txscript.NullDataScript(opReturnData)
if err != nil {
log.Error().Err(err).Msg("Error occured while constructiong OP_RETURN data")
return 0, err
}

opReturnOut := wire.NewTxOut(0, opReturnScript)
Expand Down
3 changes: 1 addition & 2 deletions tss/frost/signing/signing.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,11 @@ func (s *Signing) processEndMessage(ctx context.Context) error {
select {
case <-s.Done:
{
s.Log.Info().Msg("Successfully generated signature")

result, err := s.Handler.Result()
if err != nil {
return err
}
s.Log.Info().Msg("Successfully generated signature")
signature, _ := result.(taproot.Signature)

s.resultChn <- Signature{
Expand Down
Loading