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

refactor: simplify routine call and result handler #32

Merged
merged 31 commits into from
Feb 5, 2024

Conversation

sarvalabs-harshrastogi
Copy link
Member

@sarvalabs-harshrastogi sarvalabs-harshrastogi commented Jan 29, 2024

The following pull introduces the below-mentioned enhancements and fixes:

Changes:

  • Simplified Logic Driver:
    • Introduced optional parameters (fuelPrice and fuelLimit) within the ix options for logic routine calls and deployment.
    • If fuelPrice is not explicitly provided, the system defaults to a value of 1.
    • When fuelPrice and fuelLimit are not provided, the implementation fetches fuel estimates using the moi.FuelEstimate method.
  • Error Handling in Contract Execution:
    • Modified behaviour of ix.result() and ix.wait() to throw an error if the contract method execution encounters an error.
    • The thrown error object includes a params field. In case of failure, developers can access the receipt through error.params.receipt
  • Introduction of u256 and i256:
    • Introduced new types u256 and i256.
  • Fix for Values Transfer in Estimating Fuel:
    • Resolved an issue where estimating fuel for values transfer resulted in zero.
    • The problem was identified in the transfer_values function, which took a Map but when converted to JSON resulted in an empty object ({}). This has been addressed.
  • Clean-Up:
    • Removed older build files cached in Git.
  • Update Example and Documentation:
    • Updated example code and documentation to reflect the changes made.

Note: This is a breaking change.

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have tested this code
  • I have updated the README and other relevant documents (guides...)

@sarvalabs-harshrastogi sarvalabs-harshrastogi added enhancement New feature or request logic Module to interact with MOI Logic Objects providers Issues related to providers signer Issues related to signer utils Issues related to utils labels Jan 29, 2024
Copy link

cloudflare-workers-and-pages bot commented Jan 29, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 448613e
Status: ✅  Deploy successful!
Preview URL: https://2a007e23.js-moi-sdk.pages.dev
Branch Preview URL: https://refactor-simple-logic-call.js-moi-sdk.pages.dev

View logs

docs/source/logic.rst Outdated Show resolved Hide resolved
packages/js-moi-logic/__tests__/logic.test.ts Outdated Show resolved Hide resolved
packages/js-moi-logic/__tests__/logic.test.ts Outdated Show resolved Hide resolved
docs/source/logic.rst Outdated Show resolved Hide resolved
docs/source/logic.rst Show resolved Hide resolved
packages/js-moi-logic/src/logic-base.ts Outdated Show resolved Hide resolved
packages/js-moi-logic/src/logic-driver.ts Outdated Show resolved Hide resolved
packages/js-moi-providers/src/base-provider.ts Outdated Show resolved Hide resolved
packages/js-moi-providers/src/interaction.ts Outdated Show resolved Hide resolved
packages/js-moi-signer/dist/signer.js Outdated Show resolved Hide resolved
@sarvalabs-gokul sarvalabs-gokul changed the title refactor: simplify routine call and handling result refactor: simplify routine call and result handler Feb 5, 2024
@sarvalabs-gokul sarvalabs-gokul merged commit 51e20d7 into develop Feb 5, 2024
2 checks passed
@sarvalabs-harshrastogi sarvalabs-harshrastogi deleted the refactor/simple-logic-call branch February 5, 2024 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request logic Module to interact with MOI Logic Objects manifest Issues related to manifest providers Issues related to providers signer Issues related to signer utils Issues related to utils
Projects
None yet
2 participants