File tree Expand file tree Collapse file tree
contract/AElf.Contracts.Vote
AElf.Contracts.Election.Tests/BVT
AElf.Contracts.Profit.Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,9 +108,9 @@ public override Empty Vote(VoteInput input)
108108 if ( existingRecord != null )
109109 {
110110 Assert ( input . IsChangeTarget , "VoteId already exists." ) ;
111- Assert ( existingRecord . IsWithdrawn , "VoteId already exists." ) ;
112- Assert ( existingRecord . VotingItemId == input . VotingItemId , "VoteId already exists ." ) ;
113- Assert ( existingRecord . Voter == input . Voter , "VoteId already exists ." ) ;
111+ Assert ( existingRecord . IsWithdrawn , "VoteId already exists and not withdrawn ." ) ;
112+ Assert ( existingRecord . VotingItemId == input . VotingItemId , "VoteId belongs to a different voting item ." ) ;
113+ Assert ( existingRecord . Voter == input . Voter , "VoteId belongs to a different voter ." ) ;
114114 }
115115
116116 var votingRecord = new VotingRecord
Original file line number Diff line number Diff line change @@ -1301,9 +1301,10 @@ public async Task ElectionContract_Withdraw_Succeeds_When_Delegated_VoteId_Colli
13011301 recordAfterRejectedCollision . Option . ShouldBe ( candidatePubkey ) ;
13021302 recordAfterRejectedCollision . IsWithdrawn . ShouldBeFalse ( ) ;
13031303
1304- BlockTimeProvider . SetBlockTime ( recordAfterRejectedCollision . VoteTimestamp . AddSeconds ( lockTime + 1 ) ) ;
1304+ BlockTimeProvider . SetBlockTime ( recordAfterRejectedCollision . VoteTimestamp . AddSeconds ( lockTime + 1000 ) ) ;
13051305
13061306 var withdrawResult = await WithdrawVotes ( voterKeyPair , voteId ) ;
1307+ withdrawResult . Error . ShouldBeEmpty ( ) ;
13071308 withdrawResult . Status . ShouldBe ( TransactionResultStatus . Mined ) ;
13081309
13091310 var electorVote = await ElectionContractStub . GetElectorVoteWithAllRecords . CallAsync ( new StringValue
Original file line number Diff line number Diff line change 22using System . Threading . Tasks ;
33using AElf . Contracts . MultiToken ;
44using AElf . CSharp . Core ;
5+ using AElf . CSharp . Core . Extension ;
6+ using AElf . Kernel ;
57using AElf . Types ;
68using Google . Protobuf . WellKnownTypes ;
79using Shouldly ;
@@ -1950,7 +1952,7 @@ await TokenContractStub.Create.SendAsync(new CreateInput
19501952 { "__seed_owned_symbol" , symbol } ,
19511953 {
19521954 "__seed_exp_time" ,
1953- Timestamp . FromDateTime ( global :: System . DateTime . UtcNow . AddDays ( 1 ) ) . Seconds . ToString ( )
1955+ TimestampHelper . GetUtcNow ( ) . AddHours ( 1 ) . Seconds . ToString ( )
19541956 }
19551957 }
19561958 } ,
You can’t perform that action at this time.
0 commit comments