Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Contracts: migrate to fungible traits #14020

Merged
Merged
Show file tree
Hide file tree
Changes from 126 commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
7179359
contracts: refactor currency to use fungible traits
juangirini Apr 26, 2023
c0a95d2
contracts: refactor currency to use fungible traits
juangirini Apr 26, 2023
da7db01
contracts: merge master and resolve conflicts
juangirini May 2, 2023
9a1e824
Merge branch 'master' into jg/13643-contracts-migrate-to-fungible-traits
juangirini May 2, 2023
5eee859
contracts: add minor improvements
juangirini May 3, 2023
713a426
contracts: merge master and fix conflicts
juangirini May 8, 2023
4acbbe5
contracts: max holds config set
juangirini May 8, 2023
e6d82d1
contracts: fix some typos
juangirini May 8, 2023
c47ac0d
contracts: map token errors
juangirini May 8, 2023
4e8a7cc
fix typo
juangirini May 8, 2023
33229ff
contracts: add 0 balance transfer to test
juangirini May 8, 2023
a1fd020
contracts: not transfer if value is zero
juangirini May 9, 2023
0967556
contracts: [WIP] add StorageDepositHold
juangirini May 11, 2023
3acdcbb
Merge branch 'master' into jg/13643-contracts-migrate-to-fungible-traits
juangirini May 11, 2023
bcb9077
contracts: add storage deposit held event
juangirini May 11, 2023
8f244c4
contracts: clean up some code and comments
juangirini May 11, 2023
73b9285
contracts: add deposit storage released event
juangirini May 11, 2023
26472d5
contracts: update comment
juangirini May 12, 2023
c442b79
contracts: update slash cannot kill account test
juangirini May 12, 2023
3c515ab
contracts: fix tests
juangirini May 12, 2023
4d68a48
contracts: add some comments to the slashing test
juangirini May 12, 2023
78fc19e
contracts: add some comments to the slashing test
juangirini May 12, 2023
2c1e2ea
contracts: remove references to Currency
juangirini May 15, 2023
e6509d7
Merge branch 'master' into jg/13643-contracts-migrate-to-fungible-traits
juangirini May 15, 2023
1c82bef
contracts: do not transfer if from equals to
juangirini May 15, 2023
9eb19ef
wip
juangirini Jun 2, 2023
e4853e9
Merge remote-tracking branch 'origin/master' into jg/13643-contracts-…
juangirini Jun 5, 2023
921d89c
bound BalanceOf<T>
juangirini Jun 6, 2023
a103057
added FixedPointOperand to Balance trait
juangirini Jun 6, 2023
5c14529
move migrate sequence to config
juangirini Jun 6, 2023
e8c493c
remove commented out code
juangirini Jun 6, 2023
0e62930
Update frame/contracts/src/lib.rs
juangirini Jun 6, 2023
14a7175
remove Migrations generic
juangirini Jun 6, 2023
2601d79
make runtime use noop migrations
juangirini Jun 6, 2023
e88854a
restrict is_upgrade_supported
juangirini Jun 6, 2023
1400ab0
undo is_upgrade_supported change
juangirini Jun 7, 2023
cc7609c
Update bin/node/runtime/src/lib.rs
juangirini Jun 7, 2023
c173ad7
add rust doc example for `Migrations`
juangirini Jun 7, 2023
c9cf9c6
feature gate NoopMigration
juangirini Jun 7, 2023
de545a3
fix example code
juangirini Jun 7, 2023
62bec96
improve example
juangirini Jun 8, 2023
f446edc
wip
juangirini Jun 8, 2023
de67661
rebase and fix conflicts
juangirini Jun 8, 2023
a1b9d71
remove FixedPointOperand from trait
juangirini Jun 9, 2023
c68288f
trait bound BalanceOf
juangirini Jun 13, 2023
9a813ef
more trait bound BalanceOf
juangirini Jun 13, 2023
9cddbef
rebase
juangirini Jun 15, 2023
11308f5
update to use RuntimeHoldReason
juangirini Jun 16, 2023
f4e1e53
replace Fungible for Currency
juangirini Jun 16, 2023
4da6b17
update runtime
juangirini Jun 16, 2023
790a8d2
WIP
juangirini Jun 27, 2023
1922bfe
make v10 benchmark generic over currency
juangirini Jul 3, 2023
b2da991
rebase and solve conflicts
juangirini Jul 3, 2023
d3ea9e2
solve merge conflicts
juangirini Jul 4, 2023
3673892
rebase and solve conflicts
juangirini Jul 4, 2023
e6201c1
make v12 migration benchmarking generic over DepositPerItem and Depos…
juangirini Jul 6, 2023
22fd924
give some format
juangirini Jul 6, 2023
013dc41
rebase and fix conflicts
juangirini Jul 6, 2023
f8da1e0
fix tests and old migrations
juangirini Jul 7, 2023
e29f2d4
add migration v13 placholder
juangirini Jul 11, 2023
ca8772a
rebase and fix errors\
juangirini Jul 11, 2023
6df91bd
wip
juangirini Jul 11, 2023
eb9c56a
wip
juangirini Jul 12, 2023
7f18359
rebase and merge conflicts
juangirini Jul 12, 2023
ab1af04
add benchmarking
juangirini Jul 12, 2023
316ab36
add weights
juangirini Jul 13, 2023
5209d01
wip
juangirini Jul 13, 2023
0cd0830
[pallet_collective] Enforce prime is a valid member of collective in …
ToufeeqP Jul 12, 2023
de849d2
update to docify 0.2.0 / crate-relative embed paths (#14570)
sam0x17 Jul 13, 2023
adba2c9
Fix Society v2 migration (#14421)
liamaharon Jul 13, 2023
9a42019
Moves `Block` to `frame_system` instead of `construct_runtime` and re…
gupnik Jul 13, 2023
1744884
Refactor the asset-conversion-tx-payment pallet (#14558)
jsidorenko Jul 13, 2023
15634c2
wip
juangirini Jul 13, 2023
c2eb60d
rebase and fix conflicts
juangirini Jul 14, 2023
1775efa
wip
juangirini Jul 14, 2023
cb1adf3
Merge remote-tracking branch 'origin/master' into jg/13643-contracts-…
juangirini Jul 17, 2023
12c522c
wip
juangirini Jul 17, 2023
6fb9713
improve try-runtime imports
juangirini Jul 17, 2023
cdd0ca4
fix benchmark test
juangirini Jul 18, 2023
ae4fda2
improved rustdocs
juangirini Jul 18, 2023
f5e4b20
improved rustdocs
juangirini Jul 18, 2023
cb9217d
remove log
juangirini Jul 18, 2023
36f936a
Merge branch 'master' into jg/13643-contracts-migrate-to-fungible-traits
juangirini Jul 19, 2023
632ef2e
ignore variable
juangirini Jul 19, 2023
bc8efaf
reduce caller funding
juangirini Jul 19, 2023
7c97aae
move v13 out
juangirini Jul 21, 2023
a96a50e
update v13 migration
juangirini Jul 21, 2023
c67ea9f
v13 migration
juangirini Jul 24, 2023
ad7fa61
benchmark v13_migration
juangirini Jul 24, 2023
6e6fdb3
fix broken compilation
juangirini Jul 24, 2023
ae5d558
Merge branch 'master' of https://github.com/paritytech/substrate into…
Jul 24, 2023
90de832
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Jul 24, 2023
55fd7ce
remove all the `where BalanceOf`
juangirini Jul 25, 2023
50e0348
add Balance to Config
juangirini Jul 25, 2023
199a6f5
Merge remote-tracking branch 'origin/master' into jg/13643-contracts-…
juangirini Jul 25, 2023
05299ae
Merge remote-tracking branch 'origin/master' into jg/13643-contracts-…
juangirini Jul 25, 2023
a741737
improve docs
juangirini Jul 25, 2023
3950327
add new deposit storage error
juangirini Jul 25, 2023
0a790a6
remove todo message
juangirini Jul 25, 2023
0c57451
rename migration v13 pre rebase
juangirini Jul 26, 2023
ec5415f
rebase
juangirini Jul 26, 2023
560d190
fix tests
juangirini Jul 26, 2023
ed3b399
add missing migration;
juangirini Jul 26, 2023
8186e21
bump storage version
juangirini Jul 27, 2023
08619a0
apply review suggestions
juangirini Jul 27, 2023
9435d4b
improved comment
juangirini Jul 27, 2023
06f7941
remove unnecessary code
juangirini Jul 27, 2023
eec1d20
simplify migrations
juangirini Jul 27, 2023
8b69d3e
mock balance
juangirini Jul 28, 2023
38c044c
mock more for benchmarks
juangirini Jul 28, 2023
48ce88c
rebase and merge conflicts
juangirini Jul 28, 2023
4cd120f
fix benchmarking tests
juangirini Jul 28, 2023
f08f844
fix benchmarking tests with caller
juangirini Jul 28, 2023
da6e8c1
improve cargo toml
juangirini Jul 28, 2023
3e6ce6a
solve nit
juangirini Jul 28, 2023
0ce5815
Update frame/contracts/src/lib.rs
juangirini Jul 31, 2023
3054dce
Update frame/contracts/src/exec.rs
juangirini Jul 31, 2023
b0a6d39
Update frame/contracts/src/exec.rs
juangirini Jul 31, 2023
49d8f7f
Update frame/contracts/src/storage/meter.rs
juangirini Jul 31, 2023
432ea07
review improvements
juangirini Jul 31, 2023
ae7ddf7
Merge remote-tracking branch 'origin/master' into jg/13643-contracts-…
juangirini Jul 31, 2023
a7bf911
remove extra events
juangirini Jul 31, 2023
41812ef
update cargo
juangirini Jul 31, 2023
2ed2c85
undo update cargo
juangirini Jul 31, 2023
49efe87
review updates
juangirini Aug 1, 2023
c9673f6
rebase and fix conflicts
juangirini Aug 1, 2023
90c4c84
rebase and fix conflicts
juangirini Aug 2, 2023
5c668aa
remove type Balance
juangirini Aug 2, 2023
39e83cc
add extra fields to events
juangirini Aug 2, 2023
aae16cc
fix zepter ci
juangirini Aug 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1230,6 +1230,7 @@ impl pallet_contracts::Config for Runtime {
type Time = Timestamp;
type Randomness = RandomnessCollectiveFlip;
type Currency = Balances;
type Balance = Balance;
juangirini marked this conversation as resolved.
Show resolved Hide resolved
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
/// The safest default is to allow no calls at all.
Expand All @@ -1252,6 +1253,7 @@ impl pallet_contracts::Config for Runtime {
type MaxStorageKeyLen = ConstU32<128>;
type UnsafeUnstableInterface = ConstBool<false>;
type MaxDebugBufferLen = ConstU32<{ 2 * 1024 * 1024 }>;
type RuntimeHoldReason = RuntimeHoldReason;
#[cfg(not(feature = "runtime-benchmarks"))]
type Migrations = ();
#[cfg(feature = "runtime-benchmarks")]
Expand Down
3 changes: 3 additions & 0 deletions frame/contracts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ environmental = { version = "1.1.4", default-features = false }
frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true }
frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" }
frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" }
pallet-balances = { version = "4.0.0-dev", path = "../balances", optional = true, default-features = false }
pallet-contracts-primitives = { version = "24.0.0", default-features = false, path = "primitives" }
pallet-contracts-proc-macro = { version = "4.0.0-dev", path = "proc-macro" }
sp-api = { version = "4.0.0-dev", default-features = false, path = "../../primitives/api" }
Expand Down Expand Up @@ -82,11 +83,13 @@ std = [
"log/std",
"rand/std",
"environmental/std",
"pallet-balances?/std",
]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"rand",
"rand_pcg",
"pallet-balances",
"wasm-instrument",
]
try-runtime = ["frame-support/try-runtime"]
4 changes: 2 additions & 2 deletions frame/contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ The Contracts module provides functionality for the runtime to deploy and execut

## Overview

This module extends accounts based on the `Currency` trait to have smart-contract functionality. It can
be used with other modules that implement accounts based on `Currency`. These "smart-contract accounts"
This module extends accounts based on the [`frame_support::traits::fungible`] traits to have smart-contract functionality. It can
be used with other modules that implement accounts based on [`frame_support::traits::fungible`]. These "smart-contract accounts"
have the ability to instantiate smart-contracts and make calls to other contract and non-contract accounts.

The smart-contract code is stored once, and later retrievable via its `code_hash`.
Expand Down
Loading