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

chore: backend fixes #7725

Merged
merged 1 commit into from
Oct 21, 2020
Merged

chore: backend fixes #7725

merged 1 commit into from
Oct 21, 2020

Conversation

thelostone-mc
Copy link
Member

Description
  • add check to ensure txn is not older than 5 min
  • ensure contirbution mail is sent only after txn is validated
  • removed address as a mandatory param on the backend
  • set deploy_tx_id default to 0x0

- ensure contirbution mail is sent only after txn is validated
- removed address as a mandatory param on the backend
- set deploy_tx_id default to 0x0
@@ -1173,7 +1173,8 @@ def create_contribution(self, tx_id):
self.save()
grant.updateActiveSubscriptions()
grant.save()
successful_contribution(self.grant, self, contribution)
Copy link
Member Author

Choose a reason for hiding this comment

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

@mds1 / @octavioamu this is what always causes the mail to be sent asap !
For cross chain flows it will happen only after txn is validated
For eth -> we will have to shift this to the celery task which does the validation

process_grant_contribution can do this in follow up PR after running it with team

@@ -73,6 +77,19 @@ def get_zcash_txn_status(txnid):
return None


def is_txn_done_recently(time_of_txn):
Copy link
Member Author

Choose a reason for hiding this comment

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

this check ensures that the txn was signed within 5 hours of submission on the Contribution record being created

'message': 'error: tx_id is mandatory param'
})
continue
# tx_id = contribution.get('tx_id', None)
Copy link
Member Author

Choose a reason for hiding this comment

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

made this not mandatory as other cross chains might not be able to provide tx_id , commented out in case if want to keep this for some reason

Copy link
Contributor

Choose a reason for hiding this comment

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

Good call - do you want to add a quick comment in the code explaining it?

Copy link
Member Author

Choose a reason for hiding this comment

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

will add it in a follow up commit 🙌

@thelostone-mc thelostone-mc merged commit ae2ed9c into zcash Oct 21, 2020
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.

3 participants