Skip to content

Commit

Permalink
Integrate hooks (#4)
Browse files Browse the repository at this point in the history
* add hook functions

* dissolve hook

* add hooks

* dissolve

* update tests

* proposal status

* Apply suggestions from code review

Co-authored-by: Robert Zaremba <robert@zaremba.ch>

* update and tests

* add role support, add unit tests

* update integration tests

* fix

* Apply suggestions from code review

Co-authored-by: Robert Zaremba <robert@zaremba.ch>
Co-authored-by: sczembor <43810037+sczembor@users.noreply.github.com>

* changes

* add docs about roles

* house policy

* add whole flow test

* lint

* updates

* move to common

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Robert Zaremba <robert@zaremba.ch>

* few changes

* Apply suggestions from code review

Co-authored-by: Robert Zaremba <robert@zaremba.ch>

* add test

* Update astra/src/lib.rs

* Apply suggestions from code review

Co-authored-by: Robert Zaremba <robert@zaremba.ch>

* update

* rename to _hook

* add fix

---------

Co-authored-by: Robert Zaremba <robert@zaremba.ch>
Co-authored-by: sczembor <43810037+sczembor@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 20, 2023
1 parent 8a5f38b commit c5fac1d
Show file tree
Hide file tree
Showing 10 changed files with 324 additions and 9 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ near view $ASTRA_ID get_policy

- A role with: `["*:*"]` has _unlimited_ permission. Normally, the `council` role has `*:*` as its permission so they can perform _any_ vote action on _any_ kind of proposal.

- A role with: `"VetoProposal"` or `"Dissolve"` can perform veto proposal and dissolve DAO actions.

**Here is a list of actions:**

- `AddProposal` - _Adds given proposal to the DAO (this is the primary mechanism for getting things done)._
Expand All @@ -235,6 +237,8 @@ near view $ASTRA_ID get_policy
- `VoteRemove` - _Votes to remove given proposal or bounty (this may be because the proposal is spam or otherwise invalid)._
- `Finalize` - _Finalizes proposal which is cancelled when proposal has expired (this action also returns funds)._
- `MoveToHub` - _Moves a proposal to the hub (this is used to move a proposal into another DAO)._
- `VetoProposal` - Veto a proposal. Veto is instant, it will `reject` the proposal and return bond.
- `Dissolve` - Dissolve this DAO: remove all members of the DAO, and sending the remaining funds back to the trust.

---

Expand Down
3 changes: 3 additions & 0 deletions astra/src/bounties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ mod tests {

use crate::proposals::{ProposalInput, ProposalKind};
use crate::{Action, Config};
use crate::test_utils::ndc_trust;

use super::*;

Expand Down Expand Up @@ -240,6 +241,7 @@ mod tests {
let mut contract = Contract::new(
Config::test_config(),
VersionedPolicy::Default(vec![accounts(1)]),
ndc_trust()
);
add_bounty(&mut context, &mut contract, 2);

Expand Down Expand Up @@ -303,6 +305,7 @@ mod tests {
let mut contract = Contract::new(
Config::test_config(),
VersionedPolicy::Default(vec![accounts(1)]),
ndc_trust()
);
let id = add_bounty(&mut context, &mut contract, 1);
contract.bounty_claim(id, U64::from(500));
Expand Down
Loading

0 comments on commit c5fac1d

Please sign in to comment.