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

feat: automatically expand the relevant address in the tx summary #993

Conversation

panteleymonchuk
Copy link
Collaborator

Description of change

Open transaction details
fixes #982.

Type of change

  • Bug fix (a non-breaking change which fixes an issue)

How the change has been tested

  1. Open page http://localhost:3000/testnet/transaction/0x363bdf69fd60a973d02d5eced642f86af3ced4b2c65d7b5d66f899baec4adedd
  2. take a look block 'Payload'

Make sure to provide instructions for the maintainer as well as any relevant configurations.

Change checklist

Add an x to the boxes that are relevant to your changes, and delete any items that are not.

  • My code follows the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • [] I have made corresponding changes to the documentation
  • [] I have added tests that prove my fix is effective or that my feature works
  • [] New and existing unit tests pass locally with my changes

Signed-off-by: Eugene Panteleymonchuk <[email protected]>
Signed-off-by: Eugene Panteleymonchuk <[email protected]>
Signed-off-by: Eugene Panteleymonchuk <[email protected]>
Signed-off-by: Eugene Panteleymonchuk <[email protected]>
Signed-off-by: Eugene Panteleymonchuk <[email protected]>
@panteleymonchuk panteleymonchuk marked this pull request as ready for review January 23, 2024 15:47
Signed-off-by: Eugene Panteleymonchuk <[email protected]>
const history = useHistory();
const { tokenInfo } = useContext(NetworkContext);
const [isExpanded, setIsExpanded] = useState(false);
const [isExpanded, setIsExpanded] = useState(isPreExpanded ?? true);
Copy link
Member

Choose a reason for hiding this comment

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

the basic output doesnt look expanded by default, we should expand all the outputs to see at first glance what is the address that spent it for inputs, and where they got sent for the output part
image

Copy link
Member

Choose a reason for hiding this comment

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

it should look like this
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hmm, it was expanded. I'll doublecheck it.

(cond) => cond.type === UnlockConditionType.Expiration,
) as ExpirationUnlockCondition;
const isExpirationConditionPresent = !!expirationUnlockCondition;
const isExpirationConditionExpired =
Copy link
Member

Choose a reason for hiding this comment

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

this logic is not working, this output 0x4bd228a6f865de501c1a4c55990d968de1ea958c74852860f66e2befabd74cdb0000 was spent by the return address unlock condition, not the address unlock condition, because the output was spent after the time expired

Copy link
Member

Choose a reason for hiding this comment

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

I feel like we should distinguish between the outputs in the input part, and the outputs in the output part of the tx,

For the inputs, we need to check if the output was spent before or after the expiration time, it should not be checked against "now", but when the output was spent
For the outputs, i feel like we could for now always expand the address unlock condition and call it a day, at least for now

@panteleymonchuk panteleymonchuk marked this pull request as draft January 24, 2024 10:05
@panteleymonchuk panteleymonchuk marked this pull request as ready for review January 29, 2024 15:09
Signed-off-by: Eugene Panteleymonchuk <[email protected]>
Signed-off-by: Eugene Panteleymonchuk <[email protected]>
Signed-off-by: Eugene Panteleymonchuk <[email protected]>
@begonaalvarezd
Copy link
Member

superseeded by #1027

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Automatically expand the relevant address in the tx summary
2 participants