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

36 bounty done multiple claims #3

Open
wants to merge 22 commits into
base: 36-bounty-done
Choose a base branch
from

Conversation

swfsql
Copy link

@swfsql swfsql commented Nov 18, 2021

In case that multiple claims are to be allowed, by the same user on the same bounty, this shows a possibility on how to allow a user to set the a bounty's claim to "done".

mikedotexe and others added 21 commits July 4, 2021 17:30
* add nft test file

* make folder for test-nft

* Added test-nft to build

* Use prerelease near-sdk that supports NFTs and paste in example contract

* begin upgrading code to v4

* Use AccountId instead of VerifiedAccountId, and use new str logs

* Upgrade gas to use gas struct

* Convert token id to str for comparison

* Using safe versions of blockchain api

* finished types.rs

* change dereference to clone

* everything is building

* start updating tests and update test-token

* Update all dependencies to near-sdk v4

* All packages upgraded to near-sdk 4.0.0-pre.2

* Tests are building, but failing

* All build errors including building tests resolved. Now to fix logic bugs from tests

* fixed some small issues

* Use Gas() syntax instead of Gas{}

* removed fromstr, changed token_id to accept a string

* removed unneeded line

* remove unnecessary mocked_blockchain

* update unsafe code

* All tests passing!

* delete test-nft

* remove to_va()

* PR changes

* remove unncessary testing macro
Fix compilation error that occurs with the latest version of near-sdk
…-test-test_create_dao_and_use_token

Fix sputnikdao2 test
…orkflows-pr

add pull_request to GitHub workflows
…rnings

Remove unused imports that generate compilation warnings
* Related to near-daos#29
* Allows user to call bounty_done on multiple claims on the same bounty.
* Removes the bounty on it's last payout.
  * I believe this fixes near-daos#19
* Add tests on various bounty errors.
@@ -82,7 +85,7 @@ impl Contract {
format!("Bounty {} payout", id),
None,
);
if bounty.times == 0 {
if bounty.times <= 1 {
Copy link
Author

Choose a reason for hiding this comment

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

I believe this change allows the bounty "done" proposal to be cleared up, and thus that proposal's bond to be returned

…-bounty-done-multiple-claims

* merged near-daos#28.
  * kept the fix on claim clearing.
  * claims checks added on tests.
  * but also kept the possibility of multiple claims by the same user.
}

#[test]
fn test_bounty_general2() {
Copy link
Author

Choose a reason for hiding this comment

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

This is the testing on multiple claims on the same bounty by the same user

}

#[test]
fn test_bounty_general() {
Copy link
Author

Choose a reason for hiding this comment

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

This tests various errors and also normal functioning on a bounty.

@swfsql swfsql mentioned this pull request Nov 19, 2021
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.

5 participants