lightninglabs / taproot-assets

A layer 1 daemon, for the Taproot Assets Protocol specification, written in Go (golang)
MIT License
464 stars 111 forks source link

[bug]: itest psbt_test.go func testPsbtTrustlessSwap #996

Closed penglipeng666 closed 4 months ago

penglipeng666 commented 4 months ago

I try to be independent "testPsbtTrustlessSwap ", However, there was a problem with the parameter in the following place, and the proof file could not be queried. Finally, I found that there seemed to be a problem with the parameter:

bobScriptKeyBytes := bobScriptKey.PubKey.SerializeCompressed()
    sendUniProof(
        t, t.universeServer.service, bob, bobScriptKeyBytes, genInfo,
        mintedAsset.AssetGroup,
        logResp.Transfer.Outputs[0].Anchor.Outpoint,
    )

I changed "bobScriptKeyBytes" to "logResp.Transfer.Outputs[0].ScriptKey" and succeeded! Here is the query configuration file. Why is it "bobScriptKeyBytes"?

penglipeng666 commented 4 months ago

https://github.com/lightninglabs/taproot-assets/blob/main/itest/psbt_test.go

guggero commented 4 months ago

What's the error you get when you don't change bobScriptKeyBytes to logResp.Transfer.Outputs[0].ScriptKey? The two keys should be the exact same one, so either should work. I just tried it locally (make itest icase=trustless) and it works with both keys.

penglipeng666 commented 4 months ago

I get it, I simulated "A-B-A" completely, so "func DeriveKeys" twice. sorry to bother you. But for a complete "swap", you should transfer "logResp.Transfer.Outputs[0].Anchor.Outpoint". thank you

penglipeng666 commented 4 months ago

image