Пример #1
0
 public PollViewModel(Poll poll, IPollResultExecutor executor)
 {
     this.IsPending  = poll.IsPending;
     this.IsExecuted = poll.IsExecuted;
     this.Id         = poll.Id;
     this.PollVotedInFavorBlockData = poll.PollVotedInFavorBlockData;
     this.PollStartBlockData        = poll.PollStartBlockData;
     this.PollExecutedBlockData     = poll.PollExecutedBlockData;
     this.PubKeysHexVotedInFavor    = poll.PubKeysHexVotedInFavor;
     this.VotingDataString          = executor.ConvertToString(poll.VotingData);
 }
Пример #2
0
 public PollViewModel(Poll poll, IPollResultExecutor executor)
 {
     this.IsPending  = poll.IsPending;
     this.IsExecuted = poll.IsExecuted;
     this.Id         = poll.Id;
     this.PollVotedInFavorBlockDataHash   = poll.PollVotedInFavorBlockData?.Hash;
     this.PollVotedInFavorBlockDataHeight = poll.PollVotedInFavorBlockData?.Height;
     this.PollStartBlockDataHash          = poll.PollStartBlockData?.Hash;
     this.PollStartBlockDataHeight        = poll.PollStartBlockData?.Height;
     this.PollExecutedBlockDataHash       = poll.PollExecutedBlockData?.Hash;
     this.PollExecutedBlockDataHeight     = poll.PollExecutedBlockData?.Height;
     this.PubKeysHexVotedInFavor          = poll.PubKeysHexVotedInFavor.Select(v => v.PubKey).ToList();
     this.VotingDataString = executor.ConvertToString(poll.VotingData);
 }