Skip to content

Commit

Permalink
Merge pull request #2 from ethereum/develop
Browse files Browse the repository at this point in the history
Recipients display optimistically through challenge period
  • Loading branch information
daodesigner authored Dec 13, 2021
2 parents 04bd3fe + d1618b8 commit 4e3d9c3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 28 deletions.
27 changes: 0 additions & 27 deletions vue-app/src/api/recipient-registry-optimistic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,16 +352,6 @@ export async function getProjects(

const recipients = data.recipients

const registry = new Contract(
registryAddress,
OptimisticRecipientRegistry,
provider
)
const now = DateTime.now().toSeconds()
const challengePeriodDuration = (
await registry.challengePeriodDuration()
).toNumber()

const projects: Project[] = recipients
.map((recipient) => {
let project
Expand All @@ -372,10 +362,6 @@ export async function getProjects(
}

const submissionTime = Number(recipient.submissionTime)
if (submissionTime + challengePeriodDuration >= now) {
// Challenge period is not over yet
return
}

if (recipient.rejected) {
return
Expand Down Expand Up @@ -422,15 +408,6 @@ export async function getProject(
if (!isHexString(recipientId, 32)) {
return null
}
const registry = new Contract(
registryAddress,
OptimisticRecipientRegistry,
provider
)
const now = DateTime.now().toSeconds()
const challengePeriodDuration = (
await registry.challengePeriodDuration()
).toNumber()

const data = await sdk.GetProject({
registryAddress: registryAddress.toLowerCase(),
Expand All @@ -451,10 +428,6 @@ export async function getProject(
// Invalid metadata
return null
}
if (project.extra.submissionTime + challengePeriodDuration >= now) {
// Challenge period is not over yet
return null
}

const requestType = Number(recipient.requestType)
if (requestType === RequestTypeCode.Registration) {
Expand Down
2 changes: 1 addition & 1 deletion vue-app/src/components/RecipientSubmissionWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export default class RecipientSubmissionWidget extends Vue {
currentUser
) {
try {
if (DateTime.now() >= currentRound.votingDeadline) {
if (currentRound && DateTime.now() >= currentRound.votingDeadline) {
this.$router.push({
name: 'join',
})
Expand Down

0 comments on commit 4e3d9c3

Please sign in to comment.