Skip to content

Conversation

@mzyau
Copy link
Collaborator

@mzyau mzyau commented Mar 1, 2021

No description provided.

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

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