Skip to content

SubgraphDeployment struct #141

@cargopete

Description

@cargopete

From @hopeyen's comment on a PR:

I'm thinking about the data structure being used here, and wondering what do you think about creating a struct for subgraph deployments that contains the fields of id, allocated, stake, block_number, block_hash, poi, ...? It feels like a more tidy way to tracking everything we care about for a particular deployment, and we just need to pass in a vec instead of all fields in vecs.
this might be a separate refactor effort though, just raising it since I was thinking about it

which was made in relation to this function's signature:

pub async fn process_comparison_results(
    blocks_str: String,
    num_topics: usize,
    result_strings: Vec<Result<ComparisonResult, OperationError>>,
    notifier: Notifier,
    db: SqlitePool,
    allocated_subgraphs: HashSet<String>,
)

We should:

  • create a new struct that holds data for a specific Subgraph deployment and use that instead of separate fields as arguments/values
  • add allocated_subgraphs to Radio operator and send the query inside network_check

Metadata

Metadata

Assignees

No one assigned

    Labels

    meta:triagedThis issue has been triaged (has a good description, as well as labels for priority, size and type)p2Medium prioritysize:smallSmalltype:refactorChanges not visible to users

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions