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 pallet contracts #11

Merged
merged 1 commit into from
Jun 14, 2023
Merged

Add pallet contracts #11

merged 1 commit into from
Jun 14, 2023

Conversation

fbielejec
Copy link
Contributor

@fbielejec fbielejec commented Jun 12, 2023

adds pallet contracts + RPC endpoints

Copy link
Collaborator

@JoshOrndorff JoshOrndorff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking awesome so far. Thank you for doing this!

This PR also fixes clippy lints. Thanks for adding that!

Still todo is the Contracts RPC layer.

@fbielejec
Copy link
Contributor Author

Looking awesome so far. Thank you for doing this!

This PR also fixes clippy lints. Thanks for adding that!

Still todo is the Contracts RPC layer.

It's still a draft, but I cannot mark as draft (because private repo / free plan strikes again :/ ). Will ping you ASAP when ready 4 a review

@fbielejec fbielejec requested a review from JoshOrndorff June 13, 2023 13:27
Base automatically changed from fmt-all to main June 13, 2023 14:35
Copy link
Collaborator

@JoshOrndorff JoshOrndorff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall very good. Thank you for doing this!

I left a few small comments. Merge when ready.

Comment on lines 115 to 117
// sudo: SudoConfig {
// key: Some(root_key),
// },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this removed from the autoformatter? If possible I'd like to keep the sudo stuff because we may end up adding it back. Or at least if we want to remove it maybe do so in its own PR so it can be reverted later if we end up needing it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blameless, I removed 🙂

YMMV, but as much as I like comments / even TODOs in code, I just find commented out code noisy and unnecessary - because indeed there is version control for that. Not the hill I'm dying on though, so reverting 🤷‍♂️ .

Makefile Outdated
Comment on lines 1 to 2
watch:
cargo watch -s 'WASM_BUILD_WORKSPACE_HINT=${PWD} CARGO_TARGET_DIR=/tmp/target/ cargo check' -c
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DQ, what does this command do? Do you think it is generally useful enough to be worth checking in?

Copy link
Contributor Author

@fbielejec fbielejec Jun 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a watcher that runs check on file changes and clears the output afterwards.

But most importantly I'd like to have a Makefile under version control - imho it's the first place one would look into for instructions how to run the project and already ascertains (together with a lock and toolchain file) a good amount of reproducible across developer machine and the CI server (of course completely dockerized env is even better, but takes some work).

At the same time it's completely opt-in, because you can choose to just type the commands in 🤷

Comment on lines +125 to +127
// native chain currency
pub const TOKEN_DECIMALS: u32 = 12;
pub const TOKEN: u128 = 10u128.pow(TOKEN_DECIMALS);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we add this constant it should be used throughout. I know at least the faucet would be a place. But actually it is only used in a singe place. I wonder if it is worth adding the constant. Up to you how to proceed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point - i scanned the module and added it where possible, there were a few places - e.g. block rewards).

If it's to be used outside of runtime it might be nice to create a separate module (constants or primitives), wyt?

@fbielejec fbielejec force-pushed the add-pallet-contracts branch from b0658fc to 362de9a Compare June 14, 2023 14:15
@JoshOrndorff JoshOrndorff merged commit f4c6396 into main Jun 14, 2023
@JoshOrndorff JoshOrndorff deleted the add-pallet-contracts branch June 14, 2023 18:37
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.

2 participants