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!: rs-sdk cache of data contracts #1568

Merged
merged 6 commits into from
Nov 9, 2023

Conversation

lklimek
Copy link
Contributor

@lklimek lklimek commented Nov 8, 2023

Issue being fixed or feature implemented

What was done?

Changes summary:

  1. Sdk now provides cache of data contracts returning Arc
  2. Dapi no longer needs to be mutable
  3. QuorumInfoProvider renamed to ContextProvider; now also returns data contracts
  4. Defined Put trait and TransitionContext to be implemented for modification operations

TODO:

Refactor Documents to use ContextProvider to retrieve data contract

How Has This Been Tested?

Breaking Changes

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@lklimek lklimek changed the base branch from v1.0-dev to feat/register November 8, 2023 13:49
@lklimek lklimek changed the title refactor: rs-sdk feat! rs-sdk now provides cache of data contracts Nov 8, 2023
@lklimek lklimek changed the title feat! rs-sdk now provides cache of data contracts feat! rs-sdk cache of data contracts Nov 8, 2023
@lklimek lklimek changed the title feat! rs-sdk cache of data contracts feat!: rs-sdk cache of data contracts Nov 8, 2023
@lklimek lklimek marked this pull request as ready for review November 8, 2023 14:13
Copy link
Contributor

@QuantumExplorer QuantumExplorer left a comment

Choose a reason for hiding this comment

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

While I am going to merge this in, I do not believe that the SDK should hold cached contracts, as that is the responsibility of the wallet.

Basically the SDK should not be stateful.

use crate::Sdk;

/// State transition identifier
pub struct TxId([u8; 32]);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be best to just say TxId is a Bytes32, and get all the benefit from that already defined struct.

Copy link
Contributor

Choose a reason for hiding this comment

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

It also should be in DPP and not the SDK

@QuantumExplorer QuantumExplorer merged commit a097cc3 into feat/register Nov 9, 2023
50 of 52 checks passed
@QuantumExplorer QuantumExplorer deleted the rs-sdk/refactor-dapi-no-mut branch November 9, 2023 01:07
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.

None yet

2 participants