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

sender see no balance after a transfer (tapret1st) #173

Closed
nicbus opened this issue Apr 18, 2024 · 12 comments · Fixed by #175
Closed

sender see no balance after a transfer (tapret1st) #173

nicbus opened this issue Apr 18, 2024 · 12 comments · Fixed by #175
Assignees
Labels
bug Something isn't working
Milestone

Comments

@nicbus
Copy link
Contributor

nicbus commented Apr 18, 2024

Using commit f9813b7 plus a cargo update to include rgb-std #193 I face an issue.

This is what I'm doing (wallet 1 is the issuer/sender, wallet 2 is the recipient):

  • issue a NIA asset on wallet 1
  • send some assets from wallet 1 to wallet 2

All operations are carried out using tapret1st closing method. The same issue doesn't manifest itself when using opret1st.

After the 1st transfer, the sender doesn't see the assets allocated as RGB change.

These are the sender UTXOs after the transfer:

HeightAmount, ṩ    Outpoint
Loadingdescriptor from wallet wallet_1 ... success

Wallettotal balance: 0 ṩ

This is the sender's contract state after the transfer:

Global:
  spec := (ticker=("USDT"), name=("USD Tether"), details=~, precision=0)
  terms := (text=("demo NIA asset"), media=~)
  issuedSupply := (2000)

Owned:
  assetOwner:
@dr-orlovsky dr-orlovsky self-assigned this Apr 18, 2024
@dr-orlovsky dr-orlovsky added the bug Something isn't working label Apr 18, 2024
@dr-orlovsky dr-orlovsky added this to the v0.11.0 milestone Apr 18, 2024
@dr-orlovsky
Copy link
Member

Looks like issue with detecting outputs containing tweaks... Can you please include the sender data directory?

@nicbus
Copy link
Contributor Author

nicbus commented Apr 19, 2024

Here is the whole sender's data directory.

sender_data.tar.gz

@dr-orlovsky
Copy link
Member

Ok, this was trivial: tapret tweak was added to the wallet, but the wallet itself wasn't saved to the disk. Fixed in #175

@nicbus
Copy link
Contributor Author

nicbus commented Apr 19, 2024

Re-tested using branch v0.11 (commit 7aa7361).

The sender now fails to prepare the transfer with:

thread 'main' panicked at .../rgb/src/runtime.rs:213:31:
unable to save wallet data: Toml(Error { inner: KeyNotString })

@dr-orlovsky
Copy link
Member

Ok, this means my fix from f9813b7#diff-f643199b78cd917deee88c751028d85bc710961b6f7b874f3c99cf6935fd68b0L109-L118 doesn't actually work.

Finding another way to save using serde in a feature-gate aware way with no cfg_eval involved...

dr-orlovsky added a commit that referenced this issue Apr 19, 2024
@dr-orlovsky
Copy link
Member

With the new fix from ac43eb2 using BP-WG/bp-core#87 and BP-WG/bp-std#24 this should be working now

@nicbus
Copy link
Contributor Author

nicbus commented Apr 22, 2024

Using commit ac43eb2 plus a cargo update, I get this error when trying to create a wallet:

error: unable to serialize wallet cache as YAML file - can only flatten structs and maps (got a string)

@nicbus
Copy link
Contributor Author

nicbus commented Apr 22, 2024

moreover, I noticed the exit status of the command is 0 even if the reported error gets output and I think this should be fixed

@dr-orlovsky
Copy link
Member

dr-orlovsky commented Apr 22, 2024

Try with e05f6c75a1a150851a4b08fcec74f02230de6bb1 - just do cargo update. The exit status is separate issue and I will work on it elsewhere

@nicbus
Copy link
Contributor Author

nicbus commented Apr 22, 2024

Wallet creation now succeeds, but I get the error when syncing the wallet (utxos --sync) after receiving some funds:

Syncing keychain 0 .......... keychain 1 .......... keychain 9 .......... keychain 10 ........... success
Error: unable to serialize wallet cache as YAML file - can only flatten structs and maps (got a string)

@nicbus
Copy link
Contributor Author

nicbus commented Apr 22, 2024

After including a fix in bp-std (commit 68ca949a), wallet syncing now succeeds, but I get another error when syncing the sender (wallet 1) after the transfer (after the tx has been broadcast and confirmed, before accepting):

Loading descriptor from wallet wallet_1 ... Error: unable to parse TOML file - TOML parse error at line 7, column 1
  |
7 | "&10/1" = "^k$0ej@X7L@NTPs0zL$(MRC_`!3rCMxVn8)b0OE|00"
  | ^^^^^^^
invalid type: string "&10/1", expected a borrowed string

@nicbus
Copy link
Contributor Author

nicbus commented Apr 22, 2024

Including fixes for bp-std (6741b11d) and rgb-core (ff275566) the issue is solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants