-
Notifications
You must be signed in to change notification settings - Fork 425
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
Provide environmental types (Balance, Gas, AccountId, ..) #4
Comments
The currently proposed design is to introduce another trait trait EnvTypes {
type Address;
type Gas;
type Balance;
} A possible implementation could then be: struct SmrlEnv;
impl EnvTypes for SrmlEnv {
type Address = [u8; 32];
type Gas = u64,
type Balance = u64;
} Then we could add the trait impl requirement to trait Env: EnvTypes { ... } |
Commit b84fe87 adds initial environmental types. These are structured in the following way: Next there is a new In this we have some new definitions. Since c89eb2d the Subpeep example project is making use of these new environmental types and since b8b92ca there is another initial implementation of an example project of a very basic ERC-20 token based on the pDSL. |
Closed by #108 |
Environmental Types
Currently
pdsl_core
does not provide environmental types, for example what type an address has.Having this information is very important for contract writers.
However, there are certain limitations and problems connected with making those environmental type definitions generic and chain agnostic.
We do want this information as part of
psdl_core
or similar.This issue is about finding a proper, user friendly, efficient and possibly chain agnostic design for this feature.
Design 1: Bound to Environment
An implemention of
pdsl_core::env::Env
could be required to provide this information.For this the
Env
trait should be extended for those type definitions or require an implementation of another trait that provides them.We use this issue also to track which type definitions we initially want to provide for users.
The downside to this approach is that making the types bound to an environment implementation would restrict pDSL to be used only from certain predefined environments. This should be sufficient as a start, since we could for example provide an environment for testing purposes, for SRML contracts on substrate, for pwasm and for ewasm just to name a few.
The text was updated successfully, but these errors were encountered: