-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #343 from hypha-dao/feat/handle-vote-casting
feat: handle vote casting
- Loading branch information
Showing
10 changed files
with
327 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,17 @@ | ||
import 'package:hypha_wallet/core/crypto/seeds_esr/eos_action.dart'; | ||
import 'package:hypha_wallet/core/network/models/vote_model.dart'; | ||
|
||
class Voteactionfactory { | ||
class VoteActionFactory { | ||
// Vote action | ||
// Note: Don't hard-code the dao contract since it's different on different networks | ||
// get daoContract by calling | ||
// final daoContract = remoteConfigService.daoContract(network: network); | ||
// | ||
static EOSAction voteAction(String daoContract, String voter, int proposalId, String vote) { | ||
if (vote != 'pass' && vote != 'fail') { | ||
throw 'vote needs to be one of pass or fail'; | ||
} | ||
static EOSAction voteAction(String daoContract, String voter, String proposalId, VoteStatus vote) { | ||
return EOSAction() | ||
..account = daoContract | ||
..name = 'vote' | ||
..data = { | ||
'voter': voter, | ||
'proposal_id': proposalId, | ||
'vote': vote, | ||
'vote': vote.name, | ||
'notes': '' | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 34 additions & 5 deletions
39
lib/ui/proposals/details/interactor/proposal_detail_bloc.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.