-
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 #314 from hypha-dao/feature/run_action_stubs
Feature/run action stubs
- Loading branch information
Showing
3 changed files
with
39 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import 'package:hypha_wallet/core/crypto/seeds_esr/eos_action.dart'; | ||
|
||
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'; | ||
} | ||
return EOSAction() | ||
..account = daoContract | ||
..name = 'vote' | ||
..data = { | ||
'voter': voter, | ||
'proposal_id': proposalId, | ||
'vote': vote, | ||
}; | ||
} | ||
} |
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