Closed k0k0ne closed 2 months ago
@zoedberg @nicbus do you have tests covering such a case and do they succeed with the latest master?
@k0k0ne but does 44763b5d58ca6a750184d13a5a82e879435e2865906652943c25a40937252bd5, the transaction with the output to which you assign the issued asset, belongs to your wallet?
If you want to see all fungible state, not just the one for your wallet, you have to use FilterAll
as a filter, instead of your wallet.filter()
.
Interpreting "standard procedure to issue assets and query state" as "using the CLI" and with rgb-sandbox
updated to use bp-wallet
, rgb-wallet
and rgb-schemata
all at version 0.11.0-beta.7
, I can successfully issue an asset and then see the allocation in the contract state.
Here the relevant commands and related output:
$ rgb -n regtest --electrum=localhost:50001 -d data0 issue -w wallet_0 'RDYhMTR!9gv8Y2GLv9UNBEK1hcrCmdLDFk9Qd5fnO8k#brave-dinner-banana' ssi:wallet_0 contracts/usdt.yaml
A new contract rgb:aRxk1nph-LLGKNzR-WWYq7U8-7fo5FkS-eJzbBAc-NQDhBac is issued and added to the stash.
$ rgb -n regtest --electrum=localhost:50001 -d data0 state -w wallet_0 rgb:aRxk1nph-LLGKNzR-WWYq7U8-7fo5FkS-eJzbBAc-NQDhBac RGB20Fixed
Global:
spec := (ticker=("USDT"), name=("USD Tether"), details=~, precision=0)
terms := (text=("demo NIA asset"), media=~)
issuedSupply := (2000)
Owned:
assetOwner:
value=2000, utxo=bc:opret1st:3ba030f10013b87eaf4631949c7a52837ad8ee26dd2044c4832eed151ee87d2d:1, witness=~
The assignments
-> assetOwner
-> seal
in the contract's yaml is set to an UTXO controlled by the wallet (on keychain 9 or 10, based on the closing method).
After this, I can successfully spend the asset and the contract state continues to be the expected one.
Thank you for your reply. It's working now.
RGB version
0.11.0-beta.7
Reproduction Steps
Just follow the standard procedure to issue assets and query state.
Observed Behavior
Fungible asset allocation information is not visible.
Seems the function
contract.fungible(owned.name.clone(), &filter)
returns an empty value.Additional Details
I tried to set some breakpoints.
The
assignment.check_witness
function is executed once, indicating thatself.unfiltered
contains data. It can be observed thatassignment.check_witness
returns true.However, in the
include_outpoint
function insrc/wrapper.rs
,XChain::Bitcoin(outpoint)
has atxid
of1f8aed3292b0d1418171f5da7903ad635baa7aae6be4aedd1ac88dfbc9a8a2a9
, while*output
has atxid
of311ec7d43f0f33cda5a0c515a737b5e0bbce3896e6eb32e67db0e868a58f4150
. This discrepancy might cause the filter to return false, ultimately resulting in no data being displayed.When issuing, I have:
However, in
cache.yaml
of wallet, it is:I am unsure why these two are inconsistent.