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

PE-1918: PST composite #621

Merged
merged 49 commits into from Aug 22, 2022
Merged

PE-1918: PST composite #621

merged 49 commits into from Aug 22, 2022

Conversation

matibat
Copy link
Contributor

@matibat matibat commented Aug 5, 2022

Changes

  • Ports the safe types: ArweaveAddress, Winston, and TransactionID from CORE into Dart
  • Implements a Builder for the contract state
  • Implements the ContractReader interface
    • Implements RedstoneContractReader
    • Implements VertoContractReader
    • Implements SmartweaveContractReader
      • which refactors the implementation of web-pst to simply read the contract (removed the TS code that is already ported to Dart)
  • Implements the ContractOracle interface class
    • Implements ArDriveContractOracle (the composite class; implements ContractOracle)
  • Implements the CommunityOracle interface class
    • which makes use of a ContractOracle (e.i. the composite class) to make high-level computations
  • Injects the CommunityOracle to the PSTService

TODO

  • Make the weightedRandom method testable

@matibat matibat self-assigned this Aug 5, 2022
@github-actions
Copy link

github-actions bot commented Aug 5, 2022

Visit the preview URL for this PR (updated for commit a8e6865):

https://ardrive-web--pr621-pe-1918-asn7k3fb.web.app

(expires Fri, 02 Sep 2022 21:36:03 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Copy link
Contributor Author

@matibat matibat left a comment

Choose a reason for hiding this comment

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

* self review checkpoint *

@matibat
Copy link
Contributor Author

matibat commented Aug 8, 2022

Only missing:

  • the implementations of ContractReader and ContractOracle, then the composite, and the CommunityOracle which is the high level class to be used in the codebase;
  • integrate web-pst to the ContractOracle composite (only for web);
  • start using the high-level class in the codebase

Copy link
Contributor Author

@matibat matibat left a comment

Choose a reason for hiding this comment

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

* self review checkpoint *

lib/pst/pst_contract_data_builder.dart Outdated Show resolved Hide resolved
lib/pst/pst_contract_data.dart Outdated Show resolved Hide resolved
Copy link
Collaborator

@thiagocarvalhodev thiagocarvalhodev left a comment

Choose a reason for hiding this comment

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

Almost finishing! Reviewed all implementations. Just need to review the tests.

Copy link
Collaborator

@thiagocarvalhodev thiagocarvalhodev left a comment

Choose a reason for hiding this comment

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

Finished review! Left some comments.

Copy link
Collaborator

@thiagocarvalhodev thiagocarvalhodev left a comment

Choose a reason for hiding this comment

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

Just left a small comment about changing the while approach with for. But it's good to go! thanks for addressing all of my comments.

karlprieb
karlprieb previously approved these changes Aug 15, 2022
Copy link
Contributor Author

@matibat matibat left a comment

Choose a reason for hiding this comment

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

Left one single comment. Imma apply the change and manually test the PR

lib/types/winston.dart Outdated Show resolved Hide resolved
Copy link
Contributor

@jdaev jdaev left a comment

Choose a reason for hiding this comment

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

Awesome work 👍🏽

@matibat matibat merged commit 49321ba into dev Aug 22, 2022
@matibat matibat deleted the PE-1918 branch August 22, 2022 18:22
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

4 participants