Closed k0k0ne closed 1 month ago
---- missing_history_bug stdout ----
Starting test: missing_history_bug
starting test services...
waiting for indexer to sync with bitcoind...
wallet dir: "tests/tmp/1bfd3b97"
keychain 0 .......... keychain 1 .......... keychain 9 ..........wallet dir: "tests/tmp/7acf740f"
keychain 0 .......... keychain 1 .......... keychain 9 ..........Wallets created: wlt_1 and wlt_2
Initial amount: 100000
keychain 0 .......... keychain 1 .......... keychain 9 ...........Contract issued - ID: ContractId(Array<32>(338b88a2a45510ca0f820a74af1341203861b91b18a3ba2732802f081134e798)), Interface type: RGB20Fixed
Initial height: 104
Amount Counterparty Witness Id
Transfer amount: 200
Invoice created: RgbInvoice { transports: [UnspecifiedMeans], contract: Some(ContractId(Array<32>(338b88a2a45510ca0f820a74af1341203861b91b18a3ba2732802f081134e798))), iface: Some(TypeName("RGB20Fixed")), operation: None, assignment: None, beneficiary: BitcoinRegtest(WitnessVout(Pay2Vout { method: OpretFirst, address: Wpkh(WPubkeyHash(Array<20>(2c640e65f331d9d012d4467ff617415cc2844cc2))) })), owned_state: Amount(Amount(200)), expiry: None, unknown_query: {} }
keychain 0 .......... keychain 1 .......... keychain 9 ...........transfer txid: "197b2005e5822d831285cca9e406e5f65c82b48db5c7199bb7f272b69dd16a98"
Height: 104
keychain 0 .......... keychain 1 .......... keychain 9 ........... keychain 0 .......... keychain 1 .......... keychain 9 ............ keychain 0 .......... keychain 1 .......... keychain 9 ...........Height: 105
History 1:
Amount Counterparty Witness Id
-200,-Sa none bc:197b2005e5822d831285cca9e406e5f65c82b48db5c7199bb7f272b69dd16a98
Balance 1:
Global:
spec := (ticker=("NIATCKR"), name=("NIA asset name"), details=~, precision=2)
terms := (text=("NIA terms"), media=~)
issuedSupply := (100000)
Owned:
assetOwner:
amount=VccFc, utxo=bc:opret1st:197b2005e5822d831285cca9e406e5f65c82b48db5c7199bb7f272b69dd16a98:1, witness=Some(Bitcoin(Array<32>(197b2005e5822d831285cca9e406e5f65c82b48db5c7199bb7f272b69dd16a98))) # owned by the wallet
amount=Mcdac, utxo=bc:opret1st:c32dd7038dd14b7de4972d1ec16d93a7cb59b3b28af586dc091ff0ea656bf8df:0, witness=None # owner unknown
amount=Sa, utxo=bc:opret1st:197b2005e5822d831285cca9e406e5f65c82b48db5c7199bb7f272b69dd16a98:0, witness=Some(Bitcoin(Array<32>(197b2005e5822d831285cca9e406e5f65c82b48db5c7199bb7f272b69dd16a98))) # owner unknown
Height Amount, ṩ Outpoint
bcrt1q62g5jsuwg3uncu25u22mampvhyague7syggdqy &9/1
105 99996766 197b2005e5822d831285cca9e406e5f65c82b48db5c7199bb7f272b69dd16a98:1
Wallet total balance: 99996766 ṩ
()
History 2:
Amount Counterparty Witness Id
Balance 2:
Global:
spec := (ticker=("NIATCKR"), name=("NIA asset name"), details=~, precision=2)
terms := (text=("NIA terms"), media=~)
issuedSupply := (100000)
Owned:
assetOwner:
amount=Mcdac, utxo=bc:opret1st:c32dd7038dd14b7de4972d1ec16d93a7cb59b3b28af586dc091ff0ea656bf8df:0, witness=None # owner unknown
Height Amount, ṩ Outpoint
bcrt1q93jque0nx8vaqyk5gellv96ptnpggnxztvwygq &9/0
105 2000 197b2005e5822d831285cca9e406e5f65c82b48db5c7199bb7f272b69dd16a98:0
Wallet total balance: 2000 ṩ
()
---- self_transfer_example stdout ----
Starting test: self_transfer_example
starting test services...
waiting for indexer to sync with bitcoind...
wallet dir: "tests/tmp/21563e33"
keychain 0 .......... keychain 1 .......... keychain 9 ..........Wallet created: wlt
Initial amount: 100000
keychain 0 .......... keychain 1 .......... keychain 9 ...........Contract issued - ID: ContractId(Array<32>(053e1566d7b1cb7e043e835dd57b9683563b0e355424ca19d8b788bafd2df411)), Interface type: RGB20Fixed
Amount Counterparty Witness Id
Transfer amount: 300
Invoice created: RgbInvoice { transports: [UnspecifiedMeans], contract: Some(ContractId(Array<32>(053e1566d7b1cb7e043e835dd57b9683563b0e355424ca19d8b788bafd2df411))), iface: Some(TypeName("RGB20Fixed")), operation: None, assignment: None, beneficiary: BitcoinRegtest(WitnessVout(Pay2Vout { method: OpretFirst, address: Wpkh(WPubkeyHash(Array<20>(2bb6bd3344e75ee6eab70dd16fa5c06b3567cbba))) })), owned_state: Amount(Amount(300)), expiry: None, unknown_query: {} }
keychain 0 .......... keychain 1 .......... keychain 9 ...........transfer txid: "a2eee953dbb1794ae6e9cb0c8b47b3c18c1199913e8883ed345c875ed5bb34f8"
Height: 104
keychain 0 .......... keychain 1 .......... keychain 9 ............ keychain 0 .......... keychain 1 .......... keychain 9 ............Height after sync: 105
Final History:
Amount Counterparty Witness Id
Balance:
Global:
spec := (ticker=("NIATCKR"), name=("NIA asset name"), details=~, precision=2)
terms := (text=("NIA terms"), media=~)
issuedSupply := (100000)
Owned:
assetOwner:
amount=Mcdac, utxo=bc:opret1st:dcabd0c11a310ef8a0887a1cc5e83cb6b1b3967dae2bb9f5f0101a3044423c6a:0, witness=None # owner unknown
Height Amount, ṩ Outpoint
bcrt1q9wmt6v6yua0wd64hphgklfwqdv6k0ja60whw06 &9/0
105 2000 a2eee953dbb1794ae6e9cb0c8b47b3c18c1199913e8883ed345c875ed5bb34f8:0
bcrt1q5t6kqnnyzk8cytvedzpdzafher0mrlcxlgkue8 &9/1
105 99996766 a2eee953dbb1794ae6e9cb0c8b47b3c18c1199913e8883ed345c875ed5bb34f8:1
Wallet total balance: 99998766 ṩ
()
This is not an issue of the integration tests so I would move this to https://github.com/RGB-WG/rgb
Closing this in favor of https://github.com/RGB-WG/rgb/issues/252
Description
We've identified two issues with the transaction history recording for RGB asset transfers:
Incomplete transfer records between wallets: When transferring assets from Wallet A to Wallet B, only the sender's (Wallet A) transaction history shows the outgoing transfer. The recipient's (Wallet B) history does not reflect the incoming transfer, despite the assets being successfully received.
Missing self-transfer records: When a wallet transfers assets to itself, neither the outgoing nor the incoming transaction is recorded in the wallet's history. The balance is updated correctly, but there's no trace of the transfer in the transaction history.
Steps to Reproduce
tests/history-missing-bug.rs
(https://github.com/RGB-WG/rgb-integration-tests/pull/3)Expected Behavior
Actual Behavior
Additional Information: