Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

Add finalize_transfers API #211

Merged
merged 1 commit into from
Nov 11, 2022
Merged

Conversation

zoedberg
Copy link
Contributor

In order to finalize an RGB transfer that sends more than one asset, I added a new finalize_transfers API. I haven't changed the existing finalize transfer API since I don't want to break compatibility, but maybe in the future we can deprecate that in favor of this API. Moreover I haven't implemented the beneficiary part to save some implementation time (since currently we are not using that feature) and the respective CLI command, but I guess we can open some "good first" issues for these features.

@crisdut
Copy link
Member

crisdut commented Oct 17, 2022

Hi @zoedberg

How are you?

That's a great feature!

I will try to reproduce the tests. Can you help with questions?

  1. Do you made all transfers using OpRet, correct?
  2. For each consignment file, it is necessary to have an output in PSBT file, correct?

Thanks

@zoedberg
Copy link
Contributor Author

Hi! All good, thanks :) Sure, always happy to help!

  1. Do you made all transfers using OpRet, correct?

Yes, correct

  1. For each consignment file, it is necessary to have an output in PSBT file, correct?

No, all transfers are anchored on a single opret output

@crisdut
Copy link
Member

crisdut commented Oct 18, 2022

Hi! All good, thanks :) Sure, always happy to help!

  1. Do you made all transfers using OpRet, correct?

Yes, correct

  1. For each consignment file, it is necessary to have an output in PSBT file, correct?

No, all transfers are anchored on a single opret output

Thanks for reply, I will try make tests ASAP.

@crisdut crisdut self-requested a review October 26, 2022 03:53
Copy link
Member

@cryptoquick cryptoquick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a code style suggestion. Also, I'm having trouble understanding how Vec<(StateTransfer, Vec<SealEndpoint>)> gets defined.

src/bucketd/processor.rs Outdated Show resolved Hide resolved
@crisdut
Copy link
Member

crisdut commented Oct 26, 2022

Thanks for reply, I will try make tests ASAP.

Hi @zoedberg ,

I tried to reproduce all steps, and add more than one contract into the psbt file, but when I executed rgb-cli transfer combine the node returned Error:
The key is already present but has a different value.

Can you help me to reproduce the tests?

My Test

  1. Create two new contracts with different UTXO issuer.
  2. Create a new consignment file with each contract.
  3. Create two new state transitions with the same change output (with rgb20).
  4. Create one PSBT file with two inputs with UTXOs used in the first step (with descriptor wallet)
  5. Try embed and combining consignment files with PSBT.

PS: The new API seems correct!

@zoedberg
Copy link
Contributor Author

zoedberg commented Nov 8, 2022

Hi @crisdut,

Your test is a very high level one, not sure how to reproduce it. Are you doing this via CLI? If so please note there are some open issues and missing features on rgb-node CLI that I think prevent your test from working properly.

In rgb-lib we have a test send::receive_multiple_different_assets_success that does exactly what you say (using opret instead of tapret). So I believe the bug you're encountering is not in the rgb-node daemon or other RGB libraries. It could be an issue in one of the RGB CLIs or another issue in your setup.

@crisdut
Copy link
Member

crisdut commented Nov 8, 2022

Hi @zoedberg,

Your test is a very high level one, not sure how to reproduce it. Are you doing this via CLI? If so please note there are some open issues and missing features on rgb-node CLI that I think prevent your test from working properly.

Sorry, I didn't detail how I tested the feature. Yes, I'm doing with rgb-cli to test.

In rgb-lib we have a test send::receive_multiple_different_assets_success that does exactly what you say (using opret instead of tapret). So I believe the bug you're encountering is not in the rgb-node daemon or other RGB libraries. It could be an issue in one of the RGB CLIs or another issue in your setup.

The error occurs when executing rgb-cli transfer combine command in rgb daemon.

Well, I will investigate more. However, I agree this error is about tooling compatibility and not your feature.

@zoedberg zoedberg force-pushed the feat/finalize_transfers branch from 950798e to 90b23b7 Compare November 9, 2022 13:09
@crisdut crisdut merged commit ff08b30 into RGB-WG:master Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants