Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove maci-start-block and modify related codes #121

Merged
merged 1 commit into from
May 24, 2024

Conversation

kittybest
Copy link

@kittybest kittybest commented May 22, 2024

Description

  • remove NEXT_PUBIC_MACI_START_BLOCK in environment variables and config files
  • store deployment transaction hash while registering contract
  • MaciService.getMaciData would return { maciAddress, maciStartBlock }
  • maci context would read start block from the returned maci data

Related Issue
close issue #115

@kittybest kittybest added the chore Chore tasks label May 22, 2024
@kittybest kittybest self-assigned this May 22, 2024
Copy link

vercel bot commented May 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
maci-rpgf ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 24, 2024 6:42pm

@crisgarner
Copy link

Using the service, assumes that we won't deploy MACI in another way right? As we removed the MACI Address

@kittybest
Copy link
Author

Using the service, assumes that we won't deploy MACI in another way right? As we removed the MACI Address

Yes, I think so, but the user could also input existing maci address and register it, this is an opened issue: #112

expect(maciAddress).toBe(ZeroAddress);
const maciData = await service.getMaciData();
expect(maciData.address).toBe(ZeroAddress);
expect(maciData.startBlock).toBe(0);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually not sure how to test this case, since the outputs are all mocked? or we just wanna make sure it does call those functions?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can mock it with different data and test it. For instance, if there is no provider or transaction hash.

Copy link
Collaborator

@0xmad 0xmad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kittybest thanks, just left some comments

src/services/maci/service.ts Outdated Show resolved Hide resolved
expect(maciAddress).toBe(ZeroAddress);
const maciData = await service.getMaciData();
expect(maciData.address).toBe(ZeroAddress);
expect(maciData.startBlock).toBe(0);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can mock it with different data and test it. For instance, if there is no provider or transaction hash.

Copy link
Collaborator

@0xmad 0xmad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kittybest thanks!

@kittybest kittybest merged commit c35b480 into feat/deployment-service May 24, 2024
2 checks passed
@kittybest kittybest deleted the chore/remove-maci-start-block branch May 24, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Chore tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants