Skip to content

Commit

Permalink
return nil neither both op_ret nor inscription found
Browse files Browse the repository at this point in the history
  • Loading branch information
bitSmiley committed Aug 21, 2024
1 parent 152b0d7 commit b341832
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions e2e/e2etests/test_extract_bitcoin_inscription_memo.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func TestExtractBitcoinInscriptionMemo(r *runner.E2ERunner, args []string) {
require.NoError(r, err)

amount := parseFloat(r, args[0])
// this is just some random test memo for inscription
memo, err := hex.DecodeString(
"72f080c854647755d0d9e6f6821f6931f855b9acffd53d87433395672756d58822fd143360762109ab898626556b1c3b8d3096d2361f1297df4a41c1b429471a9aa2fc9be5f27c13b3863d6ac269e4b587d8389f8fd9649859935b0d48dea88cdb40f20c",
)
Expand Down
2 changes: 1 addition & 1 deletion e2e/runner/bitcoin.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ func (r *E2ERunner) InscribeToTSSFromDeployerWithMemo(
) (*chainhash.Hash, error) {
// TODO: replace builder with Go function to enable instructions
// https://github.com/zeta-chain/node/issues/2759
builder := InscriptionBuilder{sidecarUrl: "http://bitcoin-node-sidecar:8000", client: http.Client{}}
builder := InscriptionBuilder{sidecarURL: "http://bitcoin-node-sidecar:8000", client: http.Client{}}

address, err := builder.GenerateCommitAddress(memo)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions e2e/runner/inscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type revealRequest struct {

// InscriptionBuilder is a util struct that help create inscription commit and reveal transactions
type InscriptionBuilder struct {
sidecarUrl string
sidecarURL string
client http.Client
}

Expand All @@ -44,7 +44,7 @@ func (r *InscriptionBuilder) GenerateCommitAddress(memo []byte) (string, error)
return "", err
}

postUrl := r.sidecarUrl + "/commit"
postUrl := r.sidecarURL + "/commit"
req, err := http.NewRequest("POST", postUrl, bytes.NewBuffer(jsonData))
if err != nil {
return "", errors.Wrap(err, "cannot create commit request")
Expand Down Expand Up @@ -85,7 +85,7 @@ func (r *InscriptionBuilder) GenerateRevealTxn(to string, txnHash string, idx in
return "", err
}

postUrl := r.sidecarUrl + "/reveal"
postUrl := r.sidecarURL + "/reveal"
req, err := http.NewRequest("POST", postUrl, bytes.NewBuffer(jsonData))
if err != nil {
return "", errors.Wrap(err, "cannot create reveal request")
Expand Down
2 changes: 1 addition & 1 deletion zetaclient/chains/bitcoin/observer/witness.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func GetBtcEventWithWitness(
memo = candidate
logger.Debug().Msgf("GetBtcEventWithWitness: found inscription memo %s in tx %s", hex.EncodeToString(memo), tx.Txid)
} else {
return nil, errors.Errorf("error getting memo for inbound: %s", tx.Txid)
return nil, nil
}

// event found, get sender address
Expand Down

0 comments on commit b341832

Please sign in to comment.