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

Add untested/unintegrated nomad-substrate crate #231

Closed
wants to merge 23 commits into from

Conversation

luketchang
Copy link
Collaborator

@luketchang luketchang commented Aug 22, 2022

Motivation

Enable Nomad agents to run against substrate chains. Must add nomad-substrate crate to implement contract traits.

Solution

Major High Level Changes

  • Adds nomad-substrate crate to rust/chains but does NOT integrate into rest of codebase (i.e. nomad-base and agents)
  • Moves nomad_core::ChainCommunicationError to nomad-base and makes it a wrapper across chain-specific error types defined in `chains
    • Note that this solves the issue of having chain-specific errors leak into nomad-core
    • Note this is also consistent with having nomad-base draw on chain-specific crates and serve as chain-agnostic wrapper
  • Changes nomad_core::{Common, Home, ConnectionManager} to return associated type error (Self::Error), having chain-specific crates define/return their own chain-specific error types (e.g. EthereumError, SubstrateError)

Details

  • nomad-substrate
    • Adds SubstrateHome and SubstrateHomeIndexer objects and implements necessary nomad_core traits
    • Adds SubstrateError type which wraps all subxt and scale-value deserialization errors (substrate-specific)
  • nomad-core
    • Removes ChainCommunicationError (changed/moved to nomad-base)
    • Has contract traits return associated type errors instead of the old ChainCommunicationError
  • nomad-base
    • Adds new ChainCommunicationError which wraps nomad_ethereum::EthereumError and nomad_substrate::SubstrateError
  • nomad-ethereum
    • Adds EthereumError error enum to wrapper ethers and gelato errors (ethereum-specific)
    • Has existing contract methods return Results<_, EthereumError> now instead of using old ChainCommunicationError
  • accumulator
    • Adds deserialization for LightMerkle (nomad-substrate needs this to decode tree object)

PR Checklist

  • Added Tests
  • Updated Documentation
  • Updated CHANGELOG.md for the appropriate package
  • Ran PR in local/dev/staging

…tead of ChainCommunciationError, rest of build failing
…ionError with chain specific enum moved to nomad-base
@luketchang luketchang changed the title Luke/nomad substrate Add untested nomad-substrate Aug 22, 2022
@luketchang luketchang changed the title Add untested nomad-substrate Add untested/unintegrated nomad-substrate crate Aug 22, 2022
@luketchang
Copy link
Collaborator Author

Closing in favor of #232

@luketchang luketchang closed this Aug 30, 2022
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

1 participant