-
Notifications
You must be signed in to change notification settings - Fork 11
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
New runtime lifecycle contracts API & Initial Account Deposits (runtime v1.0.0) #188
Conversation
Warning Rate Limit Exceeded@nhenin has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 16 minutes and 0 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. WalkthroughThis update revolutionizes the runtime lifecycle, introducing initial account deposits for streamlined contract creation and a new Contract API for smarter contract management. These changes enhance developer control, streamline interfaces, and boost the efficiency of smart contract operations. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
fa8def4
to
fb7ef61
Compare
fb7ef61
to
dd24739
Compare
5751458
to
ba14e9c
Compare
ba14e9c
to
93e516a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 7
Out of diff range and nitpick comments (2)
changelog.d/20240511_113958_nicolas.henin_runtime_lifecycle_refactor.md (1)
5-5
: Consider adding the article "the" before "account setup process" for grammatical correctness.packages/runtime/client/rest/src/index.ts (1)
239-239
: Consider enhancing the error message for thestrict
parameter to be more informative, e.g., "Expected 'strict' to be a boolean value."
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (31)
- changelog.d/20240511_113958_nicolas.henin_runtime_lifecycle_refactor.md (1 hunks)
- examples/nodejs/src/experimental-features/source-map.ts (3 hunks)
- examples/nodejs/src/marlowe-object-flow.ts (4 hunks)
- examples/rest-client-flow/index.html (4 hunks)
- packages/adapter/src/io-ts.ts (2 hunks)
- packages/adapter/src/time.ts (1 hunks)
- packages/language/core/v1/src/index.ts (1 hunks)
- packages/language/core/v1/src/semantics.ts (2 hunks)
- packages/language/examples/src/atomicSwap.ts (12 hunks)
- packages/language/examples/test/atomicSwap.spec.ts (13 hunks)
- packages/language/specification-client/src/main.ts (2 hunks)
- packages/runtime/client/rest/src/contract/endpoints/collection.ts (4 hunks)
- packages/runtime/client/rest/src/index.ts (4 hunks)
- packages/runtime/client/rest/src/runtime/version.ts (1 hunks)
- packages/runtime/core/src/asset/index.ts (3 hunks)
- packages/runtime/core/src/contract/accountDeposits.ts (1 hunks)
- packages/runtime/core/src/index.ts (1 hunks)
- packages/runtime/core/src/payout/index.ts (3 hunks)
- packages/runtime/lifecycle/src/browser/index.ts (3 hunks)
- packages/runtime/lifecycle/src/generic/applicable-actions.ts (22 hunks)
- packages/runtime/lifecycle/src/generic/contracts.ts (6 hunks)
- packages/runtime/lifecycle/src/generic/new-contract-api.ts (1 hunks)
- packages/runtime/lifecycle/src/index.ts (2 hunks)
- packages/runtime/lifecycle/src/nodejs/index.ts (1 hunks)
- packages/runtime/lifecycle/test/examples/swap.ada.token.e2e.spec.ts (5 hunks)
- packages/runtime/lifecycle/test/generic/contracts.e2e.spec.ts (3 hunks)
- packages/testing-kit/src/environment/index.ts (2 hunks)
- packages/testing-kit/src/logging.ts (1 hunks)
- packages/testing-kit/src/wallet/lucid/index.ts (3 hunks)
- packages/testing-kit/src/wallet/lucid/provisionning.ts (1 hunks)
- packages/wallet/src/lucid/index.ts (1 hunks)
Files skipped from review as they are similar to previous changes (26)
- examples/nodejs/src/experimental-features/source-map.ts
- examples/nodejs/src/marlowe-object-flow.ts
- examples/rest-client-flow/index.html
- packages/adapter/src/io-ts.ts
- packages/adapter/src/time.ts
- packages/language/core/v1/src/index.ts
- packages/language/core/v1/src/semantics.ts
- packages/language/examples/src/atomicSwap.ts
- packages/language/examples/test/atomicSwap.spec.ts
- packages/language/specification-client/src/main.ts
- packages/runtime/client/rest/src/contract/endpoints/collection.ts
- packages/runtime/client/rest/src/runtime/version.ts
- packages/runtime/core/src/contract/accountDeposits.ts
- packages/runtime/core/src/index.ts
- packages/runtime/core/src/payout/index.ts
- packages/runtime/lifecycle/src/browser/index.ts
- packages/runtime/lifecycle/src/generic/applicable-actions.ts
- packages/runtime/lifecycle/src/index.ts
- packages/runtime/lifecycle/src/nodejs/index.ts
- packages/runtime/lifecycle/test/examples/swap.ada.token.e2e.spec.ts
- packages/runtime/lifecycle/test/generic/contracts.e2e.spec.ts
- packages/testing-kit/src/environment/index.ts
- packages/testing-kit/src/logging.ts
- packages/testing-kit/src/wallet/lucid/index.ts
- packages/testing-kit/src/wallet/lucid/provisionning.ts
- packages/wallet/src/lucid/index.ts
Additional Context Used
LanguageTool (5)
changelog.d/20240511_113958_nicolas.henin_runtime_lifecycle_refactor.md (5)
Near line 5: You might be missing the article “the” here.
Context: ...e the account setup process and enhance user experience. - Benefits: This feat...
Near line 14: A punctuation mark might be missing here.
Context: ...ion (BuildCreateContractTxRequest
viabuildCreateContractTx
)([PR-188](https:/...
Near line 27: Did you mean the adjective “end-to-end” (spelled with hyphens)?
Context: ...t ofContractInstance
object) - see end to end tests for examples (e.g : `swap.ada.tok...
Near line 30: The abbreviation “e.g.” (= for example) requires two periods.
Context: ...arameter fieldaccountDeposits
in - e.g ```ts const sellerContractInstance = a...
Near line 43: Did you mean the adjective “end-to-end” (spelled with hyphens)?
Context: ...re (initial account deposits
) - see end to end tests for examples (e.g : `swap.ada.tok...
GitHub Check Runs (1)
CodeQL success (1)
packages/runtime/core/src/asset/index.ts: [warning] 98-98: Prototype-polluting assignment
This assignment may alter Object.prototype if a malicious 'proto' string is injected from library input.
This assignment may alter Object.prototype if a malicious 'proto' string is injected from library input.
This assignment may alter Object.prototype if a malicious 'proto' string is injected from library input.
Additional comments not posted (6)
packages/runtime/core/src/asset/index.ts (2)
41-58
: Ensure that theAssetsGuard
type definition correctly handles nullable fields and complex types.
85-100
: The functionmapAsset
correctly handles optional fields and maps assets to their respective types. Good use of nullish coalescing operator for default values.packages/runtime/lifecycle/src/generic/new-contract-api.ts (1)
53-72
: The functionmkContractsAPI
correctly uses a map to cache instances ofContractInstanceAPI
. This is a good practice to avoid unnecessary re-instantiations.packages/runtime/lifecycle/src/generic/contracts.ts (1)
Line range hint
372-488
: The functioncreateContract
andapplyInputs
are well-structured and handle various contract creation and input application scenarios. Ensure that all parameters are validated before use to prevent injection attacks.packages/runtime/client/rest/src/index.ts (2)
216-229
: The implementation ofwithDynamicTypeCheck
function correctly adds optional runtime type checking based on thestrict
parameter. Good use of conditional logic.
262-423
: The use ofwithDynamicTypeCheck
across various methods in theRestClient
interface enhances type safety and robustness. This is consistent with the changes in themkRestClient
function and aligns with the overall goal of the PR.
changelog.d/20240511_113958_nicolas.henin_runtime_lifecycle_refactor.md
Outdated
Show resolved
Hide resolved
changelog.d/20240511_113958_nicolas.henin_runtime_lifecycle_refactor.md
Outdated
Show resolved
Hide resolved
changelog.d/20240511_113958_nicolas.henin_runtime_lifecycle_refactor.md
Outdated
Show resolved
Hide resolved
changelog.d/20240511_113958_nicolas.henin_runtime_lifecycle_refactor.md
Outdated
Show resolved
Hide resolved
93e516a
to
086b483
Compare
086b483
to
de8769b
Compare
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
820a24c
to
a058f7f
Compare
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Refactor
Style
Tests
Chores