Fix getCommunityVoting (#89)

This commit is contained in:
Szymon Szlachtowicz 2021-07-06 15:34:48 +02:00 committed by GitHub
parent cbd319db3f
commit 167c34a42a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 6 deletions

View File

@ -16,7 +16,7 @@ interface EnvConfigs {
const contracts = { const contracts = {
3: { 3: {
votingContract: '0xF8739d0dDC51aCC421808b6b887f4A34bEB92960', votingContract: '0x942C8248d14c20b9E79d7A60178B5b17Dd7186c3',
}, },
} }

View File

@ -51,8 +51,6 @@ contract MockContract {
uint256 roomNumber uint256 roomNumber
) )
{ {
require(communityVotingId[publicKey] > 0, 'vote not found');
require(votingRoomMap[communityVotingId[publicKey]].endAt > block.timestamp, 'vote ended');
startBlock = votingRoomMap[communityVotingId[publicKey]].startBlock; startBlock = votingRoomMap[communityVotingId[publicKey]].startBlock;
endAt = votingRoomMap[communityVotingId[publicKey]].endAt; endAt = votingRoomMap[communityVotingId[publicKey]].endAt;
voteType = votingRoomMap[communityVotingId[publicKey]].voteType; voteType = votingRoomMap[communityVotingId[publicKey]].voteType;

View File

@ -186,10 +186,7 @@ describe('Contract', () => {
BigNumber.from(1), BigNumber.from(1),
]) ])
await expect(contract.getCommunityVoting(secondAddress.address)).to.be.revertedWith('vote not found')
await provider.send('evm_mine', [Math.floor(Date.now() + 10000)]) await provider.send('evm_mine', [Math.floor(Date.now() + 10000)])
await expect(contract.getCommunityVoting(firstAddress.address)).to.be.revertedWith('vote ended')
await contract.initializeVotingRoom(1, secondAddress.address) await contract.initializeVotingRoom(1, secondAddress.address)
expect((await contract.getCommunityVoting(secondAddress.address)).slice(2)).to.deep.eq([ expect((await contract.getCommunityVoting(secondAddress.address)).slice(2)).to.deep.eq([
1, 1,