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

🔨 Updating state.ts to deprecate existing precondition apis and updating them with new #1263

Merged
merged 4 commits into from
Nov 22, 2023

Conversation

LuffySama-Dev
Copy link
Contributor

Hi @mitschabaude ,
As discussed in issue #1247 , I have replaced old api by deprecating them rather than removing.
Question:

Do we need to update this assertStatePrecondition too ?

Please review and let know if any changes are required.

As discussed in issue o1-labs#1247 , I have replaced old api by deprecating them rather than removing. 
Question:

Do we need to update this `assertStatePrecondition` too ?


Please review and let know if anything else is required.
Copy link
Collaborator

@mitschabaude mitschabaude left a comment

Choose a reason for hiding this comment

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

Very nice! If you're up for it, two things are needed as a follow-up (feel free to do this in a later PR)

  • update /src/examples - maybe grep for .getAndAssertEquals etc, check if it's now deprecated and replace with require version
  • add an entry to CHANGELOG.md (under ## Changed) about this change

src/lib/state.ts Outdated
Comment on lines 235 to 236
assertEquals(state: T) {
if (this._contract === undefined)
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be nice if you could get rid of the code duplication, by making the assert* methods just call the require* versions. Something like

assertEquals(state: T) {
   return this.requireEquals(state);
}

etc

Copy link
Contributor Author

@LuffySama-Dev LuffySama-Dev Nov 22, 2023

Choose a reason for hiding this comment

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

Hi @mitschabaude ,

As discussed above I have removed the duplicate code by making assert* call the require* version.
Please let me know if any change is required.

Thank You 😃

@LuffySama-Dev
Copy link
Contributor Author

Hi @mitschabaude ,

As discussed above I have removed the duplicate code by making assert* call the require* version.
As well as built the project locally and adding screenshots of it for your reference.

State_ts_deprecated
State_ts_deprecated_01

Also, I am making changes to CHANGELOG.md for first time so can you please help to review it. I have added change in Unreleased for now. Let me know if we need move it.

Please let me know if any change is required.

Thank You 😃

CHANGELOG.md Outdated Show resolved Hide resolved
@mitschabaude mitschabaude merged commit 036a99e into o1-labs:main Nov 22, 2023
13 checks passed
@mitschabaude mitschabaude mentioned this pull request Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants