1 package civitas.common.mix.hashrevelation;
2
3 import org.springframework.beans.factory.annotation.Autowired;
4 import org.springframework.stereotype.Controller;
5
6 import civitas.common.CommonConstants;
7 import civitas.common.election.ElectionDetails;
8 import civitas.common.election.GetBlockName;
9
10 @Controller
11 public class GetMetaForMixHashRevelation implements CommonConstants {
12
13 @Autowired
14 GetBlockName getBlockName;
15
16 public String apply(
17 final ElectionDetails electionDetails, final boolean isVoteMix, final int block, final int tellerIndex) {
18 String blockDesc = getBlockName.apply(electionDetails, block);
19 return MIX_HASH_REVELATION_META_PREFIX
20 + (isVoteMix ? MIX_HASH_REVELATION_META_VOTE_REVELATION : MIX_HASH_REVELATION_META_ER_REVELATION)
21 + ":" + blockDesc + ":" + tellerIndex;
22 }
23 }