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

Implement pallet that extends our current treasury pallet with buyout feature #396

Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
b1ad3f1
WIP
bogdanS98 Jan 11, 2024
dd83e1b
Fmt
bogdanS98 Jan 11, 2024
3ff7277
Add comment
bogdanS98 Jan 11, 2024
dcc6a4b
Still wip
bogdanS98 Jan 12, 2024
d998215
Fmt
bogdanS98 Jan 12, 2024
0afee4a
Add doc comments
bogdanS98 Jan 12, 2024
3e7b9bb
Address change requests
bogdanS98 Jan 12, 2024
edc4d94
Fmt
bogdanS98 Jan 12, 2024
1359c94
Add comment
bogdanS98 Jan 12, 2024
dc68751
Add fee for basic asset
bogdanS98 Jan 15, 2024
069d17e
Fmt
bogdanS98 Jan 15, 2024
67f3513
Return NoPrice error when price fetching fails
bogdanS98 Jan 15, 2024
beb234b
Add signed extension
bogdanS98 Jan 15, 2024
2479198
Add first iteration of mock
bogdanS98 Jan 26, 2024
449296a
Allow only XCM assets for buyout
bogdanS98 Jan 26, 2024
69a81c7
Update mock to only allow specific XCM assets
bogdanS98 Jan 26, 2024
b8cda83
Add tests and benchmarks - still wip
bogdanS98 Jan 30, 2024
95035a4
Fmt
bogdanS98 Jan 31, 2024
eebf511
Handle currency id in benchmarks
bogdanS98 Jan 31, 2024
a75ad1a
Update comments
bogdanS98 Jan 31, 2024
560268b
Remove benchmark comment
bogdanS98 Jan 31, 2024
be4f99a
Fix benchmarks and tests, add pallet to Foucoco, switch from UnixTime…
bogdanS98 Feb 1, 2024
19932f9
Merge remote-tracking branch 'origin' into 395-implement-pallet-that-…
bogdanS98 Feb 1, 2024
4aaee33
Fmt
bogdanS98 Feb 1, 2024
f2d1eda
Refactor dot currency id in tests
bogdanS98 Feb 2, 2024
8bae6e8
Small refactor for test attempt_buyout_after_buyout_limit_exceeded_fails
bogdanS98 Feb 2, 2024
11d9609
Update comments
bogdanS98 Feb 2, 2024
d224292
Small refactor
bogdanS98 Feb 2, 2024
e07318c
Add comment in Foucoco runtime
bogdanS98 Feb 2, 2024
fa68d4d
Add comment in Foucoco runtime
bogdanS98 Feb 2, 2024
de93547
Update comment
bogdanS98 Feb 2, 2024
9a19333
Update comment
bogdanS98 Feb 2, 2024
b2e2f17
Add signed extension to runtime
bogdanS98 Feb 2, 2024
f02fbc8
Add comment
bogdanS98 Feb 2, 2024
4fa8b91
Fix indentation in tests
bogdanS98 Feb 2, 2024
fe04294
Fix indentation in tests
bogdanS98 Feb 2, 2024
7c46f0b
Fix indentation in tests
bogdanS98 Feb 2, 2024
382b0d3
Fix indentation in tests
bogdanS98 Feb 2, 2024
66a86da
Update comment
bogdanS98 Feb 2, 2024
96af52c
Fix building project with runtime benchmarks flag
bogdanS98 Feb 2, 2024
d8c6738
Address change requests
bogdanS98 Feb 5, 2024
d31c2b0
Merge branch '395-implement-pallet-that-extends-our-current-treasury-…
bogdanS98 Feb 5, 2024
d4fcb93
Small refactor for asset registry benchmarks
bogdanS98 Feb 5, 2024
510b4ff
Fix compiler warning
bogdanS98 Feb 5, 2024
9e8f129
Address change requests
bogdanS98 Feb 5, 2024
f3ebd72
Update comment
bogdanS98 Feb 5, 2024
d020484
Optimise fetching oracle price for benchmarks and regenerate weights
bogdanS98 Feb 5, 2024
8352c1c
Merge branch '395-implement-pallet-that-extends-our-current-treasury-…
bogdanS98 Feb 5, 2024
470b0e7
Fmt
bogdanS98 Feb 5, 2024
bbc6ca4
Add change requests + fmt
bogdanS98 Feb 7, 2024
86a90d5
Merge remote-tracking branch 'origin' into 395-implement-pallet-that-…
bogdanS98 Feb 7, 2024
caa7fd9
Add try-runtime feature
bogdanS98 Feb 7, 2024
30faae5
Update Github workflow
bogdanS98 Feb 8, 2024
6ef98e1
Update Github workflow
bogdanS98 Feb 8, 2024
5fe4225
Update Github workflow
bogdanS98 Feb 8, 2024
9a25230
Add extrinsic and storage item for updating allowed assets for buyout
bogdanS98 Feb 8, 2024
4a4d2a9
Fmt
bogdanS98 Feb 8, 2024
4e618c7
Refactor update_allowed_assets extrinsic, tests
bogdanS98 Feb 9, 2024
51749b1
Fmt
bogdanS98 Feb 9, 2024
e8f97a1
Address request for change
bogdanS98 Feb 12, 2024
37d056a
Fmt
bogdanS98 Feb 12, 2024
0c06230
Move comment
bogdanS98 Feb 12, 2024
84b6165
Address comments + regenerate weights
bogdanS98 Feb 13, 2024
f0e209e
Fmt
bogdanS98 Feb 13, 2024
00e0d3c
Update extrinsic weight
bogdanS98 Feb 13, 2024
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
29 changes: 29 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ members = [
"pallets/vesting-manager",
"pallets/orml-currencies-allowance-extension",
"pallets/orml-tokens-management-extension",
"pallets/treasury-buyout-extension",
"runtime/common",
"runtime/amplitude",
"runtime/foucoco",
Expand Down
68 changes: 68 additions & 0 deletions pallets/treasury-buyout-extension/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
[package]
authors = ["Pendulum Chain"]
edition = "2021"
name = "treasury-buyout-extension"
version = "1.0.0"

[dependencies]
codec = {package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive", "max-encoded-len"]}
scale-info = {version = "2.2.0", default-features = false, features = ["derive"]}
serde = {version = "1.0.130", default-features = false, features = ["derive"], optional = true}
sha2 = {version = "0.8.2", default-features = false}

# Substrate dependencies
frame-support = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false}
frame-system = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false}
sp-core = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false}
sp-runtime = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false}
sp-std = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false}
sp-arithmetic = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false}
pallet-treasury = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.40"}

frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false, optional = true }

orml-asset-registry = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", default-features = false, branch = "polkadot-v0.9.40" }
orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.40", default-features = false }
orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.40", default-features = false }
orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.40", default-features = false }

dia-oracle = {git = "https://github.com/pendulum-chain/oracle-pallet", default-features = false, branch = "polkadot-v0.9.40"}
dia-oracle-runtime-api = {git = "https://github.com/pendulum-chain/oracle-pallet", default-features = false, branch = "polkadot-v0.9.40"}
oracle = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "20a3dd191dc352f989f90a1a48eacb8ff6d9ac85" }


[dev-dependencies]
mocktopus = "0.8.0"
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sp-io = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40", default-features = false}

pallet-balances = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40"}

# Spacewalk libraries
spacewalk-primitives = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "d05b0015d15ca39cc780889bcc095335e9862a36"}


[features]
default = ["std"]
std = [
"serde",
"codec/std",
"sha2/std",
"sp-core/std",
"sp-std/std",
"sp-arithmetic/std",
"sp-runtime/std",
"frame-support/std",
"frame-system/std",
"orml-currencies/std",
"orml-tokens/std",
"orml-traits/std",
"frame-benchmarking/std",
"spacewalk-primitives/std"
]

runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
]
1 change: 1 addition & 0 deletions pallets/treasury-buyout-extension/src/benchmarking.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions pallets/treasury-buyout-extension/src/default_weights.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading