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

fix: correct validation for trust relationship request #476

Merged
merged 2 commits into from
Sep 17, 2024

Conversation

pranavkparti
Copy link
Collaborator

Description

Fixed validation while creating new trust relationship request.

  • Subwallet cannot send request to its own parent

What kind of change(s) does this PR introduce?

  • Enhancement
  • Bug fix
  • Refactor

Please check if the PR fulfils these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Breaking change

Does this PR introduce a breaking change?
No

Other useful information

None

@pranavkparti pranavkparti requested a review from Kpoke July 30, 2024 05:10
@Kpoke
Copy link
Collaborator

Kpoke commented Jul 30, 2024

Can you fix the tests? @pranavkparti

@pranavkparti
Copy link
Collaborator Author

pranavkparti commented Jul 30, 2024

Can you fix the tests? @pranavkparti

It seems to be some issue with the workflow itself. @samwel141 's PR also fails with the same errors.

Run actions/checkout@v2

Post job cleanup.
/usr/bin/docker exec  a908f88d1a9d977836040a6fbc79b4ca4713346959f0061826b921428e5c4caa sh -c "cat /etc/*release | grep ^ID"
/__e/node20/bin/node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by /__e/node20/bin/node)
/__e/node20/bin/node: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /__e/node20/bin/node)
/__e/node20/bin/node: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /__e/node20/bin/node)
/__e/node20/bin/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /__e/node20/bin/node)
/__e/node20/bin/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /__e/node20/bin/node)

// originating wallet doesn't need to send requests to a sub wallet it manages
if (hasControlOverTarget) {
if (actorHasControlOverTarget) {
Copy link
Collaborator

@Kpoke Kpoke Sep 3, 2024

Choose a reason for hiding this comment

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

Why was this replaced with actorHasControlOverTarget? @pranavkparti

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

O = Originator, A = Actor, T = Target

By the time the code reaches here, the check is made that O != A && O != T && O has control over both A and T. Meaning that A and T are subwallets of O, and an error displays if it is true.

Next a check is made that A has control over T. This is to deal with the case if A = O, and has control over T. Meaning T (requestee) is already managed by A (requester).

Next, the last check is made that T = O. Meaning that A is a subwallet of O, and target is the originating wallet. Meaning T (requestee) already manages A (requester).

@Kpoke The checks are mainly for displaying specific and appropriate error messages.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay noted. That's fine. I just wanted to confirm

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you pull the latest changes I made to your PR? It'll enable the PR github action run

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@Kpoke Done, thank you

@Kpoke Kpoke merged commit ca76b97 into Greenstand:master Sep 17, 2024
1 check passed
Copy link

github-actions bot commented Oct 8, 2024

🎉 This PR is included in version 1.40.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants