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/wallet upgrades #175

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

Conversation

mzyau
Copy link
Collaborator

@mzyau mzyau commented Mar 1, 2021

No description provided.

@@ -414,7 +414,7 @@ class Wallet{
if(
trustRelationship.actor_wallet_id === senderWallet.getId() &&
trustRelationship.target_wallet_id === receiveWallet.getId() &&
trustRelationship.request_type === TrustRelationship.ENTITY_TRUST_REQUEST_TYPE.send
trustRelationship.request_type === trustType
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This hasTrust method in wallet model was not actually referencing the trustType parameter sent in, so I changed it to be more flexible to reuse for checking other request types

@@ -274,9 +274,9 @@ describe("Wallet", () => {
target_wallet_id: wallet.getId(),
}]);
const result = await wallet.hasTrust(
TrustRelationship.ENTITY_TRUST_TYPE.send,
wallet,
TrustRelationship.ENTITY_TRUST_REQUEST_TYPE.receive,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As a result of my change on hasTrust method referencing the trust type parameter now, I also think this test should expect a "receive" request type (should not be sending an entity trust type). Since wallet2 (actor, receiver) is sending a receive request to wallet (target, sender).

@dadiorchen
Copy link
Collaborator

  const queryWallet = await walletService.getByIdOrName(req.query.wallet);

https://github.com/mzyau/treetracker-token-trading-api/blob/9737e3674e5e998b02b9cbb3fd3ee0cd7b844686/server/routes/trustRouter.js#L44

@mzyau I think we also need to mock this

@ZavenArra
Copy link
Contributor

@dadiorchen Can you fix this for @mzyau as an example?

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