-
Notifications
You must be signed in to change notification settings - Fork 428
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
[E2E alternative backend]: Backend choice #1864
[E2E alternative backend]: Backend choice #1864
Conversation
…macro # Conflicts: # CHANGELOG.md
…macro # Conflicts: # CHANGELOG.md # crates/e2e/Cargo.toml # crates/e2e/macro/src/codegen.rs # crates/e2e/src/lib.rs # crates/e2e/src/subxt_client.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very solid. Just a few nitpicks
/// Identifier type for an actor. | ||
type ActorId; | ||
/// Account type. | ||
type AccountId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't it make sense to add Clone + Send + Sync
trait bounds to this associated type since it looks like you impose them later in drink_client
anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requiring bounds on the associated type here would be a bit implementation-based, so I'm not convinced if it is the correct move
but anyway, even if I put these bounds here, I would have to keep them in the impl<AccountId, *> *Backend for *
, so nothing to 'gain' here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -22,6 +22,7 @@ ink_primitives = { workspace = true, default-features = true } | |||
|
|||
cargo_metadata = { workspace = true } | |||
contract-build = { workspace = true } | |||
drink = { workspace = true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we consider having a feature flag for this, since it is bringing in a few heavy substrate dependencies and (at the moment) is not the default backend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair point, I'll hide it tomorrow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it that heavy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~70 new dependencies, some of which are substrate crates (for state-machines, externalities, few pallets etc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally we provide implementation of
E2EBackend
trait for a drink-based client. Also, we add a new argument fore2e-test
macro, enabling user to specify target backend architecture.Since
drink
library is pretty immature yet, we are lacking some functionalities like dry-running or events. Relevant places in code are marked with the corresponding issues in drink repository. We'll fix them in the near future.Notes:
flipper
that uses new backendwasm-instrument
withsign_ext
feature because of compilation error:non-exhaustive patterns:
&Instruction::SignExt(_)not covered
forcargo 1.70
Actor
andActorId
associated types from backend traits: since we have to support all backends for a single test code, we always have to operate withKeypair
andE::AccountId
typesclient_utils
()
, I will adaptDrinkBackend
to the mainError
soon (required some changes to drink as well)