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(connector): add get_deals builtin #2180

Merged
merged 48 commits into from
Jun 5, 2024
Merged

feat(connector): add get_deals builtin #2180

merged 48 commits into from
Jun 5, 2024

Conversation

justprosh
Copy link
Member

@justprosh justprosh commented Mar 16, 2024

Description

Added new builtins for decider to use chain-connector of the node.

Proposed Changes

  1. Added the builtins with the following interface
aqua Connector declares *

import CUID from "@fluencelabs/aqua-lib/workers.aqua"
import DealId, TxHash from "../types.aqua"



data Deal:
    deal_id: DealId 
    status: string
    unit_ids: []CUID
    app_cid: string

data TxInfo:
    deal_id: DealId 
    tx_hash: string

data TxReceipt:
    block_number: string
    tx_hash: TxHash

data TxResult:
    success: bool
    error: ?string
    status: string
    receipt: ?TxReceipt

-- Each of the function can throw an error on network connection problem
service ChainConnector("connector"):
  -- Register a worker on chain
  register_worker(deal_id: string, worker_id: string, unit_ids: []CUID) -> TxHash
  -- Get the list of current deals
  get_deals() -> []Deal 
  -- Get transaction receipts for the given transaction hashes
  get_tx_receipts(tx_hashes: []TxHash) -> []TxResult
  1. Added tests for these builtins

@justprosh justprosh added the e2e Run e2e workflow label Mar 16, 2024
@kmd-fl kmd-fl added e2e Run e2e workflow and removed e2e Run e2e workflow labels May 21, 2024
@kmd-fl kmd-fl requested review from folex and gurinderu May 27, 2024 13:00
@kmd-fl
Copy link
Contributor

kmd-fl commented May 27, 2024

@justprosh I cannot assign you on the PR that you've created -_-

@kmd-fl kmd-fl requested a review from mikevoronov May 28, 2024 11:04
@justprosh
Copy link
Member Author

justprosh commented May 29, 2024

lgtm

@kmd-fl kmd-fl merged commit b6e15d5 into master Jun 5, 2024
12 of 14 checks passed
@kmd-fl kmd-fl deleted the get_deals_builtin branch June 5, 2024 16:03
@kmd-fl
Copy link
Contributor

kmd-fl commented Jun 5, 2024

Merged without FCLI and Decider tests passing since we are in the process of updating Decider

@kmd-fl kmd-fl restored the get_deals_builtin branch June 5, 2024 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Run e2e workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants