-
Notifications
You must be signed in to change notification settings - Fork 38
Conversation
default = ["std"] | ||
substrate = [ | ||
"pallet-contracts", | ||
"sp-runtime", | ||
"frame-system", | ||
] | ||
ink-no-std = [ | ||
"ink", | ||
] | ||
std = [ | ||
"scale-info/std", | ||
"scale/std", | ||
] | ||
substrate-std = [ | ||
"std", | ||
"sp-runtime/std", | ||
"frame-system/std", | ||
"pallet-contracts/std", | ||
] | ||
ink-std = [ | ||
"std", | ||
"ink/std", | ||
] |
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.
We had a discussion about this before but here's my new take on it.
The default
features should ensure code compiles without any issues. When doing the uplift to polkadot-v0.9.37
I had to change default
to substrate-std
in order for normal check
to pass.
My experience from the uplift was that there were conflicting features (cargo check --all-features
would fail).
It would be good to avoid this.
https://doc.rust-lang.org/cargo/reference/features.html#mutually-exclusive-features
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.
If I put substrate dep in std it will not build on ink! side.
So only solution is to remove ink! dep from this crate and have a separate crate for ink!. Then we will lose coupling of Outcome enum (that was the reason why we put it in same crate)
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.
If it makes for cleaner code, perhaps it's fine.
I do believe we should follow good design principles and right now this seems a bit messy.
How about having enum generated via a simple macro?
That way we have controlled code duplication.
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!
fn metadata_decimals() -> Weight { | ||
T::DbWeight::get().reads(1 as u64) | ||
} | ||
} |
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.
Github complains newline is missing 🙂
674458f
to
218167e
Compare
218167e
to
a24ee84
Compare
Minimum allowed line rate is |
Pull Request Summary
This PR is rebase from v0.9.37 and close previous #127
This PR adds a 1 on 1 map of pallet-assets functions to chain-extension.
For each extrinsic:
Origin
enum that takes eitherCaller
orContract
as value. This way the contract can chose between making call on behalf of the caller or on behalf of itselfintegrations tests here:
AstarNetwork/chain-extension-contracts#11
Check list