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

Is it possible to use transaction list command to scan all the deck's transactions? #158

Closed
buhtignew opened this issue Jul 16, 2024 · 9 comments
Labels
question Further information is requested

Comments

@buhtignew
Copy link
Collaborator

buhtignew commented Jul 16, 2024

I don't remember whether we've already spoken about but I'd like to ask you whether there is any combination of flags in transaction list command to scan all the transactions of a deck.

I'm asking because during my tests I've experienced that it's a kind of difficult to get that info.

For instance for the deck efb8c9aa6bdd5d48a711ccfae351d6e7ef2340c439b2cde7aa711d9047ddaf18 mentioned here I'm not able to see the burn transactions that are already claimed, since if I launch transaction list efb8c9aa6bdd5d48a711ccfae351d6e7ef2340c439b2cde7aa711d9047ddaf18 -x -g -f 489999 I'm getting the following output:

Starting at block: 489999
Ending at block: 491716
{
    'txid': 'a45563c27360f25637f0cc12ca4d4d9b44849656ac3f56ce37125f220aa77331',
    'inputs': [
        {'sender': ['n3MtPoPaAREU5GEhAErBPuju83bVog2opz'], 'value': 0.01},
        {'sender': ['n3MtPoPaAREU5GEhAErBPuju83bVog2opz'], 'value': 115.32}
    ],
    'outputs': [
        {'receivers': ['mmSLiMCoinTestnetBurnAddress1XU5fu'], 'value': 1.0},
        {'receivers': ['mx5MdsenFDZufFuwT9ND7BKQBzS4Hy9YUP'], 'value': 114.32}
    ],
    'blockheight': 490768
}
{
    'txid': '7327b93a674b843b5551e460fdc6fdf71876155a4f363b3d1d86671c906028e0',
    'inputs': [
        {'sender': ['n3MtPoPaAREU5GEhAErBPuju83bVog2opz'], 'value': 0.01},
        {'sender': ['n3MtPoPaAREU5GEhAErBPuju83bVog2opz'], 'value': 7.0}
    ],
    'outputs': [
        {'receivers': ['mmSLiMCoinTestnetBurnAddress1XU5fu'], 'value': 2.0},
        {'receivers': ['mx5MdsenFDZufFuwT9ND7BKQBzS4Hy9YUP'], 'value': 5.0}
    ],
    'blockheight': 491554
}
{
    'txid': 'bcc8bf6db27a6a2de191ed7f31dddd4dd170eab34688147767961786a88124eb',
    'inputs': [
        {'sender': ['n3MtPoPaAREU5GEhAErBPuju83bVog2opz'], 'value': 25.0}
    ],
    'outputs': [
        {'receivers': ['mmSLiMCoinTestnetBurnAddress1XU5fu'], 'value': 0.1113},
        {'receivers': ['mx5MdsenFDZufFuwT9ND7BKQBzS4Hy9YUP'], 'value': 24.8787}
    ],
    'blockheight': 491555
}
{
    'txid': '71a7283f5915bcc15481b8911137827d54cf09c956b30d7a22bec044e6673ca8',
    'inputs': [
        {'sender': ['n3MtPoPaAREU5GEhAErBPuju83bVog2opz'], 'value': 10.0}
    ],
    'outputs': [
        {'receivers': ['mmSLiMCoinTestnetBurnAddress1XU5fu'], 'value': 1.0},
        {'receivers': ['mx5MdsenFDZufFuwT9ND7BKQBzS4Hy9YUP'], 'value': 8.99}
    ],
    'blockheight': 491555
}
{
    'txid': '0f80484cbb1cfb173975724468f3f7775a949082a41219321f791d825efa6639',
    'inputs': [
        {'sender': ['n3MtPoPaAREU5GEhAErBPuju83bVog2opz'], 'value': 0.01},
        {'sender': ['n3MtPoPaAREU5GEhAErBPuju83bVog2opz'], 'value': 0.01},
        {'sender': ['n3MtPoPaAREU5GEhAErBPuju83bVog2opz'], 'value': 0.01},
        {'sender': ['n3MtPoPaAREU5GEhAErBPuju83bVog2opz'], 'value': 4.96}
    ],
    'outputs': [
        {'receivers': ['mmSLiMCoinTestnetBurnAddress1XU5fu'], 'value': 0.1114},
        {'receivers': ['mx5MdsenFDZufFuwT9ND7BKQBzS4Hy9YUP'], 'value': 4.8686}
    ],
    'blockheight': 491569
}
{
    'txid': '204a5a2a07538a8ef6fa92fb1592c78aefbd6832c3278af897af60bf5f79a046',
    'inputs': [
        {'sender': ['n3MtPoPaAREU5GEhAErBPuju83bVog2opz'], 'value': 0.01},
        {'sender': ['n3MtPoPaAREU5GEhAErBPuju83bVog2opz'], 'value': 30.0}
    ],
    'outputs': [
        {'receivers': ['mmSLiMCoinTestnetBurnAddress1XU5fu'], 'value': 0.111},
        {'receivers': ['mx5MdsenFDZufFuwT9ND7BKQBzS4Hy9YUP'], 'value': 29.889}
    ],
    'blockheight': 491575
}
{
    'txid': '5351ad8a5723456d56e72c4d26eaf936d27eacf4385748da9d5f65946e3a34f8',
    'inputs': [
        {'sender': ['n3MtPoPaAREU5GEhAErBPuju83bVog2opz'], 'value': 10.0}
    ],
    'outputs': [
        {'receivers': ['mmSLiMCoinTestnetBurnAddress1XU5fu'], 'value': 1.1115},
        {'receivers': ['n3MtPoPaAREU5GEhAErBPuju83bVog2opz'], 'value': 8.8785}
    ],
    'blockheight': 491604
}

Which in agreement to this contains the transactions of the deck 1991d3d80c5df0d7c7b90afd4acf67d398cf8868f3a48b7568a96871bcc6f8e7 as well.

While transaction list DECK [ADDRESS] -b -u can't be used without the -u flag.

By other hand token tranfers efb8c9aa6bdd5d48a711ccfae351d6e7ef2340c439b2cde7aa711d9047ddaf18 doesn't list the burn transactions of deck and is essentially providing the same info of the transaction list efb8c9aa6bdd5d48a711ccfae351d6e7ef2340c439b2cde7aa711d9047ddaf18 -c.

Or maybe the burn transactions that has been claimed are to be considered as not making part of a deck?

@buhtignew buhtignew added the question Further information is requested label Jul 16, 2024
@d5000
Copy link

d5000 commented Aug 5, 2024

Or maybe the burn transactions that has been claimed are to be considered as not making part of a deck?

Burn transactions are indeed not "part of the deck", because they are valid for all PoB decks (save those which have limitations by block height), but I agree that it could be useful to see those which are allowed by the deck's limitations, e.g. when the token is limited by block height(s).

I guess you would like a function like transaction list -b DECK without -u? The problem is that I have some complicated branching here, the reason being that I wanted to allow transaction list -b ADDRESS without a deck being given. I have to re-check if this can be changed in a way no new flag is needed.

For now as a workaround, you can see this with transaction list -b DECK ADDRESS.

Edit: Found a solution, addresses can use -o flag, and then -b will work again with DECK and without -u. Will be uploaded with next update.

@d5000
Copy link

d5000 commented Aug 7, 2024

I have changed the policy in the following way:

-o ORIGIN_ADDRESS is the standard way to designate the origin address in the case of -c, -b and -g options. In -c and several cases specified in the help the ORIGIN_ADDRESS can be given as a positional argument like until now, and the -o flag can be omitted.

This allows to use transaction list -b DECK or transaction list -g DECK without the -u flag, to see all burn/gateway transactions valid for the deck.

Commit: df75223

Can be closed if everything works, was pre-tested by me.

@buhtignew
Copy link
Collaborator Author

buhtignew commented Aug 8, 2024

This allows to use transaction list -b DECK

I think you mean transaction list DECK -b here.
At least on my end if I launch transaction list -b efb8c9aa6bdd5d48a711ccfae351d6e7ef2340c439b2cde7aa711d9047ddaf18 I'm not getting results, while in case of the transaction list efb8c9aa6bdd5d48a711ccfae351d6e7ef2340c439b2cde7aa711d9047ddaf18 -b the output makes sense to me.

If so everything seems to work fine on my end.
_
I don't remember whether the -b, the -c, the -g and the -u flags were previously enabled to work with the -w flag as well? (For instance it's ignored if I launch transaction list efb8c9aa6bdd5d48a711ccfae351d6e7ef2340c439b2cde7aa711d9047ddaf18 -w -b -u command on my side.)
If not we should probably mention it in the -w flag description.
_
I'd also like to ask whether in any context it may be useful/meaningful to have the -b, the -c and -u enabled with the -x flag as well, since the -g flag is already enabled.

@d5000
Copy link

d5000 commented Aug 8, 2024

I think you mean transaction list DECK -b here.

Correct. Sorry for the mistake.

I don't remember whether the -b, the -c, the -g and the -u flags were previously enabled to work with the -w flag as well?

Normally yes. -u isn't another usage mode but complements -b and -g.
-b -w works here as expected, without -w it restricts txes to the current address. Same for -g -w. -u worked fine here too, both with -b and -g.
-c shows all claim transactions if alone (without -w or -o) not only from the current address, actually you have to use -o to get results for a specific address. This behavior is a bit unintuitive. I'll think about if this can be changed.

I see however there are still a couple of more problems with this command. For example, I had problems with duplicates. I've written down these issues on a TODO list and will check them during the coming days and then update this issue here.

@d5000 d5000 self-assigned this Aug 9, 2024
@d5000
Copy link

d5000 commented Aug 17, 2024

The duplicates problem was solved in commit efb066d.

This means the issue can now be closed.

@buhtignew
Copy link
Collaborator Author

buhtignew commented Aug 18, 2024

I don't know whether it's relevant, but I have still this question left:

I'd also like to ask whether in any context it may be useful/meaningful to have the -b, the -c and -u enabled with the -x flag as well, since the -g flag is already enabled.

_
Another question: wouldn't it make sense to move the explorer functionalities from the transaction list command into its own category (for instance explorer) or just its own command (like transaction explorer)?
Maybe that would help us reducing the number of flags in transaction list command and make it easier to test and to understand.

@d5000
Copy link

d5000 commented Aug 19, 2024

I'd also like to ask whether in any context it may be useful/meaningful to have the -b, the -c and -u enabled with the -x flag as well, since the -g flag is already enabled.

-b should also be enabled with -x. If it did't work in some context, then it's a bug, so please provide me more info in the case you got that impression.

-u is not enabled, I've already clarified this in the help. It may be a "nice to have" addition but it is not a quick-and-easy fix, it has the same complexity as supporting -c. In addition, users should normally use the functions without -x and only if in doubt about the wallet integrity use -x. Burn transactions and gateway transactions of any deck initialized (with P2TH address imported to the wallet) are always part of the wallet transactions if everything works.

-c can be supported perhaps once the token transfers command (which uses similar functions) supports the -x mode but is also not really important, I think.

wouldn't it make sense to move the explorer functionalities from the transaction list

No. As I wrote elsewhere there is at least one other command where I would like to provide the explorer function as well (token transfers). In addition, I spent a lot of work making several flags of this command available for the -x mode.

@buhtignew
Copy link
Collaborator Author

buhtignew commented Aug 19, 2024

-b should also be enabled with -x. If it did't work in some context, then it's a bug, so please provide me more info in the case you got that impression.

I haven't checked it yet, because my explorer functionality tests are stuck until #135 is solved.
I've asked because I've seen pacli transaction list DECK -x -g [-o ORIGIN_ADDRESS] [-f STARTHEIGHT] [-e ENDHEIGHT] Usage mode in the help but there is no -b flag mention. So I was not sure the -b flag is usable in that context.

@d5000
Copy link

d5000 commented Aug 19, 2024

I added the -b -x variant to the help.

Will be soon pushed. I have made some changes to transaction list today but will open a new issue for it.

Edit: Pushed. Can be closed now.

@d5000 d5000 removed their assignment Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants