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

feat: bonded coins pallet #726

Draft
wants to merge 39 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
98c88bc
feat: init bonded coins pallet
rflechtner Sep 3, 2024
10f3cb8
feat: add config
rflechtner Sep 4, 2024
fbcbdff
feat: add storage
rflechtner Sep 4, 2024
37a9647
feat: implement create extrinsic
rflechtner Sep 5, 2024
f6acfa3
docs: update docstrings
rflechtner Sep 9, 2024
d2f4b34
refactor: move to more generic pallet design
rflechtner Sep 10, 2024
08277e1
refactor: make currency ids user-specified
rflechtner Sep 10, 2024
76f651e
feat: add mint_into extrinsic
rflechtner Sep 11, 2024
bd227e1
refactor: use account lookups
rflechtner Sep 11, 2024
9ae15d2
chore: make Frozen the default PoolStatus
rflechtner Sep 11, 2024
ea44040
refactor: implement cost calculation in designated function
rflechtner Sep 11, 2024
b0fb432
chore: fmt cargo.toml
rflechtner Sep 12, 2024
11b37c5
chore: update package info
rflechtner Sep 12, 2024
8b32634
chore: review suggestions
rflechtner Sep 12, 2024
434afd9
feat: add parameter to curve enum
rflechtner Sep 12, 2024
771bb33
fix: currencies number check
rflechtner Sep 12, 2024
cccae24
refactor: curve parameters are a struct
rflechtner Sep 12, 2024
3026f97
chore: handle parameters in MockCurve
rflechtner Sep 12, 2024
53f0614
first draft bonding curves
Ad96el Sep 13, 2024
96e555b
Merge branch 'feat-bonded-coins' of github.com:KILTprotocol/kilt-node…
Ad96el Sep 13, 2024
c2c6914
unit tests with linear bonding curve
Ad96el Sep 16, 2024
e2a7497
feat: more bonding curves
Ad96el Sep 16, 2024
16a8ca3
feat: implement burn_into extrinsic (#728)
rflechtner Sep 16, 2024
4842a55
Merge branch 'feat-bonded-coins' into ag_bonded_coins_curves
Ad96el Sep 17, 2024
b58738a
merge conflicts
Ad96el Sep 17, 2024
28e9dcc
remove file content
Ad96el Sep 17, 2024
1c053c7
clippy
Ad96el Sep 17, 2024
708e090
first draft swap
Ad96el Sep 17, 2024
90928a1
Merge branch 'ag_bonded_coins_curves' into feat-bonded-coins
Ad96el Sep 17, 2024
2570c5c
swap tx
Ad96el Sep 18, 2024
eefb535
lock tx
Ad96el Sep 18, 2024
00a35c4
first mvp
Ad96el Sep 18, 2024
388e015
minor refactoring
Ad96el Sep 18, 2024
87fcea8
Add testing framework
Ad96el Sep 19, 2024
be943ea
mocks
Ad96el Sep 19, 2024
dba9266
test + fixes for create pool
Ad96el Sep 19, 2024
a44a904
test + fixes for create pool
Ad96el Sep 20, 2024
a7f2cec
test for mint_into. Refactor mocking
Ad96el Sep 20, 2024
cd28d42
test for mint_into. Refactor mocking
Ad96el Sep 20, 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
21 changes: 21 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ ctype = { path = "pallets/ctype", default-features = false }
delegation = { path = "pallets/delegation", default-features = false }
did = { path = "pallets/did", default-features = false }
pallet-asset-switch = { path = "pallets/pallet-asset-switch", default-features = false }
pallet-bonded-coins = { path = "pallets/pallet-bonded-coins", default-features = false }
pallet-configuration = { path = "pallets/pallet-configuration", default-features = false }
pallet-deposit-storage = { path = "pallets/pallet-deposit-storage", default-features = false }
pallet-did-lookup = { path = "pallets/pallet-did-lookup", default-features = false }
Expand Down Expand Up @@ -161,6 +162,7 @@ pallet-treasury = { git = "https://github.com/parityt
pallet-utility = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-crates-io-v1.7.0" }
pallet-vesting = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-crates-io-v1.7.0" }
sp-api = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-crates-io-v1.7.0" }
sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-crates-io-v1.7.0" }
sp-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-crates-io-v1.7.0" }
sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-crates-io-v1.7.0" }
sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-crates-io-v1.7.0" }
Expand Down
20 changes: 20 additions & 0 deletions chopsticks/chain.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

endpoint:
# We fetch relevant storage elements from Spiritnet even tho we are running Peregrine (with sudo).
- wss://kilt.ibp.network
db: db/peregrine.sqlite
runtime-log-level: 5
port: 50002
wasm-override: /home/adel/projects/kilt-node/target/debug/wbuild/peregrine-runtime/peregrine_runtime.wasm

import-storage:
System:
Account:
- - - 5HeHMRTEabP45PkFugDAy5hRnagQmmQJMfUFffWhAmDUw8TR
- providers: 1
data:
free: "100000000000000000000000"
Sudo:
Key: 5HeHMRTEabP45PkFugDAy5hRnagQmmQJMfUFffWhAmDUw8TR


10 changes: 10 additions & 0 deletions chopsticks/db/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "kilt-chopsticks",
"private": "true",
"devDependencies": {
"@acala-network/chopsticks": "^0.14.1"
},
"scripts": {
"spawn:": "cargo build -p peregrine-runtime && yarn chopsticks -c chain.yaml"
}
}
10 changes: 10 additions & 0 deletions chopsticks/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "kilt-chopsticks",
"private": "true",
"devDependencies": {
"@acala-network/chopsticks": "^0.14.1"
},
"scripts": {
"spawn": "cargo build -p peregrine-runtime && yarn chopsticks -c chain.yaml"
}
}
Loading
Loading