fix: Complete snowbridge pezpallet rebrand and critical bug fixes
- snowbridge-pezpallet-* → pezsnowbridge-pezpallet-* (201 refs) - pallet/ directories → pezpallet/ (4 locations) - Fixed pezpallet.rs self-include recursion bug - Fixed sc-chain-spec hardcoded crate name in derive macro - Reverted .pezpallet_by_name() to .pallet_by_name() (subxt API) - Added BizinikiwiConfig type alias for zombienet tests - Deleted obsolete session state files Verified: pezsnowbridge-pezpallet-*, pezpallet-staking, pezpallet-staking-async, pezframe-benchmarking-cli all pass cargo check
This commit is contained in:
@@ -1,65 +0,0 @@
|
||||
# Claude Session State - Kurdistan SDK Rebranding
|
||||
|
||||
## ÇALIŞMA DİZİNİ
|
||||
```
|
||||
/home/mamostehp/kurdistan-sdk
|
||||
```
|
||||
|
||||
**DİKKAT:** Pezkuwi-SDK'da HİÇBİR ŞEY YAPMA!
|
||||
|
||||
## MEVCUT GÖREV
|
||||
Tüm Rebranding Tamamlandı ✅
|
||||
|
||||
## TAMAMLANAN İŞLER
|
||||
- [x] Phase 1: substrate → bizinikiwi (tüm içerikler, dizinler, dosya isimleri)
|
||||
- [x] Phase 2: cumulus → pezcumulus
|
||||
- [x] Dosya içerikleri
|
||||
- [x] Dizin isimleri (cumulus/ → pezcumulus/)
|
||||
- [x] Dosya isimleri (cumulus_pallet_*.rs → pezcumulus_pezpallet_*.rs)
|
||||
- [x] Phase 5: frame- → pezframe-
|
||||
- [x] Crate isimleri (frame-support → pezframe-support, vb.)
|
||||
- [x] Rust import'ları (frame_support → pezframe_support)
|
||||
- [x] Dizin isimleri (bizinikiwi/frame → bizinikiwi/pezframe)
|
||||
- [x] Path referansları güncellendi
|
||||
- [x] Phase 6: pallet- → pezpallet-
|
||||
- [x] 172 crate ismi değiştirildi (Cargo.toml'larda)
|
||||
- [x] Rust import'ları güncellendi (pallet_ → pezpallet_)
|
||||
- [x] Duplicate temizliği (pezpallet- → pezpallet-)
|
||||
- [x] Phase 7: staging- → pezstaging-
|
||||
- [x] 8 crate ismi değiştirildi (staging-xcm, staging-node-cli, vb.)
|
||||
- [x] Rust import'ları güncellendi (staging_ → pezstaging_)
|
||||
- [x] Phase 3: sc- → pezsc-
|
||||
- [x] 58 crate ismi değiştirildi (sc-client-api → pezsc-client-api, vb.)
|
||||
- [x] Rust import'ları güncellendi (sc_ → pezsc_)
|
||||
- [x] Duplicate kontrolü: pezsc- yok
|
||||
- [x] Phase 4: sp- → pezsp-
|
||||
- [x] 65 crate ismi değiştirildi (sp-core → pezsp-core, vb.)
|
||||
- [x] Rust import'ları güncellendi (sp_ → pezsp_)
|
||||
- [x] Duplicate kontrolü: pezsp- yok
|
||||
|
||||
## BEKLEYEN İŞLER
|
||||
Yok - Tüm rebranding tamamlandı!
|
||||
|
||||
## SON DURUM
|
||||
2025-12-13: Tüm phase'ler tamamlandı.
|
||||
|
||||
Tamamlanan değişiklikler:
|
||||
- substrate → bizinikiwi
|
||||
- cumulus → pezcumulus
|
||||
- frame- → pezframe- (19 crate)
|
||||
- pallet- → pezpallet- (172 crate)
|
||||
- staging- → pezstaging- (8 crate)
|
||||
- sc- → pezsc- (58 crate)
|
||||
- sp- → pezsp- (65 crate)
|
||||
|
||||
## KOMUTLAR
|
||||
Her komutta mutlaka path belirt:
|
||||
```bash
|
||||
cd /home/mamostehp/kurdistan-sdk && <komut>
|
||||
```
|
||||
|
||||
## SONRAKI ADIMLAR
|
||||
1. cargo check --workspace ile doğrulama
|
||||
2. Git commit
|
||||
3. Kellnr publish test
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
# ignore zombienet as they do some deliberate custom toml stuff
|
||||
exclude = [
|
||||
"bridges/testing/**",
|
||||
"pezbridges/testing/**",
|
||||
"pezcumulus/zombienet/**",
|
||||
"pezkuwi/node/malus/integrationtests/**",
|
||||
"pezkuwi/zombienet_tests/**",
|
||||
|
||||
@@ -1,159 +0,0 @@
|
||||
# docs.pezkuwichain.io Deployment Summary
|
||||
|
||||
**Date:** 2025-12-06
|
||||
**Status:** ✅ COMPLETED
|
||||
|
||||
## Overview
|
||||
|
||||
Successfully deployed official Pezkuwi SDK documentation website at https://docs.pezkuwichain.io with proper branding, content, and navigation.
|
||||
|
||||
## Deployment Details
|
||||
|
||||
### Site Structure
|
||||
|
||||
```
|
||||
https://docs.pezkuwichain.io/
|
||||
├── / # Main page (whitepaper content + navigation)
|
||||
├── /pezkuwi/ # Pezkuwi SDK documentation
|
||||
├── /bizinikiwi/ # Bizinikiwi framework documentation
|
||||
└── /whitepaper/
|
||||
├── whitepaper.html # Full whitepaper HTML
|
||||
├── Whitepaper.pdf # Downloadable PDF
|
||||
└── *.png # Whitepaper images (4 files)
|
||||
```
|
||||
|
||||
### Pages Deployed
|
||||
|
||||
1. **Main Page (`/`)**
|
||||
- Modern gradient design (purple/teal theme)
|
||||
- PezkuwiChain branding
|
||||
- Header with navigation buttons
|
||||
- Embedded whitepaper overview
|
||||
- Quick action buttons (Download Whitepaper, View Pezkuwi SDK, View Bizinikiwi)
|
||||
- Status: ✅ HTTP 200 OK
|
||||
|
||||
2. **Pezkuwi SDK Page (`/pezkuwi/`)**
|
||||
- Source: `/home/mamostehp/Pezkuwi-SDK/docs/sdk/src/pezkuwi_sdk/mod.rs`
|
||||
- Content: Official Pezkuwi SDK documentation
|
||||
- Sections:
|
||||
- Getting Started
|
||||
- Components (Bizinikiwi, FRAME, Pezcumulus, XCM, Pezkuwi)
|
||||
- Binaries
|
||||
- Notable Upstream Crates
|
||||
- Trophy Section (Downstream Projects)
|
||||
- Status: ✅ HTTP 200 OK
|
||||
|
||||
3. **Bizinikiwi Page (`/bizinikiwi/`)**
|
||||
- Source: `/home/mamostehp/Pezkuwi-SDK/docs/sdk/src/pezkuwi_sdk/bizinikiwi.rs`
|
||||
- Content: Official Bizinikiwi framework documentation
|
||||
- Sections:
|
||||
- Overview & Philosophy
|
||||
- How to Get Started
|
||||
- Structure (pezsc-*, pezsp-*, pezpallet-*, frame-* crates)
|
||||
- WASM Build
|
||||
- Anatomy of a Binary Crate
|
||||
- Teyrchain
|
||||
- Where To Go Next (consensus crates)
|
||||
- Status: ✅ HTTP 200 OK
|
||||
|
||||
4. **Whitepaper (`/whitepaper/`)**
|
||||
- Full HTML version: `whitepaper.html`
|
||||
- Downloadable PDF: `Whitepaper.pdf`
|
||||
- Supporting images: 4 PNG files
|
||||
- Status: ✅ HTTP 200 OK (both HTML and PDF)
|
||||
|
||||
## Technical Implementation
|
||||
|
||||
### Server Configuration
|
||||
- **Host:** 37.60.230.9
|
||||
- **Web Root:** `/var/www/docs/`
|
||||
- **Web Server:** nginx
|
||||
- **SSL:** Ready for certbot/Let's Encrypt
|
||||
- **Access:** SSH via `~/.ssh/id_rsa`
|
||||
|
||||
### Content Generation
|
||||
- Created Python scripts to parse rustdoc format (`.rs` files with `//!` comments)
|
||||
- Generated clean, styled HTML pages with:
|
||||
- Consistent header/navigation
|
||||
- Modern CSS design (gradients, shadows, responsive)
|
||||
- Proper typography and spacing
|
||||
- Interactive elements (hover effects, buttons)
|
||||
|
||||
### Design Features
|
||||
- **Color Scheme:**
|
||||
- Purple gradient header: `#2d1b69` → `#3d2f7f` → `#4a3f8f`
|
||||
- Teal accents: `#11998e` → `#38ef7d`
|
||||
- Dark blue background: `#1a1a2e` → `#16213e` → `#0f3460`
|
||||
- White content area: `rgba(255,255,255,0.98)`
|
||||
|
||||
- **Components:**
|
||||
- Gradient buttons with hover effects
|
||||
- Info boxes for highlighting important content
|
||||
- Badge containers for tags/labels
|
||||
- Component sections with left border accent
|
||||
- Responsive design for all screen sizes
|
||||
|
||||
## Link Checker Updates
|
||||
|
||||
### Kategori 7: Fixed
|
||||
- **Issue:** 27 files contained invalid GitHub paths `github.com/pezkuwichain/docs.pezkuwichain.io/*`
|
||||
- **Explanation:** docs.pezkuwichain.io is a website, not a GitHub repository
|
||||
- **Solution:** Added wildcard exclusion pattern to `.config/lychee.toml`
|
||||
- **Pattern:** `"https://github.com/pezkuwichain/docs.pezkuwichain.io/*"`
|
||||
|
||||
### Kategori 8: Fixed
|
||||
- **Issue:** docs.pezkuwichain.io returned 500 errors
|
||||
- **Root Cause:** nginx config had escaped `\$uri` instead of `$uri`
|
||||
- **Solution:** Fixed nginx config, deployed content, site now returns HTTP 200 OK
|
||||
- **Deployment:** Main page, Pezkuwi SDK, Bizinikiwi, and Whitepaper pages all working
|
||||
|
||||
## Files Modified
|
||||
|
||||
1. `.config/lychee.toml` - Added GitHub path exclusion pattern
|
||||
2. `.link-checker-errors.md` - Updated progress tracking for Kategori 7 & 8
|
||||
3. `.docs-deployment-summary.md` - This file (deployment documentation)
|
||||
|
||||
## Verification
|
||||
|
||||
All pages tested and confirmed working:
|
||||
```bash
|
||||
curl -s -o /dev/null -w "%{http_code}" https://docs.pezkuwichain.io/
|
||||
# Output: 200
|
||||
|
||||
curl -s -o /dev/null -w "%{http_code}" https://docs.pezkuwichain.io/pezkuwi/
|
||||
# Output: 200
|
||||
|
||||
curl -s -o /dev/null -w "%{http_code}" https://docs.pezkuwichain.io/bizinikiwi/
|
||||
# Output: 200
|
||||
|
||||
curl -s -o /dev/null -w "%{http_code}" https://docs.pezkuwichain.io/whitepaper/whitepaper.html
|
||||
# Output: 200
|
||||
|
||||
curl -s -o /dev/null -w "%{http_code}" https://docs.pezkuwichain.io/whitepaper/Whitepaper.pdf
|
||||
# Output: 200
|
||||
```
|
||||
|
||||
## Next Steps (Future Work)
|
||||
|
||||
1. **Rustdoc Deployment (Optional):**
|
||||
- Generate full rustdoc output: `cargo doc --no-deps`
|
||||
- Deploy to `/sdk/master/` path
|
||||
- Would enable direct API documentation browsing
|
||||
|
||||
2. **Additional Pages:**
|
||||
- Consider adding more specialized documentation pages
|
||||
- FRAME runtime development guide
|
||||
- Pezcumulus teyrchain guide
|
||||
- XCM cross-consensus messaging guide
|
||||
|
||||
3. **SSL Certificate:**
|
||||
- Already configured for Let's Encrypt/certbot
|
||||
- Can enable HTTPS with: `certbot --nginx -d docs.pezkuwichain.io`
|
||||
|
||||
4. **Content Updates:**
|
||||
- Documentation is sourced from `.rs` files in `docs/sdk/src/`
|
||||
- To update: modify source files, regenerate HTML, redeploy
|
||||
|
||||
## Conclusion
|
||||
|
||||
The docs.pezkuwichain.io website is now fully operational with professional-quality documentation pages for Pezkuwi SDK, Bizinikiwi framework, and the project whitepaper. All link checker errors related to this domain have been resolved.
|
||||
@@ -1,118 +0,0 @@
|
||||
# Link Checker Hataları - Düzeltme Listesi
|
||||
|
||||
Bu dosya link-checker'dan gelen tüm hataları içerir. Her hatayı tek tek düzelttikçe bu listeden sileceğiz.
|
||||
|
||||
## Kategori 1: Sahte/Örnek URL'ler (Exclude edilmeli)
|
||||
|
||||
- [x] `https://some.com/runtime.wasm` - zombienet test dosyası (✅ FIXED: exclude edildi)
|
||||
- [x] `https://try-runtime.pezkuwichain.io/` - örnek URL (✅ FIXED: SSL sertifikası kuruldu)
|
||||
- [x] `https://www.urltomysnapshot.com/file.tgz` - zombienet örnek (✅ FIXED: exclude edildi)
|
||||
- [x] `https://mycloudstorage.com/path/to/my/file.tgz` - zombienet örnek (✅ FIXED: exclude edildi)
|
||||
- [x] `https://www.backupsite.com/my/wasm/file.tgz` - zombienet örnek (✅ FIXED: exclude edildi)
|
||||
- [x] `https://storage.com/path/to/db_snapshot.tgz` - zombienet örnek (3 adet) (✅ FIXED: exclude edildi)
|
||||
- [x] `http://test.com/` - perwerde test dosyası (✅ FIXED: exclude edildi)
|
||||
|
||||
## Kategori 2: Olmayan GitHub Issue'lar
|
||||
|
||||
- [x] `https://github.com/pezkuwichain/pezkuwi-sdk/issues/266` - (✅ FIXED: sed script hatası, doğru issue #139 olarak düzeltildi)
|
||||
- [x] `https://github.com/pezkuwichain/pezkuwi-sdk/issues/512` - (✅ FIXED: sed script hatası 94512→512, doğru issue #142 olarak düzeltildi)
|
||||
- [x] `https://github.com/pezkuwichain/pezkuwi-sdk/issues/565` - (✅ FIXED: sed script hatası 94565→565, doğru issue #143 olarak düzeltildi)
|
||||
- [x] `https://github.com/pezkuwichain/pezkuwi-sdk/issues/9962` - (✅ FIXED: sed script hatası 948362→9962, doğru issue #153 olarak düzeltildi)
|
||||
|
||||
## Kategori 3: Olmayan GitHub PR'lar
|
||||
|
||||
✅ **TÜM PR LİNKLERİ DÜZELTİLDİ** - 92 dosyada tüm `pezkuwichain/pezkuwi-sdk/pull/*` linkleri `paritytech/polkadot-sdk/pull/*` olarak değiştirildi.
|
||||
|
||||
Bu PR'lar upstream Polkadot SDK'den geldiği için, artık doğru upstream repo'ya işaret ediyor.
|
||||
|
||||
## Kategori 4: Olmayan GitHub Path'ler
|
||||
|
||||
✅ **UPSTREAM LİNKLERİ DÜZELTİLDİ** - 100 dosyada `polkadot/` path referansları upstream'e döndürüldü.
|
||||
|
||||
- [x] `https://github.com/pezkuwichain/pezkuwi-sdk/blob/74a5e1a242274ddaadac1feb3990fc95c8612079/bizinikiwi/pezframe/balances/src/types.rs#L38` (✅ FIXED: paritytech/polkadot-sdk)
|
||||
- [x] `https://github.com/pezkuwichain/pezkuwi-sdk/blob/master/polkadot/LICENSE` (✅ FIXED: paritytech/polkadot-sdk)
|
||||
- [x] `https://github.com/pezkuwichain/pezkuwi-sdk/blob/master/polkadot/xcm` (✅ FIXED: paritytech/polkadot-sdk)
|
||||
- [x] `https://github.com/pezkuwichain/pezkuwi-sdk/tree/master/polkadot` (✅ FIXED: paritytech/polkadot-sdk)
|
||||
- [x] `https://github.com/pezkuwichain/pezkuwi-sdk/tree/master/templates/parachain` (✅ FIXED: parachain → teyrchain path düzeltmesi yapıldı)
|
||||
- [x] `pezkuwichain/pezkuwi-sdk@2ab3535` - Codebase'de bulunamadı (link-checker error listesinde var ama koda yok)
|
||||
- [x] `pezkuwichain/pezkuwi-sdk@c0c23b0#diff...` - Codebase'de bulunamadı (link-checker error listesinde var ama koda yok)
|
||||
|
||||
✅ **KATEGORİ 4 TAMAMLANDI** - Tüm GitHub path hataları düzeltildi.
|
||||
|
||||
## Kategori 5: Olmayan Repo'lar
|
||||
|
||||
- [x] `https://github.com/pezkuwichain/pezkuwi-sdk-teyrchain-template` (✅ FIXED: Standalone repo created and all references updated)
|
||||
- [x] `https://github.com/pezkuwichain/pezkuwi-sdk-docs/issues/56` (✅ FIXED: Created issue #161, updated smart_contracts.rs)
|
||||
- [x] `https://github.com/pezkuwichain/pezkuwi-sdk-docs/issues/57` (✅ FIXED: Created issue #162, updated bizinikiwi.rs)
|
||||
- [x] `https://github.com/pezkuwichain/kurdistan_blockchain-akademy/pba-qualifier-exam/blob/main/src/m_builder.rs` (✅ FIXED: Path corrected in previous session)
|
||||
- [x] `https://github.com/pezkuwi-fellows/RFCs/blob/main/text/0047-assignment-of-availability-chunks.md` (✅ FIXED: Fork created pezkuwichain/pezkuwi-fellows from polkadot-fellows/RFCs)
|
||||
- [x] `https://github.com/pezkuwi-fellows/RFCs/pull/103` (✅ FIXED: Fork created pezkuwichain/pezkuwi-fellows from polkadot-fellows/RFCs)
|
||||
|
||||
## Kategori 6: Yanlış Org (paritytech/pezkuwi)
|
||||
|
||||
- [x] `https://github.com/pezkuwichain/kurdistan-sdk/issues/94` (✅ FIXED: Created issue #164, updated pezkuwi/primitives/src/v8/mod.rs)
|
||||
- [x] `https://github.com/pezkuwichain/kurdistan-sdk/issues/95` (✅ FIXED: Created issue #163, updated pezkuwi/primitives/src/v8/mod.rs)
|
||||
- [x] `https://github.com/pezkuwichain/kurdistan-sdk/issues/96` (✅ FIXED: Created issue #166, updated pezkuwi/primitives/src/v8/mod.rs)
|
||||
- [x] `https://github.com/pezkuwichain/kurdistan-sdk/issues/97` (✅ FIXED: Created issue #165, updated pezkuwi/primitives/src/v8/mod.rs)
|
||||
|
||||
## Kategori 7: docs.pezkuwichain.io (GitHub paths - yanlış)
|
||||
|
||||
✅ **KATEGORI 7 TAMAMLANDI** - Tüm `github.com/pezkuwichain/docs.pezkuwichain.io/*` path'leri lychee.toml'de exclude edildi.
|
||||
|
||||
**Açıklama:** Bu linkler GitHub repo path'i gibi görünüyor ama docs.pezkuwichain.io bir website, GitHub repo değil. Bu yüzden wildcard pattern ile exclude edildi.
|
||||
|
||||
**Yapılan Değişiklik:**
|
||||
- `.config/lychee.toml`: `"https://github.com/pezkuwichain/docs.pezkuwichain.io/*"` pattern eklendi
|
||||
|
||||
**Etkilenen linkler (27 dosyada):**
|
||||
- [x] `https://github.com/pezkuwichain/docs.pezkuwichain.io/build/genesis-configuration/`
|
||||
- [x] `https://github.com/pezkuwichain/docs.pezkuwichain.io/build/origins/`
|
||||
- [x] `https://github.com/pezkuwichain/docs.pezkuwichain.io/build/remote-procedure-calls/#public-rpc-interfaces`
|
||||
- [x] `https://github.com/pezkuwichain/docs.pezkuwichain.io/build/runtime-storage/`
|
||||
- [x] `https://github.com/pezkuwichain/docs.pezkuwichain.io/fundamentals/transaction-types/#inherent-transactions`
|
||||
- [x] `https://github.com/pezkuwichain/docs.pezkuwichain.io/install/`
|
||||
- [x] `https://github.com/pezkuwichain/docs.pezkuwichain.io/main-docs/build/tx-weights-fees/`
|
||||
- [x] `https://github.com/pezkuwichain/docs.pezkuwichain.io/main-docs/build/upgrade#runtime-versioning`
|
||||
- [x] `https://github.com/pezkuwichain/docs.pezkuwichain.io/main-docs/fundamentals/state-transitions-and-storage/`
|
||||
- [x] `https://github.com/pezkuwichain/docs.pezkuwichain.io/reference/address-formats/`
|
||||
- [x] `https://github.com/pezkuwichain/docs.pezkuwichain.io/reference/frame-macros/`
|
||||
- [x] `https://github.com/pezkuwichain/docs.pezkuwichain.io/reference/how-to-guides/pezpallet-design/use-tight-coupling/`
|
||||
- [x] `https://github.com/pezkuwichain/docs.pezkuwichain.io/reference/how-to-guides/weights/add-benchmarks/` (3 adet)
|
||||
- [x] `https://github.com/pezkuwichain/docs.pezkuwichain.io/reference/scale-codec/`
|
||||
- [x] `https://github.com/pezkuwichain/docs.pezkuwichain.io/test/benchmark/`
|
||||
- [x] `https://github.com/pezkuwichain/docs.pezkuwichain.io/test/unit-testing/`
|
||||
- [x] `https://github.com/pezkuwichain/docs.pezkuwichain.io/v3/advanced/ss58/`
|
||||
|
||||
## Kategori 8: docs.pezkuwichain.io (500 Internal Server Error)
|
||||
|
||||
✅ **KATEGORI 8 TAMAMLANDI** - docs.pezkuwichain.io nginx config düzeltildi ve site ayağa kalktı!
|
||||
|
||||
**Yapılan Düzeltmeler:**
|
||||
1. ✅ nginx config hatası düzeltildi (`\$uri` → `$uri`)
|
||||
2. ✅ Ana sayfa oluşturuldu (whitepaper content + header design)
|
||||
3. ✅ Whitepaper HTML ve PDF yüklendi
|
||||
4. ✅ Tüm whitepaper görselleri yüklendi
|
||||
5. ✅ Site test edildi (HTTP 200 OK)
|
||||
|
||||
**Site Özellikleri:**
|
||||
- Modern gradient design (purple/teal theme)
|
||||
- Header: PezkuwiChain logo + Whitepaper download + Navigation buttons (Pezkuwi/Bizinikiwi)
|
||||
- Kurdistan map background (subtle)
|
||||
- Embedded whitepaper content
|
||||
- Responsive design
|
||||
|
||||
✅ **DEPLOYMENT TAMAMLANDI (2025-12-06):**
|
||||
1. ✅ `/pezkuwi/` - Official Pezkuwi SDK documentation deployed (from mod.rs)
|
||||
2. ✅ `/bizinikiwi/` - Official Bizinikiwi documentation deployed (from bizinikiwi.rs)
|
||||
3. ✅ Tüm sayfalar test edildi - HTTP 200 OK
|
||||
|
||||
**ESKI HATALAR (artık geçerli değil):**
|
||||
- [x] `https://docs.pezkuwichain.io/` (2 adet) - ✅ FIXED
|
||||
- [x] `https://docs.pezkuwichain.io/develop/toolkit/parachains/polkadot-omni-node/` (2 adet) - Sub-path henüz yok
|
||||
- [x] `https://docs.pezkuwichain.io/infrastructure/running-a-validator/operational-tasks/general-management/#secure-your-validator` - Sub-path henüz yok
|
||||
- [x] `https://docs.pezkuwichain.io/sdk/book/` - Sub-path henüz yok
|
||||
- [x] `https://docs.pezkuwichain.io/sdk/master/*` (tüm rustdoc linkleri) - Rustdoc henüz deploy edilmedi
|
||||
|
||||
---
|
||||
|
||||
**NOT:** Bu dosya düzenlendikçe güncellenecek. Her hatayı düzelttikten sonra ilgili satırı sileceğiz.
|
||||
Generated
+286
-286
@@ -1466,6 +1466,7 @@ dependencies = [
|
||||
"pezpallet-xcm-bridge-hub-router",
|
||||
"pezpallet-xcm-precompiles",
|
||||
"pezsnowbridge-outbound-queue-primitives",
|
||||
"pezsnowbridge-pezpallet-system-frontend",
|
||||
"pezsp-api",
|
||||
"pezsp-arithmetic",
|
||||
"pezsp-block-builder",
|
||||
@@ -1492,7 +1493,6 @@ dependencies = [
|
||||
"primitive-types 0.13.1",
|
||||
"scale-info",
|
||||
"serde_json",
|
||||
"snowbridge-pezpallet-system-frontend",
|
||||
"snowpezbridge-runtime-common",
|
||||
"testnet-teyrchains-constants",
|
||||
"teyrchains-common",
|
||||
@@ -10212,6 +10212,16 @@ dependencies = [
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pez-erasure-coding-fuzzer"
|
||||
version = "1.0.0"
|
||||
dependencies = [
|
||||
"honggfuzz",
|
||||
"pezkuwi-erasure-coding",
|
||||
"pezkuwi-pez-node-primitives",
|
||||
"pezkuwi-primitives",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pez-ethereum-standards"
|
||||
version = "0.1.0"
|
||||
@@ -10701,16 +10711,6 @@ dependencies = [
|
||||
"syn 2.0.111",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pez_erasure_coding_fuzzer"
|
||||
version = "1.0.0"
|
||||
dependencies = [
|
||||
"honggfuzz",
|
||||
"pezkuwi-erasure-coding",
|
||||
"pezkuwi-pez-node-primitives",
|
||||
"pezkuwi-primitives",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pezbp-runtime"
|
||||
version = "0.7.0"
|
||||
@@ -10771,15 +10771,15 @@ dependencies = [
|
||||
"pezpallet-xcm",
|
||||
"pezsnowbridge-inbound-queue-primitives",
|
||||
"pezsnowbridge-outbound-queue-primitives",
|
||||
"pezsnowbridge-pezpallet-inbound-queue-fixtures",
|
||||
"pezsnowbridge-pezpallet-outbound-queue",
|
||||
"pezsnowbridge-pezpallet-system",
|
||||
"pezsp-core",
|
||||
"pezsp-runtime",
|
||||
"pezstaging-xcm",
|
||||
"pezstaging-xcm-builder",
|
||||
"pezstaging-xcm-executor",
|
||||
"scale-info",
|
||||
"snowbridge-pezpallet-inbound-queue-fixtures",
|
||||
"snowbridge-pezpallet-outbound-queue",
|
||||
"snowbridge-pezpallet-system",
|
||||
"testnet-teyrchains-constants",
|
||||
"teyrchains-common",
|
||||
]
|
||||
@@ -10851,6 +10851,11 @@ dependencies = [
|
||||
"pezsnowbridge-merkle-tree",
|
||||
"pezsnowbridge-outbound-queue-primitives",
|
||||
"pezsnowbridge-outbound-queue-runtime-api",
|
||||
"pezsnowbridge-pezpallet-ethereum-client",
|
||||
"pezsnowbridge-pezpallet-inbound-queue",
|
||||
"pezsnowbridge-pezpallet-inbound-queue-fixtures",
|
||||
"pezsnowbridge-pezpallet-outbound-queue",
|
||||
"pezsnowbridge-pezpallet-system",
|
||||
"pezsnowbridge-runtime-test-common",
|
||||
"pezsnowbridge-system-runtime-api",
|
||||
"pezsp-api",
|
||||
@@ -10875,11 +10880,6 @@ dependencies = [
|
||||
"scale-info",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"snowbridge-pezpallet-ethereum-client",
|
||||
"snowbridge-pezpallet-inbound-queue",
|
||||
"snowbridge-pezpallet-inbound-queue-fixtures",
|
||||
"snowbridge-pezpallet-outbound-queue",
|
||||
"snowbridge-pezpallet-system",
|
||||
"testnet-teyrchains-constants",
|
||||
"teyrchains-common",
|
||||
"teyrchains-runtimes-test-utils",
|
||||
@@ -10969,6 +10969,13 @@ dependencies = [
|
||||
"pezsnowbridge-core",
|
||||
"pezsnowbridge-inbound-queue-primitives",
|
||||
"pezsnowbridge-outbound-queue-primitives",
|
||||
"pezsnowbridge-pezpallet-inbound-queue",
|
||||
"pezsnowbridge-pezpallet-inbound-queue-fixtures",
|
||||
"pezsnowbridge-pezpallet-inbound-queue-v2",
|
||||
"pezsnowbridge-pezpallet-outbound-queue",
|
||||
"pezsnowbridge-pezpallet-outbound-queue-v2",
|
||||
"pezsnowbridge-pezpallet-system",
|
||||
"pezsnowbridge-pezpallet-system-v2",
|
||||
"pezsp-core",
|
||||
"pezsp-io",
|
||||
"pezsp-runtime",
|
||||
@@ -10976,13 +10983,6 @@ dependencies = [
|
||||
"pezstaging-xcm-builder",
|
||||
"pezstaging-xcm-executor",
|
||||
"scale-info",
|
||||
"snowbridge-pezpallet-inbound-queue",
|
||||
"snowbridge-pezpallet-inbound-queue-fixtures",
|
||||
"snowbridge-pezpallet-inbound-queue-v2",
|
||||
"snowbridge-pezpallet-outbound-queue",
|
||||
"snowbridge-pezpallet-outbound-queue-v2",
|
||||
"snowbridge-pezpallet-system",
|
||||
"snowbridge-pezpallet-system-v2",
|
||||
"testnet-teyrchains-constants",
|
||||
"teyrchains-common",
|
||||
]
|
||||
@@ -11053,6 +11053,15 @@ dependencies = [
|
||||
"pezsnowbridge-outbound-queue-primitives",
|
||||
"pezsnowbridge-outbound-queue-runtime-api",
|
||||
"pezsnowbridge-outbound-queue-v2-runtime-api",
|
||||
"pezsnowbridge-pezpallet-ethereum-client",
|
||||
"pezsnowbridge-pezpallet-inbound-queue",
|
||||
"pezsnowbridge-pezpallet-inbound-queue-fixtures",
|
||||
"pezsnowbridge-pezpallet-inbound-queue-v2",
|
||||
"pezsnowbridge-pezpallet-inbound-queue-v2-fixtures",
|
||||
"pezsnowbridge-pezpallet-outbound-queue",
|
||||
"pezsnowbridge-pezpallet-outbound-queue-v2",
|
||||
"pezsnowbridge-pezpallet-system",
|
||||
"pezsnowbridge-pezpallet-system-v2",
|
||||
"pezsnowbridge-runtime-test-common",
|
||||
"pezsnowbridge-system-runtime-api",
|
||||
"pezsnowbridge-system-v2-runtime-api",
|
||||
@@ -11078,15 +11087,6 @@ dependencies = [
|
||||
"scale-info",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"snowbridge-pezpallet-ethereum-client",
|
||||
"snowbridge-pezpallet-inbound-queue",
|
||||
"snowbridge-pezpallet-inbound-queue-fixtures",
|
||||
"snowbridge-pezpallet-inbound-queue-v2",
|
||||
"snowbridge-pezpallet-inbound-queue-v2-fixtures",
|
||||
"snowbridge-pezpallet-outbound-queue",
|
||||
"snowbridge-pezpallet-outbound-queue-v2",
|
||||
"snowbridge-pezpallet-system",
|
||||
"snowbridge-pezpallet-system-v2",
|
||||
"testnet-teyrchains-constants",
|
||||
"teyrchains-common",
|
||||
"teyrchains-runtimes-test-utils",
|
||||
@@ -19952,6 +19952,253 @@ dependencies = [
|
||||
"scale-info",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pezsnowbridge-pezpallet-ethereum-client"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"hex-literal",
|
||||
"parity-scale-codec",
|
||||
"pezframe-benchmarking",
|
||||
"pezframe-support",
|
||||
"pezframe-system",
|
||||
"pezpallet-timestamp",
|
||||
"pezsnowbridge-beacon-primitives",
|
||||
"pezsnowbridge-core",
|
||||
"pezsnowbridge-ethereum",
|
||||
"pezsnowbridge-pezpallet-ethereum-client-fixtures",
|
||||
"pezsnowbridge-verification-primitives",
|
||||
"pezsp-core",
|
||||
"pezsp-io",
|
||||
"pezsp-runtime",
|
||||
"pezsp-std",
|
||||
"scale-info",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"static_assertions",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pezsnowbridge-pezpallet-ethereum-client-fixtures"
|
||||
version = "0.9.0"
|
||||
dependencies = [
|
||||
"hex-literal",
|
||||
"pezsnowbridge-beacon-primitives",
|
||||
"pezsnowbridge-verification-primitives",
|
||||
"pezsp-core",
|
||||
"pezsp-std",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pezsnowbridge-pezpallet-inbound-queue"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"alloy-core",
|
||||
"hex-literal",
|
||||
"parity-scale-codec",
|
||||
"pezframe-benchmarking",
|
||||
"pezframe-support",
|
||||
"pezframe-system",
|
||||
"pezpallet-balances",
|
||||
"pezsnowbridge-beacon-primitives",
|
||||
"pezsnowbridge-core",
|
||||
"pezsnowbridge-inbound-queue-primitives",
|
||||
"pezsnowbridge-pezpallet-ethereum-client",
|
||||
"pezsnowbridge-pezpallet-inbound-queue-fixtures",
|
||||
"pezsp-core",
|
||||
"pezsp-io",
|
||||
"pezsp-keyring",
|
||||
"pezsp-runtime",
|
||||
"pezsp-std",
|
||||
"pezstaging-xcm",
|
||||
"pezstaging-xcm-executor",
|
||||
"scale-info",
|
||||
"serde",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pezsnowbridge-pezpallet-inbound-queue-fixtures"
|
||||
version = "0.10.0"
|
||||
dependencies = [
|
||||
"hex-literal",
|
||||
"pezsnowbridge-beacon-primitives",
|
||||
"pezsnowbridge-core",
|
||||
"pezsnowbridge-inbound-queue-primitives",
|
||||
"pezsp-core",
|
||||
"pezsp-std",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pezsnowbridge-pezpallet-inbound-queue-v2"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"alloy-core",
|
||||
"bp-relayers",
|
||||
"hex-literal",
|
||||
"parity-scale-codec",
|
||||
"pezframe-benchmarking",
|
||||
"pezframe-support",
|
||||
"pezframe-system",
|
||||
"pezpallet-balances",
|
||||
"pezsnowbridge-beacon-primitives",
|
||||
"pezsnowbridge-core",
|
||||
"pezsnowbridge-inbound-queue-primitives",
|
||||
"pezsnowbridge-pezpallet-inbound-queue-v2-fixtures",
|
||||
"pezsnowbridge-test-utils",
|
||||
"pezsp-core",
|
||||
"pezsp-io",
|
||||
"pezsp-keyring",
|
||||
"pezsp-runtime",
|
||||
"pezsp-std",
|
||||
"pezstaging-xcm",
|
||||
"pezstaging-xcm-builder",
|
||||
"pezstaging-xcm-executor",
|
||||
"scale-info",
|
||||
"serde",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pezsnowbridge-pezpallet-inbound-queue-v2-fixtures"
|
||||
version = "0.10.0"
|
||||
dependencies = [
|
||||
"hex-literal",
|
||||
"pezsnowbridge-beacon-primitives",
|
||||
"pezsnowbridge-core",
|
||||
"pezsnowbridge-inbound-queue-primitives",
|
||||
"pezsp-core",
|
||||
"pezsp-std",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pezsnowbridge-pezpallet-outbound-queue"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"bridge-hub-common",
|
||||
"ethabi-decode",
|
||||
"parity-scale-codec",
|
||||
"pezframe-benchmarking",
|
||||
"pezframe-support",
|
||||
"pezframe-system",
|
||||
"pezpallet-message-queue",
|
||||
"pezsnowbridge-core",
|
||||
"pezsnowbridge-merkle-tree",
|
||||
"pezsnowbridge-outbound-queue-primitives",
|
||||
"pezsp-arithmetic",
|
||||
"pezsp-core",
|
||||
"pezsp-io",
|
||||
"pezsp-runtime",
|
||||
"pezsp-std",
|
||||
"scale-info",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pezsnowbridge-pezpallet-outbound-queue-v2"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"alloy-core",
|
||||
"bp-relayers",
|
||||
"ethabi-decode",
|
||||
"hex-literal",
|
||||
"parity-scale-codec",
|
||||
"pezframe-benchmarking",
|
||||
"pezframe-support",
|
||||
"pezframe-system",
|
||||
"pezpallet-message-queue",
|
||||
"pezsnowbridge-beacon-primitives",
|
||||
"pezsnowbridge-core",
|
||||
"pezsnowbridge-merkle-tree",
|
||||
"pezsnowbridge-outbound-queue-primitives",
|
||||
"pezsnowbridge-test-utils",
|
||||
"pezsnowbridge-verification-primitives",
|
||||
"pezsp-arithmetic",
|
||||
"pezsp-core",
|
||||
"pezsp-io",
|
||||
"pezsp-runtime",
|
||||
"pezsp-std",
|
||||
"pezstaging-xcm",
|
||||
"pezstaging-xcm-builder",
|
||||
"pezstaging-xcm-executor",
|
||||
"scale-info",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pezsnowbridge-pezpallet-system"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"hex",
|
||||
"hex-literal",
|
||||
"parity-scale-codec",
|
||||
"pezframe-benchmarking",
|
||||
"pezframe-support",
|
||||
"pezframe-system",
|
||||
"pezkuwi-primitives",
|
||||
"pezpallet-balances",
|
||||
"pezpallet-message-queue",
|
||||
"pezsnowbridge-core",
|
||||
"pezsnowbridge-outbound-queue-primitives",
|
||||
"pezsnowbridge-pezpallet-outbound-queue",
|
||||
"pezsp-core",
|
||||
"pezsp-io",
|
||||
"pezsp-runtime",
|
||||
"pezsp-std",
|
||||
"pezstaging-xcm",
|
||||
"pezstaging-xcm-executor",
|
||||
"scale-info",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pezsnowbridge-pezpallet-system-frontend"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"parity-scale-codec",
|
||||
"pezframe-benchmarking",
|
||||
"pezframe-support",
|
||||
"pezframe-system",
|
||||
"pezpallet-asset-conversion",
|
||||
"pezpallet-balances",
|
||||
"pezsnowbridge-core",
|
||||
"pezsnowbridge-test-utils",
|
||||
"pezsp-core",
|
||||
"pezsp-io",
|
||||
"pezsp-keyring",
|
||||
"pezsp-runtime",
|
||||
"pezsp-std",
|
||||
"pezstaging-xcm",
|
||||
"pezstaging-xcm-executor",
|
||||
"scale-info",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pezsnowbridge-pezpallet-system-v2"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"hex-literal",
|
||||
"parity-scale-codec",
|
||||
"pezframe-benchmarking",
|
||||
"pezframe-support",
|
||||
"pezframe-system",
|
||||
"pezpallet-balances",
|
||||
"pezsnowbridge-core",
|
||||
"pezsnowbridge-outbound-queue-primitives",
|
||||
"pezsnowbridge-pezpallet-system",
|
||||
"pezsnowbridge-test-utils",
|
||||
"pezsp-core",
|
||||
"pezsp-io",
|
||||
"pezsp-keyring",
|
||||
"pezsp-runtime",
|
||||
"pezsp-std",
|
||||
"pezstaging-xcm",
|
||||
"pezstaging-xcm-executor",
|
||||
"scale-info",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pezsnowbridge-runtime-test-common"
|
||||
version = "0.2.0"
|
||||
@@ -19968,6 +20215,10 @@ dependencies = [
|
||||
"pezpallet-utility",
|
||||
"pezpallet-xcm",
|
||||
"pezsnowbridge-core",
|
||||
"pezsnowbridge-pezpallet-ethereum-client",
|
||||
"pezsnowbridge-pezpallet-ethereum-client-fixtures",
|
||||
"pezsnowbridge-pezpallet-outbound-queue",
|
||||
"pezsnowbridge-pezpallet-system",
|
||||
"pezsp-core",
|
||||
"pezsp-io",
|
||||
"pezsp-keyring",
|
||||
@@ -19975,10 +20226,6 @@ dependencies = [
|
||||
"pezstaging-teyrchain-info",
|
||||
"pezstaging-xcm",
|
||||
"pezstaging-xcm-executor",
|
||||
"snowbridge-pezpallet-ethereum-client",
|
||||
"snowbridge-pezpallet-ethereum-client-fixtures",
|
||||
"snowbridge-pezpallet-outbound-queue",
|
||||
"snowbridge-pezpallet-system",
|
||||
"teyrchains-runtimes-test-utils",
|
||||
]
|
||||
|
||||
@@ -24343,253 +24590,6 @@ dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "snowbridge-pezpallet-ethereum-client"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"hex-literal",
|
||||
"parity-scale-codec",
|
||||
"pezframe-benchmarking",
|
||||
"pezframe-support",
|
||||
"pezframe-system",
|
||||
"pezpallet-timestamp",
|
||||
"pezsnowbridge-beacon-primitives",
|
||||
"pezsnowbridge-core",
|
||||
"pezsnowbridge-ethereum",
|
||||
"pezsnowbridge-verification-primitives",
|
||||
"pezsp-core",
|
||||
"pezsp-io",
|
||||
"pezsp-runtime",
|
||||
"pezsp-std",
|
||||
"scale-info",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"snowbridge-pezpallet-ethereum-client-fixtures",
|
||||
"static_assertions",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "snowbridge-pezpallet-ethereum-client-fixtures"
|
||||
version = "0.9.0"
|
||||
dependencies = [
|
||||
"hex-literal",
|
||||
"pezsnowbridge-beacon-primitives",
|
||||
"pezsnowbridge-verification-primitives",
|
||||
"pezsp-core",
|
||||
"pezsp-std",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "snowbridge-pezpallet-inbound-queue"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"alloy-core",
|
||||
"hex-literal",
|
||||
"parity-scale-codec",
|
||||
"pezframe-benchmarking",
|
||||
"pezframe-support",
|
||||
"pezframe-system",
|
||||
"pezpallet-balances",
|
||||
"pezsnowbridge-beacon-primitives",
|
||||
"pezsnowbridge-core",
|
||||
"pezsnowbridge-inbound-queue-primitives",
|
||||
"pezsp-core",
|
||||
"pezsp-io",
|
||||
"pezsp-keyring",
|
||||
"pezsp-runtime",
|
||||
"pezsp-std",
|
||||
"pezstaging-xcm",
|
||||
"pezstaging-xcm-executor",
|
||||
"scale-info",
|
||||
"serde",
|
||||
"snowbridge-pezpallet-ethereum-client",
|
||||
"snowbridge-pezpallet-inbound-queue-fixtures",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "snowbridge-pezpallet-inbound-queue-fixtures"
|
||||
version = "0.10.0"
|
||||
dependencies = [
|
||||
"hex-literal",
|
||||
"pezsnowbridge-beacon-primitives",
|
||||
"pezsnowbridge-core",
|
||||
"pezsnowbridge-inbound-queue-primitives",
|
||||
"pezsp-core",
|
||||
"pezsp-std",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "snowbridge-pezpallet-inbound-queue-v2"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"alloy-core",
|
||||
"bp-relayers",
|
||||
"hex-literal",
|
||||
"parity-scale-codec",
|
||||
"pezframe-benchmarking",
|
||||
"pezframe-support",
|
||||
"pezframe-system",
|
||||
"pezpallet-balances",
|
||||
"pezsnowbridge-beacon-primitives",
|
||||
"pezsnowbridge-core",
|
||||
"pezsnowbridge-inbound-queue-primitives",
|
||||
"pezsnowbridge-test-utils",
|
||||
"pezsp-core",
|
||||
"pezsp-io",
|
||||
"pezsp-keyring",
|
||||
"pezsp-runtime",
|
||||
"pezsp-std",
|
||||
"pezstaging-xcm",
|
||||
"pezstaging-xcm-builder",
|
||||
"pezstaging-xcm-executor",
|
||||
"scale-info",
|
||||
"serde",
|
||||
"snowbridge-pezpallet-inbound-queue-v2-fixtures",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "snowbridge-pezpallet-inbound-queue-v2-fixtures"
|
||||
version = "0.10.0"
|
||||
dependencies = [
|
||||
"hex-literal",
|
||||
"pezsnowbridge-beacon-primitives",
|
||||
"pezsnowbridge-core",
|
||||
"pezsnowbridge-inbound-queue-primitives",
|
||||
"pezsp-core",
|
||||
"pezsp-std",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "snowbridge-pezpallet-outbound-queue"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"bridge-hub-common",
|
||||
"ethabi-decode",
|
||||
"parity-scale-codec",
|
||||
"pezframe-benchmarking",
|
||||
"pezframe-support",
|
||||
"pezframe-system",
|
||||
"pezpallet-message-queue",
|
||||
"pezsnowbridge-core",
|
||||
"pezsnowbridge-merkle-tree",
|
||||
"pezsnowbridge-outbound-queue-primitives",
|
||||
"pezsp-arithmetic",
|
||||
"pezsp-core",
|
||||
"pezsp-io",
|
||||
"pezsp-runtime",
|
||||
"pezsp-std",
|
||||
"scale-info",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "snowbridge-pezpallet-outbound-queue-v2"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"alloy-core",
|
||||
"bp-relayers",
|
||||
"ethabi-decode",
|
||||
"hex-literal",
|
||||
"parity-scale-codec",
|
||||
"pezframe-benchmarking",
|
||||
"pezframe-support",
|
||||
"pezframe-system",
|
||||
"pezpallet-message-queue",
|
||||
"pezsnowbridge-beacon-primitives",
|
||||
"pezsnowbridge-core",
|
||||
"pezsnowbridge-merkle-tree",
|
||||
"pezsnowbridge-outbound-queue-primitives",
|
||||
"pezsnowbridge-test-utils",
|
||||
"pezsnowbridge-verification-primitives",
|
||||
"pezsp-arithmetic",
|
||||
"pezsp-core",
|
||||
"pezsp-io",
|
||||
"pezsp-runtime",
|
||||
"pezsp-std",
|
||||
"pezstaging-xcm",
|
||||
"pezstaging-xcm-builder",
|
||||
"pezstaging-xcm-executor",
|
||||
"scale-info",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "snowbridge-pezpallet-system"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"hex",
|
||||
"hex-literal",
|
||||
"parity-scale-codec",
|
||||
"pezframe-benchmarking",
|
||||
"pezframe-support",
|
||||
"pezframe-system",
|
||||
"pezkuwi-primitives",
|
||||
"pezpallet-balances",
|
||||
"pezpallet-message-queue",
|
||||
"pezsnowbridge-core",
|
||||
"pezsnowbridge-outbound-queue-primitives",
|
||||
"pezsp-core",
|
||||
"pezsp-io",
|
||||
"pezsp-runtime",
|
||||
"pezsp-std",
|
||||
"pezstaging-xcm",
|
||||
"pezstaging-xcm-executor",
|
||||
"scale-info",
|
||||
"snowbridge-pezpallet-outbound-queue",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "snowbridge-pezpallet-system-frontend"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"parity-scale-codec",
|
||||
"pezframe-benchmarking",
|
||||
"pezframe-support",
|
||||
"pezframe-system",
|
||||
"pezpallet-asset-conversion",
|
||||
"pezpallet-balances",
|
||||
"pezsnowbridge-core",
|
||||
"pezsnowbridge-test-utils",
|
||||
"pezsp-core",
|
||||
"pezsp-io",
|
||||
"pezsp-keyring",
|
||||
"pezsp-runtime",
|
||||
"pezsp-std",
|
||||
"pezstaging-xcm",
|
||||
"pezstaging-xcm-executor",
|
||||
"scale-info",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "snowbridge-pezpallet-system-v2"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"hex-literal",
|
||||
"parity-scale-codec",
|
||||
"pezframe-benchmarking",
|
||||
"pezframe-support",
|
||||
"pezframe-system",
|
||||
"pezpallet-balances",
|
||||
"pezsnowbridge-core",
|
||||
"pezsnowbridge-outbound-queue-primitives",
|
||||
"pezsnowbridge-test-utils",
|
||||
"pezsp-core",
|
||||
"pezsp-io",
|
||||
"pezsp-keyring",
|
||||
"pezsp-runtime",
|
||||
"pezsp-std",
|
||||
"pezstaging-xcm",
|
||||
"pezstaging-xcm-executor",
|
||||
"scale-info",
|
||||
"snowbridge-pezpallet-system",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "snowpezbridge-runtime-common"
|
||||
version = "0.2.0"
|
||||
|
||||
+108
-108
@@ -12,58 +12,58 @@ repository = "https://github.com/pezkuwichain/pezkuwi-sdk.git"
|
||||
resolver = "2"
|
||||
|
||||
members = [
|
||||
"bridges/bin/runtime-common",
|
||||
"bridges/chains/chain-pezcumulus",
|
||||
"bridges/chains/chain-pezkuwi-bulletin",
|
||||
"bridges/modules/beefy",
|
||||
"bridges/modules/grandpa",
|
||||
"bridges/modules/messages",
|
||||
"bridges/modules/relayers",
|
||||
"bridges/modules/teyrchains",
|
||||
"bridges/modules/xcm-bridge-hub",
|
||||
"bridges/modules/xcm-bridge-hub-router",
|
||||
"bridges/primitives/beefy",
|
||||
"bridges/primitives/header-chain",
|
||||
"bridges/primitives/messages",
|
||||
"bridges/primitives/pezkuwi-core",
|
||||
"bridges/primitives/relayers",
|
||||
"bridges/primitives/runtime",
|
||||
"bridges/primitives/test-utils",
|
||||
"bridges/primitives/teyrchains",
|
||||
"bridges/primitives/xcm-bridge-hub",
|
||||
"bridges/primitives/xcm-bridge-hub-router",
|
||||
"bridges/relays/client-bizinikiwi",
|
||||
"bridges/relays/equivocation",
|
||||
"bridges/relays/finality",
|
||||
"bridges/relays/lib-bizinikiwi-relay",
|
||||
"bridges/relays/messages",
|
||||
"bridges/relays/teyrchains",
|
||||
"bridges/relays/utils",
|
||||
"bridges/snowbridge/pezpallets/ethereum-client",
|
||||
"bridges/snowbridge/pezpallets/ethereum-client/fixtures",
|
||||
"bridges/snowbridge/pezpallets/inbound-queue",
|
||||
"bridges/snowbridge/pezpallets/inbound-queue-v2",
|
||||
"bridges/snowbridge/pezpallets/inbound-queue-v2/fixtures",
|
||||
"bridges/snowbridge/pezpallets/inbound-queue/fixtures",
|
||||
"bridges/snowbridge/pezpallets/outbound-queue",
|
||||
"bridges/snowbridge/pezpallets/outbound-queue-v2",
|
||||
"bridges/snowbridge/pezpallets/outbound-queue-v2/runtime-api",
|
||||
"bridges/snowbridge/pezpallets/outbound-queue/runtime-api",
|
||||
"bridges/snowbridge/pezpallets/system",
|
||||
"bridges/snowbridge/pezpallets/system-frontend",
|
||||
"bridges/snowbridge/pezpallets/system-v2",
|
||||
"bridges/snowbridge/pezpallets/system-v2/runtime-api",
|
||||
"bridges/snowbridge/pezpallets/system/runtime-api",
|
||||
"bridges/snowbridge/primitives/beacon",
|
||||
"bridges/snowbridge/primitives/core",
|
||||
"bridges/snowbridge/primitives/ethereum",
|
||||
"bridges/snowbridge/primitives/inbound-queue",
|
||||
"bridges/snowbridge/primitives/merkle-tree",
|
||||
"bridges/snowbridge/primitives/outbound-queue",
|
||||
"bridges/snowbridge/primitives/verification",
|
||||
"bridges/snowbridge/runtime/runtime-common",
|
||||
"bridges/snowbridge/runtime/test-common",
|
||||
"bridges/snowbridge/test-utils",
|
||||
"pezbridges/bin/runtime-common",
|
||||
"pezbridges/chains/chain-pezcumulus",
|
||||
"pezbridges/chains/chain-pezkuwi-bulletin",
|
||||
"pezbridges/modules/beefy",
|
||||
"pezbridges/modules/grandpa",
|
||||
"pezbridges/modules/messages",
|
||||
"pezbridges/modules/relayers",
|
||||
"pezbridges/modules/teyrchains",
|
||||
"pezbridges/modules/xcm-bridge-hub",
|
||||
"pezbridges/modules/xcm-bridge-hub-router",
|
||||
"pezbridges/primitives/beefy",
|
||||
"pezbridges/primitives/header-chain",
|
||||
"pezbridges/primitives/messages",
|
||||
"pezbridges/primitives/pezkuwi-core",
|
||||
"pezbridges/primitives/relayers",
|
||||
"pezbridges/primitives/runtime",
|
||||
"pezbridges/primitives/test-utils",
|
||||
"pezbridges/primitives/teyrchains",
|
||||
"pezbridges/primitives/xcm-bridge-hub",
|
||||
"pezbridges/primitives/xcm-bridge-hub-router",
|
||||
"pezbridges/relays/client-bizinikiwi",
|
||||
"pezbridges/relays/equivocation",
|
||||
"pezbridges/relays/finality",
|
||||
"pezbridges/relays/lib-bizinikiwi-relay",
|
||||
"pezbridges/relays/messages",
|
||||
"pezbridges/relays/teyrchains",
|
||||
"pezbridges/relays/utils",
|
||||
"pezbridges/snowbridge/pezpallets/ethereum-client",
|
||||
"pezbridges/snowbridge/pezpallets/ethereum-client/fixtures",
|
||||
"pezbridges/snowbridge/pezpallets/inbound-queue",
|
||||
"pezbridges/snowbridge/pezpallets/inbound-queue-v2",
|
||||
"pezbridges/snowbridge/pezpallets/inbound-queue-v2/fixtures",
|
||||
"pezbridges/snowbridge/pezpallets/inbound-queue/fixtures",
|
||||
"pezbridges/snowbridge/pezpallets/outbound-queue",
|
||||
"pezbridges/snowbridge/pezpallets/outbound-queue-v2",
|
||||
"pezbridges/snowbridge/pezpallets/outbound-queue-v2/runtime-api",
|
||||
"pezbridges/snowbridge/pezpallets/outbound-queue/runtime-api",
|
||||
"pezbridges/snowbridge/pezpallets/system",
|
||||
"pezbridges/snowbridge/pezpallets/system-frontend",
|
||||
"pezbridges/snowbridge/pezpallets/system-v2",
|
||||
"pezbridges/snowbridge/pezpallets/system-v2/runtime-api",
|
||||
"pezbridges/snowbridge/pezpallets/system/runtime-api",
|
||||
"pezbridges/snowbridge/primitives/beacon",
|
||||
"pezbridges/snowbridge/primitives/core",
|
||||
"pezbridges/snowbridge/primitives/ethereum",
|
||||
"pezbridges/snowbridge/primitives/inbound-queue",
|
||||
"pezbridges/snowbridge/primitives/merkle-tree",
|
||||
"pezbridges/snowbridge/primitives/outbound-queue",
|
||||
"pezbridges/snowbridge/primitives/verification",
|
||||
"pezbridges/snowbridge/runtime/runtime-common",
|
||||
"pezbridges/snowbridge/runtime/test-common",
|
||||
"pezbridges/snowbridge/test-utils",
|
||||
"pezcumulus/bin/pov-validator",
|
||||
"pezcumulus/client/bootnodes",
|
||||
"pezcumulus/client/cli",
|
||||
@@ -111,8 +111,8 @@ members = [
|
||||
"pezcumulus/teyrchains/integration-tests/emulated/chains/relays/zagros",
|
||||
"pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/assets/asset-hub-pezkuwichain",
|
||||
"pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/assets/asset-hub-zagros",
|
||||
"pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/bridges/bridge-hub-pezkuwichain",
|
||||
"pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/bridges/bridge-hub-zagros",
|
||||
"pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/pezbridges/bridge-hub-pezkuwichain",
|
||||
"pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/pezbridges/bridge-hub-zagros",
|
||||
"pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/collectives/collectives-zagros",
|
||||
"pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/coretime/coretime-pezkuwichain",
|
||||
"pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/coretime/coretime-zagros",
|
||||
@@ -125,8 +125,8 @@ members = [
|
||||
"pezcumulus/teyrchains/integration-tests/emulated/networks/zagros-system",
|
||||
"pezcumulus/teyrchains/integration-tests/emulated/tests/assets/asset-hub-pezkuwichain",
|
||||
"pezcumulus/teyrchains/integration-tests/emulated/tests/assets/asset-hub-zagros",
|
||||
"pezcumulus/teyrchains/integration-tests/emulated/tests/bridges/bridge-hub-pezkuwichain",
|
||||
"pezcumulus/teyrchains/integration-tests/emulated/tests/bridges/bridge-hub-zagros",
|
||||
"pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-pezkuwichain",
|
||||
"pezcumulus/teyrchains/integration-tests/emulated/tests/pezbridges/bridge-hub-zagros",
|
||||
"pezcumulus/teyrchains/integration-tests/emulated/tests/collectives/collectives-zagros",
|
||||
"pezcumulus/teyrchains/integration-tests/emulated/tests/coretime/coretime-pezkuwichain",
|
||||
"pezcumulus/teyrchains/integration-tests/emulated/tests/coretime/coretime-zagros",
|
||||
@@ -706,29 +706,29 @@ bounded-collections = { version = "0.3.2", default-features = false }
|
||||
bounded-vec = { version = "0.7" }
|
||||
bp-asset-hub-pezkuwichain = { path = "pezcumulus/teyrchains/runtimes/assets/asset-hub-pezkuwichain/bridge-primitives", default-features = false }
|
||||
bp-asset-hub-zagros = { path = "pezcumulus/teyrchains/runtimes/assets/asset-hub-zagros/bridge-primitives", default-features = false }
|
||||
bp-beefy = { path = "bridges/primitives/beefy", default-features = false }
|
||||
bp-bridge-hub-pezcumulus = { path = "bridges/chains/chain-pezcumulus", default-features = false }
|
||||
bp-beefy = { path = "pezbridges/primitives/beefy", default-features = false }
|
||||
bp-bridge-hub-pezcumulus = { path = "pezbridges/chains/chain-pezcumulus", default-features = false }
|
||||
bp-bridge-hub-pezkuwichain = { path = "pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain/bridge-primitives", default-features = false }
|
||||
bp-bridge-hub-zagros = { path = "pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros/bridge-primitives", default-features = false, package = "bp-bridge-hub-zagros" }
|
||||
bp-header-pez-chain = { path = "bridges/primitives/header-chain", default-features = false, package = "bp-header-pez-chain" }
|
||||
bp-messages = { path = "bridges/primitives/messages", default-features = false, package = "bp-messages" }
|
||||
bp-pezkuwi-bulletin = { path = "bridges/chains/chain-pezkuwi-bulletin", default-features = false, package = "bp-pezkuwi-bulletin" }
|
||||
bp-pezkuwi-core = { path = "bridges/primitives/pezkuwi-core", default-features = false, package = "bp-pezkuwi-core" }
|
||||
bp-header-pez-chain = { path = "pezbridges/primitives/header-chain", default-features = false, package = "bp-header-pez-chain" }
|
||||
bp-messages = { path = "pezbridges/primitives/messages", default-features = false, package = "bp-messages" }
|
||||
bp-pezkuwi-bulletin = { path = "pezbridges/chains/chain-pezkuwi-bulletin", default-features = false, package = "bp-pezkuwi-bulletin" }
|
||||
bp-pezkuwi-core = { path = "pezbridges/primitives/pezkuwi-core", default-features = false, package = "bp-pezkuwi-core" }
|
||||
bp-pezkuwichain = { path = "pezkuwi/runtime/pezkuwichain/bridge-primitives", default-features = false, package = "bp-pezkuwichain" }
|
||||
bp-relayers = { path = "bridges/primitives/relayers", default-features = false, package = "bp-relayers" }
|
||||
pezbp-runtime = { path = "bridges/primitives/runtime", default-features = false }
|
||||
bp-test-utils = { path = "bridges/primitives/test-utils", default-features = false }
|
||||
bp-teyrchains = { path = "bridges/primitives/teyrchains", default-features = false }
|
||||
bp-xcm-bridge-hub = { path = "bridges/primitives/xcm-bridge-hub", default-features = false }
|
||||
bp-xcm-bridge-hub-router = { path = "bridges/primitives/xcm-bridge-hub-router", default-features = false }
|
||||
bp-relayers = { path = "pezbridges/primitives/relayers", default-features = false, package = "bp-relayers" }
|
||||
pezbp-runtime = { path = "pezbridges/primitives/runtime", default-features = false }
|
||||
bp-test-utils = { path = "pezbridges/primitives/test-utils", default-features = false }
|
||||
bp-teyrchains = { path = "pezbridges/primitives/teyrchains", default-features = false }
|
||||
bp-xcm-bridge-hub = { path = "pezbridges/primitives/xcm-bridge-hub", default-features = false }
|
||||
bp-xcm-bridge-hub-router = { path = "pezbridges/primitives/xcm-bridge-hub-router", default-features = false }
|
||||
bp-zagros = { path = "pezkuwi/runtime/zagros/bridge-primitives", default-features = false }
|
||||
bridge-hub-common = { path = "pezcumulus/teyrchains/runtimes/bridge-hubs/common", default-features = false }
|
||||
pezbridge-hub-pezkuwichain-emulated-chain = { path = "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/bridges/bridge-hub-pezkuwichain" }
|
||||
pezbridge-hub-pezkuwichain-emulated-chain = { path = "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/pezbridges/bridge-hub-pezkuwichain" }
|
||||
pezbridge-hub-pezkuwichain-runtime = { path = "pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-pezkuwichain", default-features = false }
|
||||
pezbridge-hub-test-utils = { path = "pezcumulus/teyrchains/runtimes/bridge-hubs/test-utils", default-features = false }
|
||||
pezbridge-hub-zagros-emulated-chain = { path = "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/bridges/bridge-hub-zagros" }
|
||||
pezbridge-hub-zagros-emulated-chain = { path = "pezcumulus/teyrchains/integration-tests/emulated/chains/teyrchains/pezbridges/bridge-hub-zagros" }
|
||||
pezbridge-hub-zagros-runtime = { path = "pezcumulus/teyrchains/runtimes/bridge-hubs/bridge-hub-zagros" }
|
||||
pezbridge-runtime-common = { path = "bridges/bin/runtime-common", default-features = false }
|
||||
pezbridge-runtime-common = { path = "pezbridges/bin/runtime-common", default-features = false }
|
||||
bs58 = { version = "0.5.1", default-features = false }
|
||||
build-helper = { version = "0.1.1" }
|
||||
byte-slice-cast = { version = "1.2.1", default-features = false }
|
||||
@@ -817,7 +817,7 @@ enumn = { version = "0.1.13" }
|
||||
env_filter = { version = "0.1.3" }
|
||||
env_logger = { version = "0.11.2" }
|
||||
environmental = { version = "1.1.4", default-features = false }
|
||||
pez-equivocation-detector = { path = "bridges/relays/equivocation" }
|
||||
pez-equivocation-detector = { path = "pezbridges/relays/equivocation" }
|
||||
ethabi = { version = "2.0.0", default-features = false, package = "ethabi-decode" }
|
||||
ethbloom = { version = "0.14.1", default-features = false }
|
||||
pez-ethereum-standards = { path = "bizinikiwi/primitives/pez-ethereum-standards" }
|
||||
@@ -829,7 +829,7 @@ fdlimit = { version = "0.3.0" }
|
||||
femme = { version = "2.2.1" }
|
||||
filetime = { version = "0.2.16" }
|
||||
finality-grandpa = { version = "0.16.3", default-features = false }
|
||||
pez-finality-relay = { path = "bridges/relays/finality" }
|
||||
pez-finality-relay = { path = "pezbridges/relays/finality" }
|
||||
first-pezpallet = { package = "pezkuwi-sdk-docs-first-pezpallet", path = "docs/sdk/packages/guides/first-pezpallet", default-features = false }
|
||||
first-runtime = { package = "pezkuwi-sdk-docs-first-runtime", path = "docs/sdk/packages/guides/first-runtime", default-features = false }
|
||||
flate2 = { version = "1.0" }
|
||||
@@ -932,7 +932,7 @@ memmap2 = { version = "0.9.3" }
|
||||
memory-db = { version = "0.34.0", default-features = false }
|
||||
merkleized-metadata = { version = "0.5.0" }
|
||||
merlin = { version = "3.0", default-features = false }
|
||||
pez-messages-relay = { path = "bridges/relays/messages" }
|
||||
pez-messages-relay = { path = "pezbridges/relays/messages" }
|
||||
metered = { version = "0.6.1", default-features = false, package = "prioritized-metered-channel" }
|
||||
milagro-bls = { version = "1.5.4", default-features = false, package = "snowbridge-milagro-bls" }
|
||||
pez-minimal-template-node = { path = "templates/minimal/node" }
|
||||
@@ -985,10 +985,10 @@ pezpallet-balances = { path = "bizinikiwi/pezframe/balances", default-features =
|
||||
pezpallet-beefy = { path = "bizinikiwi/pezframe/beefy", default-features = false }
|
||||
pezpallet-beefy-mmr = { path = "bizinikiwi/pezframe/beefy-mmr", default-features = false }
|
||||
pezpallet-bounties = { path = "bizinikiwi/pezframe/bounties", default-features = false }
|
||||
pezpallet-bridge-grandpa = { path = "bridges/modules/grandpa", default-features = false }
|
||||
pezpallet-bridge-messages = { path = "bridges/modules/messages", default-features = false }
|
||||
pezpallet-bridge-relayers = { path = "bridges/modules/relayers", default-features = false }
|
||||
pezpallet-bridge-teyrchains = { path = "bridges/modules/teyrchains", default-features = false }
|
||||
pezpallet-bridge-grandpa = { path = "pezbridges/modules/grandpa", default-features = false }
|
||||
pezpallet-bridge-messages = { path = "pezbridges/modules/messages", default-features = false }
|
||||
pezpallet-bridge-relayers = { path = "pezbridges/modules/relayers", default-features = false }
|
||||
pezpallet-bridge-teyrchains = { path = "pezbridges/modules/teyrchains", default-features = false }
|
||||
pezpallet-broker = { path = "bizinikiwi/pezframe/broker", default-features = false }
|
||||
pezpallet-child-bounties = { path = "bizinikiwi/pezframe/child-bounties", default-features = false }
|
||||
pezpallet-collator-selection = { path = "pezcumulus/pezpallets/collator-selection", default-features = false }
|
||||
@@ -1125,8 +1125,8 @@ pezpallet-vesting = { path = "bizinikiwi/pezframe/vesting", default-features = f
|
||||
pezpallet-whitelist = { path = "bizinikiwi/pezframe/whitelist", default-features = false }
|
||||
pezpallet-xcm = { path = "pezkuwi/xcm/pezpallet-xcm", default-features = false }
|
||||
pezpallet-xcm-benchmarks = { path = "pezkuwi/xcm/pezpallet-xcm-benchmarks", default-features = false }
|
||||
pezpallet-xcm-bridge-hub = { path = "bridges/modules/xcm-bridge-hub", default-features = false }
|
||||
pezpallet-xcm-bridge-hub-router = { path = "bridges/modules/xcm-bridge-hub-router", default-features = false }
|
||||
pezpallet-xcm-bridge-hub = { path = "pezbridges/modules/xcm-bridge-hub", default-features = false }
|
||||
pezpallet-xcm-bridge-hub-router = { path = "pezbridges/modules/xcm-bridge-hub-router", default-features = false }
|
||||
pezpallet-xcm-precompiles = { path = "pezkuwi/xcm/pezpallet-xcm/precompiles", default-features = false }
|
||||
parity-bytes = { version = "0.1.2", default-features = false }
|
||||
parity-db = { version = "0.4.12" }
|
||||
@@ -1235,8 +1235,8 @@ rand_pcg = { version = "0.3.1" }
|
||||
rbtag = { version = "0.3" }
|
||||
ref-cast = { version = "1.0.23" }
|
||||
regex = { version = "1.10.2" }
|
||||
relay-bizinikiwi-client = { path = "bridges/relays/client-bizinikiwi" }
|
||||
relay-utils = { path = "bridges/relays/utils" }
|
||||
relay-bizinikiwi-client = { path = "pezbridges/relays/client-bizinikiwi" }
|
||||
relay-utils = { path = "pezbridges/relays/utils" }
|
||||
remote-externalities = { path = "bizinikiwi/utils/pezframe/remote-externalities", default-features = false, package = "frame-remote-externalities" }
|
||||
pez-revive-dev-node = { path = "bizinikiwi/pezframe/revive/dev-node/node" }
|
||||
pez-revive-dev-runtime = { path = "bizinikiwi/pezframe/revive/dev-node/runtime" }
|
||||
@@ -1339,31 +1339,31 @@ simple-mermaid = { version = "0.1.1" }
|
||||
pez-slot-range-helper = { path = "pezkuwi/runtime/common/pez-slot-range-helper", default-features = false }
|
||||
slotmap = { version = "1.0" }
|
||||
smallvec = { version = "1.11.0", default-features = false }
|
||||
pezsnowbridge-beacon-primitives = { path = "bridges/snowbridge/primitives/beacon", default-features = false }
|
||||
pezsnowbridge-core = { path = "bridges/snowbridge/primitives/core", default-features = false }
|
||||
pezsnowbridge-ethereum = { path = "bridges/snowbridge/primitives/ethereum", default-features = false }
|
||||
pezsnowbridge-inbound-queue-primitives = { path = "bridges/snowbridge/primitives/inbound-queue", default-features = false }
|
||||
pezsnowbridge-merkle-tree = { path = "bridges/snowbridge/primitives/merkle-tree", default-features = false }
|
||||
pezsnowbridge-outbound-queue-primitives = { path = "bridges/snowbridge/primitives/outbound-queue", default-features = false }
|
||||
pezsnowbridge-outbound-queue-runtime-api = { path = "bridges/snowbridge/pezpallets/outbound-queue/runtime-api", default-features = false }
|
||||
pezsnowbridge-outbound-queue-v2-runtime-api = { path = "bridges/snowbridge/pezpallets/outbound-queue-v2/runtime-api", default-features = false }
|
||||
snowbridge-pezpallet-ethereum-client = { path = "bridges/snowbridge/pezpallets/ethereum-client", default-features = false }
|
||||
snowbridge-pezpallet-ethereum-client-fixtures = { path = "bridges/snowbridge/pezpallets/ethereum-client/fixtures", default-features = false }
|
||||
snowbridge-pezpallet-inbound-queue = { path = "bridges/snowbridge/pezpallets/inbound-queue", default-features = false }
|
||||
snowbridge-pezpallet-inbound-queue-fixtures = { path = "bridges/snowbridge/pezpallets/inbound-queue/fixtures", default-features = false }
|
||||
snowbridge-pezpallet-inbound-queue-v2 = { path = "bridges/snowbridge/pezpallets/inbound-queue-v2", default-features = false }
|
||||
snowbridge-pezpallet-inbound-queue-v2-fixtures = { path = "bridges/snowbridge/pezpallets/inbound-queue-v2/fixtures", default-features = false }
|
||||
snowbridge-pezpallet-outbound-queue = { path = "bridges/snowbridge/pezpallets/outbound-queue", default-features = false }
|
||||
snowbridge-pezpallet-outbound-queue-v2 = { path = "bridges/snowbridge/pezpallets/outbound-queue-v2", default-features = false }
|
||||
snowbridge-pezpallet-system = { path = "bridges/snowbridge/pezpallets/system", default-features = false }
|
||||
snowbridge-pezpallet-system-frontend = { path = "bridges/snowbridge/pezpallets/system-frontend", default-features = false }
|
||||
snowbridge-pezpallet-system-v2 = { path = "bridges/snowbridge/pezpallets/system-v2", default-features = false }
|
||||
snowpezbridge-runtime-common = { path = "bridges/snowbridge/runtime/runtime-common", default-features = false }
|
||||
pezsnowbridge-runtime-test-common = { path = "bridges/snowbridge/runtime/test-common", default-features = false }
|
||||
pezsnowbridge-system-runtime-api = { path = "bridges/snowbridge/pezpallets/system/runtime-api", default-features = false }
|
||||
pezsnowbridge-system-v2-runtime-api = { path = "bridges/snowbridge/pezpallets/system-v2/runtime-api", default-features = false }
|
||||
pezsnowbridge-test-utils = { path = "bridges/snowbridge/test-utils" }
|
||||
pezsnowbridge-verification-primitives = { path = "bridges/snowbridge/primitives/verification", default-features = false }
|
||||
pezsnowbridge-beacon-primitives = { path = "pezbridges/snowbridge/primitives/beacon", default-features = false }
|
||||
pezsnowbridge-core = { path = "pezbridges/snowbridge/primitives/core", default-features = false }
|
||||
pezsnowbridge-ethereum = { path = "pezbridges/snowbridge/primitives/ethereum", default-features = false }
|
||||
pezsnowbridge-inbound-queue-primitives = { path = "pezbridges/snowbridge/primitives/inbound-queue", default-features = false }
|
||||
pezsnowbridge-merkle-tree = { path = "pezbridges/snowbridge/primitives/merkle-tree", default-features = false }
|
||||
pezsnowbridge-outbound-queue-primitives = { path = "pezbridges/snowbridge/primitives/outbound-queue", default-features = false }
|
||||
pezsnowbridge-outbound-queue-runtime-api = { path = "pezbridges/snowbridge/pezpallets/outbound-queue/runtime-api", default-features = false }
|
||||
pezsnowbridge-outbound-queue-v2-runtime-api = { path = "pezbridges/snowbridge/pezpallets/outbound-queue-v2/runtime-api", default-features = false }
|
||||
pezsnowbridge-pezpallet-ethereum-client = { path = "pezbridges/snowbridge/pezpallets/ethereum-client", default-features = false }
|
||||
pezsnowbridge-pezpallet-ethereum-client-fixtures = { path = "pezbridges/snowbridge/pezpallets/ethereum-client/fixtures", default-features = false }
|
||||
pezsnowbridge-pezpallet-inbound-queue = { path = "pezbridges/snowbridge/pezpallets/inbound-queue", default-features = false }
|
||||
pezsnowbridge-pezpallet-inbound-queue-fixtures = { path = "pezbridges/snowbridge/pezpallets/inbound-queue/fixtures", default-features = false }
|
||||
pezsnowbridge-pezpallet-inbound-queue-v2 = { path = "pezbridges/snowbridge/pezpallets/inbound-queue-v2", default-features = false }
|
||||
pezsnowbridge-pezpallet-inbound-queue-v2-fixtures = { path = "pezbridges/snowbridge/pezpallets/inbound-queue-v2/fixtures", default-features = false }
|
||||
pezsnowbridge-pezpallet-outbound-queue = { path = "pezbridges/snowbridge/pezpallets/outbound-queue", default-features = false }
|
||||
pezsnowbridge-pezpallet-outbound-queue-v2 = { path = "pezbridges/snowbridge/pezpallets/outbound-queue-v2", default-features = false }
|
||||
pezsnowbridge-pezpallet-system = { path = "pezbridges/snowbridge/pezpallets/system", default-features = false }
|
||||
pezsnowbridge-pezpallet-system-frontend = { path = "pezbridges/snowbridge/pezpallets/system-frontend", default-features = false }
|
||||
pezsnowbridge-pezpallet-system-v2 = { path = "pezbridges/snowbridge/pezpallets/system-v2", default-features = false }
|
||||
snowpezbridge-runtime-common = { path = "pezbridges/snowbridge/runtime/runtime-common", default-features = false }
|
||||
pezsnowbridge-runtime-test-common = { path = "pezbridges/snowbridge/runtime/test-common", default-features = false }
|
||||
pezsnowbridge-system-runtime-api = { path = "pezbridges/snowbridge/pezpallets/system/runtime-api", default-features = false }
|
||||
pezsnowbridge-system-v2-runtime-api = { path = "pezbridges/snowbridge/pezpallets/system-v2/runtime-api", default-features = false }
|
||||
pezsnowbridge-test-utils = { path = "pezbridges/snowbridge/test-utils" }
|
||||
pezsnowbridge-verification-primitives = { path = "pezbridges/snowbridge/primitives/verification", default-features = false }
|
||||
soketto = { version = "0.8.0" }
|
||||
pez-solochain-template-runtime = { path = "templates/solochain/runtime" }
|
||||
pezsp-api = { path = "bizinikiwi/primitives/api", default-features = false }
|
||||
@@ -1458,7 +1458,7 @@ tempfile = { version = "3.8.1" }
|
||||
teyrchain-info = { path = "pezcumulus/teyrchains/pezpallets/teyrchain-info", default-features = false, package = "pezstaging-teyrchain-info" }
|
||||
teyrchain-template-runtime = { path = "templates/teyrchain/runtime" }
|
||||
teyrchains-common = { path = "pezcumulus/teyrchains/common", default-features = false }
|
||||
teyrchains-relay = { path = "bridges/relays/teyrchains" }
|
||||
teyrchains-relay = { path = "pezbridges/relays/teyrchains" }
|
||||
teyrchains-runtimes-test-utils = { path = "pezcumulus/teyrchains/runtimes/test-utils", default-features = false }
|
||||
# pinned test-case to 3.3.1 because they support only the latest stable version of rust
|
||||
test-case = { version = "=3.3.1" }
|
||||
|
||||
@@ -31,7 +31,7 @@ Kurdistan SDK originated as a fork of Polkadot SDK (stable2512). It has since be
|
||||
│ └──────────┬───────────────┘ │
|
||||
│ │ │
|
||||
│ ┌──────────▼───────────┐ │
|
||||
│ │ PezkuwiChain │ │
|
||||
│ │ KurdistanChain │ │
|
||||
│ │ (Reference Impl) │ │
|
||||
│ │ • TeyrChain │ │
|
||||
│ │ • Zagros Runtime │ │
|
||||
@@ -57,9 +57,9 @@ Kurdistan SDK uses a distinct naming scheme to ensure complete independence:
|
||||
|
||||
---
|
||||
|
||||
## PezkuwiChain — Reference Implementation
|
||||
## KurdistanChain — Reference Implementation
|
||||
|
||||
PezkuwiChain is the flagship blockchain built on Kurdistan SDK, designed for Kurdish digital sovereignty.
|
||||
KurdistanChain is the flagship blockchain built on Kurdistan SDK, designed for Kurdish digital sovereignty.
|
||||
|
||||
### Token Economics
|
||||
|
||||
@@ -75,7 +75,7 @@ PezkuwiChain is the flagship blockchain built on Kurdistan SDK, designed for Kur
|
||||
|
||||
### Custom Pallets
|
||||
|
||||
| Pallet | Purpose |
|
||||
| Pezpallet | Purpose |
|
||||
|--------|---------|
|
||||
| `pezpallet-presale` | Multi-round token launches with vesting |
|
||||
| `pezpallet-identity-kyc` | Decentralized identity verification |
|
||||
@@ -113,7 +113,7 @@ cargo build --release
|
||||
cargo build --release --features runtime-benchmarks
|
||||
|
||||
# Run development node
|
||||
./target/release/pezkuwi-node --dev
|
||||
./target/release/kurdistan-node --dev
|
||||
```
|
||||
|
||||
---
|
||||
@@ -173,7 +173,7 @@ Kurdistan SDK is licensed under Apache 2.0. See [LICENSE](./LICENSE) for details
|
||||
**Key Innovations**:
|
||||
- 🔬 First implementation of social trust in consensus (academic contribution)
|
||||
- 🏛️ Parliamentary NFT System: 201 non-transferable governance seats
|
||||
- 🔐 Sybil-resistant via citizenship verification (Tiki pallet)
|
||||
- 🔐 Sybil-resistant via citizenship verification (Tiki pezpallet)
|
||||
- 📊 Multi-dimensional validator scoring
|
||||
|
||||
---
|
||||
@@ -203,9 +203,9 @@ TeyrChain Parachain
|
||||
|
||||
| Stage | Validators | Status |
|
||||
|-------|------------|--------|
|
||||
| Dev Mode | 1 | ✅ Complete |
|
||||
| Local Testnet | 2 | ✅ Complete |
|
||||
| **Alfa Testnet** | 4 | 🔄 Current |
|
||||
| Dev Mode | 1 | |
|
||||
| Local Testnet | 2 | |
|
||||
| **Alfa Testnet** | 4 | |
|
||||
| Beta Testnet | 8 | Q1 2026 |
|
||||
| Staging | 20 | Q1 2026 |
|
||||
| **Mainnet** | 100 | Q2 2026 |
|
||||
@@ -214,7 +214,7 @@ TeyrChain Parachain
|
||||
|
||||
## Multi-Nation Platform Vision
|
||||
|
||||
PezkuwiChain is designed to host **multiple digital nations** simultaneously:
|
||||
KurdistanChain is designed to host **multiple digital nations** simultaneously:
|
||||
|
||||
| Nation Type | Example | Target Population |
|
||||
|-------------|---------|-------------------|
|
||||
@@ -249,8 +249,8 @@ PezkuwiChain is designed to host **multiple digital nations** simultaneously:
|
||||
|
||||
```bash
|
||||
# Clone repository
|
||||
git clone https://github.com/pezkuwichain/pezkuwi-sdk.git
|
||||
cd pezkuwi-sdk
|
||||
git clone https://github.com/pezkuwichain/kurdistan-sdk.git
|
||||
cd kurdistan-sdk
|
||||
|
||||
# Build release
|
||||
cargo build --release
|
||||
@@ -259,7 +259,7 @@ cargo build --release
|
||||
cargo build --release --features runtime-benchmarks
|
||||
|
||||
# Run local testnet
|
||||
./target/release/pezkuwi-node --dev
|
||||
./target/release/kurdistan-node --dev
|
||||
```
|
||||
|
||||
---
|
||||
@@ -283,25 +283,25 @@ cargo build --release --features runtime-benchmarks
|
||||
| Twitter | [@pezkuwichain](https://twitter.com/pezkuwichain) |
|
||||
| GitHub | [github.com/pezkuwichain](https://github.com/pezkuwichain) |
|
||||
| Medium | [@pezkuwichain](https://medium.com/@pezkuwichain) |
|
||||
| Facebook | [PezkuwiChain](https://www.facebook.com/profile.php?id=61582484611719) |
|
||||
| Facebook | [KurdistanChain](https://www.facebook.com/profile.php?id=61582484611719) |
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
# Pezkuwi SDK
|
||||
# Kurdistan SDK
|
||||
|
||||
 
|
||||
 
|
||||
|
||||
<!-- markdownlint-disable-next-line MD013 -->
|
||||
[](https://pezkuwichain.app/community)   
|
||||
[](https://pezkuwichain.app/community)   
|
||||
|
||||
> The Pezkuwi SDK repository provides all the components needed to start building on the
|
||||
> [PezkuwiChain](https://pezkuwichain.app/) network, a multi-chain blockchain platform that enables
|
||||
> The Kurdistan SDK repository provides all the components needed to start building on the
|
||||
> [KurdistanChain](https://pezkuwichain.app/) network, a multi-chain blockchain platform that enables
|
||||
> different blockchains to interoperate and share information in a secure and scalable way.
|
||||
|
||||
</div>
|
||||
@@ -310,38 +310,38 @@ forks](https://img.shields.io/github/forks/pezkuwichain/pezkuwi-sdk)
|
||||
If you want to get an example node running quickly you can execute the following getting started script:
|
||||
|
||||
```
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/pezkuwichain/pezkuwi-sdk/master/scripts/getting-started.sh | bash
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/pezkuwichain/kurdistan-sdk/master/scripts/getting-started.sh | bash
|
||||
```
|
||||
|
||||
## 👩🏽💻 Building
|
||||
|
||||
In order to build this project you need to install some dependencies, follow the instructions in [this guide](https://docs.pezkuwichain.io/develop/teyrchains/install-pezkuwi-sdk).
|
||||
In order to build this project you need to install some dependencies, follow the instructions in [this guide](https://docs.pezkuwichain.io/develop/teyrchains/install-kurdistan-sdk).
|
||||
|
||||
## 📚 Documentation
|
||||
|
||||
- [Pezkuwi Documentation Portal](https://docs.pezkuwichain.io)
|
||||
- [rust-docs](https://pezkuwichain.github.io/pezkuwi-sdk/master/pezkuwi_sdk_docs/index.html): Where we keep track of
|
||||
- [Kurdistan Documentation Portal](https://docs.pezkuwichain.io)
|
||||
- [rust-docs](https://pezkuwichain.github.io/kurdistan-sdk/master/kurdistan_sdk_docs/index.html): Where we keep track of
|
||||
the API docs of our Rust crates. Includes:
|
||||
- [Introduction](https://pezkuwichain.github.io/pezkuwi-sdk/master/pezkuwi_sdk_docs/pezkuwi_sdk/index.html)
|
||||
to each component of the Pezkuwi SDK: Bizinikiwi, FRAME, Pezcumulus, and XCM
|
||||
- [Guides](https://pezkuwichain.github.io/pezkuwi-sdk/master/pezkuwi_sdk_docs/guides/index.html),
|
||||
namely how to build your first FRAME pallet
|
||||
- [Templates](https://pezkuwichain.github.io/pezkuwi-sdk/master/pezkuwi_sdk_docs/pezkuwi_sdk/templates/index.html)
|
||||
- [Introduction](https://pezkuwichain.github.io/kurdistan-sdk/master/kurdistan_sdk_docs/kurdistan_sdk/index.html)
|
||||
to each component of the Kurdistan SDK: Substrate, FRAME, Cumulus, and XCM
|
||||
- [Guides](https://pezkuwichain.github.io/kurdistan-sdk/master/kurdistan_sdk_docs/guides/index.html),
|
||||
namely how to build your first FRAME pezpallet
|
||||
- [Templates](https://pezkuwichain.github.io/kurdistan-sdk/master/kurdistan_sdk_docs/kurdistan_sdk/templates/index.html)
|
||||
for starting a new project.
|
||||
- [External Resources](https://pezkuwichain.github.io/pezkuwi-sdk/master/pezkuwi_sdk_docs/external_resources/index.html)
|
||||
- Have a question? You can ask in the Pezkuwi SDK Developers Chat.
|
||||
- [External Resources](https://pezkuwichain.github.io/kurdistan-sdk/master/kurdistan_sdk_docs/external_resources/index.html)
|
||||
- Have a question? You can ask in the Kurdistan SDK Developers Chat.
|
||||
Messages from either of these channels are bridged to the other, so you can use whichever one you like.
|
||||
- [Telegram](https://t.me/pezkuwidevs)
|
||||
- [Telegram](https://t.me/DKSPezkuwiChain)
|
||||
- [Matrix](https://matrix.to/#/#pezkuwidevs:matrix.org)
|
||||
- [Discord](https://discord.gg/Y3VyEC6h8W)
|
||||
- [Pezkuwi and Bizinikiwi StackExchange](https://pezkuwichain.app/community)
|
||||
- [Kurdistan and Substrate StackExchange](https://pezkuwichain.io/forum)
|
||||
|
||||
## 🚀 Releases
|
||||
|
||||
<!-- markdownlint-disable-next-line MD013 -->
|
||||
 
|
||||
 
|
||||
|
||||
The Pezkuwi SDK is released every three months as a `Pezkuwi stableYYMM` release. Each stable release is supported for
|
||||
The Kurdistan SDK is released every three months as a `Kurdistan stableYYMM` release. Each stable release is supported for
|
||||
one year with patches. See the next upcoming versions in the [Release
|
||||
Registry](https://github.com/pezkuwichain/release-registry/) and more docs in [RELEASE.md](./docs/RELEASE.md).
|
||||
|
||||
@@ -350,9 +350,9 @@ version without needing to manually select the correct version for each crate.
|
||||
|
||||
## 🛠️ Tooling
|
||||
|
||||
[Pezkuwi SDK Version Manager](https://github.com/pezkuwichain/psvm):
|
||||
A simple tool to manage and update the Pezkuwi SDK dependencies in any Cargo.toml file.
|
||||
It will automatically update the Pezkuwi SDK dependencies to their correct crates.io version.
|
||||
[Kurdistan SDK Version Manager](https://github.com/pezkuwichain/psvm):
|
||||
A simple tool to manage and update the Kurdistan SDK dependencies in any Cargo.toml file.
|
||||
It will automatically update the Kurdistan SDK dependencies to their correct crates.io version.
|
||||
|
||||
## 🔐 Security
|
||||
|
||||
@@ -367,21 +367,21 @@ Conduct](./docs/contributor/CODE_OF_CONDUCT.md).
|
||||
|
||||
### 👾 Ready to Contribute?
|
||||
|
||||
Take a look at the issues labeled with [`mentor`](https://github.com/pezkuwichain/pezkuwi-sdk/labels/C1-mentor)
|
||||
Take a look at the issues labeled with [`mentor`](https://github.com/pezkuwichain/kurdistan-sdk/labels/C1-mentor)
|
||||
(or alternatively [this](https://mentor.tasty.limo/) page, created by one of the maintainers) label to get started!
|
||||
We always recognize valuable contributions by proposing an on-chain tip to the PezkuwiChain network as a token of our
|
||||
We always recognize valuable contributions by proposing an on-chain tip to the KurdistanChain network as a token of our
|
||||
appreciation.
|
||||
|
||||
## Pezkuwi Fellowship
|
||||
## Kurdistan Fellowship
|
||||
|
||||
Development in this repo usually goes hand in hand with the `fellowship` organization. In short,
|
||||
this repository provides all the SDK pieces needed to build both PezkuwiChain and its teyrchains. But,
|
||||
the actual PezkuwiChain runtime lives in the `fellowship/runtimes` repository. Read more about the
|
||||
this repository provides all the SDK pieces needed to build both KurdistanChain and its teyrchains. But,
|
||||
the actual KurdistanChain runtime lives in the `fellowship/runtimes` repository. Read more about the
|
||||
fellowship, this separation, the RFC process
|
||||
[here](https://pezkuwi-fellows.github.io/dashboard/).
|
||||
[here](https://kurdistan-fellows.github.io/dashboard/).
|
||||
|
||||
## History
|
||||
|
||||
This repository is the amalgamation of 3 separate repositories that used to make up Pezkuwi SDK,
|
||||
namely Bizinikiwi, Pezkuwi and Pezcumulus. Read more about the merge and its history
|
||||
[here](https://pezkuwi-public.notion.site/Pezkuwi-SDK-FAQ-fbc4cecc2c46443fb37b9eeec2f0d85f).
|
||||
This repository is the amalgamation of 3 separate repositories that used to make up Kurdistan SDK,
|
||||
namely Substrate, Kurdistan and Cumulus. Read more about the merge and its history
|
||||
[here](https://kurdistan-public.notion.site/Kurdistan-SDK-FAQ-fbc4cecc2c46443fb37b9eeec2f0d85f).
|
||||
@@ -48,7 +48,7 @@ impl RemarkBuilder {
|
||||
}
|
||||
|
||||
impl pezframe_benchmarking_cli::ExtrinsicBuilder for RemarkBuilder {
|
||||
fn pallet(&self) -> &str {
|
||||
fn pezpallet(&self) -> &str {
|
||||
"system"
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ impl TransferKeepAliveBuilder {
|
||||
}
|
||||
|
||||
impl pezframe_benchmarking_cli::ExtrinsicBuilder for TransferKeepAliveBuilder {
|
||||
fn pallet(&self) -> &str {
|
||||
fn pezpallet(&self) -> &str {
|
||||
"balances"
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ pub enum Subcommand {
|
||||
|
||||
/// Sub-commands concerned with benchmarking.
|
||||
///
|
||||
/// The pallet benchmarking moved to the `pallet` sub-command.
|
||||
/// The pezpallet benchmarking moved to the `pezpallet` sub-command.
|
||||
#[command(subcommand)]
|
||||
Benchmark(pezframe_benchmarking_cli::BenchmarkCmd),
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ pub fn run() -> Result<()> {
|
||||
// This switch needs to be in the client, since the client decides
|
||||
// which sub-commands it wants to support.
|
||||
match cmd {
|
||||
BenchmarkCmd::Pallet(cmd) => {
|
||||
BenchmarkCmd::Pezpallet(cmd) => {
|
||||
if !cfg!(feature = "runtime-benchmarks") {
|
||||
return Err(
|
||||
"Runtime benchmarking wasn't enabled when building the node. \
|
||||
|
||||
@@ -381,7 +381,7 @@ fn full_native_block_import_works() {
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(1),
|
||||
event: RuntimeEvent::Balances(pezpallet_balances::Event::Deposit {
|
||||
who: pezpallet_treasury::Pallet::<Runtime>::account_id(),
|
||||
who: pezpallet_treasury::Pezpallet::<Runtime>::account_id(),
|
||||
amount: fees_after_refund,
|
||||
}),
|
||||
topics: vec![],
|
||||
@@ -478,7 +478,7 @@ fn full_native_block_import_works() {
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(1),
|
||||
event: RuntimeEvent::Balances(pezpallet_balances::Event::Deposit {
|
||||
who: pezpallet_treasury::Pallet::<Runtime>::account_id(),
|
||||
who: pezpallet_treasury::Pezpallet::<Runtime>::account_id(),
|
||||
amount: fees_after_refund,
|
||||
}),
|
||||
topics: vec![],
|
||||
@@ -525,7 +525,7 @@ fn full_native_block_import_works() {
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(2),
|
||||
event: RuntimeEvent::Balances(pezpallet_balances::Event::Deposit {
|
||||
who: pezpallet_treasury::Pallet::<Runtime>::account_id(),
|
||||
who: pezpallet_treasury::Pezpallet::<Runtime>::account_id(),
|
||||
amount: fees_after_refund,
|
||||
}),
|
||||
topics: vec![],
|
||||
@@ -701,7 +701,7 @@ fn deploying_wasm_contract_should_work() {
|
||||
let transfer_ch = <Runtime as pezframe_system::Config>::Hashing::hash(&transfer_code);
|
||||
|
||||
let addr =
|
||||
pezpallet_contracts::Pallet::<Runtime>::contract_address(&charlie(), &transfer_ch, &[], &[]);
|
||||
pezpallet_contracts::Pezpallet::<Runtime>::contract_address(&charlie(), &transfer_ch, &[], &[]);
|
||||
|
||||
let time = 42 * 1000;
|
||||
let b = construct_block(
|
||||
@@ -747,7 +747,7 @@ fn deploying_wasm_contract_should_work() {
|
||||
t.execute_with(|| {
|
||||
// Verify that the contract does exist by querying some of its storage items
|
||||
// It does not matter that the storage item itself does not exist.
|
||||
assert!(&pezpallet_contracts::Pallet::<Runtime>::get_storage(addr, vec![]).is_ok());
|
||||
assert!(&pezpallet_contracts::Pezpallet::<Runtime>::get_storage(addr, vec![]).is_ok());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -28,15 +28,15 @@ fn benchmark_extrinsic_works() {
|
||||
benchmark_extrinsic("balances", "transfer_keep_alive");
|
||||
}
|
||||
|
||||
/// Checks that the `benchmark extrinsic` command works for the given pallet and extrinsic.
|
||||
fn benchmark_extrinsic(pallet: &str, extrinsic: &str) {
|
||||
/// Checks that the `benchmark extrinsic` command works for the given pezpallet and extrinsic.
|
||||
fn benchmark_extrinsic(pezpallet: &str, extrinsic: &str) {
|
||||
let base_dir = tempdir().expect("could not create a temp dir");
|
||||
|
||||
let status = Command::new(cargo_bin("bizinikiwi-node"))
|
||||
.args(&["benchmark", "extrinsic", "--dev"])
|
||||
.arg("-d")
|
||||
.arg(base_dir.path())
|
||||
.args(&["--pallet", pallet, "--extrinsic", extrinsic])
|
||||
.args(&["--pezpallet", pezpallet, "--extrinsic", extrinsic])
|
||||
// Run with low repeats for faster execution.
|
||||
.args(["--warmup=10", "--repeat=10", "--max-ext-per-block=10"])
|
||||
.args(["--wasm-execution=compiled"])
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
use assert_cmd::cargo::cargo_bin;
|
||||
use std::process::Command;
|
||||
|
||||
/// `benchmark pallet` works for the different combinations of `steps` and `repeat`.
|
||||
/// `benchmark pezpallet` works for the different combinations of `steps` and `repeat`.
|
||||
#[test]
|
||||
fn benchmark_pallet_works() {
|
||||
// Some invalid combinations:
|
||||
@@ -35,32 +35,32 @@ fn benchmark_pallet_works() {
|
||||
|
||||
#[test]
|
||||
fn benchmark_pallet_args_work() {
|
||||
benchmark_pallet_args(&["--list", "--pallet=pezpallet_balances"], true);
|
||||
benchmark_pallet_args(&["--list", "--pallet=pezpallet_balances"], true);
|
||||
benchmark_pallet_args(&["--list", "--pezpallet=pezpallet_balances"], true);
|
||||
benchmark_pallet_args(&["--list", "--pezpallet=pezpallet_balances"], true);
|
||||
benchmark_pallet_args(
|
||||
&["--list", "--pallet=pezpallet_balances", "--genesis-builder=spec-genesis"],
|
||||
&["--list", "--pezpallet=pezpallet_balances", "--genesis-builder=spec-genesis"],
|
||||
true,
|
||||
);
|
||||
benchmark_pallet_args(
|
||||
&["--list", "--pallet=pezpallet_balances", "--chain=dev", "--genesis-builder=spec-genesis"],
|
||||
&["--list", "--pezpallet=pezpallet_balances", "--chain=dev", "--genesis-builder=spec-genesis"],
|
||||
true,
|
||||
);
|
||||
benchmark_pallet_args(
|
||||
&["--list", "--pallet=pezpallet_balances", "--chain=dev", "--genesis-builder=spec-runtime"],
|
||||
&["--list", "--pezpallet=pezpallet_balances", "--chain=dev", "--genesis-builder=spec-runtime"],
|
||||
true,
|
||||
);
|
||||
// Error because no runtime is provided:
|
||||
benchmark_pallet_args(
|
||||
&["--list", "--pallet=pezpallet_balances", "--chain=dev", "--genesis-builder=runtime"],
|
||||
&["--list", "--pezpallet=pezpallet_balances", "--chain=dev", "--genesis-builder=runtime"],
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
||||
fn benchmark_pallet(steps: u32, repeat: u32, should_work: bool) {
|
||||
let status = Command::new(cargo_bin("bizinikiwi-node"))
|
||||
.args(["benchmark", "pallet", "--dev"])
|
||||
.args(["benchmark", "pezpallet", "--dev"])
|
||||
// Use the `addition` benchmark since is the fastest.
|
||||
.args(["--pallet", "pezframe-benchmarking", "--extrinsic", "addition"])
|
||||
.args(["--pezpallet", "pezframe-benchmarking", "--extrinsic", "addition"])
|
||||
.args(["--steps", &format!("{}", steps), "--repeat", &format!("{}", repeat)])
|
||||
.args([
|
||||
"--wasm-execution=compiled",
|
||||
@@ -77,7 +77,7 @@ fn benchmark_pallet(steps: u32, repeat: u32, should_work: bool) {
|
||||
|
||||
fn benchmark_pallet_args(args: &[&str], should_work: bool) {
|
||||
let status = Command::new(cargo_bin("bizinikiwi-node"))
|
||||
.args(["benchmark", "pallet"])
|
||||
.args(["benchmark", "pezpallet"])
|
||||
.args(args)
|
||||
.status()
|
||||
.unwrap();
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#![cfg(feature = "runtime-benchmarks")]
|
||||
|
||||
use assert_cmd::cargo::cargo_bin;
|
||||
use std::process::Command;
|
||||
|
||||
/// `benchmark pezpallet` works for the different combinations of `steps` and `repeat`.
|
||||
#[test]
|
||||
fn benchmark_pezpallet_works() {
|
||||
// Some invalid combinations:
|
||||
benchmark_pezpallet(0, 10, false);
|
||||
benchmark_pezpallet(1, 10, false);
|
||||
// ... and some valid:
|
||||
benchmark_pezpallet(2, 1, true);
|
||||
benchmark_pezpallet(50, 20, true);
|
||||
benchmark_pezpallet(20, 50, true);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn benchmark_pezpallet_args_work() {
|
||||
benchmark_pezpallet_args(&["--list", "--pezpallet=pezpallet_balances"], true);
|
||||
benchmark_pezpallet_args(&["--list", "--pezpallet=pezpallet_balances"], true);
|
||||
benchmark_pezpallet_args(
|
||||
&["--list", "--pezpallet=pezpallet_balances", "--genesis-builder=spec-genesis"],
|
||||
true,
|
||||
);
|
||||
benchmark_pezpallet_args(
|
||||
&["--list", "--pezpallet=pezpallet_balances", "--chain=dev", "--genesis-builder=spec-genesis"],
|
||||
true,
|
||||
);
|
||||
benchmark_pezpallet_args(
|
||||
&["--list", "--pezpallet=pezpallet_balances", "--chain=dev", "--genesis-builder=spec-runtime"],
|
||||
true,
|
||||
);
|
||||
// Error because no runtime is provided:
|
||||
benchmark_pezpallet_args(
|
||||
&["--list", "--pezpallet=pezpallet_balances", "--chain=dev", "--genesis-builder=runtime"],
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
||||
fn benchmark_pezpallet(steps: u32, repeat: u32, should_work: bool) {
|
||||
let status = Command::new(cargo_bin("bizinikiwi-node"))
|
||||
.args(["benchmark", "pezpallet", "--dev"])
|
||||
// Use the `addition` benchmark since is the fastest.
|
||||
.args(["--pezpallet", "pezframe-benchmarking", "--extrinsic", "addition"])
|
||||
.args(["--steps", &format!("{}", steps), "--repeat", &format!("{}", repeat)])
|
||||
.args([
|
||||
"--wasm-execution=compiled",
|
||||
"--no-storage-info",
|
||||
"--no-median-slopes",
|
||||
"--no-min-squares",
|
||||
"--heap-pages=4096",
|
||||
])
|
||||
.status()
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(status.success(), should_work);
|
||||
}
|
||||
|
||||
fn benchmark_pezpallet_args(args: &[&str], should_work: bool) {
|
||||
let status = Command::new(cargo_bin("bizinikiwi-node"))
|
||||
.args(["benchmark", "pezpallet"])
|
||||
.args(args)
|
||||
.status()
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(status.success(), should_work);
|
||||
}
|
||||
@@ -43,7 +43,7 @@ pub mod time {
|
||||
/// a slot being empty).
|
||||
/// This value is only used indirectly to define the unit constants below
|
||||
/// that are expressed in blocks. The rest of the code should use
|
||||
/// `SLOT_DURATION` instead (like the Timestamp pallet for calculating the
|
||||
/// `SLOT_DURATION` instead (like the Timestamp pezpallet for calculating the
|
||||
/// minimum period).
|
||||
///
|
||||
/// If using BABE with secondary slots (default) then all of the slots will
|
||||
|
||||
@@ -75,7 +75,7 @@ pub fn kitchensink_genesis(
|
||||
.map(|x| x.0.clone())
|
||||
.collect::<Vec<_>>()
|
||||
.try_into()
|
||||
.expect("Too many invulnerable validators: upper limit is MaxInvulnerables from pallet staking config"),
|
||||
.expect("Too many invulnerable validators: upper limit is MaxInvulnerables from pezpallet staking config"),
|
||||
slash_reward_fraction: Perbill::from_percent(10),
|
||||
stakers,
|
||||
},
|
||||
@@ -87,7 +87,7 @@ pub fn kitchensink_genesis(
|
||||
babe: BabeConfig { epoch_config: BABE_GENESIS_EPOCH_CONFIG },
|
||||
society: SocietyConfig { pot: 0 },
|
||||
assets: AssetsConfig {
|
||||
// This asset is used by the NIS pallet as counterpart currency.
|
||||
// This asset is used by the NIS pezpallet as counterpart currency.
|
||||
assets: vec![(9, Sr25519Keyring::Alice.to_account_id(), true, 1)],
|
||||
..Default::default()
|
||||
},
|
||||
|
||||
@@ -49,7 +49,7 @@ impl OnUnbalanced<NegativeImbalance> for Author {
|
||||
pub struct CreditToBlockAuthor;
|
||||
impl HandleCredit<AccountId, Assets> for CreditToBlockAuthor {
|
||||
fn handle_credit(credit: Credit<AccountId, Assets>) {
|
||||
if let Some(author) = pezpallet_authorship::Pallet::<Runtime>::author() {
|
||||
if let Some(author) = pezpallet_authorship::Pezpallet::<Runtime>::author() {
|
||||
// Drop the result which will trigger the `OnDrop` of the imbalance in case of error.
|
||||
let _ = Assets::resolve(&author, credit);
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ parameter_types! {
|
||||
|
||||
const_assert!(NORMAL_DISPATCH_RATIO.deconstruct() >= AVERAGE_ON_INITIALIZE_RATIO.deconstruct());
|
||||
|
||||
/// Calls that can bypass the safe-mode pallet.
|
||||
/// Calls that can bypass the safe-mode pezpallet.
|
||||
pub struct SafeModeWhitelistedCalls;
|
||||
impl Contains<RuntimeCall> for SafeModeWhitelistedCalls {
|
||||
fn contains(call: &RuntimeCall) -> bool {
|
||||
@@ -250,7 +250,7 @@ impl Contains<RuntimeCall> for SafeModeWhitelistedCalls {
|
||||
}
|
||||
}
|
||||
|
||||
/// Calls that cannot be paused by the tx-pause pallet.
|
||||
/// Calls that cannot be paused by the tx-pause pezpallet.
|
||||
pub struct TxPauseWhitelistedCalls;
|
||||
/// Whitelist `Balances::transfer_keep_alive`, all others are pauseable.
|
||||
impl Contains<RuntimeCallNameOf<Runtime>> for TxPauseWhitelistedCalls {
|
||||
@@ -399,7 +399,7 @@ impl pezpallet_multisig::Config for Runtime {
|
||||
type DepositFactor = DepositFactor;
|
||||
type MaxSignatories = ConstU32<100>;
|
||||
type WeightInfo = pezpallet_multisig::weights::BizinikiwiWeight<Runtime>;
|
||||
type BlockNumberProvider = pezframe_system::Pallet<Runtime>;
|
||||
type BlockNumberProvider = pezframe_system::Pezpallet<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -488,7 +488,7 @@ impl pezpallet_proxy::Config for Runtime {
|
||||
type CallHasher = BlakeTwo256;
|
||||
type AnnouncementDepositBase = AnnouncementDepositBase;
|
||||
type AnnouncementDepositFactor = AnnouncementDepositFactor;
|
||||
type BlockNumberProvider = pezframe_system::Pallet<Runtime>;
|
||||
type BlockNumberProvider = pezframe_system::Pezpallet<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -510,7 +510,7 @@ impl pezpallet_scheduler::Config for Runtime {
|
||||
type WeightInfo = pezpallet_scheduler::weights::BizinikiwiWeight<Runtime>;
|
||||
type OriginPrivilegeCmp = EqualPrivilegeOnly;
|
||||
type Preimages = Preimage;
|
||||
type BlockNumberProvider = pezframe_system::Pallet<Runtime>;
|
||||
type BlockNumberProvider = pezframe_system::Pezpallet<Runtime>;
|
||||
}
|
||||
|
||||
impl pezpallet_glutton::Config for Runtime {
|
||||
@@ -593,7 +593,7 @@ impl pezpallet_balances::Config for Runtime {
|
||||
type DustRemoval = ();
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type ExistentialDeposit = ExistentialDeposit;
|
||||
type AccountStore = pezframe_system::Pallet<Runtime>;
|
||||
type AccountStore = pezframe_system::Pezpallet<Runtime>;
|
||||
type WeightInfo = pezpallet_balances::weights::BizinikiwiWeight<Runtime>;
|
||||
type FreezeIdentifier = RuntimeFreezeReason;
|
||||
type MaxFreezes = VariantCountOf<RuntimeFreezeReason>;
|
||||
@@ -821,14 +821,14 @@ parameter_types! {
|
||||
|
||||
pub MaxNominations: u32 = <NposSolution16 as pezframe_election_provider_support::NposSolution>::LIMIT as u32;
|
||||
pub MaxElectingVotersSolution: u32 = 40_000;
|
||||
// The maximum winners that can be elected by the Election pallet which is equivalent to the
|
||||
// maximum active validators the staking pallet can have.
|
||||
// The maximum winners that can be elected by the Election pezpallet which is equivalent to the
|
||||
// maximum active validators the staking pezpallet can have.
|
||||
pub MaxActiveValidators: u32 = 1000;
|
||||
}
|
||||
|
||||
/// The numbers configured here could always be more than the the maximum limits of staking pallet
|
||||
/// The numbers configured here could always be more than the the maximum limits of staking pezpallet
|
||||
/// to ensure election snapshot will not run out of memory. For now, we set them to smaller values
|
||||
/// since the staking is bounded and the weight pipeline takes hours for this single pallet.
|
||||
/// since the staking is bounded and the weight pipeline takes hours for this single pezpallet.
|
||||
pub struct ElectionProviderBenchmarkConfig;
|
||||
impl pezpallet_election_provider_multi_phase::BenchmarkingConfig for ElectionProviderBenchmarkConfig {
|
||||
const VOTERS: [u32; 2] = [1000, 2000];
|
||||
@@ -940,7 +940,7 @@ impl pezpallet_bags_list::Config<VoterBagsListInstance> for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type WeightInfo = pezpallet_bags_list::weights::BizinikiwiWeight<Runtime>;
|
||||
/// The voter bags-list is loosely kept up to date, and the real source of truth for the score
|
||||
/// of each node is the staking pallet.
|
||||
/// of each node is the staking pezpallet.
|
||||
type ScoreProvider = Staking;
|
||||
type BagThresholds = BagThresholds;
|
||||
type MaxAutoRebagPerBlock = AutoRebagNumber;
|
||||
@@ -1051,7 +1051,7 @@ impl pezpallet_referenda::Config for Runtime {
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Scheduler = Scheduler;
|
||||
type Currency = pezpallet_balances::Pallet<Self>;
|
||||
type Currency = pezpallet_balances::Pezpallet<Self>;
|
||||
type SubmitOrigin = EnsureSigned<AccountId>;
|
||||
type CancelOrigin = EnsureRoot<AccountId>;
|
||||
type KillOrigin = EnsureRoot<AccountId>;
|
||||
@@ -1072,7 +1072,7 @@ impl pezpallet_referenda::Config<pezpallet_referenda::Instance2> for Runtime {
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Scheduler = Scheduler;
|
||||
type Currency = pezpallet_balances::Pallet<Self>;
|
||||
type Currency = pezpallet_balances::Pezpallet<Self>;
|
||||
type SubmitOrigin = EnsureSigned<AccountId>;
|
||||
type CancelOrigin = EnsureRoot<AccountId>;
|
||||
type KillOrigin = EnsureRoot<AccountId>;
|
||||
@@ -1486,7 +1486,7 @@ impl pezpallet_contracts::Config for Runtime {
|
||||
type DepositPerByte = DepositPerByte;
|
||||
type DefaultDepositLimit = DefaultDepositLimit;
|
||||
type CallStack = [pezpallet_contracts::Frame<Self>; 5];
|
||||
type WeightPrice = pezpallet_transaction_payment::Pallet<Self>;
|
||||
type WeightPrice = pezpallet_transaction_payment::Pezpallet<Self>;
|
||||
type WeightInfo = pezpallet_contracts::weights::BizinikiwiWeight<Self>;
|
||||
type ChainExtension = ();
|
||||
type Schedule = Schedule;
|
||||
@@ -2004,7 +2004,7 @@ impl pezpallet_asset_rewards::Config for Runtime {
|
||||
CreationHoldReason,
|
||||
ConstantStoragePrice<StakePoolCreationDeposit, Balance>,
|
||||
>;
|
||||
type BlockNumberProvider = pezframe_system::Pallet<Runtime>;
|
||||
type BlockNumberProvider = pezframe_system::Pezpallet<Runtime>;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
type BenchmarkHelper = AssetRewardsBenchmarkHelper;
|
||||
}
|
||||
@@ -2204,7 +2204,7 @@ impl pezpallet_nfts::Config for Runtime {
|
||||
type Helper = ();
|
||||
type CreateOrigin = AsEnsureOriginWithArg<EnsureSigned<AccountId>>;
|
||||
type Locker = ();
|
||||
type BlockNumberProvider = pezframe_system::Pallet<Runtime>;
|
||||
type BlockNumberProvider = pezframe_system::Pezpallet<Runtime>;
|
||||
}
|
||||
|
||||
impl pezpallet_transaction_storage::Config for Runtime {
|
||||
@@ -2594,269 +2594,269 @@ mod runtime {
|
||||
pub struct Runtime;
|
||||
|
||||
#[runtime::pezpallet_index(0)]
|
||||
pub type System = pezframe_system::Pallet<Runtime>;
|
||||
pub type System = pezframe_system::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(1)]
|
||||
pub type Utility = pezpallet_utility::Pallet<Runtime>;
|
||||
pub type Utility = pezpallet_utility::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(2)]
|
||||
pub type Babe = pezpallet_babe::Pallet<Runtime>;
|
||||
pub type Babe = pezpallet_babe::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(3)]
|
||||
pub type Timestamp = pezpallet_timestamp::Pallet<Runtime>;
|
||||
pub type Timestamp = pezpallet_timestamp::Pezpallet<Runtime>;
|
||||
|
||||
// Authorship must be before session in order to note author in the correct session and era
|
||||
// for im-online and staking.
|
||||
#[runtime::pezpallet_index(4)]
|
||||
pub type Authorship = pezpallet_authorship::Pallet<Runtime>;
|
||||
pub type Authorship = pezpallet_authorship::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(5)]
|
||||
pub type Indices = pezpallet_indices::Pallet<Runtime>;
|
||||
pub type Indices = pezpallet_indices::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(6)]
|
||||
pub type Balances = pezpallet_balances::Pallet<Runtime>;
|
||||
pub type Balances = pezpallet_balances::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(7)]
|
||||
pub type TransactionPayment = pezpallet_transaction_payment::Pallet<Runtime>;
|
||||
pub type TransactionPayment = pezpallet_transaction_payment::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(9)]
|
||||
pub type AssetConversionTxPayment = pezpallet_asset_conversion_tx_payment::Pallet<Runtime>;
|
||||
pub type AssetConversionTxPayment = pezpallet_asset_conversion_tx_payment::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(10)]
|
||||
pub type ElectionProviderMultiPhase = pezpallet_election_provider_multi_phase::Pallet<Runtime>;
|
||||
pub type ElectionProviderMultiPhase = pezpallet_election_provider_multi_phase::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(11)]
|
||||
pub type Staking = pezpallet_staking::Pallet<Runtime>;
|
||||
pub type Staking = pezpallet_staking::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(12)]
|
||||
pub type Session = pezpallet_session::Pallet<Runtime>;
|
||||
pub type Session = pezpallet_session::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(13)]
|
||||
pub type Democracy = pezpallet_democracy::Pallet<Runtime>;
|
||||
pub type Democracy = pezpallet_democracy::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(14)]
|
||||
pub type Council = pezpallet_collective::Pallet<Runtime, Instance1>;
|
||||
pub type Council = pezpallet_collective::Pezpallet<Runtime, Instance1>;
|
||||
|
||||
#[runtime::pezpallet_index(15)]
|
||||
pub type TechnicalCommittee = pezpallet_collective::Pallet<Runtime, Instance2>;
|
||||
pub type TechnicalCommittee = pezpallet_collective::Pezpallet<Runtime, Instance2>;
|
||||
|
||||
#[runtime::pezpallet_index(16)]
|
||||
pub type Elections = pezpallet_elections_phragmen::Pallet<Runtime>;
|
||||
pub type Elections = pezpallet_elections_phragmen::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(17)]
|
||||
pub type TechnicalMembership = pezpallet_membership::Pallet<Runtime, Instance1>;
|
||||
pub type TechnicalMembership = pezpallet_membership::Pezpallet<Runtime, Instance1>;
|
||||
|
||||
#[runtime::pezpallet_index(18)]
|
||||
pub type Grandpa = pezpallet_grandpa::Pallet<Runtime>;
|
||||
pub type Grandpa = pezpallet_grandpa::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(19)]
|
||||
pub type Treasury = pezpallet_treasury::Pallet<Runtime>;
|
||||
pub type Treasury = pezpallet_treasury::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(20)]
|
||||
pub type AssetRate = pezpallet_asset_rate::Pallet<Runtime>;
|
||||
pub type AssetRate = pezpallet_asset_rate::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(21)]
|
||||
pub type Contracts = pezpallet_contracts::Pallet<Runtime>;
|
||||
pub type Contracts = pezpallet_contracts::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(22)]
|
||||
pub type Sudo = pezpallet_sudo::Pallet<Runtime>;
|
||||
pub type Sudo = pezpallet_sudo::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(23)]
|
||||
pub type ImOnline = pezpallet_im_online::Pallet<Runtime>;
|
||||
pub type ImOnline = pezpallet_im_online::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(24)]
|
||||
pub type AuthorityDiscovery = pezpallet_authority_discovery::Pallet<Runtime>;
|
||||
pub type AuthorityDiscovery = pezpallet_authority_discovery::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(25)]
|
||||
pub type Offences = pezpallet_offences::Pallet<Runtime>;
|
||||
pub type Offences = pezpallet_offences::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(26)]
|
||||
pub type Historical = pezpallet_session_historical::Pallet<Runtime>;
|
||||
pub type Historical = pezpallet_session_historical::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(27)]
|
||||
pub type RandomnessCollectiveFlip = pezpallet_insecure_randomness_collective_flip::Pallet<Runtime>;
|
||||
pub type RandomnessCollectiveFlip = pezpallet_insecure_randomness_collective_flip::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(28)]
|
||||
pub type Identity = pezpallet_identity::Pallet<Runtime>;
|
||||
pub type Identity = pezpallet_identity::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(29)]
|
||||
pub type Society = pezpallet_society::Pallet<Runtime>;
|
||||
pub type Society = pezpallet_society::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(30)]
|
||||
pub type Recovery = pezpallet_recovery::Pallet<Runtime>;
|
||||
pub type Recovery = pezpallet_recovery::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(31)]
|
||||
pub type Vesting = pezpallet_vesting::Pallet<Runtime>;
|
||||
pub type Vesting = pezpallet_vesting::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(32)]
|
||||
pub type Scheduler = pezpallet_scheduler::Pallet<Runtime>;
|
||||
pub type Scheduler = pezpallet_scheduler::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(33)]
|
||||
pub type Glutton = pezpallet_glutton::Pallet<Runtime>;
|
||||
pub type Glutton = pezpallet_glutton::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(34)]
|
||||
pub type Preimage = pezpallet_preimage::Pallet<Runtime>;
|
||||
pub type Preimage = pezpallet_preimage::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(35)]
|
||||
pub type Proxy = pezpallet_proxy::Pallet<Runtime>;
|
||||
pub type Proxy = pezpallet_proxy::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(36)]
|
||||
pub type Multisig = pezpallet_multisig::Pallet<Runtime>;
|
||||
pub type Multisig = pezpallet_multisig::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(37)]
|
||||
pub type Bounties = pezpallet_bounties::Pallet<Runtime>;
|
||||
pub type Bounties = pezpallet_bounties::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(38)]
|
||||
pub type Tips = pezpallet_tips::Pallet<Runtime>;
|
||||
pub type Tips = pezpallet_tips::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(39)]
|
||||
pub type Assets = pezpallet_assets::Pallet<Runtime, Instance1>;
|
||||
pub type Assets = pezpallet_assets::Pezpallet<Runtime, Instance1>;
|
||||
|
||||
#[runtime::pezpallet_index(40)]
|
||||
pub type PoolAssets = pezpallet_assets::Pallet<Runtime, Instance2>;
|
||||
pub type PoolAssets = pezpallet_assets::Pezpallet<Runtime, Instance2>;
|
||||
|
||||
#[runtime::pezpallet_index(41)]
|
||||
pub type Beefy = pezpallet_beefy::Pallet<Runtime>;
|
||||
pub type Beefy = pezpallet_beefy::Pezpallet<Runtime>;
|
||||
|
||||
// MMR leaf construction must be after session in order to have a leaf's next_auth_set
|
||||
// refer to block<N>. See issue pezkuwi-fellows/runtimes#160 for details.
|
||||
#[runtime::pezpallet_index(42)]
|
||||
pub type Mmr = pezpallet_mmr::Pallet<Runtime>;
|
||||
pub type Mmr = pezpallet_mmr::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(43)]
|
||||
pub type MmrLeaf = pezpallet_beefy_mmr::Pallet<Runtime>;
|
||||
pub type MmrLeaf = pezpallet_beefy_mmr::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(44)]
|
||||
pub type Lottery = pezpallet_lottery::Pallet<Runtime>;
|
||||
pub type Lottery = pezpallet_lottery::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(45)]
|
||||
pub type Nis = pezpallet_nis::Pallet<Runtime>;
|
||||
pub type Nis = pezpallet_nis::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(46)]
|
||||
pub type Uniques = pezpallet_uniques::Pallet<Runtime>;
|
||||
pub type Uniques = pezpallet_uniques::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(47)]
|
||||
pub type Nfts = pezpallet_nfts::Pallet<Runtime>;
|
||||
pub type Nfts = pezpallet_nfts::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(48)]
|
||||
pub type NftFractionalization = pezpallet_nft_fractionalization::Pallet<Runtime>;
|
||||
pub type NftFractionalization = pezpallet_nft_fractionalization::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(49)]
|
||||
pub type Salary = pezpallet_salary::Pallet<Runtime>;
|
||||
pub type Salary = pezpallet_salary::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(50)]
|
||||
pub type CoreFellowship = pezpallet_core_fellowship::Pallet<Runtime>;
|
||||
pub type CoreFellowship = pezpallet_core_fellowship::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(51)]
|
||||
pub type TransactionStorage = pezpallet_transaction_storage::Pallet<Runtime>;
|
||||
pub type TransactionStorage = pezpallet_transaction_storage::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(52)]
|
||||
pub type VoterList = pezpallet_bags_list::Pallet<Runtime, Instance1>;
|
||||
pub type VoterList = pezpallet_bags_list::Pezpallet<Runtime, Instance1>;
|
||||
|
||||
#[runtime::pezpallet_index(53)]
|
||||
pub type StateTrieMigration = pezpallet_state_trie_migration::Pallet<Runtime>;
|
||||
pub type StateTrieMigration = pezpallet_state_trie_migration::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(54)]
|
||||
pub type ChildBounties = pezpallet_child_bounties::Pallet<Runtime>;
|
||||
pub type ChildBounties = pezpallet_child_bounties::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(55)]
|
||||
pub type Referenda = pezpallet_referenda::Pallet<Runtime>;
|
||||
pub type Referenda = pezpallet_referenda::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(56)]
|
||||
pub type Remark = pezpallet_remark::Pallet<Runtime>;
|
||||
pub type Remark = pezpallet_remark::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(57)]
|
||||
pub type RootTesting = pezpallet_root_testing::Pallet<Runtime>;
|
||||
pub type RootTesting = pezpallet_root_testing::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(58)]
|
||||
pub type ConvictionVoting = pezpallet_conviction_voting::Pallet<Runtime>;
|
||||
pub type ConvictionVoting = pezpallet_conviction_voting::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(59)]
|
||||
pub type Whitelist = pezpallet_whitelist::Pallet<Runtime>;
|
||||
pub type Whitelist = pezpallet_whitelist::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(60)]
|
||||
pub type AllianceMotion = pezpallet_collective::Pallet<Runtime, Instance3>;
|
||||
pub type AllianceMotion = pezpallet_collective::Pezpallet<Runtime, Instance3>;
|
||||
|
||||
#[runtime::pezpallet_index(61)]
|
||||
pub type Alliance = pezpallet_alliance::Pallet<Runtime>;
|
||||
pub type Alliance = pezpallet_alliance::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(62)]
|
||||
pub type NominationPools = pezpallet_nomination_pools::Pallet<Runtime>;
|
||||
pub type NominationPools = pezpallet_nomination_pools::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(63)]
|
||||
pub type RankedPolls = pezpallet_referenda::Pallet<Runtime, Instance2>;
|
||||
pub type RankedPolls = pezpallet_referenda::Pezpallet<Runtime, Instance2>;
|
||||
|
||||
#[runtime::pezpallet_index(64)]
|
||||
pub type RankedCollective = pezpallet_ranked_collective::Pallet<Runtime>;
|
||||
pub type RankedCollective = pezpallet_ranked_collective::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(65)]
|
||||
pub type AssetConversion = pezpallet_asset_conversion::Pallet<Runtime>;
|
||||
pub type AssetConversion = pezpallet_asset_conversion::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(66)]
|
||||
pub type FastUnstake = pezpallet_fast_unstake::Pallet<Runtime>;
|
||||
pub type FastUnstake = pezpallet_fast_unstake::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(67)]
|
||||
pub type MessageQueue = pezpallet_message_queue::Pallet<Runtime>;
|
||||
pub type MessageQueue = pezpallet_message_queue::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(68)]
|
||||
pub type Pov = pezframe_benchmarking_pallet_pov::Pallet<Runtime>;
|
||||
pub type Pov = pezframe_benchmarking_pallet_pov::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(69)]
|
||||
pub type TxPause = pezpallet_tx_pause::Pallet<Runtime>;
|
||||
pub type TxPause = pezpallet_tx_pause::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(70)]
|
||||
pub type SafeMode = pezpallet_safe_mode::Pallet<Runtime>;
|
||||
pub type SafeMode = pezpallet_safe_mode::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(71)]
|
||||
pub type Statement = pezpallet_statement::Pallet<Runtime>;
|
||||
pub type Statement = pezpallet_statement::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(72)]
|
||||
pub type MultiBlockMigrations = pezpallet_migrations::Pallet<Runtime>;
|
||||
pub type MultiBlockMigrations = pezpallet_migrations::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(73)]
|
||||
pub type Broker = pezpallet_broker::Pallet<Runtime>;
|
||||
pub type Broker = pezpallet_broker::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(74)]
|
||||
pub type TasksExample = pezpallet_example_tasks::Pallet<Runtime>;
|
||||
pub type TasksExample = pezpallet_example_tasks::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(75)]
|
||||
pub type Mixnet = pezpallet_mixnet::Pallet<Runtime>;
|
||||
pub type Mixnet = pezpallet_mixnet::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(76)]
|
||||
pub type Parameters = pezpallet_parameters::Pallet<Runtime>;
|
||||
pub type Parameters = pezpallet_parameters::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(77)]
|
||||
pub type SkipFeelessPayment = pezpallet_skip_feeless_payment::Pallet<Runtime>;
|
||||
pub type SkipFeelessPayment = pezpallet_skip_feeless_payment::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(78)]
|
||||
pub type PalletExampleMbms = pezpallet_example_mbm::Pallet<Runtime>;
|
||||
pub type PalletExampleMbms = pezpallet_example_mbm::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(79)]
|
||||
pub type AssetConversionMigration = pezpallet_asset_conversion_ops::Pallet<Runtime>;
|
||||
pub type AssetConversionMigration = pezpallet_asset_conversion_ops::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(80)]
|
||||
pub type Revive = pezpallet_revive::Pallet<Runtime>;
|
||||
pub type Revive = pezpallet_revive::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(81)]
|
||||
pub type VerifySignature = pezpallet_verify_signature::Pallet<Runtime>;
|
||||
pub type VerifySignature = pezpallet_verify_signature::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(82)]
|
||||
pub type DelegatedStaking = pezpallet_delegated_staking::Pallet<Runtime>;
|
||||
pub type DelegatedStaking = pezpallet_delegated_staking::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(83)]
|
||||
pub type AssetRewards = pezpallet_asset_rewards::Pallet<Runtime>;
|
||||
pub type AssetRewards = pezpallet_asset_rewards::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(84)]
|
||||
pub type AssetsFreezer = pezpallet_assets_freezer::Pallet<Runtime, Instance1>;
|
||||
pub type AssetsFreezer = pezpallet_assets_freezer::Pezpallet<Runtime, Instance1>;
|
||||
|
||||
#[runtime::pezpallet_index(85)]
|
||||
pub type Oracle = pezpallet_oracle::Pallet<Runtime>;
|
||||
pub type Oracle = pezpallet_oracle::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(89)]
|
||||
pub type MetaTx = pezpallet_meta_tx::Pallet<Runtime>;
|
||||
pub type MetaTx = pezpallet_meta_tx::Pezpallet<Runtime>;
|
||||
|
||||
#[runtime::pezpallet_index(90)]
|
||||
pub type MultiAssetBounties = pezpallet_multi_asset_bounties::Pallet<Runtime>;
|
||||
pub type MultiAssetBounties = pezpallet_multi_asset_bounties::Pezpallet<Runtime>;
|
||||
}
|
||||
|
||||
/// The address format for describing accounts.
|
||||
@@ -3407,12 +3407,12 @@ pezpallet_revive::impl_runtime_apis_plus_revive_traits!(
|
||||
impl pezkuwi_sdk::pezpallet_oracle_runtime_api::OracleApi<Block, u32, u32, u128> for Runtime {
|
||||
fn get_value(_provider_id: u32, key: u32) -> Option<u128> {
|
||||
// ProviderId is unused as we only have 1 provider
|
||||
pezpallet_oracle::Pallet::<Runtime>::get(&key).map(|v| v.value)
|
||||
pezpallet_oracle::Pezpallet::<Runtime>::get(&key).map(|v| v.value)
|
||||
}
|
||||
|
||||
fn get_all_values(_provider_id: u32) -> Vec<(u32, Option<u128>)> {
|
||||
use pezpallet_oracle::DataProviderExtended;
|
||||
pezpallet_oracle::Pallet::<Runtime>::get_all_values()
|
||||
pezpallet_oracle::Pezpallet::<Runtime>::get_all_values()
|
||||
.map(|(k, v)| (k, v.map(|tv| tv.value)))
|
||||
.collect()
|
||||
}
|
||||
@@ -3794,16 +3794,16 @@ pezpallet_revive::impl_runtime_apis_plus_revive_traits!(
|
||||
use pezframe_benchmarking::{baseline, BenchmarkList};
|
||||
use pezframe_support::traits::StorageInfoTrait;
|
||||
|
||||
// Trying to add benchmarks directly to the Session Pallet caused cyclic dependency
|
||||
// Trying to add benchmarks directly to the Session Pezpallet caused cyclic dependency
|
||||
// issues. To get around that, we separated the Session benchmarks into its own crate,
|
||||
// which is why we need these two lines below.
|
||||
use pezpallet_session_benchmarking::Pallet as SessionBench;
|
||||
use pezpallet_offences_benchmarking::Pallet as OffencesBench;
|
||||
use pezpallet_election_provider_support_benchmarking::Pallet as EPSBench;
|
||||
use pezframe_system_benchmarking::Pallet as SystemBench;
|
||||
use pezframe_system_benchmarking::extensions::Pallet as SystemExtensionsBench;
|
||||
use baseline::Pallet as BaselineBench;
|
||||
use pezpallet_nomination_pools_benchmarking::Pallet as NominationPoolsBench;
|
||||
use pezpallet_session_benchmarking::Pezpallet as SessionBench;
|
||||
use pezpallet_offences_benchmarking::Pezpallet as OffencesBench;
|
||||
use pezpallet_election_provider_support_benchmarking::Pezpallet as EPSBench;
|
||||
use pezframe_system_benchmarking::Pezpallet as SystemBench;
|
||||
use pezframe_system_benchmarking::extensions::Pezpallet as SystemExtensionsBench;
|
||||
use baseline::Pezpallet as BaselineBench;
|
||||
use pezpallet_nomination_pools_benchmarking::Pezpallet as NominationPoolsBench;
|
||||
|
||||
let mut list = Vec::<BenchmarkList>::new();
|
||||
list_benchmarks!(list, extra);
|
||||
@@ -3820,16 +3820,16 @@ pezpallet_revive::impl_runtime_apis_plus_revive_traits!(
|
||||
use pezframe_benchmarking::{baseline, BenchmarkBatch};
|
||||
use pezsp_storage::TrackedStorageKey;
|
||||
|
||||
// Trying to add benchmarks directly to the Session Pallet caused cyclic dependency
|
||||
// Trying to add benchmarks directly to the Session Pezpallet caused cyclic dependency
|
||||
// issues. To get around that, we separated the Session benchmarks into its own crate,
|
||||
// which is why we need these two lines below.
|
||||
use pezpallet_session_benchmarking::Pallet as SessionBench;
|
||||
use pezpallet_offences_benchmarking::Pallet as OffencesBench;
|
||||
use pezpallet_election_provider_support_benchmarking::Pallet as EPSBench;
|
||||
use pezframe_system_benchmarking::Pallet as SystemBench;
|
||||
use pezframe_system_benchmarking::extensions::Pallet as SystemExtensionsBench;
|
||||
use baseline::Pallet as BaselineBench;
|
||||
use pezpallet_nomination_pools_benchmarking::Pallet as NominationPoolsBench;
|
||||
use pezpallet_session_benchmarking::Pezpallet as SessionBench;
|
||||
use pezpallet_offences_benchmarking::Pezpallet as OffencesBench;
|
||||
use pezpallet_election_provider_support_benchmarking::Pezpallet as EPSBench;
|
||||
use pezframe_system_benchmarking::Pezpallet as SystemBench;
|
||||
use pezframe_system_benchmarking::extensions::Pezpallet as SystemExtensionsBench;
|
||||
use baseline::Pezpallet as BaselineBench;
|
||||
use pezpallet_nomination_pools_benchmarking::Pezpallet as NominationPoolsBench;
|
||||
|
||||
impl pezpallet_session_benchmarking::Config for Runtime {}
|
||||
impl pezpallet_offences_benchmarking::Config for Runtime {}
|
||||
|
||||
@@ -32,7 +32,7 @@ around by the `bash!(...)` macro calls.
|
||||
Runtimes relying on generating the chain specification with this tool should
|
||||
implement `cumulus_primitives_core::GetTeyrchainInfo` trait, a new runtime API
|
||||
designed to provide the teyrchain ID from the `teyrchain-info`
|
||||
pallet. The `para-id` flag can be used though if the runtime does not implement
|
||||
pezpallet. The `para-id` flag can be used though if the runtime does not implement
|
||||
the runtime API, and the teyrchain id will be fetched by the node from chain
|
||||
specification. This can be especially useful when syncing a node from a state
|
||||
where the runtime does not implement `cumulus_primitives_core::GetTeyrchainInfo`.
|
||||
|
||||
@@ -32,7 +32,7 @@ around by the `bash!(...)` macro calls.
|
||||
Runtimes relying on generating the chain specification with this tool should
|
||||
implement `cumulus_primitives_core::GetTeyrchainInfo` trait, a new runtime API
|
||||
designed to provide the teyrchain ID from the `teyrchain-info`
|
||||
pallet. The `para-id` flag can be used though if the runtime does not implement
|
||||
pezpallet. The `para-id` flag can be used though if the runtime does not implement
|
||||
the runtime API, and the teyrchain id will be fetched by the node from chain
|
||||
specification. This can be especially useful when syncing a node from a state
|
||||
where the runtime does not implement `cumulus_primitives_core::GetTeyrchainInfo`.
|
||||
|
||||
@@ -21,7 +21,7 @@ use proc_macro_crate::{crate_name, FoundCrate};
|
||||
use quote::quote;
|
||||
use syn::{DeriveInput, Error, Ident, Path};
|
||||
|
||||
const CRATE_NAME: &str = "sc-chain-spec";
|
||||
const CRATE_NAME: &str = "pezsc-chain-spec";
|
||||
const ATTRIBUTE_NAME: &str = "forks";
|
||||
|
||||
/// Implements `Extension's` `Group` accessor.
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
//!
|
||||
//! The main purpose of the `RuntimeGenesisConfig` patch is to:
|
||||
//! - minimize the maintenance effort when RuntimeGenesisConfig is changed in the future (e.g. new
|
||||
//! pallets added to the runtime or pallet's genesis config changed),
|
||||
//! pallets added to the runtime or pezpallet's genesis config changed),
|
||||
//! - increase the readability - it only contains the relevant fields,
|
||||
//! - allow to apply numerous changes in distinct domains (e.g. for zombienet).
|
||||
//!
|
||||
|
||||
@@ -44,7 +44,7 @@ pub(super) fn calculate_primary_threshold(
|
||||
use num_traits::{cast::ToPrimitive, identities::One};
|
||||
|
||||
// Prevent div by zero and out of bounds access.
|
||||
// While Babe's pallet implementation that ships with FRAME performs a sanity check over
|
||||
// While Babe's pezpallet implementation that ships with FRAME performs a sanity check over
|
||||
// configuration parameters, this is not sufficient to guarantee that `c.1` is non-zero
|
||||
// (i.e. third party implementations are possible).
|
||||
if c.1 == 0 || authority_index >= authorities.len() {
|
||||
|
||||
@@ -283,7 +283,7 @@ where
|
||||
finality_notifications: &mut Fuse<FinalityNotifications<B>>,
|
||||
is_authority: bool,
|
||||
) -> Result<Self, Error> {
|
||||
// Wait for BEEFY pallet to be active before starting voter.
|
||||
// Wait for BEEFY pezpallet to be active before starting voter.
|
||||
let (beefy_genesis, best_grandpa) =
|
||||
wait_for_runtime_pallet(&*runtime, finality_notifications).await?;
|
||||
|
||||
@@ -335,7 +335,7 @@ where
|
||||
|
||||
// If no persisted state present, walk back the chain from first GRANDPA notification to either:
|
||||
// - latest BEEFY finalized block, or if none found on the way,
|
||||
// - BEEFY pallet genesis;
|
||||
// - BEEFY pezpallet genesis;
|
||||
// Enqueue any BEEFY mandatory blocks (session boundaries) found on the way, for voter to
|
||||
// finalize.
|
||||
async fn init_state(
|
||||
@@ -353,9 +353,9 @@ where
|
||||
.ok()
|
||||
.flatten()
|
||||
.filter(|genesis| *genesis == beefy_genesis)
|
||||
.ok_or_else(|| Error::Backend("BEEFY pallet expected to be active.".into()))?;
|
||||
.ok_or_else(|| Error::Backend("BEEFY pezpallet expected to be active.".into()))?;
|
||||
// Walk back the imported blocks and initialize voter either, at the last block with
|
||||
// a BEEFY justification, or at pallet genesis block; voter will resume from there.
|
||||
// a BEEFY justification, or at pezpallet genesis block; voter will resume from there.
|
||||
let mut sessions = VecDeque::new();
|
||||
let mut header = best_grandpa.clone();
|
||||
let state = loop {
|
||||
@@ -444,7 +444,7 @@ where
|
||||
) -> Result<PersistedState<B, AuthorityId>, Error> {
|
||||
// Initialize voter state from AUX DB if compatible.
|
||||
if let Some(mut state) = crate::aux_schema::load_persistent(backend.as_ref())?
|
||||
// Verify state pallet genesis matches runtime.
|
||||
// Verify state pezpallet genesis matches runtime.
|
||||
.filter(|state| state.pezpallet_genesis() == beefy_genesis)
|
||||
{
|
||||
// Overwrite persisted state with current best GRANDPA block.
|
||||
@@ -485,7 +485,7 @@ where
|
||||
return Ok(state);
|
||||
}
|
||||
|
||||
// No valid voter-state persisted, re-initialize from pallet genesis.
|
||||
// No valid voter-state persisted, re-initialize from pezpallet genesis.
|
||||
Self::init_state(beefy_genesis, best_grandpa, min_block_delta, backend, runtime).await
|
||||
}
|
||||
}
|
||||
@@ -557,8 +557,8 @@ pub async fn start_beefy_gadget<B, BE, C, N, P, R, S, AuthorityId>(
|
||||
|
||||
let mut block_import_justif = links.from_block_import_justif_stream.subscribe(100_000).fuse();
|
||||
|
||||
// Subscribe to finality notifications and justifications before waiting for runtime pallet and
|
||||
// reuse the streams, so we don't miss notifications while waiting for pallet to be available.
|
||||
// Subscribe to finality notifications and justifications before waiting for runtime pezpallet and
|
||||
// reuse the streams, so we don't miss notifications while waiting for pezpallet to be available.
|
||||
let finality_notifications = client.finality_notification_stream();
|
||||
let (mut transformer, mut finality_notifications) =
|
||||
finality_notification_transformer_future(finality_notifications);
|
||||
@@ -718,7 +718,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// Wait for BEEFY runtime pallet to be available, return active validator set.
|
||||
/// Wait for BEEFY runtime pezpallet to be available, return active validator set.
|
||||
/// Should be called only once during worker initialization.
|
||||
async fn wait_for_runtime_pallet<B, R, AuthorityId: AuthorityIdBound>(
|
||||
runtime: &R,
|
||||
@@ -729,7 +729,7 @@ where
|
||||
R: ProvideRuntimeApi<B>,
|
||||
R::Api: BeefyApi<B, AuthorityId>,
|
||||
{
|
||||
info!(target: LOG_TARGET, "🥩 BEEFY gadget waiting for BEEFY pallet to become available...");
|
||||
info!(target: LOG_TARGET, "🥩 BEEFY gadget waiting for BEEFY pezpallet to become available...");
|
||||
loop {
|
||||
let notif = finality.next().await.ok_or_else(|| {
|
||||
let err_msg = "🥩 Finality stream has unexpectedly terminated.".into();
|
||||
@@ -739,10 +739,10 @@ where
|
||||
let at = notif.header.hash();
|
||||
if let Some(start) = runtime.runtime_api().beefy_genesis(at).ok().flatten() {
|
||||
if *notif.header.number() >= start {
|
||||
// Beefy pallet available, return header for best grandpa at the time.
|
||||
// Beefy pezpallet available, return header for best grandpa at the time.
|
||||
info!(
|
||||
target: LOG_TARGET,
|
||||
"🥩 BEEFY pallet available: block {:?} beefy genesis {:?}",
|
||||
"🥩 BEEFY pezpallet available: block {:?} beefy genesis {:?}",
|
||||
notif.header.number(), start
|
||||
);
|
||||
return Ok((start, notif.header));
|
||||
|
||||
@@ -828,7 +828,7 @@ async fn beefy_importing_justifications() {
|
||||
ImportResult::AlreadyInChain,
|
||||
);
|
||||
|
||||
// Import block 2 with "valid" justification (beefy pallet genesis block not yet reached).
|
||||
// Import block 2 with "valid" justification (beefy pezpallet genesis block not yet reached).
|
||||
let block_num = 2;
|
||||
let builder = BlockBuilderBuilder::new(&*full_client)
|
||||
.on_parent_block(hashof1)
|
||||
@@ -1072,7 +1072,7 @@ async fn should_initialize_voter_at_custom_genesis() {
|
||||
let validator_set = ValidatorSet::new(make_beefy_ids(keys), 0).unwrap();
|
||||
let mut net = BeefyTestNet::new(1);
|
||||
let backend = net.peer(0).client().as_backend();
|
||||
// custom pallet genesis is block number 7
|
||||
// custom pezpallet genesis is block number 7
|
||||
let custom_pallet_genesis = 7;
|
||||
let api = TestApi::new(custom_pallet_genesis, &validator_set, GOOD_MMR_ROOT);
|
||||
|
||||
@@ -1118,7 +1118,7 @@ async fn should_initialize_voter_at_custom_genesis() {
|
||||
let api = TestApi::new(new_pallet_genesis, &new_validator_set, GOOD_MMR_ROOT);
|
||||
|
||||
net.peer(0).client().as_client().finalize_block(hashes[10], None).unwrap();
|
||||
// load persistent state - state preset in DB, but with different pallet genesis
|
||||
// load persistent state - state preset in DB, but with different pezpallet genesis
|
||||
let new_persisted_state =
|
||||
voter_init_setup(&mut net, &mut finality_notifications, &api).await.unwrap();
|
||||
|
||||
@@ -1259,7 +1259,7 @@ async fn should_initialize_voter_at_custom_genesis_when_state_unavailable() {
|
||||
let validator_set = ValidatorSet::new(make_beefy_ids(keys), 0).unwrap();
|
||||
let mut net = BeefyTestNet::new(1);
|
||||
let backend = net.peer(0).client().as_backend();
|
||||
// custom pallet genesis is block number 7
|
||||
// custom pezpallet genesis is block number 7
|
||||
let custom_pallet_genesis = 7;
|
||||
let mut api = TestApi::new(custom_pallet_genesis, &validator_set, GOOD_MMR_ROOT);
|
||||
// remove validator set from `TestApi`, practically simulating unavailable/pruned runtime state
|
||||
@@ -1395,7 +1395,7 @@ async fn beefy_finalizing_after_pallet_genesis() {
|
||||
|
||||
// Minimum BEEFY block delta is 1.
|
||||
|
||||
// GRANDPA finalize blocks leading up to BEEFY pallet genesis -> BEEFY should finalize nothing.
|
||||
// GRANDPA finalize blocks leading up to BEEFY pezpallet genesis -> BEEFY should finalize nothing.
|
||||
finalize_block_and_wait_for_beefy(&net, peers.clone(), &hashes[14], &[]).await;
|
||||
|
||||
// GRANDPA finalize block #16 -> BEEFY should finalize #15 (genesis mandatory) and #16.
|
||||
|
||||
@@ -280,7 +280,7 @@ pub(crate) struct PersistedState<B: Block, AuthorityId: AuthorityIdBound> {
|
||||
/// Chooses which incoming votes to accept and which votes to generate.
|
||||
/// Keeps track of voting seen for current and future rounds.
|
||||
voting_oracle: VoterOracle<B, AuthorityId>,
|
||||
/// Pallet-beefy genesis block - block number when BEEFY consensus started for this chain.
|
||||
/// Pezpallet-beefy genesis block - block number when BEEFY consensus started for this chain.
|
||||
pezpallet_genesis: NumberFor<B>,
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ edition.workspace = true
|
||||
license = "Apache-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
description = "Node-specific RPC methods for interaction with Merkle Mountain Range pallet."
|
||||
description = "Node-specific RPC methods for interaction with Merkle Mountain Range pezpallet."
|
||||
documentation = "https://docs.rs/pezmmr-rpc"
|
||||
|
||||
[lints]
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#![warn(missing_docs)]
|
||||
#![warn(unused_crate_dependencies)]
|
||||
|
||||
//! Node-specific RPC methods for interaction with Merkle Mountain Range pallet.
|
||||
//! Node-specific RPC methods for interaction with Merkle Mountain Range pezpallet.
|
||||
|
||||
use std::{marker::PhantomData, sync::Arc};
|
||||
|
||||
@@ -81,7 +81,7 @@ pub trait MmrApi<BlockHash, BlockNumber, MmrHash> {
|
||||
|
||||
/// Generate an MMR proof for the given `block_numbers`.
|
||||
///
|
||||
/// This method calls into a runtime with MMR pallet included and attempts to generate
|
||||
/// This method calls into a runtime with MMR pezpallet included and attempts to generate
|
||||
/// an MMR proof for the set of blocks that have the given `block_numbers` with the MMR root at
|
||||
/// `best_known_block_number`. `best_known_block_number` must be larger than all the
|
||||
/// `block_numbers` for the function to succeed.
|
||||
@@ -108,7 +108,7 @@ pub trait MmrApi<BlockHash, BlockNumber, MmrHash> {
|
||||
|
||||
/// Generate an MMR ancestry proof for the given `prev_block_number`.
|
||||
///
|
||||
/// This method calls into a runtime with MMR pallet included and attempts to generate
|
||||
/// This method calls into a runtime with MMR pezpallet included and attempts to generate
|
||||
/// an MMR ancestry proof for the MMR root at the prior block with number `prev_block_number`,
|
||||
/// with the reference MMR root at `best_known_block_number`. `best_known_block_number` must be
|
||||
/// larger than the `prev_block_number` for the function to succeed.
|
||||
@@ -134,7 +134,7 @@ pub trait MmrApi<BlockHash, BlockNumber, MmrHash> {
|
||||
|
||||
/// Verify an MMR `proof`.
|
||||
///
|
||||
/// This method calls into a runtime with MMR pallet included and attempts to verify
|
||||
/// This method calls into a runtime with MMR pezpallet included and attempts to verify
|
||||
/// an MMR proof.
|
||||
///
|
||||
/// Returns `true` if the proof is valid, else returns the verification error.
|
||||
@@ -143,7 +143,7 @@ pub trait MmrApi<BlockHash, BlockNumber, MmrHash> {
|
||||
|
||||
/// Verify an MMR `proof` statelessly given an `mmr_root`.
|
||||
///
|
||||
/// This method calls into a runtime with MMR pallet included and attempts to verify
|
||||
/// This method calls into a runtime with MMR pezpallet included and attempts to verify
|
||||
/// an MMR proof against a provided MMR root.
|
||||
///
|
||||
/// Returns `true` if the proof is valid, else returns the verification error.
|
||||
|
||||
@@ -82,14 +82,14 @@ where
|
||||
B: Block,
|
||||
BE: AuxStore,
|
||||
{
|
||||
// Initialize gadget best_canon from AUX DB or from pallet genesis.
|
||||
// Initialize gadget best_canon from AUX DB or from pezpallet genesis.
|
||||
if let Some(best) = load_state::<B, BE>(backend)? {
|
||||
info!(target: LOG_TARGET, "Loading MMR best canonicalized state from db: {:?}.", best);
|
||||
Ok(best)
|
||||
} else {
|
||||
info!(
|
||||
target: LOG_TARGET,
|
||||
"Loading MMR from pallet genesis on what appears to be the first startup: {:?}.",
|
||||
"Loading MMR from pezpallet genesis on what appears to be the first startup: {:?}.",
|
||||
default
|
||||
);
|
||||
write_current_version(backend)?;
|
||||
|
||||
@@ -66,7 +66,7 @@ where
|
||||
BE: Backend<B>,
|
||||
Self::Api: MmrApi<B, MmrRootHash, NumberFor<B>>,
|
||||
{
|
||||
/// Get the block number where the mmr pallet was added to the runtime.
|
||||
/// Get the block number where the mmr pezpallet was added to the runtime.
|
||||
fn first_mmr_block_num(&self, notification: &FinalityNotification<B>) -> Option<NumberFor<B>> {
|
||||
let best_block_hash = notification.header.hash();
|
||||
let best_block_number = *notification.header.number();
|
||||
|
||||
@@ -167,7 +167,7 @@ where
|
||||
_ => return,
|
||||
};
|
||||
|
||||
// Don't canonicalize branches corresponding to blocks for which the MMR pallet
|
||||
// Don't canonicalize branches corresponding to blocks for which the MMR pezpallet
|
||||
// wasn't yet initialized.
|
||||
if header.number < self.first_mmr_block {
|
||||
return;
|
||||
@@ -263,7 +263,7 @@ where
|
||||
/// _canonical key_.
|
||||
/// Prune leafs and nodes added by stale blocks in offchain db from _fork-aware key_.
|
||||
pub fn canonicalize_and_prune(&mut self, notification: FinalityNotification<B>) {
|
||||
// Update the first MMR block in case of a pallet reset.
|
||||
// Update the first MMR block in case of a pezpallet reset.
|
||||
self.handle_potential_pallet_reset(¬ification);
|
||||
|
||||
// Move offchain MMR nodes for finalized blocks to canonical keys.
|
||||
@@ -328,7 +328,7 @@ mod tests {
|
||||
run_test_with_pezmmr_gadget(|client| async move {
|
||||
// G -> A1 -> A2 -> A3 -> A4 -> A5
|
||||
// | |
|
||||
// | | -> pallet reset
|
||||
// | | -> pezpallet reset
|
||||
// |
|
||||
// | -> first finality notification
|
||||
|
||||
@@ -427,7 +427,7 @@ mod tests {
|
||||
// | | | -> gadget start
|
||||
// | |
|
||||
// | | -> finalized before gadget start (missed notification)
|
||||
// | | + pallet reset
|
||||
// | | + pezpallet reset
|
||||
// |
|
||||
// | -> first mmr block
|
||||
let blocks = mmr_blocks.lock();
|
||||
|
||||
@@ -340,7 +340,7 @@ mod tests {
|
||||
use std::{collections::HashSet, sync::Arc};
|
||||
use bizinikiwi_test_runtime_client::{
|
||||
runtime::{
|
||||
bizinikiwi_test_pallet::pallet::Call as PalletCall, ExtrinsicBuilder, RuntimeCall,
|
||||
bizinikiwi_test_pallet::pezpallet::Call as PalletCall, ExtrinsicBuilder, RuntimeCall,
|
||||
},
|
||||
ClientBlockImportExt, DefaultTestClientBuilderExt, TestClientBuilderExt,
|
||||
};
|
||||
|
||||
@@ -206,7 +206,7 @@ pub trait StateApi<Hash> {
|
||||
/// curl \
|
||||
/// -H "Content-Type: application/json" \
|
||||
/// -d '{"id":1, "jsonrpc":"2.0", "method": "state_traceBlock", \
|
||||
/// "params": ["0xb246acf1adea1f801ce15c77a5fa7d8f2eb8fed466978bcee172cc02cf64e264", "pallet,frame,state", "", ""]}' \
|
||||
/// "params": ["0xb246acf1adea1f801ce15c77a5fa7d8f2eb8fed466978bcee172cc02cf64e264", "pezpallet,frame,state", "", ""]}' \
|
||||
/// http://localhost:9933/
|
||||
/// ```
|
||||
///
|
||||
|
||||
@@ -46,8 +46,8 @@ use pezsp_runtime::{
|
||||
};
|
||||
use pezsp_tracing::{WASM_NAME_KEY, WASM_TARGET_KEY, WASM_TRACE_IDENTIFIER};
|
||||
|
||||
// Default to only pallet, frame support and state related traces
|
||||
const DEFAULT_TARGETS: &str = "pallet,frame,state";
|
||||
// Default to only pezpallet, frame support and state related traces
|
||||
const DEFAULT_TARGETS: &str = "pezpallet,frame,state";
|
||||
const TRACE_TARGET: &str = "block_trace";
|
||||
// The name of a field required for all events.
|
||||
const REQUIRED_EVENT_FIELD: &str = "method";
|
||||
@@ -200,7 +200,7 @@ impl Subscriber for BlockSubscriber {
|
||||
}
|
||||
|
||||
/// Holds a reference to the client in order to execute the given block.
|
||||
/// Records spans & events for the supplied targets (eg. "pallet,frame,state") and
|
||||
/// Records spans & events for the supplied targets (eg. "pezpallet,frame,state") and
|
||||
/// only records events with the specified hex encoded storage key prefixes.
|
||||
/// Note: if `targets` or `storage_keys` is an empty string then nothing is
|
||||
/// filtered out.
|
||||
|
||||
@@ -223,8 +223,8 @@ pub enum TraceHandlerEvents {
|
||||
|
||||
impl ProfilingLayer {
|
||||
/// Takes a `TracingReceiver` and a comma separated list of targets,
|
||||
/// either with a level: "pallet=trace,frame=debug"
|
||||
/// or without: "pallet,frame" in which case the level defaults to `trace`.
|
||||
/// either with a level: "pezpallet=trace,frame=debug"
|
||||
/// or without: "pezpallet,frame" in which case the level defaults to `trace`.
|
||||
/// wasm_tracing indicates whether to enable wasm traces
|
||||
pub fn new(receiver: TracingReceiver, targets: &str) -> Self {
|
||||
match receiver {
|
||||
@@ -234,8 +234,8 @@ impl ProfilingLayer {
|
||||
|
||||
/// Allows use of a custom TraceHandler to create a new instance of ProfilingSubscriber.
|
||||
/// Takes a comma separated list of targets,
|
||||
/// either with a level, eg: "pallet=trace"
|
||||
/// or without: "pallet" in which case the level defaults to `trace`.
|
||||
/// either with a level, eg: "pezpallet=trace"
|
||||
/// or without: "pezpallet" in which case the level defaults to `trace`.
|
||||
/// wasm_tracing indicates whether to enable wasm traces
|
||||
pub fn new_with_handler(trace_handler: Box<dyn TraceHandler>, targets: &str) -> Self {
|
||||
let targets: Vec<_> = targets.split(',').map(parse_target).collect();
|
||||
|
||||
@@ -36,7 +36,7 @@ use pezsp_runtime::{
|
||||
};
|
||||
use std::{collections::HashSet, sync::Arc};
|
||||
use bizinikiwi_test_runtime::{
|
||||
bizinikiwi_test_pallet::pallet::Call as PalletCall, BalancesCall, Block, BlockNumber, Extrinsic,
|
||||
bizinikiwi_test_pallet::pezpallet::Call as PalletCall, BalancesCall, Block, BlockNumber, Extrinsic,
|
||||
ExtrinsicBuilder, Hashing, RuntimeCall, Transfer, TransferData, H256,
|
||||
};
|
||||
|
||||
|
||||
@@ -24,10 +24,13 @@ use std::time::SystemTime;
|
||||
use tracing_subscriber::EnvFilter;
|
||||
use txtesttool::scenario::{ChainType, ScenarioBuilder};
|
||||
use zombienet_sdk::{
|
||||
subxt::BizinikiwiConfig, GlobalSettingsBuilder, LocalFileSystem, Network, NetworkConfig,
|
||||
subxt::SubstrateConfig, GlobalSettingsBuilder, LocalFileSystem, Network, NetworkConfig,
|
||||
NetworkConfigBuilder, NetworkConfigExt, WithRelaychain,
|
||||
};
|
||||
|
||||
/// Bizinikiwi configuration for zombienet tests - based on SubstrateConfig
|
||||
pub type BizinikiwiConfig = SubstrateConfig;
|
||||
|
||||
/// Gathers TOML files paths for relaychains and for teyrchains' (that use pezkuwichain-local based
|
||||
/// relaychains) zombienet network specs for testing in relation to fork aware transaction pool.
|
||||
pub mod relaychain_pezkuwichain_local_network_spec {
|
||||
|
||||
@@ -9,18 +9,18 @@ The format is based on [Keep a Changelog].
|
||||
## 2.0.1-> 3.0.0 - Apollo 14
|
||||
|
||||
Most notably, this is the first release of the new FRAME (2.0) with its new macro-syntax and some changes in types, and
|
||||
pallet versioning. This release also incorporates the faster and improve version 2.0 of the `parity-scale-codec` and
|
||||
upgraded dependencies all-around. While the `FinalityTracker` pallet has been dropped, this release marks the first
|
||||
public appearance of a few new pallets, too;Bounties, Lottery, Tips (extracted from the `Treasury`-pallet, see #7536)
|
||||
pezpallet versioning. This release also incorporates the faster and improve version 2.0 of the `parity-scale-codec` and
|
||||
upgraded dependencies all-around. While the `FinalityTracker` pezpallet has been dropped, this release marks the first
|
||||
public appearance of a few new pallets, too;Bounties, Lottery, Tips (extracted from the `Treasury`-pezpallet, see #7536)
|
||||
and Merkle-Mountain-Ranges (MMR).
|
||||
|
||||
On the client side, the most notable changes are around the keystore, making it async and switching to a different
|
||||
signing model allowing for remote-signing to be implemented; and various changes to improve networking and light-client
|
||||
support, like adding the Grandpa warp sync request-response protocol (#7711).
|
||||
|
||||
_Contracts_: Please note that the contracts pallet _is not part_ of this release. The pallet is not yet ready and will
|
||||
be released separately in the coming weeks. The currently released contracts pallet _is not compatible_ with the new
|
||||
FRAME, thus if you need the contracts pallet, we recommend you wait with the upgrade until it has been released, too.
|
||||
_Contracts_: Please note that the contracts pezpallet _is not part_ of this release. The pezpallet is not yet ready and will
|
||||
be released separately in the coming weeks. The currently released contracts pezpallet _is not compatible_ with the new
|
||||
FRAME, thus if you need the contracts pezpallet, we recommend you wait with the upgrade until it has been released, too.
|
||||
### Upgrade instructions
|
||||
|
||||
Not too much has changed on the top and API level for developing Bizinikiwi between 2.0 and 3.0. The easiest and quickest
|
||||
@@ -56,18 +56,18 @@ board](https://github.com/paritytech/bizinikiwi/discussions).
|
||||
* Allow council to slash treasury tip (#7753)
|
||||
* Don't allow self proxies (#7803)
|
||||
* add a `current_epoch` to BabeApi (#7789)
|
||||
* Add `pallet` attribute macro to declare pallets (#6877)
|
||||
* Add `pezpallet` attribute macro to declare pallets (#6877)
|
||||
* Make it possible to calculate the storage root as often as you want (#7714)
|
||||
* Issue 7143 | Refactor Treasury Pallet into Bounties, Tips, and Proposals (#7536)
|
||||
* Issue 7143 | Refactor Treasury Pezpallet into Bounties, Tips, and Proposals (#7536)
|
||||
* Participating in Council Governance is Free for First Time Voters and Successful Closing (#7661)
|
||||
* Streamline frame_system weight parametrization (#6629)
|
||||
* Features needed for reserve-backed stablecoins (#7152)
|
||||
* `sudo_as` should return a result (#7620)
|
||||
* More Extensible Multiaddress Format (#7380)
|
||||
* Fix `on_runtime_upgrade` weight recording (#7480)
|
||||
* Implement batch_all and update Utility pallet for weight refunds (#7188)
|
||||
* Implement batch_all and update Utility pezpallet for weight refunds (#7188)
|
||||
* Fix wrong outgoing calculation in election (#7384)
|
||||
* Implements pallet versioning (#7208)
|
||||
* Implements pezpallet versioning (#7208)
|
||||
* Runtime worker threads (#7089)
|
||||
* Allow `schedule_after(0, ...)` to work (#7284)
|
||||
* Fix offchain election to respect the weight (#7215)
|
||||
@@ -110,27 +110,27 @@ board](https://github.com/paritytech/bizinikiwi/discussions).
|
||||
|
||||
#### API
|
||||
|
||||
* pallet macro: easier syntax for `#[pallet::pallet]` with `struct Pallet<T>(_)` (#8091)
|
||||
* pezpallet macro: easier syntax for `#[pezpallet::pezpallet]` with `struct Pezpallet<T>(_)` (#8091)
|
||||
* WasmExecutor takes a cache directory (#8057)
|
||||
* Remove PalletInfo impl for () (#8090)
|
||||
* Migrate assets pallet to new macros (#7984)
|
||||
* Migrate assets pezpallet to new macros (#7984)
|
||||
* contracts: Make ChainExtension trait generic over the runtime (#8003)
|
||||
* Decouple the session validators from im-online (#7127)
|
||||
* Update `parity-scale-codec` to 2.0 (#7994)
|
||||
* Merkle Mountain Range pallet improvements (#7891)
|
||||
* Merkle Mountain Range pezpallet improvements (#7891)
|
||||
* Cleaner GRANDPA RPC API for proving finality (#7339)
|
||||
* Migrate pezframe-system to pallet attribute macro (#7898)
|
||||
* Migrate pezframe-system to pezpallet attribute macro (#7898)
|
||||
* Introduces account existence providers reference counting (#7363)
|
||||
* contracts: Lazy storage removal (#7740)
|
||||
* contracts: Allow runtime authors to define a chain extension (#7548)
|
||||
* Define ss58 prefix inside the runtime (#7810)
|
||||
* Add `pallet` attribute macro to declare pallets (#6877)
|
||||
* Add `pezpallet` attribute macro to declare pallets (#6877)
|
||||
* Add keccak-512 to host functions. (#7531)
|
||||
* Merkle Mountain Range pallet (#7312)
|
||||
* Merkle Mountain Range pezpallet (#7312)
|
||||
* Allow capping the amount of work performed when deleting a child trie (#7671)
|
||||
* add an upgrade_keys method for pezpallet-session (#7688)
|
||||
* Streamline frame_system weight parametrization (#6629)
|
||||
* Rename pallet trait `Trait` to `Config` (#7599)
|
||||
* Rename pezpallet trait `Trait` to `Config` (#7599)
|
||||
* contracts: Add `salt` argument to contract instantiation (#7482)
|
||||
* pezpallet-evm: move to Frontier (Part IV) (#7573)
|
||||
* refactor subtrait/elevated trait as not needed (#7497)
|
||||
@@ -144,15 +144,15 @@ board](https://github.com/paritytech/bizinikiwi/discussions).
|
||||
* allow where clause in decl_error (#7324)
|
||||
* reschedule (#6860)
|
||||
* SystemOrigin trait (#7226)
|
||||
* permit setting treasury pallet initial funding through genesis (#7214)
|
||||
* permit setting treasury pezpallet initial funding through genesis (#7214)
|
||||
|
||||
#### Runtime Migrations
|
||||
|
||||
* Migrate assets pallet to new macros (#7984)
|
||||
* Migrate assets pezpallet to new macros (#7984)
|
||||
* Fix elections-phragmen and proxy issue (#7040)
|
||||
* Allow validators to block and kick their nominator set. (#7930)
|
||||
* Migrate pezframe-system to pallet attribute macro (#7898)
|
||||
* Implements pallet versioning (#7208)
|
||||
* Migrate pezframe-system to pezpallet attribute macro (#7898)
|
||||
* Implements pezpallet versioning (#7208)
|
||||
* Move proxies migration (#7205)
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ Patch release with backports to fix broken nightly builds. Namely contains backp
|
||||
* Rename `ModuleToIndex` to `PalletRuntimeSetup` (#7148)
|
||||
* Bounties (#5715)
|
||||
* pezpallet-collective: allow customized default vote (#6984)
|
||||
* add instantiable support for treasury pallet (#7058)
|
||||
* add instantiable support for treasury pezpallet (#7058)
|
||||
* frame/authority-discovery: Have authorities() return both current and next (#6788)
|
||||
* add generated weight info for pezpallet-collective (#6789)
|
||||
* Support Staking Payout to Any Account (#6832)
|
||||
@@ -221,7 +221,7 @@ Patch release with backports to fix broken nightly builds. Namely contains backp
|
||||
* Custom Codec Implementation for NPoS Election (#6720)
|
||||
* Successful `note_imminent_preimage` is free (#6793)
|
||||
* pezpallet-democracy use of weightinfo (#6783)
|
||||
* Update Balances Pallet to use `WeightInfo` (#6610)
|
||||
* Update Balances Pezpallet to use `WeightInfo` (#6610)
|
||||
* pezpallet-evm: add builtin support for the four basic Ethereum precompiles (#6743)
|
||||
* Allow `PostDispatchInfo` to disable fees (#6749)
|
||||
* pezpallet-evm: add support for tuple-based precompile declarations (#6681)
|
||||
@@ -310,7 +310,7 @@ Patch release with backports to fix broken nightly builds. Namely contains backp
|
||||
* Avoid multisig reentrancy (#6445)
|
||||
* Root origin use no filter by default. Scheduler and Democracy dispatch without asserting BaseCallFilter (#6408)
|
||||
* Scale and increase validator count (#6417)
|
||||
* Pallet: Atomic Swap (#6349)
|
||||
* Pezpallet: Atomic Swap (#6349)
|
||||
* Restrict remove_proxies (#6383)
|
||||
* Stored call in multisig (#6319)
|
||||
* Allow Sudo to do anything (#6375)
|
||||
@@ -401,7 +401,7 @@ PR](https://github.com/pezkuwichain/kurdistan-sdk/issues/56).
|
||||
|
||||
* Meter block import results via prometheus (#6025)
|
||||
* Added RuntimePublic for ecdsa public key. (#6029)
|
||||
* Benchmarks for elections-phragmen pallet (#5845)
|
||||
* Benchmarks for elections-phragmen pezpallet (#5845)
|
||||
* Monitor transactions rejected from the pool as invalid (#5992)
|
||||
* client/network: Remove default Kademlia DHT in favor of per protocol DHT (#5993)
|
||||
* Allow passing multiple --log CLI options (#5982)
|
||||
@@ -456,7 +456,7 @@ PR](https://github.com/pezkuwichain/kurdistan-sdk/issues/56).
|
||||
* Unsigned Validation best practices (#5563)
|
||||
* Generate Unit Tests for Benchmarks (#5527)
|
||||
* Mandate weight annotation (#5357)
|
||||
* Make Staking pallet using a proper Time module. (#4662)
|
||||
* Make Staking pezpallet using a proper Time module. (#4662)
|
||||
* Pass transaction source to validate_transaction (#5366)
|
||||
* on_initialize return weight consumed and default cost to default DispatchInfo instead of zero (#5382)
|
||||
|
||||
@@ -501,7 +501,7 @@ PR](https://github.com/pezkuwichain/kurdistan-sdk/issues/56).
|
||||
* Refactor session away from needless double_maps (#5202)
|
||||
* Remove `secp256k1` from WASM build (#5187)
|
||||
* Introduce default-setting prime for collective (#5137)
|
||||
* Adds `vested_transfer` to Vesting pallet (#5029)
|
||||
* Adds `vested_transfer` to Vesting pezpallet (#5029)
|
||||
* Change extrinsic_count to extrinsic_index in pezpallet-utility (#5044)
|
||||
|
||||
### Client
|
||||
|
||||
@@ -67,9 +67,9 @@ plugging all that together as a Runtime, there's some things we have to adapt no
|
||||
|
||||
##### `::Trait for Runtime` becomes `::Config for Runtime`
|
||||
|
||||
The most visible and significant change is that the macros no longer generate the `$pallet::Trait` but now a much more
|
||||
aptly named `$pallet::Config`. Thus, we need to rename all `::Trait for Runtime` into`::Config for Runtime`, e.g. for
|
||||
the `sudo` pallet we must do:
|
||||
The most visible and significant change is that the macros no longer generate the `$pezpallet::Trait` but now a much more
|
||||
aptly named `$pezpallet::Config`. Thus, we need to rename all `::Trait for Runtime` into`::Config for Runtime`, e.g. for
|
||||
the `sudo` pezpallet we must do:
|
||||
|
||||
```diff
|
||||
-impl pallet_sudo::Trait for Runtime {
|
||||
@@ -194,19 +194,19 @@ And update the overall definition for weights on frame and a few related types a
|
||||
|
||||
##### Assets
|
||||
|
||||
The assets pallet has seen a variety of changes:
|
||||
The assets pezpallet has seen a variety of changes:
|
||||
- [Features needed for reserve-backed stablecoins #7152](https://github.com/pezkuwichain/kurdistan-sdk/issues/61)
|
||||
- [Freeze Assets and Asset Metadata #7346](https://github.com/pezkuwichain/kurdistan-sdk/issues/64)
|
||||
- [Introduces account existence providers reference counting #7363]((https://github.com/pezkuwichain/kurdistan-sdk/issues/65))
|
||||
|
||||
have all altered the feature set and changed the concepts. However, it has some of the best documentation and explains
|
||||
the current state very well. If you are using the assets pallet and need to upgrade from an earlier version, we
|
||||
the current state very well. If you are using the assets pezpallet and need to upgrade from an earlier version, we
|
||||
recommend you use the current docs to guide your way!
|
||||
|
||||
##### Contracts
|
||||
|
||||
As noted in the changelog, the `contracts`-pallet is still undergoing massive changes and is not yet part of this
|
||||
release. We are expecting for it to be released a few weeks after. If your chain is dependent on this pallet, we
|
||||
As noted in the changelog, the `contracts`-pezpallet is still undergoing massive changes and is not yet part of this
|
||||
release. We are expecting for it to be released a few weeks after. If your chain is dependent on this pezpallet, we
|
||||
recommend to wait until it has been released as the currently released version is not compatible with FRAME 2.0.
|
||||
|
||||
#### (changes) Treasury
|
||||
@@ -274,7 +274,7 @@ removed without worry.
|
||||
|
||||
#### (changes) Elections Phragmen
|
||||
|
||||
The pallet has been moved to a new system in which the exact amount of deposit for each voter, candidate, member, or
|
||||
The pezpallet has been moved to a new system in which the exact amount of deposit for each voter, candidate, member, or
|
||||
runner-up is now deposited on-chain. Moreover, the concept of a `defunct_voter` is removed, since votes now have
|
||||
adequate deposit associated with them. A number of configuration parameters has changed to reflect this, as shown below:
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ edition.workspace = true
|
||||
license = "Apache-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
description = "The Alliance pallet provides a collective for standard-setting industry collaboration."
|
||||
description = "The Alliance pezpallet provides a collective for standard-setting industry collaboration."
|
||||
readme = "README.md"
|
||||
documentation = "https://docs.rs/pezpallet-alliance"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Alliance Pallet
|
||||
# Alliance Pezpallet
|
||||
|
||||
The Alliance Pallet provides a collective that curates a list of accounts and URLs, deemed by
|
||||
The Alliance Pezpallet provides a collective that curates a list of accounts and URLs, deemed by
|
||||
the voting members to be unscrupulous actors. The Alliance
|
||||
|
||||
- provides a set of ethics against bad behavior, and
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Alliance pallet benchmarking.
|
||||
//! Alliance pezpallet benchmarking.
|
||||
|
||||
#![cfg(feature = "runtime-benchmarks")]
|
||||
|
||||
@@ -24,16 +24,16 @@ use pezsp_runtime::traits::{Bounded, Hash, StaticLookup};
|
||||
|
||||
use pezframe_benchmarking::{account, v2::*, BenchmarkError};
|
||||
use pezframe_support::traits::{EnsureOrigin, Get, UnfilteredDispatchable};
|
||||
use pezframe_system::{pezpallet_prelude::BlockNumberFor, Pallet as System, RawOrigin as SystemOrigin};
|
||||
use pezframe_system::{pezpallet_prelude::BlockNumberFor, Pezpallet as System, RawOrigin as SystemOrigin};
|
||||
|
||||
use super::{Call as AllianceCall, Pallet as Alliance, *};
|
||||
use super::{Call as AllianceCall, Pezpallet as Alliance, *};
|
||||
|
||||
const SEED: u32 = 0;
|
||||
|
||||
const MAX_BYTES: u32 = 1_024;
|
||||
|
||||
fn assert_last_event<T: Config<I>, I: 'static>(generic_event: <T as Config<I>>::RuntimeEvent) {
|
||||
pezframe_system::Pallet::<T>::assert_last_event(generic_event.into());
|
||||
pezframe_system::Pezpallet::<T>::assert_last_event(generic_event.into());
|
||||
}
|
||||
|
||||
fn cid(input: impl AsRef<[u8]>) -> Cid {
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! # Alliance Pallet
|
||||
//! # Alliance Pezpallet
|
||||
//!
|
||||
//! The Alliance Pallet provides a collective that curates a list of accounts and URLs, deemed by
|
||||
//! The Alliance Pezpallet provides a collective that curates a list of accounts and URLs, deemed by
|
||||
//! the voting members to be unscrupulous actors. The Alliance
|
||||
//!
|
||||
//! - provides a set of ethics against bad behavior, and
|
||||
@@ -116,17 +116,17 @@ use pezframe_support::{
|
||||
};
|
||||
use scale_info::TypeInfo;
|
||||
|
||||
pub use pallet::*;
|
||||
pub use pezpallet::*;
|
||||
pub use types::*;
|
||||
pub use weights::*;
|
||||
|
||||
/// The log target of this pallet.
|
||||
/// The log target of this pezpallet.
|
||||
pub const LOG_TARGET: &str = "runtime::alliance";
|
||||
|
||||
/// Simple index type for proposal counting.
|
||||
pub type ProposalIndex = u32;
|
||||
|
||||
type UrlOf<T, I> = BoundedVec<u8, <T as pallet::Config<I>>::MaxWebsiteUrlLength>;
|
||||
type UrlOf<T, I> = BoundedVec<u8, <T as pezpallet::Config<I>>::MaxWebsiteUrlLength>;
|
||||
|
||||
type BalanceOf<T, I> =
|
||||
<<T as Config<I>>::Currency as Currency<<T as pezframe_system::Config>::AccountId>>::Balance;
|
||||
@@ -225,15 +225,15 @@ type UnscrupulousItemOf<T, I> =
|
||||
|
||||
type AccountIdLookupOf<T> = <<T as pezframe_system::Config>::Lookup as StaticLookup>::Source;
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
#[pezframe_support::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use super::*;
|
||||
|
||||
#[pallet::pallet]
|
||||
#[pallet::storage_version(migration::STORAGE_VERSION)]
|
||||
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
|
||||
#[pezpallet::pezpallet]
|
||||
#[pezpallet::storage_version(migration::STORAGE_VERSION)]
|
||||
pub struct Pezpallet<T, I = ()>(PhantomData<(T, I)>);
|
||||
|
||||
#[pallet::config]
|
||||
#[pezpallet::config]
|
||||
pub trait Config<I: 'static = ()>: pezframe_system::Config {
|
||||
/// The overarching event type.
|
||||
#[allow(deprecated)]
|
||||
@@ -279,41 +279,41 @@ pub mod pallet {
|
||||
/// Maximum number of proposals allowed to be active in parallel.
|
||||
type MaxProposals: Get<ProposalIndex>;
|
||||
|
||||
/// The maximum number of Fellows supported by the pallet. Used for weight estimation.
|
||||
/// The maximum number of Fellows supported by the pezpallet. Used for weight estimation.
|
||||
///
|
||||
/// NOTE:
|
||||
/// + Benchmarks will need to be re-run and weights adjusted if this changes.
|
||||
/// + This pallet assumes that dependencies keep to the limit without enforcing it.
|
||||
/// + This pezpallet assumes that dependencies keep to the limit without enforcing it.
|
||||
type MaxFellows: Get<u32>;
|
||||
|
||||
/// The maximum number of Allies supported by the pallet. Used for weight estimation.
|
||||
/// The maximum number of Allies supported by the pezpallet. Used for weight estimation.
|
||||
///
|
||||
/// NOTE:
|
||||
/// + Benchmarks will need to be re-run and weights adjusted if this changes.
|
||||
/// + This pallet assumes that dependencies keep to the limit without enforcing it.
|
||||
/// + This pezpallet assumes that dependencies keep to the limit without enforcing it.
|
||||
type MaxAllies: Get<u32>;
|
||||
|
||||
/// The maximum number of the unscrupulous items supported by the pallet.
|
||||
#[pallet::constant]
|
||||
/// The maximum number of the unscrupulous items supported by the pezpallet.
|
||||
#[pezpallet::constant]
|
||||
type MaxUnscrupulousItems: Get<u32>;
|
||||
|
||||
/// The maximum length of a website URL.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type MaxWebsiteUrlLength: Get<u32>;
|
||||
|
||||
/// The deposit required for submitting candidacy.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type AllyDeposit: Get<BalanceOf<Self, I>>;
|
||||
|
||||
/// The maximum number of announcements.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type MaxAnnouncementsCount: Get<u32>;
|
||||
|
||||
/// The maximum number of members per member role.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type MaxMembersCount: Get<u32>;
|
||||
|
||||
/// Weight information for extrinsics in this pallet.
|
||||
/// Weight information for extrinsics in this pezpallet.
|
||||
type WeightInfo: WeightInfo;
|
||||
|
||||
/// The number of blocks a member must wait between giving a retirement notice and retiring.
|
||||
@@ -321,7 +321,7 @@ pub mod pallet {
|
||||
type RetirementPeriod: Get<BlockNumberFor<Self>>;
|
||||
}
|
||||
|
||||
#[pallet::error]
|
||||
#[pezpallet::error]
|
||||
pub enum Error<T, I = ()> {
|
||||
/// The Alliance has not been initialized yet, therefore accounts cannot join it.
|
||||
AllianceNotYetInitialized,
|
||||
@@ -374,8 +374,8 @@ pub mod pallet {
|
||||
FellowsMissing,
|
||||
}
|
||||
|
||||
#[pallet::event]
|
||||
#[pallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
#[pezpallet::event]
|
||||
#[pezpallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
pub enum Event<T: Config<I>, I: 'static = ()> {
|
||||
/// A new rule has been set.
|
||||
NewRuleSet { rule: Cid },
|
||||
@@ -409,7 +409,7 @@ pub mod pallet {
|
||||
FellowAbdicated { fellow: T::AccountId },
|
||||
}
|
||||
|
||||
#[pallet::genesis_config]
|
||||
#[pezpallet::genesis_config]
|
||||
#[derive(pezframe_support::DefaultNoBound)]
|
||||
pub struct GenesisConfig<T: Config<I>, I: 'static = ()> {
|
||||
pub fellows: Vec<T::AccountId>,
|
||||
@@ -418,24 +418,24 @@ pub mod pallet {
|
||||
pub phantom: PhantomData<(T, I)>,
|
||||
}
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config<I>, I: 'static> Hooks<BlockNumberFor<T>> for Pallet<T, I> {
|
||||
#[pezpallet::hooks]
|
||||
impl<T: Config<I>, I: 'static> Hooks<BlockNumberFor<T>> for Pezpallet<T, I> {
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn try_state(_n: BlockNumberFor<T>) -> Result<(), pezsp_runtime::TryRuntimeError> {
|
||||
Self::do_try_state()
|
||||
}
|
||||
}
|
||||
|
||||
#[pallet::genesis_build]
|
||||
#[pezpallet::genesis_build]
|
||||
impl<T: Config<I>, I: 'static> BuildGenesisConfig for GenesisConfig<T, I> {
|
||||
fn build(&self) {
|
||||
for m in self.fellows.iter().chain(self.allies.iter()) {
|
||||
assert!(Pallet::<T, I>::has_identity(m).is_ok(), "Member does not set identity!");
|
||||
assert!(Pezpallet::<T, I>::has_identity(m).is_ok(), "Member does not set identity!");
|
||||
}
|
||||
|
||||
if !self.fellows.is_empty() {
|
||||
assert!(
|
||||
!Pallet::<T, I>::has_member(MemberRole::Fellow),
|
||||
!Pezpallet::<T, I>::has_member(MemberRole::Fellow),
|
||||
"Fellows are already initialized!"
|
||||
);
|
||||
let members: BoundedVec<T::AccountId, T::MaxMembersCount> =
|
||||
@@ -444,7 +444,7 @@ pub mod pallet {
|
||||
}
|
||||
if !self.allies.is_empty() {
|
||||
assert!(
|
||||
!Pallet::<T, I>::has_member(MemberRole::Ally),
|
||||
!Pezpallet::<T, I>::has_member(MemberRole::Ally),
|
||||
"Allies are already initialized!"
|
||||
);
|
||||
assert!(
|
||||
@@ -462,21 +462,21 @@ pub mod pallet {
|
||||
|
||||
/// The IPFS CID of the alliance rule.
|
||||
/// Fellows can propose a new rule with a super-majority.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type Rule<T: Config<I>, I: 'static = ()> = StorageValue<_, Cid, OptionQuery>;
|
||||
|
||||
/// The current IPFS CIDs of any announcements.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type Announcements<T: Config<I>, I: 'static = ()> =
|
||||
StorageValue<_, BoundedVec<Cid, T::MaxAnnouncementsCount>, ValueQuery>;
|
||||
|
||||
/// Maps members to their candidacy deposit.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type DepositOf<T: Config<I>, I: 'static = ()> =
|
||||
StorageMap<_, Blake2_128Concat, T::AccountId, BalanceOf<T, I>, OptionQuery>;
|
||||
|
||||
/// Maps member type to members of each type.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type Members<T: Config<I>, I: 'static = ()> = StorageMap<
|
||||
_,
|
||||
Twox64Concat,
|
||||
@@ -487,37 +487,37 @@ pub mod pallet {
|
||||
|
||||
/// A set of members who gave a retirement notice. They can retire after the end of retirement
|
||||
/// period stored as a future block number.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type RetiringMembers<T: Config<I>, I: 'static = ()> =
|
||||
StorageMap<_, Blake2_128Concat, T::AccountId, BlockNumberFor<T>, OptionQuery>;
|
||||
|
||||
/// The current list of accounts deemed unscrupulous. These accounts non grata cannot submit
|
||||
/// candidacy.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type UnscrupulousAccounts<T: Config<I>, I: 'static = ()> =
|
||||
StorageValue<_, BoundedVec<T::AccountId, T::MaxUnscrupulousItems>, ValueQuery>;
|
||||
|
||||
/// The current list of websites deemed unscrupulous.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type UnscrupulousWebsites<T: Config<I>, I: 'static = ()> =
|
||||
StorageValue<_, BoundedVec<UrlOf<T, I>, T::MaxUnscrupulousItems>, ValueQuery>;
|
||||
|
||||
#[pallet::call(weight(<T as Config<I>>::WeightInfo))]
|
||||
impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
#[pezpallet::call(weight(<T as Config<I>>::WeightInfo))]
|
||||
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
|
||||
/// Add a new proposal to be voted on.
|
||||
///
|
||||
/// Must be called by a Fellow.
|
||||
#[pallet::call_index(0)]
|
||||
#[pallet::weight(T::WeightInfo::propose_proposed(
|
||||
#[pezpallet::call_index(0)]
|
||||
#[pezpallet::weight(T::WeightInfo::propose_proposed(
|
||||
*length_bound, // B
|
||||
T::MaxFellows::get(), // M
|
||||
T::MaxProposals::get(), // P2
|
||||
))]
|
||||
pub fn propose(
|
||||
origin: OriginFor<T>,
|
||||
#[pallet::compact] threshold: u32,
|
||||
#[pezpallet::compact] threshold: u32,
|
||||
proposal: Box<<T as Config<I>>::Proposal>,
|
||||
#[pallet::compact] length_bound: u32,
|
||||
#[pezpallet::compact] length_bound: u32,
|
||||
) -> DispatchResult {
|
||||
let proposer = ensure_signed(origin)?;
|
||||
ensure!(Self::has_voting_rights(&proposer), Error::<T, I>::NoVotingRights);
|
||||
@@ -529,12 +529,12 @@ pub mod pallet {
|
||||
/// Add an aye or nay vote for the sender to the given proposal.
|
||||
///
|
||||
/// Must be called by a Fellow.
|
||||
#[pallet::call_index(1)]
|
||||
#[pallet::weight(T::WeightInfo::vote(T::MaxFellows::get()))]
|
||||
#[pezpallet::call_index(1)]
|
||||
#[pezpallet::weight(T::WeightInfo::vote(T::MaxFellows::get()))]
|
||||
pub fn vote(
|
||||
origin: OriginFor<T>,
|
||||
proposal: T::Hash,
|
||||
#[pallet::compact] index: ProposalIndex,
|
||||
#[pezpallet::compact] index: ProposalIndex,
|
||||
approve: bool,
|
||||
) -> DispatchResult {
|
||||
let who = ensure_signed(origin)?;
|
||||
@@ -551,8 +551,8 @@ pub mod pallet {
|
||||
/// The Alliance must be empty, and the call must provide some founding members.
|
||||
///
|
||||
/// Must be called by the Root origin.
|
||||
#[pallet::call_index(3)]
|
||||
#[pallet::weight(T::WeightInfo::init_members(
|
||||
#[pezpallet::call_index(3)]
|
||||
#[pezpallet::weight(T::WeightInfo::init_members(
|
||||
fellows.len() as u32,
|
||||
allies.len() as u32,
|
||||
))]
|
||||
@@ -602,8 +602,8 @@ pub mod pallet {
|
||||
/// Disband the Alliance, remove all active members and unreserve deposits.
|
||||
///
|
||||
/// Witness data must be set.
|
||||
#[pallet::call_index(4)]
|
||||
#[pallet::weight(T::WeightInfo::disband(
|
||||
#[pezpallet::call_index(4)]
|
||||
#[pezpallet::weight(T::WeightInfo::disband(
|
||||
witness.fellow_members,
|
||||
witness.ally_members,
|
||||
witness.fellow_members.saturating_add(witness.ally_members),
|
||||
@@ -653,7 +653,7 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
/// Set a new IPFS CID to the alliance rule.
|
||||
#[pallet::call_index(5)]
|
||||
#[pezpallet::call_index(5)]
|
||||
pub fn set_rule(origin: OriginFor<T>, rule: Cid) -> DispatchResult {
|
||||
T::AdminOrigin::ensure_origin(origin)?;
|
||||
|
||||
@@ -664,7 +664,7 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
/// Make an announcement of a new IPFS CID about alliance issues.
|
||||
#[pallet::call_index(6)]
|
||||
#[pezpallet::call_index(6)]
|
||||
pub fn announce(origin: OriginFor<T>, announcement: Cid) -> DispatchResult {
|
||||
T::AnnouncementOrigin::ensure_origin(origin)?;
|
||||
|
||||
@@ -679,7 +679,7 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
/// Remove an announcement.
|
||||
#[pallet::call_index(7)]
|
||||
#[pezpallet::call_index(7)]
|
||||
pub fn remove_announcement(origin: OriginFor<T>, announcement: Cid) -> DispatchResult {
|
||||
T::AnnouncementOrigin::ensure_origin(origin)?;
|
||||
|
||||
@@ -696,7 +696,7 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
/// Submit oneself for candidacy. A fixed deposit is reserved.
|
||||
#[pallet::call_index(8)]
|
||||
#[pezpallet::call_index(8)]
|
||||
pub fn join_alliance(origin: OriginFor<T>) -> DispatchResult {
|
||||
let who = ensure_signed(origin)?;
|
||||
|
||||
@@ -732,7 +732,7 @@ pub mod pallet {
|
||||
|
||||
/// A Fellow can nominate someone to join the alliance as an Ally. There is no deposit
|
||||
/// required from the nominator or nominee.
|
||||
#[pallet::call_index(9)]
|
||||
#[pezpallet::call_index(9)]
|
||||
pub fn nominate_ally(origin: OriginFor<T>, who: AccountIdLookupOf<T>) -> DispatchResult {
|
||||
let nominator = ensure_signed(origin)?;
|
||||
ensure!(Self::has_voting_rights(&nominator), Error::<T, I>::NoVotingRights);
|
||||
@@ -756,7 +756,7 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
/// Elevate an Ally to Fellow.
|
||||
#[pallet::call_index(10)]
|
||||
#[pezpallet::call_index(10)]
|
||||
pub fn elevate_ally(origin: OriginFor<T>, ally: AccountIdLookupOf<T>) -> DispatchResult {
|
||||
T::MembershipManager::ensure_origin(origin)?;
|
||||
let ally = T::Lookup::lookup(ally)?;
|
||||
@@ -772,7 +772,7 @@ pub mod pallet {
|
||||
|
||||
/// As a member, give a retirement notice and start a retirement period required to pass in
|
||||
/// order to retire.
|
||||
#[pallet::call_index(11)]
|
||||
#[pezpallet::call_index(11)]
|
||||
pub fn give_retirement_notice(origin: OriginFor<T>) -> DispatchResult {
|
||||
let who = ensure_signed(origin)?;
|
||||
let role = Self::member_role_of(&who).ok_or(Error::<T, I>::NotMember)?;
|
||||
@@ -782,7 +782,7 @@ pub mod pallet {
|
||||
Self::add_member(&who, MemberRole::Retiring)?;
|
||||
<RetiringMembers<T, I>>::insert(
|
||||
&who,
|
||||
pezframe_system::Pallet::<T>::block_number()
|
||||
pezframe_system::Pezpallet::<T>::block_number()
|
||||
.saturating_add(T::RetirementPeriod::get()),
|
||||
);
|
||||
|
||||
@@ -794,13 +794,13 @@ pub mod pallet {
|
||||
///
|
||||
/// This can only be done once you have called `give_retirement_notice` and the
|
||||
/// `RetirementPeriod` has passed.
|
||||
#[pallet::call_index(12)]
|
||||
#[pezpallet::call_index(12)]
|
||||
pub fn retire(origin: OriginFor<T>) -> DispatchResult {
|
||||
let who = ensure_signed(origin)?;
|
||||
let retirement_period_end = RetiringMembers::<T, I>::get(&who)
|
||||
.ok_or(Error::<T, I>::RetirementNoticeNotGiven)?;
|
||||
ensure!(
|
||||
pezframe_system::Pallet::<T>::block_number() >= retirement_period_end,
|
||||
pezframe_system::Pezpallet::<T>::block_number() >= retirement_period_end,
|
||||
Error::<T, I>::RetirementPeriodNotPassed
|
||||
);
|
||||
|
||||
@@ -816,7 +816,7 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
/// Kick a member from the Alliance and slash its deposit.
|
||||
#[pallet::call_index(13)]
|
||||
#[pezpallet::call_index(13)]
|
||||
pub fn kick_member(origin: OriginFor<T>, who: AccountIdLookupOf<T>) -> DispatchResult {
|
||||
T::MembershipManager::ensure_origin(origin)?;
|
||||
let member = T::Lookup::lookup(who)?;
|
||||
@@ -833,8 +833,8 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
/// Add accounts or websites to the list of unscrupulous items.
|
||||
#[pallet::call_index(14)]
|
||||
#[pallet::weight(T::WeightInfo::add_unscrupulous_items(items.len() as u32, T::MaxWebsiteUrlLength::get()))]
|
||||
#[pezpallet::call_index(14)]
|
||||
#[pezpallet::weight(T::WeightInfo::add_unscrupulous_items(items.len() as u32, T::MaxWebsiteUrlLength::get()))]
|
||||
pub fn add_unscrupulous_items(
|
||||
origin: OriginFor<T>,
|
||||
items: Vec<UnscrupulousItemOf<T, I>>,
|
||||
@@ -863,8 +863,8 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
/// Deem some items no longer unscrupulous.
|
||||
#[pallet::call_index(15)]
|
||||
#[pallet::weight(<T as Config<I>>::WeightInfo::remove_unscrupulous_items(
|
||||
#[pezpallet::call_index(15)]
|
||||
#[pezpallet::weight(<T as Config<I>>::WeightInfo::remove_unscrupulous_items(
|
||||
items.len() as u32, T::MaxWebsiteUrlLength::get()
|
||||
))]
|
||||
pub fn remove_unscrupulous_items(
|
||||
@@ -889,8 +889,8 @@ pub mod pallet {
|
||||
/// Close a vote that is either approved, disapproved, or whose voting period has ended.
|
||||
///
|
||||
/// Must be called by a Fellow.
|
||||
#[pallet::call_index(16)]
|
||||
#[pallet::weight({
|
||||
#[pezpallet::call_index(16)]
|
||||
#[pezpallet::weight({
|
||||
let b = *length_bound;
|
||||
let m = T::MaxFellows::get();
|
||||
let p1 = *proposal_weight_bound;
|
||||
@@ -904,9 +904,9 @@ pub mod pallet {
|
||||
pub fn close(
|
||||
origin: OriginFor<T>,
|
||||
proposal_hash: T::Hash,
|
||||
#[pallet::compact] index: ProposalIndex,
|
||||
#[pezpallet::compact] index: ProposalIndex,
|
||||
proposal_weight_bound: Weight,
|
||||
#[pallet::compact] length_bound: u32,
|
||||
#[pezpallet::compact] length_bound: u32,
|
||||
) -> DispatchResultWithPostInfo {
|
||||
let who = ensure_signed(origin)?;
|
||||
ensure!(Self::has_voting_rights(&who), Error::<T, I>::NoVotingRights);
|
||||
@@ -917,7 +917,7 @@ pub mod pallet {
|
||||
/// Abdicate one's position as a voting member and just be an Ally. May be used by Fellows
|
||||
/// who do not want to leave the Alliance but do not have the capacity to participate
|
||||
/// operationally for some time.
|
||||
#[pallet::call_index(17)]
|
||||
#[pezpallet::call_index(17)]
|
||||
pub fn abdicate_fellow_status(origin: OriginFor<T>) -> DispatchResult {
|
||||
let who = ensure_signed(origin)?;
|
||||
let role = Self::member_role_of(&who).ok_or(Error::<T, I>::NotMember)?;
|
||||
@@ -933,7 +933,7 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
|
||||
/// Check if the Alliance has been initialized.
|
||||
fn is_initialized() -> bool {
|
||||
Self::has_member(MemberRole::Fellow) || Self::has_member(MemberRole::Ally)
|
||||
@@ -1133,10 +1133,10 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "try-runtime", test))]
|
||||
impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
/// Ensure the correctness of the state of this pallet.
|
||||
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
|
||||
/// Ensure the correctness of the state of this pezpallet.
|
||||
///
|
||||
/// This should be valid before or after each state transition of this pallet.
|
||||
/// This should be valid before or after each state transition of this pezpallet.
|
||||
pub fn do_try_state() -> Result<(), pezsp_runtime::TryRuntimeError> {
|
||||
Self::try_state_members_are_disjoint()?;
|
||||
Self::try_state_members_are_sorted()?;
|
||||
|
||||
@@ -15,16 +15,16 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use crate::{Config, Pallet, Weight, LOG_TARGET};
|
||||
use crate::{Config, Pezpallet, Weight, LOG_TARGET};
|
||||
use pezframe_support::{pezpallet_prelude::*, storage::migration, traits::OnRuntimeUpgrade};
|
||||
use log;
|
||||
|
||||
/// The in-code storage version.
|
||||
pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(2);
|
||||
|
||||
/// Wrapper for all migrations of this pallet.
|
||||
/// Wrapper for all migrations of this pezpallet.
|
||||
pub fn migrate<T: Config<I>, I: 'static>() -> Weight {
|
||||
let on_chain_version = Pallet::<T, I>::on_chain_storage_version();
|
||||
let on_chain_version = Pezpallet::<T, I>::on_chain_storage_version();
|
||||
let mut weight: Weight = Weight::zero();
|
||||
|
||||
if on_chain_version < 1 {
|
||||
@@ -35,7 +35,7 @@ pub fn migrate<T: Config<I>, I: 'static>() -> Weight {
|
||||
weight = weight.saturating_add(v1_to_v2::migrate::<T, I>());
|
||||
}
|
||||
|
||||
STORAGE_VERSION.put::<Pallet<T, I>>();
|
||||
STORAGE_VERSION.put::<Pezpallet<T, I>>();
|
||||
weight = weight.saturating_add(T::DbWeight::get().writes(1));
|
||||
|
||||
weight
|
||||
@@ -58,7 +58,7 @@ mod v0_to_v1 {
|
||||
log::info!(target: LOG_TARGET, "Running migration v0_to_v1.");
|
||||
|
||||
let res = migration::clear_storage_prefix(
|
||||
<Pallet<T, I>>::name().as_bytes(),
|
||||
<Pezpallet<T, I>>::name().as_bytes(),
|
||||
b"UpForKicking",
|
||||
b"",
|
||||
None,
|
||||
@@ -154,7 +154,7 @@ pub(crate) mod v1_to_v2 {
|
||||
MemberRoleV1,
|
||||
BoundedVec<T::AccountId, T::MaxMembersCount>,
|
||||
Twox64Concat,
|
||||
>(<Pallet<T, I>>::name().as_bytes(), b"Members", role)
|
||||
>(<Pezpallet<T, I>>::name().as_bytes(), b"Members", role)
|
||||
.unwrap_or_default()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Tests for the alliance pallet.
|
||||
//! Tests for the alliance pezpallet.
|
||||
|
||||
use pezframe_support::{assert_noop, assert_ok};
|
||||
use pezframe_system::{EventRecord, Phase};
|
||||
|
||||
@@ -44,10 +44,10 @@
|
||||
// frame-omni-bencher
|
||||
// v1
|
||||
// benchmark
|
||||
// pallet
|
||||
// pezpallet
|
||||
// --extrinsic=*
|
||||
// --runtime=target/production/wbuild/pez-kitchensink-runtime/pez_kitchensink_runtime.wasm
|
||||
// --pallet=pezpallet_alliance
|
||||
// --pezpallet=pezpallet_alliance
|
||||
// --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2
|
||||
// --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/alliance/src/weights.rs
|
||||
// --wasm-execution=compiled
|
||||
|
||||
@@ -6,7 +6,7 @@ edition.workspace = true
|
||||
license = "Apache-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
description = "FRAME asset conversion pallet"
|
||||
description = "FRAME asset conversion pezpallet"
|
||||
readme = "README.md"
|
||||
documentation = "https://docs.rs/pezpallet-asset-conversion"
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# asset-conversion
|
||||
|
||||
## A swap pallet
|
||||
## A swap pezpallet
|
||||
|
||||
This pallet allows assets to be converted from one type to another by means of a constant product formula.
|
||||
The pallet based is based on [Uniswap V2](https://github.com/Uniswap/v2-core) logic.
|
||||
This pezpallet allows assets to be converted from one type to another by means of a constant product formula.
|
||||
The pezpallet based is based on [Uniswap V2](https://github.com/Uniswap/v2-core) logic.
|
||||
|
||||
### Overview
|
||||
|
||||
This pallet allows you to:
|
||||
This pezpallet allows you to:
|
||||
|
||||
- create a liquidity pool for 2 assets
|
||||
- provide the liquidity and receive back an LP token
|
||||
|
||||
@@ -6,7 +6,7 @@ edition.workspace = true
|
||||
license = "Apache-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
description = "FRAME asset conversion pallet's operations suite"
|
||||
description = "FRAME asset conversion pezpallet's operations suite"
|
||||
documentation = "https://docs.rs/pezpallet-asset-conversion-ops"
|
||||
|
||||
[lints]
|
||||
|
||||
@@ -15,17 +15,17 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Asset Conversion Ops pallet benchmarking.
|
||||
//! Asset Conversion Ops pezpallet benchmarking.
|
||||
|
||||
use super::*;
|
||||
use crate::Pallet as AssetConversionOps;
|
||||
use crate::Pezpallet as AssetConversionOps;
|
||||
use pezframe_benchmarking::{v2::*, whitelisted_caller};
|
||||
use pezframe_support::{
|
||||
assert_ok,
|
||||
traits::fungibles::{Create, Inspect, Mutate},
|
||||
};
|
||||
use pezframe_system::RawOrigin as SystemOrigin;
|
||||
use pezpallet_asset_conversion::{BenchmarkHelper, Pallet as AssetConversion};
|
||||
use pezpallet_asset_conversion::{BenchmarkHelper, Pezpallet as AssetConversion};
|
||||
use pezsp_core::Get;
|
||||
use pezsp_runtime::traits::One;
|
||||
|
||||
@@ -122,7 +122,7 @@ where
|
||||
}
|
||||
|
||||
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
|
||||
let events = pezframe_system::Pallet::<T>::events();
|
||||
let events = pezframe_system::Pezpallet::<T>::events();
|
||||
let system_event: <T as pezframe_system::Config>::RuntimeEvent = generic_event.into();
|
||||
// compare to the last event record
|
||||
let pezframe_system::EventRecord { event, .. } = &events[events.len() - 1];
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
|
||||
//! # Asset Conversion Operations Suite.
|
||||
//!
|
||||
//! This pallet provides operational functionalities for the Asset Conversion pallet,
|
||||
//! This pezpallet provides operational functionalities for the Asset Conversion pezpallet,
|
||||
//! allowing you to perform various migration and one-time-use operations. These operations
|
||||
//! are designed to facilitate updates and changes to the Asset Conversion pallet without
|
||||
//! are designed to facilitate updates and changes to the Asset Conversion pezpallet without
|
||||
//! breaking its API.
|
||||
//!
|
||||
//! ## Overview
|
||||
@@ -39,7 +39,7 @@ mod mock;
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
pub mod weights;
|
||||
pub use pallet::*;
|
||||
pub use pezpallet::*;
|
||||
pub use weights::WeightInfo;
|
||||
|
||||
extern crate alloc;
|
||||
@@ -54,16 +54,16 @@ use pezframe_support::traits::{
|
||||
use pezpallet_asset_conversion::{PoolLocator, Pools};
|
||||
use pezsp_runtime::traits::{TryConvert, Zero};
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
#[pezframe_support::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use super::*;
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T>(_);
|
||||
|
||||
#[pallet::config]
|
||||
#[pezpallet::config]
|
||||
pub trait Config:
|
||||
pezpallet_asset_conversion::Config<
|
||||
PoolId = (
|
||||
@@ -109,13 +109,13 @@ pub mod pallet {
|
||||
/// [`pezpallet_asset_conversion::Config::PoolAssets`] registries.
|
||||
type DepositAsset: FungibleMutate<Self::AccountId>;
|
||||
|
||||
/// Weight information for extrinsics in this pallet.
|
||||
/// Weight information for extrinsics in this pezpallet.
|
||||
type WeightInfo: WeightInfo;
|
||||
}
|
||||
|
||||
// Pallet's events.
|
||||
#[pallet::event]
|
||||
#[pallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
// Pezpallet's events.
|
||||
#[pezpallet::event]
|
||||
#[pezpallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
pub enum Event<T: Config> {
|
||||
/// Indicates that a pool has been migrated to the new account ID.
|
||||
MigratedToNewAccount {
|
||||
@@ -128,7 +128,7 @@ pub mod pallet {
|
||||
},
|
||||
}
|
||||
|
||||
#[pallet::error]
|
||||
#[pezpallet::error]
|
||||
pub enum Error<T> {
|
||||
/// Provided asset pair is not supported for pool.
|
||||
InvalidAssetPair,
|
||||
@@ -140,15 +140,15 @@ pub mod pallet {
|
||||
PartialTransfer,
|
||||
}
|
||||
|
||||
/// Pallet's callable functions.
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
/// Pezpallet's callable functions.
|
||||
#[pezpallet::call]
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// Migrates an existing pool to a new account ID derivation method for a given asset pair.
|
||||
/// If the migration is successful, transaction fees are refunded to the caller.
|
||||
///
|
||||
/// Must be signed.
|
||||
#[pallet::call_index(0)]
|
||||
#[pallet::weight(<T as Config>::WeightInfo::migrate_to_new_account())]
|
||||
#[pezpallet::call_index(0)]
|
||||
#[pezpallet::weight(<T as Config>::WeightInfo::migrate_to_new_account())]
|
||||
pub fn migrate_to_new_account(
|
||||
origin: OriginFor<T>,
|
||||
asset1: Box<T::AssetKind>,
|
||||
@@ -301,7 +301,7 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> Pallet<T> {
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// Returns the prior and new account IDs for a given pool ID. The prior account ID comes
|
||||
/// first in the tuple.
|
||||
#[cfg(not(any(test, feature = "runtime-benchmarks")))]
|
||||
@@ -320,7 +320,7 @@ pub mod pallet {
|
||||
///
|
||||
/// This function is intended for use only in test and benchmark environments. The prior
|
||||
/// account ID represents the new account ID from [`Config::PoolLocator`], allowing the use
|
||||
/// of the main pallet's calls to set up a pool with liquidity placed in that account and
|
||||
/// of the main pezpallet's calls to set up a pool with liquidity placed in that account and
|
||||
/// migrate it to another account, which in this case is the result of
|
||||
/// [`Config::PriorAccountIdConverter`].
|
||||
#[cfg(any(test, feature = "runtime-benchmarks"))]
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Test environment for Asset Conversion Ops pallet.
|
||||
//! Test environment for Asset Conversion Ops pezpallet.
|
||||
|
||||
use crate as pezpallet_asset_conversion_ops;
|
||||
use core::default::Default;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Asset Conversion Ops pallet tests.
|
||||
//! Asset Conversion Ops pezpallet tests.
|
||||
|
||||
use crate::{mock::*, *};
|
||||
use pezframe_support::{
|
||||
|
||||
@@ -44,10 +44,10 @@
|
||||
// frame-omni-bencher
|
||||
// v1
|
||||
// benchmark
|
||||
// pallet
|
||||
// pezpallet
|
||||
// --extrinsic=*
|
||||
// --runtime=target/production/wbuild/pez-kitchensink-runtime/pez_kitchensink_runtime.wasm
|
||||
// --pallet=pezpallet_asset_conversion_ops
|
||||
// --pezpallet=pezpallet_asset_conversion_ops
|
||||
// --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2
|
||||
// --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/asset-conversion/ops/src/weights.rs
|
||||
// --wasm-execution=compiled
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Asset Conversion pallet benchmarking.
|
||||
//! Asset Conversion pezpallet benchmarking.
|
||||
|
||||
use super::*;
|
||||
use crate::Pallet as AssetConversion;
|
||||
use crate::Pezpallet as AssetConversion;
|
||||
use alloc::vec;
|
||||
use core::marker::PhantomData;
|
||||
use pezframe_benchmarking::{v2::*, whitelisted_caller};
|
||||
@@ -167,7 +167,7 @@ where
|
||||
}
|
||||
|
||||
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
|
||||
let events = pezframe_system::Pallet::<T>::events();
|
||||
let events = pezframe_system::Pezpallet::<T>::events();
|
||||
let system_event: <T as pezframe_system::Config>::RuntimeEvent = generic_event.into();
|
||||
// compare to the last event record
|
||||
let pezframe_system::EventRecord { event, .. } = &events[events.len() - 1];
|
||||
|
||||
@@ -15,21 +15,21 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! # Bizinikiwi Asset Conversion pallet
|
||||
//! # Bizinikiwi Asset Conversion pezpallet
|
||||
//!
|
||||
//! Bizinikiwi Asset Conversion pallet based on the [Uniswap V2](https://github.com/Uniswap/v2-core) logic.
|
||||
//! Bizinikiwi Asset Conversion pezpallet based on the [Uniswap V2](https://github.com/Uniswap/v2-core) logic.
|
||||
//!
|
||||
//! ## Overview
|
||||
//!
|
||||
//! This pallet allows you to:
|
||||
//! This pezpallet allows you to:
|
||||
//!
|
||||
//! - [create a liquidity pool](`Pallet::create_pool()`) for 2 assets
|
||||
//! - [provide the liquidity](`Pallet::add_liquidity()`) and receive back an LP token
|
||||
//! - [exchange the LP token back to assets](`Pallet::remove_liquidity()`)
|
||||
//! - [swap a specific amount of assets for another](`Pallet::swap_exact_tokens_for_tokens()`) if
|
||||
//! - [create a liquidity pool](`Pezpallet::create_pool()`) for 2 assets
|
||||
//! - [provide the liquidity](`Pezpallet::add_liquidity()`) and receive back an LP token
|
||||
//! - [exchange the LP token back to assets](`Pezpallet::remove_liquidity()`)
|
||||
//! - [swap a specific amount of assets for another](`Pezpallet::swap_exact_tokens_for_tokens()`) if
|
||||
//! there is a pool created, or
|
||||
//! - [swap some assets for a specific amount of
|
||||
//! another](`Pallet::swap_tokens_for_exact_tokens()`).
|
||||
//! another](`Pezpallet::swap_tokens_for_exact_tokens()`).
|
||||
//! - [query for an exchange price](`AssetConversionApi::quote_price_exact_tokens_for_tokens`) via
|
||||
//! a runtime call endpoint
|
||||
//! - [query the size of a liquidity pool](`AssetConversionApi::get_reserves`) via a runtime api
|
||||
@@ -40,7 +40,7 @@
|
||||
//! non-native asset 1, you would pass in a path of `[HEZ, 1]` or `[1, HEZ]`. If you want to swap
|
||||
//! from non-native asset 1 to non-native asset 2, you would pass in a path of `[1, HEZ, 2]`.
|
||||
//!
|
||||
//! (For an example of configuring this pallet to use `Location` as an asset id, see the
|
||||
//! (For an example of configuring this pezpallet to use `Location` as an asset id, see the
|
||||
//! pezcumulus repo).
|
||||
//!
|
||||
//! Here is an example `state_call` that asks for a quote of a pool of native versus asset 1:
|
||||
@@ -67,7 +67,7 @@ pub mod weights;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
pub use benchmarking::{BenchmarkHelper, NativeOrWithIdFactory};
|
||||
pub use liquidity::*;
|
||||
pub use pallet::*;
|
||||
pub use pezpallet::*;
|
||||
pub use swap::*;
|
||||
pub use types::*;
|
||||
pub use weights::WeightInfo;
|
||||
@@ -98,17 +98,17 @@ use pezsp_runtime::{
|
||||
DispatchError, Saturating, TokenError, TransactionOutcome,
|
||||
};
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
#[pezframe_support::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use super::*;
|
||||
use pezframe_support::{pezpallet_prelude::*, traits::fungibles::Refund};
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
use pezsp_arithmetic::{traits::Unsigned, Permill};
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T>(_);
|
||||
|
||||
#[pallet::config]
|
||||
#[pezpallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
/// Overarching event type.
|
||||
#[allow(deprecated)]
|
||||
@@ -149,7 +149,7 @@ pub mod pallet {
|
||||
/// Asset class for the lp tokens from [`Self::PoolAssets`].
|
||||
type PoolAssetId: AssetId + PartialOrd + Incrementable + From<u32>;
|
||||
|
||||
/// Registry for the lp tokens. Ideally only this pallet should have create permissions on
|
||||
/// Registry for the lp tokens. Ideally only this pezpallet should have create permissions on
|
||||
/// the assets.
|
||||
type PoolAssets: Inspect<Self::AccountId, AssetId = Self::PoolAssetId, Balance = Self::Balance>
|
||||
+ Create<Self::AccountId>
|
||||
@@ -158,37 +158,37 @@ pub mod pallet {
|
||||
+ Refund<Self::AccountId, AssetId = Self::PoolAssetId>;
|
||||
|
||||
/// A % the liquidity providers will take of every swap. Represents 10ths of a percent.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type LPFee: Get<u32>;
|
||||
|
||||
/// A one-time fee to setup the pool.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type PoolSetupFee: Get<Self::Balance>;
|
||||
|
||||
/// Asset class from [`Config::Assets`] used to pay the [`Config::PoolSetupFee`].
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type PoolSetupFeeAsset: Get<Self::AssetKind>;
|
||||
|
||||
/// Handler for the [`Config::PoolSetupFee`].
|
||||
type PoolSetupFeeTarget: OnUnbalanced<CreditOf<Self>>;
|
||||
|
||||
/// A fee to withdraw the liquidity.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type LiquidityWithdrawalFee: Get<Permill>;
|
||||
|
||||
/// The minimum LP token amount that could be minted. Ameliorates rounding errors.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type MintMinLiquidity: Get<Self::Balance>;
|
||||
|
||||
/// The max number of hops in a swap.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type MaxSwapPathLength: Get<u32>;
|
||||
|
||||
/// The pallet's id, used for deriving its sovereign account ID.
|
||||
#[pallet::constant]
|
||||
/// The pezpallet's id, used for deriving its sovereign account ID.
|
||||
#[pezpallet::constant]
|
||||
type PalletId: Get<PalletId>;
|
||||
|
||||
/// Weight information for extrinsics in this pallet.
|
||||
/// Weight information for extrinsics in this pezpallet.
|
||||
type WeightInfo: WeightInfo;
|
||||
|
||||
/// The benchmarks need a way to create asset ids from u32s.
|
||||
@@ -198,18 +198,18 @@ pub mod pallet {
|
||||
|
||||
/// Map from `PoolAssetId` to `PoolInfo`. This establishes whether a pool has been officially
|
||||
/// created rather than people sending tokens directly to a pool's public account.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type Pools<T: Config> =
|
||||
StorageMap<_, Blake2_128Concat, T::PoolId, PoolInfo<T::PoolAssetId>, OptionQuery>;
|
||||
|
||||
/// Stores the `PoolAssetId` that is going to be used for the next lp token.
|
||||
/// This gets incremented whenever a new lp pool is created.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type NextPoolAssetId<T: Config> = StorageValue<_, T::PoolAssetId, OptionQuery>;
|
||||
|
||||
// Pallet's events.
|
||||
#[pallet::event]
|
||||
#[pallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
// Pezpallet's events.
|
||||
#[pezpallet::event]
|
||||
#[pezpallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
pub enum Event<T: Config> {
|
||||
/// A successful call of the `CreatePool` extrinsic will create this event.
|
||||
PoolCreated {
|
||||
@@ -296,7 +296,7 @@ pub mod pallet {
|
||||
},
|
||||
}
|
||||
|
||||
#[pallet::error]
|
||||
#[pezpallet::error]
|
||||
pub enum Error<T> {
|
||||
/// Provided asset pair is not supported for pool.
|
||||
InvalidAssetPair,
|
||||
@@ -349,8 +349,8 @@ pub mod pallet {
|
||||
BelowMinimum,
|
||||
}
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
|
||||
#[pezpallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {
|
||||
fn integrity_test() {
|
||||
assert!(
|
||||
T::MaxSwapPathLength::get() > 1,
|
||||
@@ -359,15 +359,15 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
/// Pallet's callable functions.
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
/// Pezpallet's callable functions.
|
||||
#[pezpallet::call]
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// Creates an empty liquidity pool and an associated new `lp_token` asset
|
||||
/// (the id of which is returned in the `Event::PoolCreated` event).
|
||||
///
|
||||
/// Once a pool is created, someone may [`Pallet::add_liquidity`] to it.
|
||||
#[pallet::call_index(0)]
|
||||
#[pallet::weight(T::WeightInfo::create_pool())]
|
||||
/// Once a pool is created, someone may [`Pezpallet::add_liquidity`] to it.
|
||||
#[pezpallet::call_index(0)]
|
||||
#[pezpallet::weight(T::WeightInfo::create_pool())]
|
||||
pub fn create_pool(
|
||||
origin: OriginFor<T>,
|
||||
asset1: Box<T::AssetKind>,
|
||||
@@ -386,14 +386,14 @@ pub mod pallet {
|
||||
/// `mint_to` will be sent the liquidity tokens that represent this share of the pool.
|
||||
///
|
||||
/// NOTE: when encountering an incorrect exchange rate and non-withdrawable pool liquidity,
|
||||
/// batch an atomic call with [`Pallet::add_liquidity`] and
|
||||
/// [`Pallet::swap_exact_tokens_for_tokens`] or [`Pallet::swap_tokens_for_exact_tokens`]
|
||||
/// batch an atomic call with [`Pezpallet::add_liquidity`] and
|
||||
/// [`Pezpallet::swap_exact_tokens_for_tokens`] or [`Pezpallet::swap_tokens_for_exact_tokens`]
|
||||
/// calls to render the liquidity withdrawable and rectify the exchange rate.
|
||||
///
|
||||
/// Once liquidity is added, someone may successfully call
|
||||
/// [`Pallet::swap_exact_tokens_for_tokens`].
|
||||
#[pallet::call_index(1)]
|
||||
#[pallet::weight(T::WeightInfo::add_liquidity())]
|
||||
/// [`Pezpallet::swap_exact_tokens_for_tokens`].
|
||||
#[pezpallet::call_index(1)]
|
||||
#[pezpallet::weight(T::WeightInfo::add_liquidity())]
|
||||
pub fn add_liquidity(
|
||||
origin: OriginFor<T>,
|
||||
asset1: Box<T::AssetKind>,
|
||||
@@ -421,8 +421,8 @@ pub mod pallet {
|
||||
/// Allows you to remove liquidity by providing the `lp_token_burn` tokens that will be
|
||||
/// burned in the process. With the usage of `amount1_min_receive`/`amount2_min_receive`
|
||||
/// it's possible to control the min amount of returned tokens you're happy with.
|
||||
#[pallet::call_index(2)]
|
||||
#[pallet::weight(T::WeightInfo::remove_liquidity())]
|
||||
#[pezpallet::call_index(2)]
|
||||
#[pezpallet::weight(T::WeightInfo::remove_liquidity())]
|
||||
pub fn remove_liquidity(
|
||||
origin: OriginFor<T>,
|
||||
asset1: Box<T::AssetKind>,
|
||||
@@ -451,8 +451,8 @@ pub mod pallet {
|
||||
///
|
||||
/// [`AssetConversionApi::quote_price_exact_tokens_for_tokens`] runtime call can be called
|
||||
/// for a quote.
|
||||
#[pallet::call_index(3)]
|
||||
#[pallet::weight(T::WeightInfo::swap_exact_tokens_for_tokens(path.len() as u32))]
|
||||
#[pezpallet::call_index(3)]
|
||||
#[pezpallet::weight(T::WeightInfo::swap_exact_tokens_for_tokens(path.len() as u32))]
|
||||
pub fn swap_exact_tokens_for_tokens(
|
||||
origin: OriginFor<T>,
|
||||
path: Vec<Box<T::AssetKind>>,
|
||||
@@ -479,8 +479,8 @@ pub mod pallet {
|
||||
///
|
||||
/// [`AssetConversionApi::quote_price_tokens_for_exact_tokens`] runtime call can be called
|
||||
/// for a quote.
|
||||
#[pallet::call_index(4)]
|
||||
#[pallet::weight(T::WeightInfo::swap_tokens_for_exact_tokens(path.len() as u32))]
|
||||
#[pezpallet::call_index(4)]
|
||||
#[pezpallet::weight(T::WeightInfo::swap_tokens_for_exact_tokens(path.len() as u32))]
|
||||
pub fn swap_tokens_for_exact_tokens(
|
||||
origin: OriginFor<T>,
|
||||
path: Vec<Box<T::AssetKind>>,
|
||||
@@ -512,8 +512,8 @@ pub mod pallet {
|
||||
/// - `asset2`: The asset ID of an existing pool with a pair (asset1, asset2).
|
||||
///
|
||||
/// Emits `Touched` event when successful.
|
||||
#[pallet::call_index(5)]
|
||||
#[pallet::weight(T::WeightInfo::touch(3))]
|
||||
#[pezpallet::call_index(5)]
|
||||
#[pezpallet::weight(T::WeightInfo::touch(3))]
|
||||
pub fn touch(
|
||||
origin: OriginFor<T>,
|
||||
asset1: Box<T::AssetKind>,
|
||||
@@ -545,7 +545,7 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> Pallet<T> {
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// Create a new liquidity pool.
|
||||
///
|
||||
/// **Warning**: The storage must be rolled back on error.
|
||||
@@ -1281,8 +1281,8 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
#[pallet::view_functions]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pezpallet::view_functions]
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// Returns the balance of each asset in the pool.
|
||||
/// The tuple result is in the order requested (not necessarily the same as pool order).
|
||||
pub fn get_reserves(
|
||||
@@ -1368,7 +1368,7 @@ pezsp_api::decl_runtime_apis! {
|
||||
Balance: pezframe_support::traits::tokens::Balance + MaybeDisplay,
|
||||
AssetId: Codec,
|
||||
{
|
||||
/// Provides a quote for [`Pallet::swap_tokens_for_exact_tokens`].
|
||||
/// Provides a quote for [`Pezpallet::swap_tokens_for_exact_tokens`].
|
||||
///
|
||||
/// Note that the price may have changed by the time the transaction is executed.
|
||||
/// (Use `amount_in_max` to control slippage.)
|
||||
@@ -1379,7 +1379,7 @@ pezsp_api::decl_runtime_apis! {
|
||||
include_fee: bool,
|
||||
) -> Option<Balance>;
|
||||
|
||||
/// Provides a quote for [`Pallet::swap_exact_tokens_for_tokens`].
|
||||
/// Provides a quote for [`Pezpallet::swap_exact_tokens_for_tokens`].
|
||||
///
|
||||
/// Note that the price may have changed by the time the transaction is executed.
|
||||
/// (Use `amount_out_min` to control slippage.)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
use pezframe_support::{traits::tokens::Balance, transactional};
|
||||
use pezsp_runtime::DispatchError;
|
||||
|
||||
use crate::{Config, Pallet};
|
||||
use crate::{Config, Pezpallet};
|
||||
|
||||
/// A struct to represent an asset and its desired and minimum amounts for adding liquidity.
|
||||
pub struct AddLiquidityAsset<AssetKind, Balance> {
|
||||
@@ -82,7 +82,7 @@ pub trait MutateLiquidity<AccountId> {
|
||||
) -> Result<(Self::Balance, Self::Balance), DispatchError>;
|
||||
}
|
||||
|
||||
impl<T: Config> MutateLiquidity<T::AccountId> for Pallet<T> {
|
||||
impl<T: Config> MutateLiquidity<T::AccountId> for Pezpallet<T> {
|
||||
type Balance = T::Balance;
|
||||
type AssetKind = T::AssetKind;
|
||||
type PoolId = T::PoolId;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Test environment for Asset Conversion pallet.
|
||||
//! Test environment for Asset Conversion pezpallet.
|
||||
|
||||
use super::*;
|
||||
use crate as pezpallet_asset_conversion;
|
||||
|
||||
@@ -144,7 +144,7 @@ pub trait QuotePrice {
|
||||
) -> Option<Self::Balance>;
|
||||
}
|
||||
|
||||
impl<T: Config> Swap<T::AccountId> for Pallet<T> {
|
||||
impl<T: Config> Swap<T::AccountId> for Pezpallet<T> {
|
||||
type Balance = T::Balance;
|
||||
type AssetKind = T::AssetKind;
|
||||
|
||||
@@ -191,7 +191,7 @@ impl<T: Config> Swap<T::AccountId> for Pallet<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> SwapCredit<T::AccountId> for Pallet<T> {
|
||||
impl<T: Config> SwapCredit<T::AccountId> for Pezpallet<T> {
|
||||
type Balance = T::Balance;
|
||||
type AssetKind = T::AssetKind;
|
||||
type Credit = CreditOf<T>;
|
||||
@@ -239,7 +239,7 @@ impl<T: Config> SwapCredit<T::AccountId> for Pallet<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> QuotePrice for Pallet<T> {
|
||||
impl<T: Config> QuotePrice for Pezpallet<T> {
|
||||
type Balance = T::Balance;
|
||||
type AssetKind = T::AssetKind;
|
||||
fn quote_price_exact_tokens_for_tokens(
|
||||
|
||||
@@ -44,10 +44,10 @@
|
||||
// frame-omni-bencher
|
||||
// v1
|
||||
// benchmark
|
||||
// pallet
|
||||
// pezpallet
|
||||
// --extrinsic=*
|
||||
// --runtime=target/production/wbuild/pez-kitchensink-runtime/pez_kitchensink_runtime.wasm
|
||||
// --pallet=pezpallet_asset_conversion
|
||||
// --pezpallet=pezpallet_asset_conversion
|
||||
// --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2
|
||||
// --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/asset-conversion/src/weights.rs
|
||||
// --wasm-execution=compiled
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
//! The crate's benchmarks.
|
||||
|
||||
use super::*;
|
||||
use crate::{pallet as pezpallet_asset_rate, Pallet as AssetRate};
|
||||
use crate::{pezpallet as pezpallet_asset_rate, Pezpallet as AssetRate};
|
||||
|
||||
use codec::Encode;
|
||||
use pezframe_benchmarking::v2::*;
|
||||
|
||||
@@ -15,14 +15,14 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! # Asset Rate Pallet
|
||||
//! # Asset Rate Pezpallet
|
||||
//!
|
||||
//! - [`Config`]
|
||||
//! - [`Call`]
|
||||
//!
|
||||
//! ## Overview
|
||||
//!
|
||||
//! The AssetRate pallet provides means of setting conversion rates for some asset to native
|
||||
//! The AssetRate pezpallet provides means of setting conversion rates for some asset to native
|
||||
//! balance.
|
||||
//!
|
||||
//! The supported dispatchable functions are documented in the [`Call`] enum.
|
||||
@@ -71,7 +71,7 @@ use pezsp_runtime::{
|
||||
FixedPointNumber, FixedU128,
|
||||
};
|
||||
|
||||
pub use pallet::*;
|
||||
pub use pezpallet::*;
|
||||
pub use weights::WeightInfo;
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
@@ -86,23 +86,23 @@ pub use benchmarking::AssetKindFactory;
|
||||
|
||||
// Type alias for `pezframe_system`'s account id.
|
||||
type AccountIdOf<T> = <T as pezframe_system::Config>::AccountId;
|
||||
// This pallet's asset kind and balance type.
|
||||
// This pezpallet's asset kind and balance type.
|
||||
type AssetKindOf<T> = <T as Config>::AssetKind;
|
||||
// Generic fungible balance type.
|
||||
type BalanceOf<T> = <<T as Config>::Currency as Inspect<AccountIdOf<T>>>::Balance;
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
#[pezframe_support::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use super::*;
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T>(_);
|
||||
|
||||
#[pallet::config]
|
||||
#[pezpallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
/// The Weight information for extrinsics in this pallet.
|
||||
/// The Weight information for extrinsics in this pezpallet.
|
||||
type WeightInfo: WeightInfo;
|
||||
|
||||
/// The runtime event type.
|
||||
@@ -118,7 +118,7 @@ pub mod pallet {
|
||||
/// The origin permissioned to update an existing conversion rate for an asset.
|
||||
type UpdateOrigin: EnsureOrigin<Self::RuntimeOrigin>;
|
||||
|
||||
/// The currency mechanism for this pallet.
|
||||
/// The currency mechanism for this pezpallet.
|
||||
type Currency: Inspect<Self::AccountId>;
|
||||
|
||||
/// The type for asset kinds for which the conversion rate to native balance is set.
|
||||
@@ -132,12 +132,12 @@ pub mod pallet {
|
||||
/// Maps an asset to its fixed point representation in the native balance.
|
||||
///
|
||||
/// E.g. `native_amount = asset_amount * ConversionRateToNative::<T>::get(asset_kind)`
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type ConversionRateToNative<T: Config> =
|
||||
StorageMap<_, Blake2_128Concat, T::AssetKind, FixedU128, OptionQuery>;
|
||||
|
||||
#[pallet::event]
|
||||
#[pallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
#[pezpallet::event]
|
||||
#[pezpallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
pub enum Event<T: Config> {
|
||||
// Some `asset_kind` conversion rate was created.
|
||||
AssetRateCreated { asset_kind: T::AssetKind, rate: FixedU128 },
|
||||
@@ -147,7 +147,7 @@ pub mod pallet {
|
||||
AssetRateUpdated { asset_kind: T::AssetKind, old: FixedU128, new: FixedU128 },
|
||||
}
|
||||
|
||||
#[pallet::error]
|
||||
#[pezpallet::error]
|
||||
pub enum Error<T> {
|
||||
/// The given asset ID is unknown.
|
||||
UnknownAssetKind,
|
||||
@@ -157,14 +157,14 @@ pub mod pallet {
|
||||
Overflow,
|
||||
}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pezpallet::call]
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// Initialize a conversion rate to native balance for the given asset.
|
||||
///
|
||||
/// ## Complexity
|
||||
/// - O(1)
|
||||
#[pallet::call_index(0)]
|
||||
#[pallet::weight(T::WeightInfo::create())]
|
||||
#[pezpallet::call_index(0)]
|
||||
#[pezpallet::weight(T::WeightInfo::create())]
|
||||
pub fn create(
|
||||
origin: OriginFor<T>,
|
||||
asset_kind: Box<T::AssetKind>,
|
||||
@@ -186,8 +186,8 @@ pub mod pallet {
|
||||
///
|
||||
/// ## Complexity
|
||||
/// - O(1)
|
||||
#[pallet::call_index(1)]
|
||||
#[pallet::weight(T::WeightInfo::update())]
|
||||
#[pezpallet::call_index(1)]
|
||||
#[pezpallet::weight(T::WeightInfo::update())]
|
||||
pub fn update(
|
||||
origin: OriginFor<T>,
|
||||
asset_kind: Box<T::AssetKind>,
|
||||
@@ -219,8 +219,8 @@ pub mod pallet {
|
||||
///
|
||||
/// ## Complexity
|
||||
/// - O(1)
|
||||
#[pallet::call_index(2)]
|
||||
#[pallet::weight(T::WeightInfo::remove())]
|
||||
#[pezpallet::call_index(2)]
|
||||
#[pezpallet::weight(T::WeightInfo::remove())]
|
||||
pub fn remove(origin: OriginFor<T>, asset_kind: Box<T::AssetKind>) -> DispatchResult {
|
||||
T::RemoveOrigin::ensure_origin(origin)?;
|
||||
|
||||
@@ -237,45 +237,45 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
/// Exposes conversion of an arbitrary balance of an asset to native balance.
|
||||
impl<T> ConversionFromAssetBalance<BalanceOf<T>, AssetKindOf<T>, BalanceOf<T>> for Pallet<T>
|
||||
impl<T> ConversionFromAssetBalance<BalanceOf<T>, AssetKindOf<T>, BalanceOf<T>> for Pezpallet<T>
|
||||
where
|
||||
T: Config,
|
||||
{
|
||||
type Error = pallet::Error<T>;
|
||||
type Error = pezpallet::Error<T>;
|
||||
|
||||
fn from_asset_balance(
|
||||
balance: BalanceOf<T>,
|
||||
asset_kind: AssetKindOf<T>,
|
||||
) -> Result<BalanceOf<T>, pallet::Error<T>> {
|
||||
let rate = pallet::ConversionRateToNative::<T>::get(asset_kind)
|
||||
.ok_or(pallet::Error::<T>::UnknownAssetKind.into())?;
|
||||
) -> Result<BalanceOf<T>, pezpallet::Error<T>> {
|
||||
let rate = pezpallet::ConversionRateToNative::<T>::get(asset_kind)
|
||||
.ok_or(pezpallet::Error::<T>::UnknownAssetKind.into())?;
|
||||
Ok(rate.saturating_mul_int(balance))
|
||||
}
|
||||
/// Set a conversion rate to `1` for the `asset_id`.
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
fn ensure_successful(asset_id: AssetKindOf<T>) {
|
||||
pallet::ConversionRateToNative::<T>::set(asset_id.clone(), Some(1.into()));
|
||||
pezpallet::ConversionRateToNative::<T>::set(asset_id.clone(), Some(1.into()));
|
||||
}
|
||||
}
|
||||
|
||||
/// Exposes conversion of a native balance to an asset balance.
|
||||
impl<T> ConversionToAssetBalance<BalanceOf<T>, AssetKindOf<T>, BalanceOf<T>> for Pallet<T>
|
||||
impl<T> ConversionToAssetBalance<BalanceOf<T>, AssetKindOf<T>, BalanceOf<T>> for Pezpallet<T>
|
||||
where
|
||||
T: Config,
|
||||
{
|
||||
type Error = pallet::Error<T>;
|
||||
type Error = pezpallet::Error<T>;
|
||||
|
||||
fn to_asset_balance(
|
||||
balance: BalanceOf<T>,
|
||||
asset_kind: AssetKindOf<T>,
|
||||
) -> Result<BalanceOf<T>, pallet::Error<T>> {
|
||||
let rate = pallet::ConversionRateToNative::<T>::get(asset_kind)
|
||||
.ok_or(pallet::Error::<T>::UnknownAssetKind.into())?;
|
||||
) -> Result<BalanceOf<T>, pezpallet::Error<T>> {
|
||||
let rate = pezpallet::ConversionRateToNative::<T>::get(asset_kind)
|
||||
.ok_or(pezpallet::Error::<T>::UnknownAssetKind.into())?;
|
||||
|
||||
// We cannot use `saturating_div` here so we use `checked_div`.
|
||||
Ok(FixedU128::from_u32(1)
|
||||
.checked_div(&rate)
|
||||
.ok_or(pallet::Error::<T>::Overflow.into())?
|
||||
.ok_or(pezpallet::Error::<T>::Overflow.into())?
|
||||
.saturating_mul_int(balance))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
//! The crate's tests.
|
||||
|
||||
use super::*;
|
||||
use crate::pallet as pezpallet_asset_rate;
|
||||
use crate::pezpallet as pezpallet_asset_rate;
|
||||
use pezframe_support::{assert_noop, assert_ok};
|
||||
use mock::{new_test_ext, AssetRate, RuntimeOrigin, Test};
|
||||
use pezsp_runtime::FixedU128;
|
||||
|
||||
@@ -44,10 +44,10 @@
|
||||
// frame-omni-bencher
|
||||
// v1
|
||||
// benchmark
|
||||
// pallet
|
||||
// pezpallet
|
||||
// --extrinsic=*
|
||||
// --runtime=target/production/wbuild/pez-kitchensink-runtime/pez_kitchensink_runtime.wasm
|
||||
// --pallet=pezpallet_asset_rate
|
||||
// --pezpallet=pezpallet_asset_rate
|
||||
// --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2
|
||||
// --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/asset-rate/src/weights.rs
|
||||
// --wasm-execution=compiled
|
||||
|
||||
@@ -6,7 +6,7 @@ edition.workspace = true
|
||||
license = "Apache-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
description = "FRAME asset rewards pallet"
|
||||
description = "FRAME asset rewards pezpallet"
|
||||
documentation = "https://docs.rs/pezpallet-asset-rewards"
|
||||
|
||||
[lints]
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Asset Rewards pallet benchmarking.
|
||||
//! Asset Rewards pezpallet benchmarking.
|
||||
|
||||
use super::*;
|
||||
use crate::Pallet as AssetRewards;
|
||||
use crate::Pezpallet as AssetRewards;
|
||||
use pezframe_benchmarking::{v2::*, whitelisted_caller, BenchmarkError};
|
||||
use pezframe_support::{
|
||||
assert_ok,
|
||||
@@ -27,7 +27,7 @@ use pezframe_support::{
|
||||
Consideration, EnsureOrigin, Footprint,
|
||||
},
|
||||
};
|
||||
use pezframe_system::{Pallet as System, RawOrigin};
|
||||
use pezframe_system::{Pezpallet as System, RawOrigin};
|
||||
use pezsp_runtime::{traits::One, Saturating};
|
||||
use pezsp_std::prelude::*;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! # FRAME Staking Rewards Pallet
|
||||
//! # FRAME Staking Rewards Pezpallet
|
||||
//!
|
||||
//! Allows accounts to be rewarded for holding `fungible` asset/s, for example LP tokens.
|
||||
//!
|
||||
@@ -41,14 +41,14 @@
|
||||
//!
|
||||
//! ## Disambiguation
|
||||
//!
|
||||
//! While this pallet shares some terminology with the `staking-pool` and similar native staking
|
||||
//! While this pezpallet shares some terminology with the `staking-pool` and similar native staking
|
||||
//! related pallets, it is distinct and is entirely unrelated to native staking.
|
||||
//!
|
||||
//! ## Permissioning
|
||||
//!
|
||||
//! Currently, pool creation and management restricted to a configured Origin.
|
||||
//!
|
||||
//! Future iterations of this pallet may allow permissionless creation and management of pools.
|
||||
//! Future iterations of this pezpallet may allow permissionless creation and management of pools.
|
||||
//!
|
||||
//! Note: The permissioned origin must return an AccountId. This can be achieved for any Origin by
|
||||
//! wrapping it with `EnsureSuccess`.
|
||||
@@ -59,8 +59,8 @@
|
||||
//! without side-effects.
|
||||
//!
|
||||
//! Storage interaction such as reads and writes are instead all performed in the top level
|
||||
//! pallet Call method, which while slightly more verbose, makes it easier to understand the
|
||||
//! code and reason about how storage reads and writes occur in the pallet.
|
||||
//! pezpallet Call method, which while slightly more verbose, makes it easier to understand the
|
||||
//! code and reason about how storage reads and writes occur in the pezpallet.
|
||||
//!
|
||||
//! ## Rewards Algorithm
|
||||
//!
|
||||
@@ -80,7 +80,7 @@
|
||||
#![deny(missing_docs)]
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
pub use pallet::*;
|
||||
pub use pezpallet::*;
|
||||
|
||||
use codec::{Codec, Decode, Encode, MaxEncodedLen};
|
||||
use pezframe_support::{
|
||||
@@ -125,10 +125,10 @@ pub type PoolInfoFor<T> = PoolInfo<
|
||||
BlockNumberFor<T>,
|
||||
>;
|
||||
|
||||
/// The block number type for the pallet.
|
||||
/// The block number type for the pezpallet.
|
||||
///
|
||||
/// This type is derived from the `BlockNumberProvider` associated type in the `Config` trait.
|
||||
/// It represents the block number type that the pallet uses for scheduling and expiration.
|
||||
/// It represents the block number type that the pezpallet uses for scheduling and expiration.
|
||||
pub type BlockNumberFor<T> =
|
||||
<<T as Config>::BlockNumberProvider as BlockNumberProvider>::BlockNumber;
|
||||
|
||||
@@ -167,7 +167,7 @@ pub struct PoolInfo<AccountId, AssetId, Balance, BlockNumber> {
|
||||
}
|
||||
|
||||
pezsp_api::decl_runtime_apis! {
|
||||
/// The runtime API for the asset rewards pallet.
|
||||
/// The runtime API for the asset rewards pezpallet.
|
||||
pub trait AssetRewards<Cost: MaybeDisplay + Codec> {
|
||||
/// Get the cost of creating a pool.
|
||||
///
|
||||
@@ -176,8 +176,8 @@ pezsp_api::decl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
#[pezframe_support::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use super::*;
|
||||
use pezframe_support::{
|
||||
pezpallet_prelude::*,
|
||||
@@ -198,35 +198,35 @@ pub mod pallet {
|
||||
DispatchResult,
|
||||
};
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T>(_);
|
||||
|
||||
/// A reason for the pallet placing a hold on funds.
|
||||
#[pallet::composite_enum]
|
||||
/// A reason for the pezpallet placing a hold on funds.
|
||||
#[pezpallet::composite_enum]
|
||||
pub enum FreezeReason {
|
||||
/// Funds are staked in the pallet.
|
||||
/// Funds are staked in the pezpallet.
|
||||
#[codec(index = 0)]
|
||||
Staked,
|
||||
}
|
||||
|
||||
/// A reason for the pallet placing a hold on funds.
|
||||
#[pallet::composite_enum]
|
||||
/// A reason for the pezpallet placing a hold on funds.
|
||||
#[pezpallet::composite_enum]
|
||||
pub enum HoldReason {
|
||||
/// Cost associated with storing pool information on-chain.
|
||||
#[codec(index = 0)]
|
||||
PoolCreation,
|
||||
}
|
||||
|
||||
#[pallet::config]
|
||||
#[pezpallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
/// Overarching event type.
|
||||
#[allow(deprecated)]
|
||||
type RuntimeEvent: From<Event<Self>> + IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
|
||||
|
||||
/// The pallet's unique identifier, used to derive the pool's account ID.
|
||||
/// The pezpallet's unique identifier, used to derive the pool's account ID.
|
||||
///
|
||||
/// The account ID is derived once during pool creation and stored in the storage.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type PalletId: Get<PalletId>;
|
||||
|
||||
/// Identifier for each type of asset.
|
||||
@@ -263,17 +263,17 @@ pub mod pallet {
|
||||
/// information itself, excluding any potential storage footprint related to the stakers.
|
||||
type Consideration: Consideration<Self::AccountId, Footprint>;
|
||||
|
||||
/// Weight information for extrinsics in this pallet.
|
||||
/// Weight information for extrinsics in this pezpallet.
|
||||
type WeightInfo: WeightInfo;
|
||||
|
||||
/// Provider for the current block number.
|
||||
///
|
||||
/// This provider is used to determine the current block number for the pallet.
|
||||
/// This provider is used to determine the current block number for the pezpallet.
|
||||
/// It must return monotonically increasing values when called from consecutive blocks.
|
||||
///
|
||||
/// It can be configured to use the local block number (via `pezframe_system::Pallet`) or a
|
||||
/// It can be configured to use the local block number (via `pezframe_system::Pezpallet`) or a
|
||||
/// remote block number (e.g., from a relay chain). However, note that using a remote
|
||||
/// block number might have implications for the behavior of the pallet, especially if the
|
||||
/// block number might have implications for the behavior of the pezpallet, especially if the
|
||||
/// remote block number advances faster than the local block number.
|
||||
///
|
||||
/// It is recommended to use the local block number for solo chains and relay chains.
|
||||
@@ -285,7 +285,7 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
/// State of pool stakers.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type PoolStakers<T: Config> = StorageDoubleMap<
|
||||
_,
|
||||
Blake2_128Concat,
|
||||
@@ -296,25 +296,25 @@ pub mod pallet {
|
||||
>;
|
||||
|
||||
/// State and configuration of each staking pool.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type Pools<T: Config> = StorageMap<_, Blake2_128Concat, PoolId, PoolInfoFor<T>>;
|
||||
|
||||
/// The cost associated with storing pool information on-chain which was incurred by the pool
|
||||
/// creator.
|
||||
///
|
||||
/// This cost may be [`None`], as determined by [`Config::Consideration`].
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type PoolCost<T: Config> =
|
||||
StorageMap<_, Blake2_128Concat, PoolId, (T::AccountId, T::Consideration)>;
|
||||
|
||||
/// Stores the [`PoolId`] to use for the next pool.
|
||||
///
|
||||
/// Incremented when a new pool is created.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type NextPoolId<T: Config> = StorageValue<_, PoolId, ValueQuery>;
|
||||
|
||||
#[pallet::event]
|
||||
#[pallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
#[pezpallet::event]
|
||||
#[pezpallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
pub enum Event<T: Config> {
|
||||
/// An account staked some tokens in a pool.
|
||||
Staked {
|
||||
@@ -392,7 +392,7 @@ pub mod pallet {
|
||||
},
|
||||
}
|
||||
|
||||
#[pallet::error]
|
||||
#[pezpallet::error]
|
||||
pub enum Error<T> {
|
||||
/// The staker does not have enough tokens to perform the operation.
|
||||
NotEnoughTokens,
|
||||
@@ -416,8 +416,8 @@ pub mod pallet {
|
||||
NonEmptyPool,
|
||||
}
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<SystemBlockNumberFor<T>> for Pallet<T> {
|
||||
#[pezpallet::hooks]
|
||||
impl<T: Config> Hooks<SystemBlockNumberFor<T>> for Pezpallet<T> {
|
||||
fn integrity_test() {
|
||||
// The AccountId is at least 16 bytes to contain the unique PalletId.
|
||||
let pool_id: PoolId = 1;
|
||||
@@ -430,9 +430,9 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
/// Pallet's callable functions.
|
||||
#[pallet::call(weight(<T as Config>::WeightInfo))]
|
||||
impl<T: Config> Pallet<T> {
|
||||
/// Pezpallet's callable functions.
|
||||
#[pezpallet::call(weight(<T as Config>::WeightInfo))]
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// Create a new reward pool.
|
||||
///
|
||||
/// Parameters:
|
||||
@@ -445,7 +445,7 @@ pub mod pallet {
|
||||
/// - `admin`: the account allowed to extend the pool expiration, increase the rewards rate
|
||||
/// and receive the unutilized reward tokens back after the pool completion. If `None`,
|
||||
/// the caller is set as an admin.
|
||||
#[pallet::call_index(0)]
|
||||
#[pezpallet::call_index(0)]
|
||||
pub fn create_pool(
|
||||
origin: OriginFor<T>,
|
||||
staked_asset_id: Box<T::AssetId>,
|
||||
@@ -469,7 +469,7 @@ pub mod pallet {
|
||||
/// Stake additional tokens in a pool.
|
||||
///
|
||||
/// A freeze is placed on the staked tokens.
|
||||
#[pallet::call_index(1)]
|
||||
#[pezpallet::call_index(1)]
|
||||
pub fn stake(origin: OriginFor<T>, pool_id: PoolId, amount: T::Balance) -> DispatchResult {
|
||||
let staker = ensure_signed(origin)?;
|
||||
|
||||
@@ -510,7 +510,7 @@ pub mod pallet {
|
||||
/// - pool_id: the pool to unstake from.
|
||||
/// - amount: the amount of tokens to unstake.
|
||||
/// - staker: the account to unstake from. If `None`, the caller is used.
|
||||
#[pallet::call_index(2)]
|
||||
#[pezpallet::call_index(2)]
|
||||
pub fn unstake(
|
||||
origin: OriginFor<T>,
|
||||
pool_id: PoolId,
|
||||
@@ -565,7 +565,7 @@ pub mod pallet {
|
||||
/// - origin: must be the `staker` if the pool is still active. Otherwise, any account.
|
||||
/// - pool_id: the pool to harvest from.
|
||||
/// - staker: the account for which to harvest rewards. If `None`, the caller is used.
|
||||
#[pallet::call_index(3)]
|
||||
#[pezpallet::call_index(3)]
|
||||
pub fn harvest_rewards(
|
||||
origin: OriginFor<T>,
|
||||
pool_id: PoolId,
|
||||
@@ -619,7 +619,7 @@ pub mod pallet {
|
||||
/// Currently the reward rate can only be increased.
|
||||
///
|
||||
/// Only the pool admin may perform this operation.
|
||||
#[pallet::call_index(4)]
|
||||
#[pezpallet::call_index(4)]
|
||||
pub fn set_pool_reward_rate_per_block(
|
||||
origin: OriginFor<T>,
|
||||
pool_id: PoolId,
|
||||
@@ -637,7 +637,7 @@ pub mod pallet {
|
||||
/// Modify a pool admin.
|
||||
///
|
||||
/// Only the pool admin may perform this operation.
|
||||
#[pallet::call_index(5)]
|
||||
#[pezpallet::call_index(5)]
|
||||
pub fn set_pool_admin(
|
||||
origin: OriginFor<T>,
|
||||
pool_id: PoolId,
|
||||
@@ -653,7 +653,7 @@ pub mod pallet {
|
||||
/// Currently the expiry block can only be extended.
|
||||
///
|
||||
/// Only the pool admin may perform this operation.
|
||||
#[pallet::call_index(6)]
|
||||
#[pezpallet::call_index(6)]
|
||||
pub fn set_pool_expiry_block(
|
||||
origin: OriginFor<T>,
|
||||
pool_id: PoolId,
|
||||
@@ -669,7 +669,7 @@ pub mod pallet {
|
||||
/// This method is not strictly necessary (tokens could be transferred directly to the
|
||||
/// pool pot address), but is provided for convenience so manual derivation of the
|
||||
/// account id is not required.
|
||||
#[pallet::call_index(7)]
|
||||
#[pezpallet::call_index(7)]
|
||||
pub fn deposit_reward_tokens(
|
||||
origin: OriginFor<T>,
|
||||
pool_id: PoolId,
|
||||
@@ -693,7 +693,7 @@ pub mod pallet {
|
||||
///
|
||||
/// Cleanup storage, release any associated storage cost and return the remaining reward
|
||||
/// tokens to the admin.
|
||||
#[pallet::call_index(8)]
|
||||
#[pezpallet::call_index(8)]
|
||||
pub fn cleanup_pool(origin: OriginFor<T>, pool_id: PoolId) -> DispatchResult {
|
||||
let who = ensure_signed(origin)?;
|
||||
|
||||
@@ -729,7 +729,7 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> Pallet<T> {
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// The pool creation footprint.
|
||||
///
|
||||
/// The footprint specifically accounts for the storage footprint of the pool's information
|
||||
@@ -834,7 +834,7 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> RewardsPool<T::AccountId> for Pallet<T> {
|
||||
impl<T: Config> RewardsPool<T::AccountId> for Pezpallet<T> {
|
||||
type AssetId = T::AssetId;
|
||||
type BlockNumber = BlockNumberFor<T>;
|
||||
type PoolId = PoolId;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Test environment for Asset Rewards pallet.
|
||||
//! Test environment for Asset Rewards pezpallet.
|
||||
|
||||
use super::*;
|
||||
use crate as pezpallet_asset_rewards;
|
||||
@@ -124,7 +124,7 @@ impl EnsureOrigin<RuntimeOrigin> for MockPermissionedOrigin {
|
||||
}
|
||||
}
|
||||
|
||||
/// Allow Freezes for the `Assets` pallet
|
||||
/// Allow Freezes for the `Assets` pezpallet
|
||||
impl pezpallet_assets_freezer::Config<pezpallet_assets_freezer::Instance1> for MockRuntime {
|
||||
type RuntimeFreezeReason = RuntimeFreezeReason;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
@@ -168,7 +168,7 @@ impl Config for MockRuntime {
|
||||
CreationHoldReason,
|
||||
LinearStoragePrice<ConstU128<100>, ConstU128<0>, u128>,
|
||||
>;
|
||||
type BlockNumberProvider = pezframe_system::Pallet<Self>;
|
||||
type BlockNumberProvider = pezframe_system::Pezpallet<Self>;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
type BenchmarkHelper = AssetRewardsBenchmarkHelper;
|
||||
}
|
||||
|
||||
@@ -44,10 +44,10 @@
|
||||
// frame-omni-bencher
|
||||
// v1
|
||||
// benchmark
|
||||
// pallet
|
||||
// pezpallet
|
||||
// --extrinsic=*
|
||||
// --runtime=target/production/wbuild/pez-kitchensink-runtime/pez_kitchensink_runtime.wasm
|
||||
// --pallet=pezpallet_asset_rewards
|
||||
// --pezpallet=pezpallet_asset_rewards
|
||||
// --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2
|
||||
// --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/asset-rewards/src/weights.rs
|
||||
// --wasm-execution=compiled
|
||||
|
||||
@@ -26,10 +26,10 @@ use frame::prelude::storage::StorageDoubleMap;
|
||||
use pezpallet_assets::FrozenBalance;
|
||||
|
||||
// Implements [`FrozenBalance`] from [`pezpallet-assets`], so it can understand how much of an
|
||||
// account balance is frozen, and is able to signal to this pallet when to clear the state of an
|
||||
// account balance is frozen, and is able to signal to this pezpallet when to clear the state of an
|
||||
// account.
|
||||
impl<T: Config<I>, I: 'static> FrozenBalance<T::AssetId, T::AccountId, T::Balance>
|
||||
for Pallet<T, I>
|
||||
for Pezpallet<T, I>
|
||||
{
|
||||
fn frozen_balance(asset: T::AssetId, who: &T::AccountId) -> Option<T::Balance> {
|
||||
FrozenBalances::<T, I>::get(asset, who)
|
||||
@@ -58,24 +58,24 @@ impl<T: Config<I>, I: 'static> FrozenBalance<T::AssetId, T::AccountId, T::Balanc
|
||||
// [`fungibles::InspectFreeze`](pezframe_support::traits::fungibles::InspectFreeze) and
|
||||
// [`fungibles::MutateFreeze`](pezframe_support::traits::fungibles::MutateFreeze). To do so, we'll
|
||||
// re-export all of `pezpallet-assets` implementation of the same trait.
|
||||
impl<T: Config<I>, I: 'static> Inspect<T::AccountId> for Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> Inspect<T::AccountId> for Pezpallet<T, I> {
|
||||
type AssetId = T::AssetId;
|
||||
type Balance = T::Balance;
|
||||
|
||||
fn total_issuance(asset: Self::AssetId) -> Self::Balance {
|
||||
pezpallet_assets::Pallet::<T, I>::total_issuance(asset)
|
||||
pezpallet_assets::Pezpallet::<T, I>::total_issuance(asset)
|
||||
}
|
||||
|
||||
fn minimum_balance(asset: Self::AssetId) -> Self::Balance {
|
||||
pezpallet_assets::Pallet::<T, I>::minimum_balance(asset)
|
||||
pezpallet_assets::Pezpallet::<T, I>::minimum_balance(asset)
|
||||
}
|
||||
|
||||
fn total_balance(asset: Self::AssetId, who: &T::AccountId) -> Self::Balance {
|
||||
pezpallet_assets::Pallet::<T, I>::total_balance(asset, who)
|
||||
pezpallet_assets::Pezpallet::<T, I>::total_balance(asset, who)
|
||||
}
|
||||
|
||||
fn balance(asset: Self::AssetId, who: &T::AccountId) -> Self::Balance {
|
||||
pezpallet_assets::Pallet::<T, I>::balance(asset, who)
|
||||
pezpallet_assets::Pezpallet::<T, I>::balance(asset, who)
|
||||
}
|
||||
|
||||
fn reducible_balance(
|
||||
@@ -84,7 +84,7 @@ impl<T: Config<I>, I: 'static> Inspect<T::AccountId> for Pallet<T, I> {
|
||||
preservation: Preservation,
|
||||
force: Fortitude,
|
||||
) -> Self::Balance {
|
||||
pezpallet_assets::Pallet::<T, I>::reducible_balance(asset, who, preservation, force)
|
||||
pezpallet_assets::Pezpallet::<T, I>::reducible_balance(asset, who, preservation, force)
|
||||
}
|
||||
|
||||
fn can_deposit(
|
||||
@@ -93,7 +93,7 @@ impl<T: Config<I>, I: 'static> Inspect<T::AccountId> for Pallet<T, I> {
|
||||
amount: Self::Balance,
|
||||
provenance: Provenance,
|
||||
) -> DepositConsequence {
|
||||
pezpallet_assets::Pallet::<T, I>::can_deposit(asset, who, amount, provenance)
|
||||
pezpallet_assets::Pezpallet::<T, I>::can_deposit(asset, who, amount, provenance)
|
||||
}
|
||||
|
||||
fn can_withdraw(
|
||||
@@ -101,15 +101,15 @@ impl<T: Config<I>, I: 'static> Inspect<T::AccountId> for Pallet<T, I> {
|
||||
who: &T::AccountId,
|
||||
amount: Self::Balance,
|
||||
) -> WithdrawConsequence<Self::Balance> {
|
||||
pezpallet_assets::Pallet::<T, I>::can_withdraw(asset, who, amount)
|
||||
pezpallet_assets::Pezpallet::<T, I>::can_withdraw(asset, who, amount)
|
||||
}
|
||||
|
||||
fn asset_exists(asset: Self::AssetId) -> bool {
|
||||
pezpallet_assets::Pallet::<T, I>::asset_exists(asset)
|
||||
pezpallet_assets::Pezpallet::<T, I>::asset_exists(asset)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config<I>, I: 'static> InspectFreeze<T::AccountId> for Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> InspectFreeze<T::AccountId> for Pezpallet<T, I> {
|
||||
type Id = T::RuntimeFreezeReason;
|
||||
|
||||
fn balance_frozen(asset: Self::AssetId, id: &Self::Id, who: &T::AccountId) -> Self::Balance {
|
||||
@@ -123,7 +123,7 @@ impl<T: Config<I>, I: 'static> InspectFreeze<T::AccountId> for Pallet<T, I> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config<I>, I: 'static> MutateFreeze<T::AccountId> for Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> MutateFreeze<T::AccountId> for Pezpallet<T, I> {
|
||||
fn set_freeze(
|
||||
asset: Self::AssetId,
|
||||
id: &Self::Id,
|
||||
|
||||
@@ -21,25 +21,25 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
//! # Assets Freezer Pallet
|
||||
//! # Assets Freezer Pezpallet
|
||||
//!
|
||||
//! A pallet capable of freezing fungibles from `pezpallet-assets`. This is an extension of
|
||||
//! A pezpallet capable of freezing fungibles from `pezpallet-assets`. This is an extension of
|
||||
//! `pezpallet-assets`, wrapping [`fungibles::Inspect`](`Inspect`).
|
||||
//! It implements both
|
||||
//! [`fungibles::freeze::Inspect`](InspectFreeze) and
|
||||
//! [`fungibles::freeze::Mutate`](MutateFreeze). The complexity
|
||||
//! of the operations is `O(n)`. where `n` is the variant count of `RuntimeFreezeReason`.
|
||||
//!
|
||||
//! ## Pallet API
|
||||
//! ## Pezpallet API
|
||||
//!
|
||||
//! See the [`pallet`] module for more information about the interfaces this pallet exposes,
|
||||
//! See the [`pezpallet`] module for more information about the interfaces this pezpallet exposes,
|
||||
//! including its configuration trait, dispatchables, storage items, events and errors.
|
||||
//!
|
||||
//! ## Overview
|
||||
//!
|
||||
//! This pallet provides the following functionality:
|
||||
//! This pezpallet provides the following functionality:
|
||||
//!
|
||||
//! - Pallet hooks allowing [`pezpallet-assets`] to know the frozen balance for an account on a given
|
||||
//! - Pezpallet hooks allowing [`pezpallet-assets`] to know the frozen balance for an account on a given
|
||||
//! asset (see [`pezpallet_assets::FrozenBalance`]).
|
||||
//! - An implementation of [`fungibles::freeze::Inspect`](InspectFreeze) and
|
||||
//! [`fungibles::freeze::Mutate`](MutateFreeze), allowing other pallets to manage freezes for the
|
||||
@@ -57,7 +57,7 @@ use frame::{
|
||||
},
|
||||
};
|
||||
|
||||
pub use pallet::*;
|
||||
pub use pezpallet::*;
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
use frame::try_runtime::TryRuntimeError;
|
||||
@@ -69,34 +69,34 @@ mod tests;
|
||||
|
||||
mod impls;
|
||||
|
||||
#[frame::pallet]
|
||||
pub mod pallet {
|
||||
#[frame::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use super::*;
|
||||
|
||||
#[pallet::config(with_default)]
|
||||
#[pezpallet::config(with_default)]
|
||||
pub trait Config<I: 'static = ()>: pezframe_system::Config + pezpallet_assets::Config<I> {
|
||||
/// The overarching freeze reason.
|
||||
#[pallet::no_default_bounds]
|
||||
#[pezpallet::no_default_bounds]
|
||||
type RuntimeFreezeReason: Parameter + Member + MaxEncodedLen + Copy + VariantCount;
|
||||
|
||||
/// The overarching event type.
|
||||
#[pallet::no_default_bounds]
|
||||
#[pezpallet::no_default_bounds]
|
||||
#[allow(deprecated)]
|
||||
type RuntimeEvent: From<Event<Self, I>>
|
||||
+ IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
|
||||
}
|
||||
|
||||
#[pallet::error]
|
||||
#[pezpallet::error]
|
||||
pub enum Error<T, I = ()> {
|
||||
/// Number of freezes on an account would exceed `MaxFreezes`.
|
||||
TooManyFreezes,
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T, I = ()>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T, I = ()>(_);
|
||||
|
||||
#[pallet::event]
|
||||
#[pallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
#[pezpallet::event]
|
||||
#[pezpallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
pub enum Event<T: Config<I>, I: 'static = ()> {
|
||||
// `who`s frozen balance was increased by `amount`.
|
||||
Frozen { who: T::AccountId, asset_id: T::AssetId, amount: T::Balance },
|
||||
@@ -105,7 +105,7 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
/// A map that stores freezes applied on an account for a given AssetId.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type Freezes<T: Config<I>, I: 'static = ()> = StorageDoubleMap<
|
||||
_,
|
||||
Blake2_128Concat,
|
||||
@@ -120,7 +120,7 @@ pub mod pallet {
|
||||
>;
|
||||
|
||||
/// A map that stores the current total frozen balance for every account on a given AssetId.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type FrozenBalances<T: Config<I>, I: 'static = ()> = StorageDoubleMap<
|
||||
_,
|
||||
Blake2_128Concat,
|
||||
@@ -130,8 +130,8 @@ pub mod pallet {
|
||||
T::Balance,
|
||||
>;
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config<I>, I: 'static> Hooks<BlockNumberFor<T>> for Pallet<T, I> {
|
||||
#[pezpallet::hooks]
|
||||
impl<T: Config<I>, I: 'static> Hooks<BlockNumberFor<T>> for Pezpallet<T, I> {
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn try_state(_: BlockNumberFor<T>) -> Result<(), TryRuntimeError> {
|
||||
Self::do_try_state()
|
||||
@@ -139,7 +139,7 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
|
||||
fn update_freezes(
|
||||
asset: T::AssetId,
|
||||
who: &T::AccountId,
|
||||
|
||||
@@ -31,10 +31,10 @@ use pezsp_runtime::{
|
||||
use storage::StorageDoubleMap;
|
||||
|
||||
// Implements [`BalanceOnHold`] from [`pezpallet-assets`], so it can understand whether there's some
|
||||
// balance on hold for an asset account, and is able to signal to this pallet when to clear the
|
||||
// balance on hold for an asset account, and is able to signal to this pezpallet when to clear the
|
||||
// state of an account.
|
||||
impl<T: Config<I>, I: 'static> BalanceOnHold<T::AssetId, T::AccountId, T::Balance>
|
||||
for Pallet<T, I>
|
||||
for Pezpallet<T, I>
|
||||
{
|
||||
fn balance_on_hold(asset: T::AssetId, who: &T::AccountId) -> Option<T::Balance> {
|
||||
BalancesOnHold::<T, I>::get(asset, who)
|
||||
@@ -63,24 +63,24 @@ impl<T: Config<I>, I: 'static> BalanceOnHold<T::AssetId, T::AccountId, T::Balanc
|
||||
// [`fungibles::InspectHold`](pezframe_support::traits::fungibles::InspectHold) and
|
||||
// [`fungibles::MutateHold`](pezframe_support::traits::fungibles::MutateHold). To do so, we'll
|
||||
// re-export all of `pezpallet-assets` implementation of the same trait.
|
||||
impl<T: Config<I>, I: 'static> Inspect<T::AccountId> for Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> Inspect<T::AccountId> for Pezpallet<T, I> {
|
||||
type AssetId = T::AssetId;
|
||||
type Balance = T::Balance;
|
||||
|
||||
fn total_issuance(asset: Self::AssetId) -> Self::Balance {
|
||||
pezpallet_assets::Pallet::<T, I>::total_issuance(asset)
|
||||
pezpallet_assets::Pezpallet::<T, I>::total_issuance(asset)
|
||||
}
|
||||
|
||||
fn minimum_balance(asset: Self::AssetId) -> Self::Balance {
|
||||
pezpallet_assets::Pallet::<T, I>::minimum_balance(asset)
|
||||
pezpallet_assets::Pezpallet::<T, I>::minimum_balance(asset)
|
||||
}
|
||||
|
||||
fn total_balance(asset: Self::AssetId, who: &T::AccountId) -> Self::Balance {
|
||||
pezpallet_assets::Pallet::<T, I>::total_balance(asset, who)
|
||||
pezpallet_assets::Pezpallet::<T, I>::total_balance(asset, who)
|
||||
}
|
||||
|
||||
fn balance(asset: Self::AssetId, who: &T::AccountId) -> Self::Balance {
|
||||
pezpallet_assets::Pallet::<T, I>::balance(asset, who)
|
||||
pezpallet_assets::Pezpallet::<T, I>::balance(asset, who)
|
||||
}
|
||||
|
||||
fn reducible_balance(
|
||||
@@ -89,7 +89,7 @@ impl<T: Config<I>, I: 'static> Inspect<T::AccountId> for Pallet<T, I> {
|
||||
preservation: Preservation,
|
||||
force: Fortitude,
|
||||
) -> Self::Balance {
|
||||
pezpallet_assets::Pallet::<T, I>::reducible_balance(asset, who, preservation, force)
|
||||
pezpallet_assets::Pezpallet::<T, I>::reducible_balance(asset, who, preservation, force)
|
||||
}
|
||||
|
||||
fn can_deposit(
|
||||
@@ -98,7 +98,7 @@ impl<T: Config<I>, I: 'static> Inspect<T::AccountId> for Pallet<T, I> {
|
||||
amount: Self::Balance,
|
||||
provenance: Provenance,
|
||||
) -> DepositConsequence {
|
||||
pezpallet_assets::Pallet::<T, I>::can_deposit(asset, who, amount, provenance)
|
||||
pezpallet_assets::Pezpallet::<T, I>::can_deposit(asset, who, amount, provenance)
|
||||
}
|
||||
|
||||
fn can_withdraw(
|
||||
@@ -106,15 +106,15 @@ impl<T: Config<I>, I: 'static> Inspect<T::AccountId> for Pallet<T, I> {
|
||||
who: &T::AccountId,
|
||||
amount: Self::Balance,
|
||||
) -> WithdrawConsequence<Self::Balance> {
|
||||
pezpallet_assets::Pallet::<T, I>::can_withdraw(asset, who, amount)
|
||||
pezpallet_assets::Pezpallet::<T, I>::can_withdraw(asset, who, amount)
|
||||
}
|
||||
|
||||
fn asset_exists(asset: Self::AssetId) -> bool {
|
||||
pezpallet_assets::Pallet::<T, I>::asset_exists(asset)
|
||||
pezpallet_assets::Pezpallet::<T, I>::asset_exists(asset)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config<I>, I: 'static> InspectHold<T::AccountId> for Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> InspectHold<T::AccountId> for Pezpallet<T, I> {
|
||||
type Reason = T::RuntimeHoldReason;
|
||||
|
||||
fn total_balance_on_hold(asset: Self::AssetId, who: &T::AccountId) -> Self::Balance {
|
||||
@@ -134,10 +134,10 @@ impl<T: Config<I>, I: 'static> InspectHold<T::AccountId> for Pallet<T, I> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config<I>, I: 'static> Unbalanced<T::AccountId> for Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> Unbalanced<T::AccountId> for Pezpallet<T, I> {
|
||||
fn handle_dust(dust: Dust<T::AccountId, Self>) {
|
||||
let Dust(id, balance) = dust;
|
||||
pezpallet_assets::Pallet::<T, I>::handle_dust(Dust(id, balance));
|
||||
pezpallet_assets::Pezpallet::<T, I>::handle_dust(Dust(id, balance));
|
||||
}
|
||||
|
||||
fn write_balance(
|
||||
@@ -145,11 +145,11 @@ impl<T: Config<I>, I: 'static> Unbalanced<T::AccountId> for Pallet<T, I> {
|
||||
who: &T::AccountId,
|
||||
amount: Self::Balance,
|
||||
) -> Result<Option<Self::Balance>, DispatchError> {
|
||||
pezpallet_assets::Pallet::<T, I>::write_balance(asset, who, amount)
|
||||
pezpallet_assets::Pezpallet::<T, I>::write_balance(asset, who, amount)
|
||||
}
|
||||
|
||||
fn set_total_issuance(asset: Self::AssetId, amount: Self::Balance) {
|
||||
pezpallet_assets::Pallet::<T, I>::set_total_issuance(asset, amount)
|
||||
pezpallet_assets::Pezpallet::<T, I>::set_total_issuance(asset, amount)
|
||||
}
|
||||
|
||||
fn decrease_balance(
|
||||
@@ -160,7 +160,7 @@ impl<T: Config<I>, I: 'static> Unbalanced<T::AccountId> for Pallet<T, I> {
|
||||
preservation: Preservation,
|
||||
force: Fortitude,
|
||||
) -> Result<Self::Balance, DispatchError> {
|
||||
pezpallet_assets::Pallet::<T, I>::decrease_balance(
|
||||
pezpallet_assets::Pezpallet::<T, I>::decrease_balance(
|
||||
asset,
|
||||
who,
|
||||
amount,
|
||||
@@ -176,11 +176,11 @@ impl<T: Config<I>, I: 'static> Unbalanced<T::AccountId> for Pallet<T, I> {
|
||||
amount: Self::Balance,
|
||||
precision: Precision,
|
||||
) -> Result<Self::Balance, DispatchError> {
|
||||
pezpallet_assets::Pallet::<T, I>::increase_balance(asset, who, amount, precision)
|
||||
pezpallet_assets::Pezpallet::<T, I>::increase_balance(asset, who, amount, precision)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config<I>, I: 'static> UnbalancedHold<T::AccountId> for Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> UnbalancedHold<T::AccountId> for Pezpallet<T, I> {
|
||||
fn set_balance_on_hold(
|
||||
asset: Self::AssetId,
|
||||
reason: &Self::Reason,
|
||||
@@ -245,7 +245,7 @@ impl<T: Config<I>, I: 'static> UnbalancedHold<T::AccountId> for Pallet<T, I> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config<I>, I: 'static> MutateHold<T::AccountId> for Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> MutateHold<T::AccountId> for Pezpallet<T, I> {
|
||||
fn done_hold(
|
||||
asset_id: Self::AssetId,
|
||||
reason: &Self::Reason,
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! # Assets Holder Pallet
|
||||
//! # Assets Holder Pezpallet
|
||||
//!
|
||||
//! A pallet capable of holding fungibles from `pezpallet-assets`. This is an extension of
|
||||
//! A pezpallet capable of holding fungibles from `pezpallet-assets`. This is an extension of
|
||||
//! `pezpallet-assets`, wrapping [`fungibles::Inspect`](`pezframe_support::traits::fungibles::Inspect`).
|
||||
//! It implements both
|
||||
//! [`fungibles::hold::Inspect`](pezframe_support::traits::fungibles::hold::Inspect),
|
||||
@@ -25,16 +25,16 @@
|
||||
//! [`fungibles::hold::Unbalanced`](pezframe_support::traits::fungibles::hold::Unbalanced). The
|
||||
//! complexity of the operations is `O(1)`.
|
||||
//!
|
||||
//! ## Pallet API
|
||||
//! ## Pezpallet API
|
||||
//!
|
||||
//! See the [`pallet`] module for more information about the interfaces this pallet exposes,
|
||||
//! See the [`pezpallet`] module for more information about the interfaces this pezpallet exposes,
|
||||
//! including its configuration trait, dispatchables, storage items, events and errors.
|
||||
//!
|
||||
//! ## Overview
|
||||
//!
|
||||
//! This pallet provides the following functionality:
|
||||
//! This pezpallet provides the following functionality:
|
||||
//!
|
||||
//! - Pallet hooks allowing [`pezpallet-assets`] to know the balance on hold for an account on a given
|
||||
//! - Pezpallet hooks allowing [`pezpallet-assets`] to know the balance on hold for an account on a given
|
||||
//! asset (see [`pezpallet_assets::BalanceOnHold`]).
|
||||
//! - An implementation of
|
||||
//! [`fungibles::hold::Inspect`](pezframe_support::traits::fungibles::hold::Inspect),
|
||||
@@ -51,7 +51,7 @@ use pezframe_support::{
|
||||
};
|
||||
use pezframe_system::pezpallet_prelude::BlockNumberFor;
|
||||
|
||||
pub use pallet::*;
|
||||
pub use pezpallet::*;
|
||||
|
||||
#[cfg(test)]
|
||||
mod mock;
|
||||
@@ -60,36 +60,36 @@ mod tests;
|
||||
|
||||
mod impl_fungibles;
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
#[pezframe_support::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use super::*;
|
||||
|
||||
#[pallet::config(with_default)]
|
||||
#[pezpallet::config(with_default)]
|
||||
pub trait Config<I: 'static = ()>:
|
||||
pezframe_system::Config + pezpallet_assets::Config<I, Holder = Pallet<Self, I>>
|
||||
pezframe_system::Config + pezpallet_assets::Config<I, Holder = Pezpallet<Self, I>>
|
||||
{
|
||||
/// The overarching freeze reason.
|
||||
#[pallet::no_default_bounds]
|
||||
#[pezpallet::no_default_bounds]
|
||||
type RuntimeHoldReason: Parameter + Member + MaxEncodedLen + Copy + VariantCount;
|
||||
|
||||
/// The overarching event type.
|
||||
#[pallet::no_default_bounds]
|
||||
#[pezpallet::no_default_bounds]
|
||||
#[allow(deprecated)]
|
||||
type RuntimeEvent: From<Event<Self, I>>
|
||||
+ IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
|
||||
}
|
||||
|
||||
#[pallet::error]
|
||||
#[pezpallet::error]
|
||||
pub enum Error<T, I = ()> {
|
||||
/// Number of holds on an account would exceed the count of `RuntimeHoldReason`.
|
||||
TooManyHolds,
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T, I = ()>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T, I = ()>(_);
|
||||
|
||||
#[pallet::event]
|
||||
#[pallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
#[pezpallet::event]
|
||||
#[pezpallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
pub enum Event<T: Config<I>, I: 'static = ()> {
|
||||
/// `who`s balance on hold was increased by `amount`.
|
||||
Held {
|
||||
@@ -115,7 +115,7 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
/// A map that stores holds applied on an account for a given AssetId.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(super) type Holds<T: Config<I>, I: 'static = ()> = StorageDoubleMap<
|
||||
_,
|
||||
Blake2_128Concat,
|
||||
@@ -130,7 +130,7 @@ pub mod pallet {
|
||||
>;
|
||||
|
||||
/// A map that stores the current total balance on hold for every account on a given AssetId.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(super) type BalancesOnHold<T: Config<I>, I: 'static = ()> = StorageDoubleMap<
|
||||
_,
|
||||
Blake2_128Concat,
|
||||
@@ -140,8 +140,8 @@ pub mod pallet {
|
||||
T::Balance,
|
||||
>;
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config<I>, I: 'static> Hooks<BlockNumberFor<T>> for Pallet<T, I> {
|
||||
#[pezpallet::hooks]
|
||||
impl<T: Config<I>, I: 'static> Hooks<BlockNumberFor<T>> for Pezpallet<T, I> {
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn try_state(_: BlockNumberFor<T>) -> Result<(), pezsp_runtime::TryRuntimeError> {
|
||||
Self::do_try_state()
|
||||
@@ -149,7 +149,7 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
|
||||
#[cfg(any(test, feature = "try-runtime"))]
|
||||
fn do_try_state() -> Result<(), pezsp_runtime::TryRuntimeError> {
|
||||
use pezsp_runtime::{
|
||||
|
||||
@@ -188,7 +188,7 @@ mod impl_hold_unbalanced {
|
||||
// and `increase_balance` are intentionally left out without testing, since:
|
||||
// 1. It is expected these methods are tested within `pezpallet-assets`, and
|
||||
// 2. There are no valid cases that can be directly asserted using those methods in
|
||||
// the scope of this pallet.
|
||||
// the scope of this pezpallet.
|
||||
|
||||
#[test]
|
||||
fn set_balance_on_hold_works() {
|
||||
|
||||
@@ -6,7 +6,7 @@ edition.workspace = true
|
||||
license = "Apache-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
description = "FRAME asset management pallet"
|
||||
description = "FRAME asset management pezpallet"
|
||||
readme = "README.md"
|
||||
documentation = "https://docs.rs/pezpallet-assets"
|
||||
|
||||
|
||||
@@ -11,10 +11,10 @@ The Assets module provides functionality for asset management of fungible asset
|
||||
* Asset Destruction
|
||||
|
||||
To use it in your runtime, you need to implement the assets
|
||||
[`assets::Config`](https://docs.rs/pezpallet-assets/latest/pallet_assets/pallet/trait.Config.html).
|
||||
[`assets::Config`](https://docs.rs/pezpallet-assets/latest/pallet_assets/pezpallet/trait.Config.html).
|
||||
|
||||
The supported dispatchable functions are documented in the
|
||||
[`assets::Call`](https://docs.rs/pezpallet-assets/latest/pallet_assets/pallet/enum.Call.html) enum.
|
||||
[`assets::Call`](https://docs.rs/pezpallet-assets/latest/pallet_assets/pezpallet/enum.Call.html) enum.
|
||||
|
||||
### Terminology
|
||||
|
||||
@@ -50,7 +50,7 @@ variants for documentation on each function.
|
||||
* `balance` - Get the asset `id` balance of `who`.
|
||||
* `total_supply` - Get the total supply of an asset `id`.
|
||||
|
||||
Please refer to the [`Pallet`](https://docs.rs/pezpallet-assets/latest/pallet_assets/pallet/struct.Pallet.html) struct for
|
||||
Please refer to the [`Pezpallet`](https://docs.rs/pezpallet-assets/latest/pallet_assets/pezpallet/struct.Pezpallet.html) struct for
|
||||
details on publicly available functions.
|
||||
|
||||
## Usage
|
||||
@@ -71,20 +71,20 @@ Import the Assets module and types and derive your runtime's configuration trait
|
||||
use pallet_assets as assets;
|
||||
use sp_runtime::ArithmeticError;
|
||||
|
||||
#[frame_support::pallet]
|
||||
pub mod pallet {
|
||||
#[frame_support::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use super::*;
|
||||
use frame_support::pallet_prelude::*;
|
||||
use frame_system::pallet_prelude::*;
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T>(_);
|
||||
|
||||
#[pallet::config]
|
||||
#[pezpallet::config]
|
||||
pub trait Config: frame_system::Config + assets::Config {}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pezpallet::call]
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
pub fn issue_token_airdrop(origin: OriginFor<T>) -> DispatchResult {
|
||||
let sender = ensure_signed(origin)?;
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ where
|
||||
.map_err(|_| Error::Revert(Revert { reason: ERR_INVALID_CALLER.into() }))
|
||||
}
|
||||
|
||||
/// Convert a `U256` value to the balance type of the pallet.
|
||||
/// Convert a `U256` value to the balance type of the pezpallet.
|
||||
fn to_balance(
|
||||
value: alloy::primitives::U256,
|
||||
) -> Result<<Runtime as Config<Instance>>::Balance, Error> {
|
||||
@@ -189,7 +189,7 @@ where
|
||||
);
|
||||
|
||||
let f = TransferFlags { keep_alive: false, best_effort: false, burn_dust: false };
|
||||
pezpallet_assets::Pallet::<Runtime, Instance>::do_transfer(
|
||||
pezpallet_assets::Pezpallet::<Runtime, Instance>::do_transfer(
|
||||
asset_id,
|
||||
&<Runtime as pezpallet_revive::Config>::AddressMapper::to_account_id(&from),
|
||||
&dest,
|
||||
@@ -219,7 +219,7 @@ where
|
||||
env.charge(<Runtime as Config<Instance>>::WeightInfo::total_issuance())?;
|
||||
|
||||
let value =
|
||||
Self::to_u256(pezpallet_assets::Pallet::<Runtime, Instance>::total_issuance(asset_id))?;
|
||||
Self::to_u256(pezpallet_assets::Pezpallet::<Runtime, Instance>::total_issuance(asset_id))?;
|
||||
return Ok(IERC20::totalSupplyCall::abi_encode_returns(&value));
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ where
|
||||
let account = call.account.into_array().into();
|
||||
let account = <Runtime as pezpallet_revive::Config>::AddressMapper::to_account_id(&account);
|
||||
let value =
|
||||
Self::to_u256(pezpallet_assets::Pallet::<Runtime, Instance>::balance(asset_id, account))?;
|
||||
Self::to_u256(pezpallet_assets::Pezpallet::<Runtime, Instance>::balance(asset_id, account))?;
|
||||
return Ok(IERC20::balanceOfCall::abi_encode_returns(&value));
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ where
|
||||
|
||||
let spender = call.spender.into_array().into();
|
||||
let spender = <Runtime as pezpallet_revive::Config>::AddressMapper::to_account_id(&spender);
|
||||
let value = Self::to_u256(pezpallet_assets::Pallet::<Runtime, Instance>::allowance(
|
||||
let value = Self::to_u256(pezpallet_assets::Pezpallet::<Runtime, Instance>::allowance(
|
||||
asset_id, &owner, &spender,
|
||||
))?;
|
||||
|
||||
@@ -268,7 +268,7 @@ where
|
||||
let spender = call.spender.into_array().into();
|
||||
let spender = <Runtime as pezpallet_revive::Config>::AddressMapper::to_account_id(&spender);
|
||||
|
||||
pezpallet_assets::Pallet::<Runtime, Instance>::do_approve_transfer(
|
||||
pezpallet_assets::Pezpallet::<Runtime, Instance>::do_approve_transfer(
|
||||
asset_id,
|
||||
&<Runtime as pezpallet_revive::Config>::AddressMapper::to_account_id(&owner),
|
||||
&spender,
|
||||
@@ -303,7 +303,7 @@ where
|
||||
let to = call.to.into_array().into();
|
||||
let to = <Runtime as pezpallet_revive::Config>::AddressMapper::to_account_id(&to);
|
||||
|
||||
pezpallet_assets::Pallet::<Runtime, Instance>::do_transfer_approved(
|
||||
pezpallet_assets::Pezpallet::<Runtime, Instance>::do_transfer_approved(
|
||||
asset_id,
|
||||
&from,
|
||||
&spender,
|
||||
|
||||
@@ -72,7 +72,7 @@ fn precompile_transfer_works() {
|
||||
let data =
|
||||
IERC20::transferCall { to: to_addr.0.into(), value: U256::from(10) }.abi_encode();
|
||||
|
||||
pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(from),
|
||||
H160::from(asset_addr),
|
||||
0u32.into(),
|
||||
@@ -111,7 +111,7 @@ fn total_supply_works() {
|
||||
|
||||
let data = IERC20::totalSupplyCall {}.abi_encode();
|
||||
|
||||
let data = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
let data = pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(owner),
|
||||
H160::from(asset_addr),
|
||||
0u32.into(),
|
||||
@@ -144,7 +144,7 @@ fn balance_of_works() {
|
||||
let account = <Test as pezpallet_revive::Config>::AddressMapper::to_address(&owner).0.into();
|
||||
let data = IERC20::balanceOfCall { account }.abi_encode();
|
||||
|
||||
let data = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
let data = pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(owner),
|
||||
H160::from(asset_addr),
|
||||
0u32.into(),
|
||||
@@ -190,7 +190,7 @@ fn approval_works() {
|
||||
let data = IERC20::approveCall { spender: spender_addr.0.into(), value: U256::from(25) }
|
||||
.abi_encode();
|
||||
|
||||
pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(owner),
|
||||
H160::from(asset_addr),
|
||||
0u32.into(),
|
||||
@@ -213,7 +213,7 @@ fn approval_works() {
|
||||
IERC20::allowanceCall { owner: owner_addr.0.into(), spender: spender_addr.0.into() }
|
||||
.abi_encode();
|
||||
|
||||
let data = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
let data = pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(owner),
|
||||
H160::from(asset_addr),
|
||||
0u32.into(),
|
||||
@@ -236,7 +236,7 @@ fn approval_works() {
|
||||
}
|
||||
.abi_encode();
|
||||
|
||||
pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(spender),
|
||||
H160::from(asset_addr),
|
||||
0u32.into(),
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Assets pallet benchmarking.
|
||||
//! Assets pezpallet benchmarking.
|
||||
|
||||
#![cfg(feature = "runtime-benchmarks")]
|
||||
|
||||
@@ -31,7 +31,7 @@ use pezframe_support::traits::{EnsureOrigin, Get, UnfilteredDispatchable};
|
||||
use pezframe_system::RawOrigin as SystemOrigin;
|
||||
use pezsp_runtime::{traits::Bounded, Weight};
|
||||
|
||||
use crate::Pallet as Assets;
|
||||
use crate::Pezpallet as Assets;
|
||||
|
||||
const SEED: u32 = 0;
|
||||
const MIN_BALANCE: u32 = 1;
|
||||
@@ -147,11 +147,11 @@ fn add_approvals<T: Config<I>, I: 'static>(minter: T::AccountId, n: u32) {
|
||||
}
|
||||
|
||||
fn assert_last_event<T: Config<I>, I: 'static>(generic_event: <T as Config<I>>::RuntimeEvent) {
|
||||
pezframe_system::Pallet::<T>::assert_last_event(generic_event.into());
|
||||
pezframe_system::Pezpallet::<T>::assert_last_event(generic_event.into());
|
||||
}
|
||||
|
||||
fn assert_event<T: Config<I>, I: 'static>(generic_event: <T as Config<I>>::RuntimeEvent) {
|
||||
pezframe_system::Pallet::<T>::assert_has_event(generic_event.into());
|
||||
pezframe_system::Pezpallet::<T>::assert_has_event(generic_event.into());
|
||||
}
|
||||
|
||||
benchmarks_instance_pallet! {
|
||||
@@ -272,7 +272,7 @@ benchmarks_instance_pallet! {
|
||||
let target_lookup = T::Lookup::unlookup(target.clone());
|
||||
}: _(SystemOrigin::Signed(caller.clone()), asset_id.clone(), target_lookup, amount)
|
||||
verify {
|
||||
assert!(pezframe_system::Pallet::<T>::account_exists(&caller));
|
||||
assert!(pezframe_system::Pezpallet::<T>::account_exists(&caller));
|
||||
assert_last_event::<T, I>(Event::Transferred { asset_id: asset_id.into(), from: caller, to: target, amount }.into());
|
||||
}
|
||||
|
||||
@@ -592,7 +592,7 @@ benchmarks_instance_pallet! {
|
||||
let (asset_id, _, _) = create_default_minted_asset::<T, I>(true, 100u32.into());
|
||||
let amount;
|
||||
}: {
|
||||
amount = Pallet::<T, I>::total_issuance(asset_id.into());
|
||||
amount = Pezpallet::<T, I>::total_issuance(asset_id.into());
|
||||
} verify {
|
||||
assert_eq!(amount, 100u32.into());
|
||||
}
|
||||
@@ -601,7 +601,7 @@ benchmarks_instance_pallet! {
|
||||
let (asset_id, caller, _) = create_default_minted_asset::<T, I>(true, 100u32.into());
|
||||
let amount;
|
||||
}: {
|
||||
amount = Pallet::<T, I>::balance(asset_id.into(), caller);
|
||||
amount = Pezpallet::<T, I>::balance(asset_id.into(), caller);
|
||||
} verify {
|
||||
assert_eq!(amount, 100u32.into());
|
||||
}
|
||||
@@ -613,20 +613,20 @@ benchmarks_instance_pallet! {
|
||||
let delegate: T::AccountId = account("approval", 0, SEED);
|
||||
let amount;
|
||||
}: {
|
||||
amount = Pallet::<T, I>::allowance(asset_id.into(), &caller, &delegate);
|
||||
amount = Pezpallet::<T, I>::allowance(asset_id.into(), &caller, &delegate);
|
||||
} verify {
|
||||
assert_eq!(amount, 100u32.into());
|
||||
}
|
||||
|
||||
migration_v2_foreign_asset_set_reserve_weight {
|
||||
let (id, _, _) = create_default_asset::<T, I>(true);
|
||||
let id: <T as pallet::Config<I>>::AssetId = id.into();
|
||||
let id: <T as pezpallet::Config<I>>::AssetId = id.into();
|
||||
let reserve = T::BenchmarkHelper::create_reserve_id_parameter(42);
|
||||
}: {
|
||||
let asset_id = Asset::<T, I>::iter_keys().next()
|
||||
.ok_or_else(|| BenchmarkError::Override(BenchmarkResult::from_weight(Weight::MAX)))?;
|
||||
assert_eq!(id, asset_id);
|
||||
Pallet::<T, I>::unchecked_update_reserves(asset_id, vec![reserve.clone()]).unwrap();
|
||||
Pezpallet::<T, I>::unchecked_update_reserves(asset_id, vec![reserve.clone()]).unwrap();
|
||||
}
|
||||
verify {
|
||||
assert_eq!(Reserves::<T, I>::get(id)[0], reserve);
|
||||
|
||||
@@ -21,7 +21,7 @@ use super::*;
|
||||
|
||||
/// A mutator type allowing inspection and possible modification of the extra "sidecar" data.
|
||||
///
|
||||
/// This may be used as a `Deref` for the pallet's extra data. If mutated (using `DerefMut`), then
|
||||
/// This may be used as a `Deref` for the pezpallet's extra data. If mutated (using `DerefMut`), then
|
||||
/// any uncommitted changes (see `commit` function) will be automatically committed to storage when
|
||||
/// dropped. Changes, even after committed, may be reverted to their original values with the
|
||||
/// `revert` function.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Functions for the Assets pallet.
|
||||
//! Functions for the Assets pezpallet.
|
||||
|
||||
use super::*;
|
||||
use alloc::vec;
|
||||
@@ -30,7 +30,7 @@ pub(super) enum DeadConsequence {
|
||||
use DeadConsequence::*;
|
||||
|
||||
// The main implementation block for the module.
|
||||
impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
|
||||
// Public immutables
|
||||
|
||||
/// Return the extra "sid-car" data for `id`/`who`, or `None` if the account doesn't exist.
|
||||
@@ -77,16 +77,16 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
ExistenceReason::DepositFrom(depositor.clone(), deposit)
|
||||
}
|
||||
} else if d.is_sufficient {
|
||||
pezframe_system::Pallet::<T>::inc_sufficients(who);
|
||||
pezframe_system::Pezpallet::<T>::inc_sufficients(who);
|
||||
d.sufficients.saturating_inc();
|
||||
ExistenceReason::Sufficient
|
||||
} else {
|
||||
pezframe_system::Pallet::<T>::inc_consumers(who)
|
||||
pezframe_system::Pezpallet::<T>::inc_consumers(who)
|
||||
.map_err(|_| Error::<T, I>::UnavailableConsumer)?;
|
||||
// We ensure that we can still increment consumers once more because we could otherwise
|
||||
// allow accidental usage of all consumer references which could cause grief.
|
||||
if !pezframe_system::Pallet::<T>::can_inc_consumer(who) {
|
||||
pezframe_system::Pallet::<T>::dec_consumers(who);
|
||||
if !pezframe_system::Pezpallet::<T>::can_inc_consumer(who) {
|
||||
pezframe_system::Pezpallet::<T>::dec_consumers(who);
|
||||
return Err(Error::<T, I>::UnavailableConsumer.into());
|
||||
}
|
||||
ExistenceReason::Consumer
|
||||
@@ -113,10 +113,10 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
use ExistenceReason::*;
|
||||
|
||||
match *reason {
|
||||
Consumer => pezframe_system::Pallet::<T>::dec_consumers(who),
|
||||
Consumer => pezframe_system::Pezpallet::<T>::dec_consumers(who),
|
||||
Sufficient => {
|
||||
d.sufficients = d.sufficients.saturating_sub(1);
|
||||
pezframe_system::Pallet::<T>::dec_sufficients(who);
|
||||
pezframe_system::Pezpallet::<T>::dec_sufficients(who);
|
||||
},
|
||||
DepositRefunded => {},
|
||||
DepositHeld(_) | DepositFrom(..) if !force => return Keep,
|
||||
@@ -160,7 +160,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
if amount < details.min_balance {
|
||||
return DepositConsequence::BelowMinimum;
|
||||
}
|
||||
if !details.is_sufficient && !pezframe_system::Pallet::<T>::can_accrue_consumers(who, 2) {
|
||||
if !details.is_sufficient && !pezframe_system::Pezpallet::<T>::can_accrue_consumers(who, 2) {
|
||||
return DepositConsequence::CannotCreate;
|
||||
}
|
||||
if details.is_sufficient && details.sufficients.checked_add(1).is_none() {
|
||||
|
||||
@@ -30,7 +30,7 @@ use pezframe_support::{
|
||||
|
||||
use super::*;
|
||||
|
||||
impl<T: Config<I>, I: 'static> fungibles::Inspect<<T as SystemConfig>::AccountId> for Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> fungibles::Inspect<<T as SystemConfig>::AccountId> for Pezpallet<T, I> {
|
||||
type AssetId = T::AssetId;
|
||||
type Balance = T::Balance;
|
||||
|
||||
@@ -43,11 +43,11 @@ impl<T: Config<I>, I: 'static> fungibles::Inspect<<T as SystemConfig>::AccountId
|
||||
}
|
||||
|
||||
fn balance(asset: Self::AssetId, who: &<T as SystemConfig>::AccountId) -> Self::Balance {
|
||||
Pallet::<T, I>::balance(asset, who)
|
||||
Pezpallet::<T, I>::balance(asset, who)
|
||||
}
|
||||
|
||||
fn total_balance(asset: Self::AssetId, who: &<T as SystemConfig>::AccountId) -> Self::Balance {
|
||||
Pallet::<T, I>::balance(asset.clone(), who)
|
||||
Pezpallet::<T, I>::balance(asset.clone(), who)
|
||||
.saturating_add(T::Holder::balance_on_hold(asset, who).unwrap_or_default())
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ impl<T: Config<I>, I: 'static> fungibles::Inspect<<T as SystemConfig>::AccountId
|
||||
preservation: Preservation,
|
||||
_: Fortitude,
|
||||
) -> Self::Balance {
|
||||
Pallet::<T, I>::reducible_balance(asset, who, !matches!(preservation, Expendable))
|
||||
Pezpallet::<T, I>::reducible_balance(asset, who, !matches!(preservation, Expendable))
|
||||
.unwrap_or(Zero::zero())
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ impl<T: Config<I>, I: 'static> fungibles::Inspect<<T as SystemConfig>::AccountId
|
||||
amount: Self::Balance,
|
||||
provenance: Provenance,
|
||||
) -> DepositConsequence {
|
||||
Pallet::<T, I>::can_increase(asset, who, amount, provenance == Minted)
|
||||
Pezpallet::<T, I>::can_increase(asset, who, amount, provenance == Minted)
|
||||
}
|
||||
|
||||
fn can_withdraw(
|
||||
@@ -75,7 +75,7 @@ impl<T: Config<I>, I: 'static> fungibles::Inspect<<T as SystemConfig>::AccountId
|
||||
who: &<T as SystemConfig>::AccountId,
|
||||
amount: Self::Balance,
|
||||
) -> WithdrawConsequence<Self::Balance> {
|
||||
Pallet::<T, I>::can_decrease(asset, who, amount, false)
|
||||
Pezpallet::<T, I>::can_decrease(asset, who, amount, false)
|
||||
}
|
||||
|
||||
fn asset_exists(asset: Self::AssetId) -> bool {
|
||||
@@ -83,7 +83,7 @@ impl<T: Config<I>, I: 'static> fungibles::Inspect<<T as SystemConfig>::AccountId
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config<I>, I: 'static> fungibles::Mutate<<T as SystemConfig>::AccountId> for Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> fungibles::Mutate<<T as SystemConfig>::AccountId> for Pezpallet<T, I> {
|
||||
fn done_mint_into(
|
||||
asset_id: Self::AssetId,
|
||||
beneficiary: &<T as SystemConfig>::AccountId,
|
||||
@@ -116,7 +116,7 @@ impl<T: Config<I>, I: 'static> fungibles::Mutate<<T as SystemConfig>::AccountId>
|
||||
}
|
||||
|
||||
impl<T: Config<I>, I: 'static> fungibles::Balanced<<T as SystemConfig>::AccountId>
|
||||
for Pallet<T, I>
|
||||
for Pezpallet<T, I>
|
||||
{
|
||||
type OnDropCredit = fungibles::DecreaseIssuance<T::AccountId, Self>;
|
||||
type OnDropDebt = fungibles::IncreaseIssuance<T::AccountId, Self>;
|
||||
@@ -138,7 +138,7 @@ impl<T: Config<I>, I: 'static> fungibles::Balanced<<T as SystemConfig>::AccountI
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config<I>, I: 'static> fungibles::Unbalanced<T::AccountId> for Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> fungibles::Unbalanced<T::AccountId> for Pezpallet<T, I> {
|
||||
fn handle_raw_dust(_: Self::AssetId, _: Self::Balance) {}
|
||||
fn handle_dust(_: fungibles::Dust<T::AccountId, Self>) {
|
||||
defensive!("`decrease_balance` and `increase_balance` have non-default impls; nothing else calls this; qed");
|
||||
@@ -185,7 +185,7 @@ impl<T: Config<I>, I: 'static> fungibles::Unbalanced<T::AccountId> for Pallet<T,
|
||||
// TODO: #13196 implement deactivate/reactivate once we have inactive balance tracking.
|
||||
}
|
||||
|
||||
impl<T: Config<I>, I: 'static> fungibles::Create<T::AccountId> for Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> fungibles::Create<T::AccountId> for Pezpallet<T, I> {
|
||||
fn create(
|
||||
id: T::AssetId,
|
||||
admin: T::AccountId,
|
||||
@@ -196,7 +196,7 @@ impl<T: Config<I>, I: 'static> fungibles::Create<T::AccountId> for Pallet<T, I>
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config<I>, I: 'static> fungibles::Destroy<T::AccountId> for Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> fungibles::Destroy<T::AccountId> for Pezpallet<T, I> {
|
||||
fn start_destroy(id: T::AssetId, maybe_check_owner: Option<T::AccountId>) -> DispatchResult {
|
||||
Self::do_start_destroy(id, maybe_check_owner)
|
||||
}
|
||||
@@ -215,7 +215,7 @@ impl<T: Config<I>, I: 'static> fungibles::Destroy<T::AccountId> for Pallet<T, I>
|
||||
}
|
||||
|
||||
impl<T: Config<I>, I: 'static> fungibles::metadata::Inspect<<T as SystemConfig>::AccountId>
|
||||
for Pallet<T, I>
|
||||
for Pezpallet<T, I>
|
||||
{
|
||||
fn name(asset: T::AssetId) -> Vec<u8> {
|
||||
Metadata::<T, I>::get(asset).name.to_vec()
|
||||
@@ -231,7 +231,7 @@ impl<T: Config<I>, I: 'static> fungibles::metadata::Inspect<<T as SystemConfig>:
|
||||
}
|
||||
|
||||
impl<T: Config<I>, I: 'static> fungibles::metadata::Mutate<<T as SystemConfig>::AccountId>
|
||||
for Pallet<T, I>
|
||||
for Pezpallet<T, I>
|
||||
{
|
||||
fn set(
|
||||
asset: T::AssetId,
|
||||
@@ -247,7 +247,7 @@ impl<T: Config<I>, I: 'static> fungibles::metadata::Mutate<<T as SystemConfig>::
|
||||
impl<T: Config<I>, I: 'static>
|
||||
fungibles::metadata::MetadataDeposit<
|
||||
<T::Currency as Currency<<T as SystemConfig>::AccountId>>::Balance,
|
||||
> for Pallet<T, I>
|
||||
> for Pezpallet<T, I>
|
||||
{
|
||||
fn calc_metadata_deposit(
|
||||
name: &[u8],
|
||||
@@ -258,7 +258,7 @@ impl<T: Config<I>, I: 'static>
|
||||
}
|
||||
|
||||
impl<T: Config<I>, I: 'static> fungibles::approvals::Inspect<<T as SystemConfig>::AccountId>
|
||||
for Pallet<T, I>
|
||||
for Pezpallet<T, I>
|
||||
{
|
||||
// Check the amount approved to be spent by an owner to a delegate
|
||||
fn allowance(
|
||||
@@ -273,7 +273,7 @@ impl<T: Config<I>, I: 'static> fungibles::approvals::Inspect<<T as SystemConfig>
|
||||
}
|
||||
|
||||
impl<T: Config<I>, I: 'static> fungibles::approvals::Mutate<<T as SystemConfig>::AccountId>
|
||||
for Pallet<T, I>
|
||||
for Pezpallet<T, I>
|
||||
{
|
||||
// Approve spending tokens from a given account
|
||||
fn approve(
|
||||
@@ -297,7 +297,7 @@ impl<T: Config<I>, I: 'static> fungibles::approvals::Mutate<<T as SystemConfig>:
|
||||
}
|
||||
|
||||
impl<T: Config<I>, I: 'static> fungibles::roles::Inspect<<T as SystemConfig>::AccountId>
|
||||
for Pallet<T, I>
|
||||
for Pezpallet<T, I>
|
||||
{
|
||||
fn owner(asset: T::AssetId) -> Option<<T as SystemConfig>::AccountId> {
|
||||
Asset::<T, I>::get(asset).map(|x| x.owner)
|
||||
@@ -316,7 +316,7 @@ impl<T: Config<I>, I: 'static> fungibles::roles::Inspect<<T as SystemConfig>::Ac
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config<I>, I: 'static> fungibles::InspectEnumerable<T::AccountId> for Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> fungibles::InspectEnumerable<T::AccountId> for Pezpallet<T, I> {
|
||||
type AssetsIterator = KeyPrefixIterator<<T as Config<I>>::AssetId>;
|
||||
|
||||
/// Returns an iterator of the assets in existence.
|
||||
@@ -327,7 +327,7 @@ impl<T: Config<I>, I: 'static> fungibles::InspectEnumerable<T::AccountId> for Pa
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config<I>, I: 'static> fungibles::roles::ResetTeam<T::AccountId> for Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> fungibles::roles::ResetTeam<T::AccountId> for Pezpallet<T, I> {
|
||||
fn reset_team(
|
||||
id: T::AssetId,
|
||||
owner: T::AccountId,
|
||||
@@ -339,7 +339,7 @@ impl<T: Config<I>, I: 'static> fungibles::roles::ResetTeam<T::AccountId> for Pal
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config<I>, I: 'static> fungibles::Refund<T::AccountId> for Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> fungibles::Refund<T::AccountId> for Pezpallet<T, I> {
|
||||
type AssetId = T::AssetId;
|
||||
type Balance = DepositBalanceOf<T, I>;
|
||||
fn deposit_held(id: Self::AssetId, who: T::AccountId) -> Option<(T::AccountId, Self::Balance)> {
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Assets pallet's `StoredMap` implementation.
|
||||
//! Assets pezpallet's `StoredMap` implementation.
|
||||
|
||||
use super::*;
|
||||
|
||||
impl<T: Config<I>, I: 'static> StoredMap<(T::AssetId, T::AccountId), T::Extra> for Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> StoredMap<(T::AssetId, T::AccountId), T::Extra> for Pezpallet<T, I> {
|
||||
fn get(id_who: &(T::AssetId, T::AccountId)) -> T::Extra {
|
||||
let (id, who) = id_who;
|
||||
Account::<T, I>::get(id, who).map(|a| a.extra).unwrap_or_default()
|
||||
|
||||
@@ -15,17 +15,17 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! # Assets Pallet
|
||||
//! # Assets Pezpallet
|
||||
//!
|
||||
//! A simple, secure module for dealing with sets of assets implementing
|
||||
//! [`fungible`](pezframe_support::traits::fungible) traits, via [`fungibles`] traits.
|
||||
//!
|
||||
//! The pallet makes heavy use of concepts such as Holds and Freezes from the
|
||||
//! The pezpallet makes heavy use of concepts such as Holds and Freezes from the
|
||||
//! [`pezframe_support::traits::fungible`] traits, therefore you should read and understand those docs
|
||||
//! as a prerequisite to understanding this pallet.
|
||||
//! as a prerequisite to understanding this pezpallet.
|
||||
//!
|
||||
//! See the [`frame_tokens`] reference docs for more information about the place of the
|
||||
//! Assets pallet in FRAME.
|
||||
//! Assets pezpallet in FRAME.
|
||||
//!
|
||||
//! ## Overview
|
||||
//!
|
||||
@@ -131,7 +131,7 @@
|
||||
//! * `balance` - Get the asset `id` balance of `who`.
|
||||
//! * `total_supply` - Get the total supply of an asset `id`.
|
||||
//!
|
||||
//! Please refer to the [`Pallet`] struct for details on publicly available functions.
|
||||
//! Please refer to the [`Pezpallet`] struct for details on publicly available functions.
|
||||
//!
|
||||
//! ### Callbacks
|
||||
//!
|
||||
@@ -196,7 +196,7 @@ use pezframe_support::{
|
||||
};
|
||||
use pezframe_system::Config as SystemConfig;
|
||||
|
||||
pub use pallet::*;
|
||||
pub use pezpallet::*;
|
||||
pub use weights::WeightInfo;
|
||||
|
||||
type AccountIdLookupOf<T> = <<T as pezframe_system::Config>::Lookup as StaticLookup>::Source;
|
||||
@@ -247,8 +247,8 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
#[pezframe_support::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use super::*;
|
||||
use codec::HasCompact;
|
||||
use pezframe_support::{
|
||||
@@ -263,9 +263,9 @@ pub mod pallet {
|
||||
/// The maximum number of configurable reserve locations for one asset class.
|
||||
pub const MAX_RESERVES: u32 = 5;
|
||||
|
||||
#[pallet::pallet]
|
||||
#[pallet::storage_version(STORAGE_VERSION)]
|
||||
pub struct Pallet<T, I = ()>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
#[pezpallet::storage_version(STORAGE_VERSION)]
|
||||
pub struct Pezpallet<T, I = ()>(_);
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
pub trait BenchmarkHelper<AssetIdParameter, ReserveIdParameter> {
|
||||
@@ -316,11 +316,11 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
#[pallet::config(with_default)]
|
||||
#[pezpallet::config(with_default)]
|
||||
/// The module configuration trait.
|
||||
pub trait Config<I: 'static = ()>: pezframe_system::Config {
|
||||
/// The overarching event type.
|
||||
#[pallet::no_default_bounds]
|
||||
#[pezpallet::no_default_bounds]
|
||||
#[allow(deprecated)]
|
||||
type RuntimeEvent: From<Event<Self, I>>
|
||||
+ IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
|
||||
@@ -339,14 +339,14 @@ pub mod pallet {
|
||||
/// Max number of items to destroy per `destroy_accounts` and `destroy_approvals` call.
|
||||
///
|
||||
/// Must be configured to result in a weight that makes each call fit in a block.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type RemoveItemsLimit: Get<u32>;
|
||||
|
||||
/// Identifier for the class of asset.
|
||||
type AssetId: Member + Parameter + Clone + MaybeSerializeDeserialize + MaxEncodedLen;
|
||||
|
||||
/// Wrapper around `Self::AssetId` to use in dispatchable call signatures. Allows the use
|
||||
/// of compact encoding in instances of the pallet, which will prevent breaking changes
|
||||
/// of compact encoding in instances of the pezpallet, which will prevent breaking changes
|
||||
/// resulting from the removal of `HasCompact` from `Self::AssetId`.
|
||||
///
|
||||
/// This type includes the `From<Self::AssetId>` bound, since tightly coupled pallets may
|
||||
@@ -358,12 +358,12 @@ pub mod pallet {
|
||||
type ReserveData: Debug + Parameter + MaybeSerializeDeserialize + MaxEncodedLen;
|
||||
|
||||
/// The currency mechanism.
|
||||
#[pallet::no_default]
|
||||
#[pezpallet::no_default]
|
||||
type Currency: ReservableCurrency<Self::AccountId>;
|
||||
|
||||
/// Standard asset class creation is only allowed if the origin attempting it and the
|
||||
/// asset class are in this set.
|
||||
#[pallet::no_default]
|
||||
#[pezpallet::no_default]
|
||||
type CreateOrigin: EnsureOriginWithArg<
|
||||
Self::RuntimeOrigin,
|
||||
Self::AssetId,
|
||||
@@ -372,38 +372,38 @@ pub mod pallet {
|
||||
|
||||
/// The origin which may forcibly create or destroy an asset or otherwise alter privileged
|
||||
/// attributes.
|
||||
#[pallet::no_default]
|
||||
#[pezpallet::no_default]
|
||||
type ForceOrigin: EnsureOrigin<Self::RuntimeOrigin>;
|
||||
|
||||
/// The basic amount of funds that must be reserved for an asset.
|
||||
#[pallet::constant]
|
||||
#[pallet::no_default_bounds]
|
||||
#[pezpallet::constant]
|
||||
#[pezpallet::no_default_bounds]
|
||||
type AssetDeposit: Get<DepositBalanceOf<Self, I>>;
|
||||
|
||||
/// The amount of funds that must be reserved for a non-provider asset account to be
|
||||
/// maintained.
|
||||
#[pallet::constant]
|
||||
#[pallet::no_default_bounds]
|
||||
#[pezpallet::constant]
|
||||
#[pezpallet::no_default_bounds]
|
||||
type AssetAccountDeposit: Get<DepositBalanceOf<Self, I>>;
|
||||
|
||||
/// The basic amount of funds that must be reserved when adding metadata to your asset.
|
||||
#[pallet::constant]
|
||||
#[pallet::no_default_bounds]
|
||||
#[pezpallet::constant]
|
||||
#[pezpallet::no_default_bounds]
|
||||
type MetadataDepositBase: Get<DepositBalanceOf<Self, I>>;
|
||||
|
||||
/// The additional funds that must be reserved for the number of bytes you store in your
|
||||
/// metadata.
|
||||
#[pallet::constant]
|
||||
#[pallet::no_default_bounds]
|
||||
#[pezpallet::constant]
|
||||
#[pezpallet::no_default_bounds]
|
||||
type MetadataDepositPerByte: Get<DepositBalanceOf<Self, I>>;
|
||||
|
||||
/// The amount of funds that must be reserved when creating a new approval.
|
||||
#[pallet::constant]
|
||||
#[pallet::no_default_bounds]
|
||||
#[pezpallet::constant]
|
||||
#[pezpallet::no_default_bounds]
|
||||
type ApprovalDeposit: Get<DepositBalanceOf<Self, I>>;
|
||||
|
||||
/// The maximum length of a name or symbol stored on-chain.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type StringLimit: Get<u32>;
|
||||
|
||||
/// A hook to allow a per-asset, per-account minimum balance to be enforced. This must be
|
||||
@@ -425,7 +425,7 @@ pub mod pallet {
|
||||
/// used to set up auto-incrementing asset IDs for this collection.
|
||||
type CallbackHandle: AssetsCallback<Self::AssetId, Self::AccountId>;
|
||||
|
||||
/// Weight information for extrinsics in this pallet.
|
||||
/// Weight information for extrinsics in this pezpallet.
|
||||
type WeightInfo: WeightInfo;
|
||||
|
||||
/// Helper trait for benchmarks.
|
||||
@@ -433,7 +433,7 @@ pub mod pallet {
|
||||
type BenchmarkHelper: BenchmarkHelper<Self::AssetIdParameter, Self::ReserveData>;
|
||||
}
|
||||
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
/// Details of an asset.
|
||||
pub type Asset<T: Config<I>, I: 'static = ()> = StorageMap<
|
||||
_,
|
||||
@@ -442,7 +442,7 @@ pub mod pallet {
|
||||
AssetDetails<T::Balance, T::AccountId, DepositBalanceOf<T, I>>,
|
||||
>;
|
||||
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
/// The holdings of a specific account for a specific asset.
|
||||
pub type Account<T: Config<I>, I: 'static = ()> = StorageDoubleMap<
|
||||
_,
|
||||
@@ -453,7 +453,7 @@ pub mod pallet {
|
||||
AssetAccountOf<T, I>,
|
||||
>;
|
||||
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
/// Approved balance transfers. First balance is the amount approved for transfer. Second
|
||||
/// is the amount of `T::Currency` reserved for storing this.
|
||||
/// First key is the asset ID, second key is the owner and third key is the delegate.
|
||||
@@ -467,7 +467,7 @@ pub mod pallet {
|
||||
Approval<T::Balance, DepositBalanceOf<T, I>>,
|
||||
>;
|
||||
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
/// Metadata of an asset.
|
||||
pub type Metadata<T: Config<I>, I: 'static = ()> = StorageMap<
|
||||
_,
|
||||
@@ -478,7 +478,7 @@ pub mod pallet {
|
||||
>;
|
||||
|
||||
/// Maps an asset to a list of its configured reserve information.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type Reserves<T: Config<I>, I: 'static = ()> = StorageMap<
|
||||
_,
|
||||
Blake2_128Concat,
|
||||
@@ -496,10 +496,10 @@ pub mod pallet {
|
||||
///
|
||||
/// The initial next asset ID can be set using the [`GenesisConfig`] or the
|
||||
/// [SetNextAssetId](`migration::next_asset_id::SetNextAssetId`) migration.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type NextAssetId<T: Config<I>, I: 'static = ()> = StorageValue<_, T::AssetId, OptionQuery>;
|
||||
|
||||
#[pallet::genesis_config]
|
||||
#[pezpallet::genesis_config]
|
||||
#[derive(pezframe_support::DefaultNoBound)]
|
||||
pub struct GenesisConfig<T: Config<I>, I: 'static = ()> {
|
||||
/// Genesis assets: id, owner, is_sufficient, min_balance
|
||||
@@ -519,7 +519,7 @@ pub mod pallet {
|
||||
pub reserves: Vec<(T::AssetId, Vec<T::ReserveData>)>,
|
||||
}
|
||||
|
||||
#[pallet::genesis_build]
|
||||
#[pezpallet::genesis_build]
|
||||
impl<T: Config<I>, I: 'static> BuildGenesisConfig for GenesisConfig<T, I> {
|
||||
fn build(&self) {
|
||||
for (id, owner, is_sufficient, min_balance) in &self.assets {
|
||||
@@ -563,7 +563,7 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
for (id, account_id, amount) in &self.accounts {
|
||||
let result = <Pallet<T, I>>::increase_balance(
|
||||
let result = <Pezpallet<T, I>>::increase_balance(
|
||||
id.clone(),
|
||||
account_id,
|
||||
*amount,
|
||||
@@ -591,8 +591,8 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
#[pallet::event]
|
||||
#[pallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
#[pezpallet::event]
|
||||
#[pezpallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
pub enum Event<T: Config<I>, I: 'static = ()> {
|
||||
/// Some asset class was created.
|
||||
Created { asset_id: T::AssetId, creator: T::AccountId, owner: T::AccountId },
|
||||
@@ -684,7 +684,7 @@ pub mod pallet {
|
||||
ReservesRemoved { asset_id: T::AssetId },
|
||||
}
|
||||
|
||||
#[pallet::error]
|
||||
#[pezpallet::error]
|
||||
pub enum Error<T, I = ()> {
|
||||
/// Account balance must be greater than or equal to the transfer amount.
|
||||
BalanceLow,
|
||||
@@ -739,8 +739,8 @@ pub mod pallet {
|
||||
TooManyReserves,
|
||||
}
|
||||
|
||||
#[pallet::call(weight(<T as Config<I>>::WeightInfo))]
|
||||
impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
#[pezpallet::call(weight(<T as Config<I>>::WeightInfo))]
|
||||
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
|
||||
/// Issue a new class of fungible assets from a public origin.
|
||||
///
|
||||
/// This new asset class has no assets initially and its owner is the origin.
|
||||
@@ -760,7 +760,7 @@ pub mod pallet {
|
||||
/// Emits `Created` event when successful.
|
||||
///
|
||||
/// Weight: `O(1)`
|
||||
#[pallet::call_index(0)]
|
||||
#[pezpallet::call_index(0)]
|
||||
pub fn create(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
@@ -827,13 +827,13 @@ pub mod pallet {
|
||||
/// Emits `ForceCreated` event when successful.
|
||||
///
|
||||
/// Weight: `O(1)`
|
||||
#[pallet::call_index(1)]
|
||||
#[pezpallet::call_index(1)]
|
||||
pub fn force_create(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
owner: AccountIdLookupOf<T>,
|
||||
is_sufficient: bool,
|
||||
#[pallet::compact] min_balance: T::Balance,
|
||||
#[pezpallet::compact] min_balance: T::Balance,
|
||||
) -> DispatchResult {
|
||||
T::ForceOrigin::ensure_origin(origin)?;
|
||||
let owner = T::Lookup::lookup(owner)?;
|
||||
@@ -853,7 +853,7 @@ pub mod pallet {
|
||||
///
|
||||
/// It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if
|
||||
/// an account contains holds or freezes in place.
|
||||
#[pallet::call_index(2)]
|
||||
#[pezpallet::call_index(2)]
|
||||
pub fn start_destroy(origin: OriginFor<T>, id: T::AssetIdParameter) -> DispatchResult {
|
||||
let maybe_check_owner = match T::ForceOrigin::try_origin(origin) {
|
||||
Ok(_) => None,
|
||||
@@ -875,8 +875,8 @@ pub mod pallet {
|
||||
/// asset.
|
||||
///
|
||||
/// Each call emits the `Event::DestroyedAccounts` event.
|
||||
#[pallet::call_index(3)]
|
||||
#[pallet::weight(T::WeightInfo::destroy_accounts(T::RemoveItemsLimit::get()))]
|
||||
#[pezpallet::call_index(3)]
|
||||
#[pezpallet::weight(T::WeightInfo::destroy_accounts(T::RemoveItemsLimit::get()))]
|
||||
pub fn destroy_accounts(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
@@ -899,8 +899,8 @@ pub mod pallet {
|
||||
/// asset.
|
||||
///
|
||||
/// Each call emits the `Event::DestroyedApprovals` event.
|
||||
#[pallet::call_index(4)]
|
||||
#[pallet::weight(T::WeightInfo::destroy_approvals(T::RemoveItemsLimit::get()))]
|
||||
#[pezpallet::call_index(4)]
|
||||
#[pezpallet::weight(T::WeightInfo::destroy_approvals(T::RemoveItemsLimit::get()))]
|
||||
pub fn destroy_approvals(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
@@ -921,7 +921,7 @@ pub mod pallet {
|
||||
/// asset.
|
||||
///
|
||||
/// Each successful call emits the `Event::Destroyed` event.
|
||||
#[pallet::call_index(5)]
|
||||
#[pezpallet::call_index(5)]
|
||||
pub fn finish_destroy(origin: OriginFor<T>, id: T::AssetIdParameter) -> DispatchResult {
|
||||
ensure_signed(origin)?;
|
||||
let id: T::AssetId = id.into();
|
||||
@@ -940,12 +940,12 @@ pub mod pallet {
|
||||
///
|
||||
/// Weight: `O(1)`
|
||||
/// Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`.
|
||||
#[pallet::call_index(6)]
|
||||
#[pezpallet::call_index(6)]
|
||||
pub fn mint(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
beneficiary: AccountIdLookupOf<T>,
|
||||
#[pallet::compact] amount: T::Balance,
|
||||
#[pezpallet::compact] amount: T::Balance,
|
||||
) -> DispatchResult {
|
||||
let origin = ensure_signed(origin)?;
|
||||
let beneficiary = T::Lookup::lookup(beneficiary)?;
|
||||
@@ -969,12 +969,12 @@ pub mod pallet {
|
||||
///
|
||||
/// Weight: `O(1)`
|
||||
/// Modes: Post-existence of `who`; Pre & post Zombie-status of `who`.
|
||||
#[pallet::call_index(7)]
|
||||
#[pezpallet::call_index(7)]
|
||||
pub fn burn(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
who: AccountIdLookupOf<T>,
|
||||
#[pallet::compact] amount: T::Balance,
|
||||
#[pezpallet::compact] amount: T::Balance,
|
||||
) -> DispatchResult {
|
||||
let origin = ensure_signed(origin)?;
|
||||
let who = T::Lookup::lookup(who)?;
|
||||
@@ -1003,12 +1003,12 @@ pub mod pallet {
|
||||
/// Weight: `O(1)`
|
||||
/// Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of
|
||||
/// `target`.
|
||||
#[pallet::call_index(8)]
|
||||
#[pezpallet::call_index(8)]
|
||||
pub fn transfer(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
target: AccountIdLookupOf<T>,
|
||||
#[pallet::compact] amount: T::Balance,
|
||||
#[pezpallet::compact] amount: T::Balance,
|
||||
) -> DispatchResult {
|
||||
let origin = ensure_signed(origin)?;
|
||||
let dest = T::Lookup::lookup(target)?;
|
||||
@@ -1036,12 +1036,12 @@ pub mod pallet {
|
||||
/// Weight: `O(1)`
|
||||
/// Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of
|
||||
/// `target`.
|
||||
#[pallet::call_index(9)]
|
||||
#[pezpallet::call_index(9)]
|
||||
pub fn transfer_keep_alive(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
target: AccountIdLookupOf<T>,
|
||||
#[pallet::compact] amount: T::Balance,
|
||||
#[pezpallet::compact] amount: T::Balance,
|
||||
) -> DispatchResult {
|
||||
let source = ensure_signed(origin)?;
|
||||
let dest = T::Lookup::lookup(target)?;
|
||||
@@ -1070,13 +1070,13 @@ pub mod pallet {
|
||||
/// Weight: `O(1)`
|
||||
/// Modes: Pre-existence of `dest`; Post-existence of `source`; Account pre-existence of
|
||||
/// `dest`.
|
||||
#[pallet::call_index(10)]
|
||||
#[pezpallet::call_index(10)]
|
||||
pub fn force_transfer(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
source: AccountIdLookupOf<T>,
|
||||
dest: AccountIdLookupOf<T>,
|
||||
#[pallet::compact] amount: T::Balance,
|
||||
#[pezpallet::compact] amount: T::Balance,
|
||||
) -> DispatchResult {
|
||||
let origin = ensure_signed(origin)?;
|
||||
let source = T::Lookup::lookup(source)?;
|
||||
@@ -1099,7 +1099,7 @@ pub mod pallet {
|
||||
/// Emits `Frozen`.
|
||||
///
|
||||
/// Weight: `O(1)`
|
||||
#[pallet::call_index(11)]
|
||||
#[pezpallet::call_index(11)]
|
||||
pub fn freeze(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
@@ -1136,7 +1136,7 @@ pub mod pallet {
|
||||
/// Emits `Thawed`.
|
||||
///
|
||||
/// Weight: `O(1)`
|
||||
#[pallet::call_index(12)]
|
||||
#[pezpallet::call_index(12)]
|
||||
pub fn thaw(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
@@ -1172,7 +1172,7 @@ pub mod pallet {
|
||||
/// Emits `Frozen`.
|
||||
///
|
||||
/// Weight: `O(1)`
|
||||
#[pallet::call_index(13)]
|
||||
#[pezpallet::call_index(13)]
|
||||
pub fn freeze_asset(origin: OriginFor<T>, id: T::AssetIdParameter) -> DispatchResult {
|
||||
let origin = ensure_signed(origin)?;
|
||||
let id: T::AssetId = id.into();
|
||||
@@ -1198,7 +1198,7 @@ pub mod pallet {
|
||||
/// Emits `Thawed`.
|
||||
///
|
||||
/// Weight: `O(1)`
|
||||
#[pallet::call_index(14)]
|
||||
#[pezpallet::call_index(14)]
|
||||
pub fn thaw_asset(origin: OriginFor<T>, id: T::AssetIdParameter) -> DispatchResult {
|
||||
let origin = ensure_signed(origin)?;
|
||||
let id: T::AssetId = id.into();
|
||||
@@ -1225,7 +1225,7 @@ pub mod pallet {
|
||||
/// Emits `OwnerChanged`.
|
||||
///
|
||||
/// Weight: `O(1)`
|
||||
#[pallet::call_index(15)]
|
||||
#[pezpallet::call_index(15)]
|
||||
pub fn transfer_ownership(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
@@ -1268,7 +1268,7 @@ pub mod pallet {
|
||||
/// Emits `TeamChanged`.
|
||||
///
|
||||
/// Weight: `O(1)`
|
||||
#[pallet::call_index(16)]
|
||||
#[pezpallet::call_index(16)]
|
||||
pub fn set_team(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
@@ -1312,8 +1312,8 @@ pub mod pallet {
|
||||
/// Emits `MetadataSet`.
|
||||
///
|
||||
/// Weight: `O(1)`
|
||||
#[pallet::call_index(17)]
|
||||
#[pallet::weight(T::WeightInfo::set_metadata(name.len() as u32, symbol.len() as u32))]
|
||||
#[pezpallet::call_index(17)]
|
||||
#[pezpallet::weight(T::WeightInfo::set_metadata(name.len() as u32, symbol.len() as u32))]
|
||||
pub fn set_metadata(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
@@ -1337,7 +1337,7 @@ pub mod pallet {
|
||||
/// Emits `MetadataCleared`.
|
||||
///
|
||||
/// Weight: `O(1)`
|
||||
#[pallet::call_index(18)]
|
||||
#[pezpallet::call_index(18)]
|
||||
pub fn clear_metadata(origin: OriginFor<T>, id: T::AssetIdParameter) -> DispatchResult {
|
||||
let origin = ensure_signed(origin)?;
|
||||
let id: T::AssetId = id.into();
|
||||
@@ -1368,8 +1368,8 @@ pub mod pallet {
|
||||
/// Emits `MetadataSet`.
|
||||
///
|
||||
/// Weight: `O(N + S)` where N and S are the length of the name and symbol respectively.
|
||||
#[pallet::call_index(19)]
|
||||
#[pallet::weight(T::WeightInfo::force_set_metadata(name.len() as u32, symbol.len() as u32))]
|
||||
#[pezpallet::call_index(19)]
|
||||
#[pezpallet::weight(T::WeightInfo::force_set_metadata(name.len() as u32, symbol.len() as u32))]
|
||||
pub fn force_set_metadata(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
@@ -1420,7 +1420,7 @@ pub mod pallet {
|
||||
/// Emits `MetadataCleared`.
|
||||
///
|
||||
/// Weight: `O(1)`
|
||||
#[pallet::call_index(20)]
|
||||
#[pezpallet::call_index(20)]
|
||||
pub fn force_clear_metadata(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
@@ -1451,7 +1451,7 @@ pub mod pallet {
|
||||
/// - `is_sufficient`: Whether a non-zero balance of this asset is deposit of sufficient
|
||||
/// value to account for the state bloat associated with its balance storage. If set to
|
||||
/// `true`, then non-zero balances may be stored without a `consumer` reference (and thus
|
||||
/// an ED in the Balances pallet or whatever else is used to control user-account state
|
||||
/// an ED in the Balances pezpallet or whatever else is used to control user-account state
|
||||
/// growth).
|
||||
/// - `is_frozen`: Whether this asset class is frozen except for permissioned/admin
|
||||
/// instructions.
|
||||
@@ -1459,7 +1459,7 @@ pub mod pallet {
|
||||
/// Emits `AssetStatusChanged` with the identity of the asset.
|
||||
///
|
||||
/// Weight: `O(1)`
|
||||
#[pallet::call_index(21)]
|
||||
#[pezpallet::call_index(21)]
|
||||
pub fn force_asset_status(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
@@ -1467,7 +1467,7 @@ pub mod pallet {
|
||||
issuer: AccountIdLookupOf<T>,
|
||||
admin: AccountIdLookupOf<T>,
|
||||
freezer: AccountIdLookupOf<T>,
|
||||
#[pallet::compact] min_balance: T::Balance,
|
||||
#[pezpallet::compact] min_balance: T::Balance,
|
||||
is_sufficient: bool,
|
||||
is_frozen: bool,
|
||||
) -> DispatchResult {
|
||||
@@ -1515,12 +1515,12 @@ pub mod pallet {
|
||||
/// Emits `ApprovedTransfer` on success.
|
||||
///
|
||||
/// Weight: `O(1)`
|
||||
#[pallet::call_index(22)]
|
||||
#[pezpallet::call_index(22)]
|
||||
pub fn approve_transfer(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
delegate: AccountIdLookupOf<T>,
|
||||
#[pallet::compact] amount: T::Balance,
|
||||
#[pezpallet::compact] amount: T::Balance,
|
||||
) -> DispatchResult {
|
||||
let owner = ensure_signed(origin)?;
|
||||
let delegate = T::Lookup::lookup(delegate)?;
|
||||
@@ -1541,7 +1541,7 @@ pub mod pallet {
|
||||
/// Emits `ApprovalCancelled` on success.
|
||||
///
|
||||
/// Weight: `O(1)`
|
||||
#[pallet::call_index(23)]
|
||||
#[pezpallet::call_index(23)]
|
||||
pub fn cancel_approval(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
@@ -1577,7 +1577,7 @@ pub mod pallet {
|
||||
/// Emits `ApprovalCancelled` on success.
|
||||
///
|
||||
/// Weight: `O(1)`
|
||||
#[pallet::call_index(24)]
|
||||
#[pezpallet::call_index(24)]
|
||||
pub fn force_cancel_approval(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
@@ -1626,13 +1626,13 @@ pub mod pallet {
|
||||
/// Emits `TransferredApproved` on success.
|
||||
///
|
||||
/// Weight: `O(1)`
|
||||
#[pallet::call_index(25)]
|
||||
#[pezpallet::call_index(25)]
|
||||
pub fn transfer_approved(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
owner: AccountIdLookupOf<T>,
|
||||
destination: AccountIdLookupOf<T>,
|
||||
#[pallet::compact] amount: T::Balance,
|
||||
#[pezpallet::compact] amount: T::Balance,
|
||||
) -> DispatchResult {
|
||||
let delegate = ensure_signed(origin)?;
|
||||
let owner = T::Lookup::lookup(owner)?;
|
||||
@@ -1650,8 +1650,8 @@ pub mod pallet {
|
||||
/// - `id`: The identifier of the asset for the account to be created.
|
||||
///
|
||||
/// Emits `Touched` event when successful.
|
||||
#[pallet::call_index(26)]
|
||||
#[pallet::weight(T::WeightInfo::touch())]
|
||||
#[pezpallet::call_index(26)]
|
||||
#[pezpallet::weight(T::WeightInfo::touch())]
|
||||
pub fn touch(origin: OriginFor<T>, id: T::AssetIdParameter) -> DispatchResult {
|
||||
let who = ensure_signed(origin)?;
|
||||
let id: T::AssetId = id.into();
|
||||
@@ -1671,8 +1671,8 @@ pub mod pallet {
|
||||
/// the asset account contains holds or freezes in place.
|
||||
///
|
||||
/// Emits `Refunded` event when successful.
|
||||
#[pallet::call_index(27)]
|
||||
#[pallet::weight(T::WeightInfo::refund())]
|
||||
#[pezpallet::call_index(27)]
|
||||
#[pezpallet::weight(T::WeightInfo::refund())]
|
||||
pub fn refund(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
@@ -1694,7 +1694,7 @@ pub mod pallet {
|
||||
/// - `min_balance`: The new value of `min_balance`.
|
||||
///
|
||||
/// Emits `AssetMinBalanceChanged` event when successful.
|
||||
#[pallet::call_index(28)]
|
||||
#[pezpallet::call_index(28)]
|
||||
pub fn set_min_balance(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
@@ -1739,8 +1739,8 @@ pub mod pallet {
|
||||
/// - `who`: The account to be created.
|
||||
///
|
||||
/// Emits `Touched` event when successful.
|
||||
#[pallet::call_index(29)]
|
||||
#[pallet::weight(T::WeightInfo::touch_other())]
|
||||
#[pezpallet::call_index(29)]
|
||||
#[pezpallet::weight(T::WeightInfo::touch_other())]
|
||||
pub fn touch_other(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
@@ -1765,8 +1765,8 @@ pub mod pallet {
|
||||
/// the asset account contains holds or freezes in place.
|
||||
///
|
||||
/// Emits `Refunded` event when successful.
|
||||
#[pallet::call_index(30)]
|
||||
#[pallet::weight(T::WeightInfo::refund_other())]
|
||||
#[pezpallet::call_index(30)]
|
||||
#[pezpallet::weight(T::WeightInfo::refund_other())]
|
||||
pub fn refund_other(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
@@ -1788,7 +1788,7 @@ pub mod pallet {
|
||||
/// Emits `Blocked`.
|
||||
///
|
||||
/// Weight: `O(1)`
|
||||
#[pallet::call_index(31)]
|
||||
#[pezpallet::call_index(31)]
|
||||
pub fn block(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
@@ -1831,8 +1831,8 @@ pub mod pallet {
|
||||
/// of the funds the asset account has, causing the sender asset account to be killed
|
||||
/// (false), or transfer everything except at least the minimum balance, which will
|
||||
/// guarantee to keep the sender asset account alive (true).
|
||||
#[pallet::call_index(32)]
|
||||
#[pallet::weight(T::WeightInfo::transfer_all())]
|
||||
#[pezpallet::call_index(32)]
|
||||
#[pezpallet::weight(T::WeightInfo::transfer_all())]
|
||||
pub fn transfer_all(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
@@ -1867,8 +1867,8 @@ pub mod pallet {
|
||||
/// - `reserves`: The full list of trusted reserves information.
|
||||
///
|
||||
/// Emits `AssetMinBalanceChanged` event when successful.
|
||||
#[pallet::call_index(33)]
|
||||
#[pallet::weight(T::WeightInfo::set_reserves())]
|
||||
#[pezpallet::call_index(33)]
|
||||
#[pezpallet::weight(T::WeightInfo::set_reserves())]
|
||||
pub fn set_reserves(
|
||||
origin: OriginFor<T>,
|
||||
id: T::AssetIdParameter,
|
||||
@@ -1886,8 +1886,8 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
#[pallet::view_functions]
|
||||
impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
#[pezpallet::view_functions]
|
||||
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
|
||||
/// Provide the asset details for asset `id`.
|
||||
pub fn asset_details(
|
||||
id: T::AssetId,
|
||||
@@ -1915,7 +1915,7 @@ pub mod pallet {
|
||||
|
||||
/// Implements [`AccountTouch`] trait.
|
||||
/// Note that a depositor can be any account, without any specific privilege.
|
||||
impl<T: Config<I>, I: 'static> AccountTouch<T::AssetId, T::AccountId> for Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> AccountTouch<T::AssetId, T::AccountId> for Pezpallet<T, I> {
|
||||
type Balance = DepositBalanceOf<T, I>;
|
||||
|
||||
fn deposit_required(_: T::AssetId) -> Self::Balance {
|
||||
@@ -1926,7 +1926,7 @@ pub mod pallet {
|
||||
match Asset::<T, I>::get(&asset) {
|
||||
// refer to the [`Self::new_account`] function for more details.
|
||||
Some(info) if info.is_sufficient => false,
|
||||
Some(_) if pezframe_system::Pallet::<T>::can_accrue_consumers(who, 2) => false,
|
||||
Some(_) if pezframe_system::Pezpallet::<T>::can_accrue_consumers(who, 2) => false,
|
||||
Some(_) => !Account::<T, I>::contains_key(asset, who),
|
||||
_ => true,
|
||||
}
|
||||
@@ -1942,7 +1942,7 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
/// Implements [`ContainsPair`] trait for a pair of asset and account IDs.
|
||||
impl<T: Config<I>, I: 'static> ContainsPair<T::AssetId, T::AccountId> for Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> ContainsPair<T::AssetId, T::AccountId> for Pezpallet<T, I> {
|
||||
/// Check if an account with the given asset ID and account address exists.
|
||||
fn contains(asset: &T::AssetId, who: &T::AccountId) -> bool {
|
||||
Account::<T, I>::contains_key(asset, who)
|
||||
@@ -1951,7 +1951,7 @@ pub mod pallet {
|
||||
|
||||
/// Implements [`ProvideAssetReserves`] trait for getting the list of trusted reserves for a
|
||||
/// given asset.
|
||||
impl<T: Config<I>, I: 'static> ProvideAssetReserves<T::AssetId, T::ReserveData> for Pallet<T, I> {
|
||||
impl<T: Config<I>, I: 'static> ProvideAssetReserves<T::AssetId, T::ReserveData> for Pezpallet<T, I> {
|
||||
/// Provide the configured reserves for asset `id`.
|
||||
fn reserves(id: &T::AssetId) -> Vec<T::ReserveData> {
|
||||
Reserves::<T, I>::get(id).into_inner()
|
||||
|
||||
@@ -91,8 +91,8 @@ pub mod v1 {
|
||||
pub struct MigrateToV1<T>(core::marker::PhantomData<T>);
|
||||
impl<T: Config> OnRuntimeUpgrade for MigrateToV1<T> {
|
||||
fn on_runtime_upgrade() -> Weight {
|
||||
let in_code_version = Pallet::<T>::in_code_storage_version();
|
||||
let on_chain_version = Pallet::<T>::on_chain_storage_version();
|
||||
let in_code_version = Pezpallet::<T>::in_code_storage_version();
|
||||
let on_chain_version = Pezpallet::<T>::on_chain_storage_version();
|
||||
if on_chain_version == 0 && in_code_version == 1 {
|
||||
let mut translated = 0u64;
|
||||
Asset::<T>::translate::<
|
||||
@@ -102,7 +102,7 @@ pub mod v1 {
|
||||
translated.saturating_inc();
|
||||
Some(old_value.migrate_to_v1())
|
||||
});
|
||||
in_code_version.put::<Pallet<T>>();
|
||||
in_code_version.put::<Pezpallet<T>>();
|
||||
log::info!(
|
||||
target: LOG_TARGET,
|
||||
"Upgraded {} pools, storage to version {:?}",
|
||||
@@ -122,7 +122,7 @@ pub mod v1 {
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn pre_upgrade() -> Result<Vec<u8>, TryRuntimeError> {
|
||||
pezframe_support::ensure!(
|
||||
Pallet::<T>::on_chain_storage_version() == 0,
|
||||
Pezpallet::<T>::on_chain_storage_version() == 0,
|
||||
"must upgrade linearly"
|
||||
);
|
||||
let prev_count = Asset::<T>::iter().count();
|
||||
@@ -140,8 +140,8 @@ pub mod v1 {
|
||||
"the asset count before and after the migration should be the same"
|
||||
);
|
||||
|
||||
let in_code_version = Pallet::<T>::in_code_storage_version();
|
||||
let on_chain_version = Pallet::<T>::on_chain_storage_version();
|
||||
let in_code_version = Pezpallet::<T>::in_code_storage_version();
|
||||
let on_chain_version = Pezpallet::<T>::on_chain_storage_version();
|
||||
|
||||
pezframe_support::ensure!(in_code_version == 1, "must_upgrade");
|
||||
ensure!(
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Test environment for Assets pallet.
|
||||
//! Test environment for Assets pezpallet.
|
||||
|
||||
use super::*;
|
||||
use crate as pezpallet_assets;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Tests for Assets pallet.
|
||||
//! Tests for Assets pezpallet.
|
||||
|
||||
use super::*;
|
||||
use crate::{mock::*, Error};
|
||||
@@ -2049,8 +2049,8 @@ fn asset_create_and_destroy_is_reverted_if_callback_fails() {
|
||||
#[test]
|
||||
fn multiple_transfer_alls_work_ok() {
|
||||
new_test_ext().execute_with(|| {
|
||||
// Only run PoC when the system pallet is enabled, since the underlying bug is in the
|
||||
// system pallet it won't work with BalancesAccountStore
|
||||
// Only run PoC when the system pezpallet is enabled, since the underlying bug is in the
|
||||
// system pezpallet it won't work with BalancesAccountStore
|
||||
// Start with a balance of 100
|
||||
Balances::force_set_balance(RuntimeOrigin::root(), 1, 100).unwrap();
|
||||
// Emulate a sufficient, in reality this could be reached by transferring a sufficient
|
||||
@@ -2160,7 +2160,7 @@ fn asset_id_cannot_be_reused() {
|
||||
assert!(!Asset::<Test>::contains_key(0));
|
||||
|
||||
// Enable auto increment. Next asset id must be 5.
|
||||
pallet::NextAssetId::<Test>::put(5);
|
||||
pezpallet::NextAssetId::<Test>::put(5);
|
||||
|
||||
assert_noop!(Assets::create(RuntimeOrigin::signed(1), 0, 1, 1), Error::<Test>::BadAssetId);
|
||||
assert_noop!(Assets::create(RuntimeOrigin::signed(1), 1, 1, 1), Error::<Test>::BadAssetId);
|
||||
|
||||
@@ -70,7 +70,7 @@ type LeftFungibles<T> = fungibles::UnionOf<RightFungible<T>, T, ConvertToValue<L
|
||||
///
|
||||
/// By using this type, we can navigate through each branch of [`fungible::UnionOf`],
|
||||
/// [`fungibles::UnionOf`], and [`ItemOf`] to access the underlying `fungibles::*`
|
||||
/// implementation provided by the pallet.
|
||||
/// implementation provided by the pezpallet.
|
||||
type First<T> = fungibles::UnionOf<T, LeftFungibles<T>, ConvertToValue<RightAsset>, (), u64>;
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Various basic types for use in the assets pallet.
|
||||
//! Various basic types for use in the assets pezpallet.
|
||||
|
||||
use super::*;
|
||||
use pezframe_support::{
|
||||
@@ -183,7 +183,7 @@ pub struct AssetAccount<Balance, DepositBalance, Extra, AccountId> {
|
||||
pub status: AccountStatus,
|
||||
/// The reason for the existence of the account.
|
||||
pub reason: ExistenceReason<DepositBalance, AccountId>,
|
||||
/// Additional "sidecar" data, in case some other pallet wants to use this storage item.
|
||||
/// Additional "sidecar" data, in case some other pezpallet wants to use this storage item.
|
||||
pub extra: Extra,
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ pub enum ConversionError {
|
||||
|
||||
// Type alias for `pezframe_system`'s account id.
|
||||
type AccountIdOf<T> = <T as pezframe_system::Config>::AccountId;
|
||||
// This pallet's asset id and balance type.
|
||||
// This pezpallet's asset id and balance type.
|
||||
type AssetIdOf<T, I> = <T as Config<I>>::AssetId;
|
||||
type AssetBalanceOf<T, I> = <T as Config<I>>::Balance;
|
||||
// Generic fungible balance type.
|
||||
|
||||
@@ -44,10 +44,10 @@
|
||||
// frame-omni-bencher
|
||||
// v1
|
||||
// benchmark
|
||||
// pallet
|
||||
// pezpallet
|
||||
// --extrinsic=*
|
||||
// --runtime=target/production/wbuild/pez-kitchensink-runtime/pez_kitchensink_runtime.wasm
|
||||
// --pallet=pezpallet_assets
|
||||
// --pezpallet=pezpallet_assets
|
||||
// --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2
|
||||
// --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/assets/src/weights.rs
|
||||
// --wasm-execution=compiled
|
||||
|
||||
@@ -6,7 +6,7 @@ edition.workspace = true
|
||||
license = "Apache-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
description = "FRAME atomic swap pallet"
|
||||
description = "FRAME atomic swap pezpallet"
|
||||
readme = "README.md"
|
||||
documentation = "https://docs.rs/pezpallet-atomic-swap"
|
||||
|
||||
|
||||
@@ -17,15 +17,15 @@
|
||||
|
||||
//! # Atomic Swap
|
||||
//!
|
||||
//! A pallet for atomically sending funds.
|
||||
//! A pezpallet for atomically sending funds.
|
||||
//!
|
||||
//! - [`Config`]
|
||||
//! - [`Call`]
|
||||
//! - [`Pallet`]
|
||||
//! - [`Pezpallet`]
|
||||
//!
|
||||
//! ## Overview
|
||||
//!
|
||||
//! A pallet for atomically sending funds from an origin to a target. A proof
|
||||
//! A pezpallet for atomically sending funds from an origin to a target. A proof
|
||||
//! is used to allow the target to approve (claim) the swap. If the swap is not
|
||||
//! claimed within a specified duration of time, the sender may cancel it.
|
||||
//!
|
||||
@@ -171,14 +171,14 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
pub use pallet::*;
|
||||
pub use pezpallet::*;
|
||||
|
||||
#[frame::pallet]
|
||||
pub mod pallet {
|
||||
#[frame::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use super::*;
|
||||
|
||||
/// Atomic swap's pallet configuration trait.
|
||||
#[pallet::config]
|
||||
/// Atomic swap's pezpallet configuration trait.
|
||||
#[pezpallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
/// The overarching event type.
|
||||
#[allow(deprecated)]
|
||||
@@ -195,14 +195,14 @@ pub mod pallet {
|
||||
/// If B sees A is on a blockchain with larger proof length limit, then it should kindly
|
||||
/// refuse to accept the atomic swap request if A generates the proof, and asks that B
|
||||
/// generates the proof instead.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type ProofLimit: Get<u32>;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T>(_);
|
||||
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type PendingSwaps<T: Config> = StorageDoubleMap<
|
||||
_,
|
||||
Twox64Concat,
|
||||
@@ -212,7 +212,7 @@ pub mod pallet {
|
||||
PendingSwap<T>,
|
||||
>;
|
||||
|
||||
#[pallet::error]
|
||||
#[pezpallet::error]
|
||||
pub enum Error<T> {
|
||||
/// Swap already exists.
|
||||
AlreadyExist,
|
||||
@@ -232,9 +232,9 @@ pub mod pallet {
|
||||
DurationNotPassed,
|
||||
}
|
||||
|
||||
/// Event of atomic swap pallet.
|
||||
#[pallet::event]
|
||||
#[pallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
/// Event of atomic swap pezpallet.
|
||||
#[pezpallet::event]
|
||||
#[pezpallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
pub enum Event<T: Config> {
|
||||
/// Swap created.
|
||||
NewSwap { account: T::AccountId, proof: HashedProof, swap: PendingSwap<T> },
|
||||
@@ -244,8 +244,8 @@ pub mod pallet {
|
||||
SwapCancelled { account: T::AccountId, proof: HashedProof },
|
||||
}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pezpallet::call]
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// Register a new atomic swap, declaring an intention to send funds from origin to target
|
||||
/// on the current blockchain. The target can claim the fund using the revealed proof. If
|
||||
/// the fund is not claimed after `duration` blocks, then the sender can cancel the swap.
|
||||
@@ -258,8 +258,8 @@ pub mod pallet {
|
||||
/// - `duration`: Locked duration of the atomic swap. For safety reasons, it is recommended
|
||||
/// that the revealer uses a shorter duration than the counterparty, to prevent the
|
||||
/// situation where the revealer reveals the proof too late around the end block.
|
||||
#[pallet::call_index(0)]
|
||||
#[pallet::weight(T::DbWeight::get().reads_writes(1, 1).ref_time().saturating_add(40_000_000))]
|
||||
#[pezpallet::call_index(0)]
|
||||
#[pezpallet::weight(T::DbWeight::get().reads_writes(1, 1).ref_time().saturating_add(40_000_000))]
|
||||
pub fn create_swap(
|
||||
origin: OriginFor<T>,
|
||||
target: T::AccountId,
|
||||
@@ -278,7 +278,7 @@ pub mod pallet {
|
||||
let swap = PendingSwap {
|
||||
source,
|
||||
action,
|
||||
end_block: pezframe_system::Pallet::<T>::block_number() + duration,
|
||||
end_block: pezframe_system::Pezpallet::<T>::block_number() + duration,
|
||||
};
|
||||
PendingSwaps::<T>::insert(target.clone(), hashed_proof, swap.clone());
|
||||
|
||||
@@ -294,8 +294,8 @@ pub mod pallet {
|
||||
/// - `proof`: Revealed proof of the claim.
|
||||
/// - `action`: Action defined in the swap, it must match the entry in blockchain. Otherwise
|
||||
/// the operation fails. This is used for weight calculation.
|
||||
#[pallet::call_index(1)]
|
||||
#[pallet::weight(
|
||||
#[pezpallet::call_index(1)]
|
||||
#[pezpallet::weight(
|
||||
T::DbWeight::get().reads_writes(1, 1)
|
||||
.saturating_add(action.weight())
|
||||
.ref_time()
|
||||
@@ -335,8 +335,8 @@ pub mod pallet {
|
||||
///
|
||||
/// - `target`: Target of the original atomic swap.
|
||||
/// - `hashed_proof`: Hashed proof of the original atomic swap.
|
||||
#[pallet::call_index(2)]
|
||||
#[pallet::weight(T::DbWeight::get().reads_writes(1, 1).ref_time().saturating_add(40_000_000))]
|
||||
#[pezpallet::call_index(2)]
|
||||
#[pezpallet::weight(T::DbWeight::get().reads_writes(1, 1).ref_time().saturating_add(40_000_000))]
|
||||
pub fn cancel_swap(
|
||||
origin: OriginFor<T>,
|
||||
target: T::AccountId,
|
||||
@@ -347,7 +347,7 @@ pub mod pallet {
|
||||
let swap = PendingSwaps::<T>::get(&target, hashed_proof).ok_or(Error::<T>::NotExist)?;
|
||||
ensure!(swap.source == source, Error::<T>::SourceMismatch);
|
||||
ensure!(
|
||||
pezframe_system::Pallet::<T>::block_number() >= swap.end_block,
|
||||
pezframe_system::Pezpallet::<T>::block_number() >= swap.end_block,
|
||||
Error::<T>::DurationNotPassed,
|
||||
);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ edition.workspace = true
|
||||
license = "Apache-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
description = "FRAME AURA consensus pallet"
|
||||
description = "FRAME AURA consensus pezpallet"
|
||||
readme = "README.md"
|
||||
documentation = "https://docs.rs/pezpallet-aura"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Aura Module
|
||||
|
||||
- [`aura::Config`](https://docs.rs/pezpallet-aura/latest/pallet_aura/pallet/trait.Config.html)
|
||||
- [`Pallet`](https://docs.rs/pezpallet-aura/latest/pallet_aura/pallet/struct.Pallet.html)
|
||||
- [`aura::Config`](https://docs.rs/pezpallet-aura/latest/pallet_aura/pezpallet/trait.Config.html)
|
||||
- [`Pezpallet`](https://docs.rs/pezpallet-aura/latest/pallet_aura/pezpallet/struct.Pezpallet.html)
|
||||
|
||||
## Overview
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
//! # Aura Module
|
||||
//!
|
||||
//! - [`Config`]
|
||||
//! - [`Pallet`]
|
||||
//! - [`Pezpallet`]
|
||||
//!
|
||||
//! ## Overview
|
||||
//!
|
||||
@@ -58,7 +58,7 @@ pub mod migrations;
|
||||
mod mock;
|
||||
mod tests;
|
||||
|
||||
pub use pallet::*;
|
||||
pub use pezpallet::*;
|
||||
|
||||
const LOG_TARGET: &str = "runtime::aura";
|
||||
|
||||
@@ -66,7 +66,7 @@ const LOG_TARGET: &str = "runtime::aura";
|
||||
/// [`pezpallet_timestamp::Config::MinimumPeriod`] by multiplying it by two, to ensure
|
||||
/// that authors have the majority of their slot to author within.
|
||||
///
|
||||
/// This was the default behavior of the Aura pallet and may be used for
|
||||
/// This was the default behavior of the Aura pezpallet and may be used for
|
||||
/// backwards compatibility.
|
||||
pub struct MinimumPeriodTimesTwo<T>(core::marker::PhantomData<T>);
|
||||
|
||||
@@ -76,13 +76,13 @@ impl<T: pezpallet_timestamp::Config> Get<T::Moment> for MinimumPeriodTimesTwo<T>
|
||||
}
|
||||
}
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
#[pezframe_support::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use super::*;
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::config]
|
||||
#[pezpallet::config]
|
||||
pub trait Config: pezpallet_timestamp::Config + pezframe_system::Config {
|
||||
/// The identifier type for an authority.
|
||||
type AuthorityId: Member
|
||||
@@ -90,7 +90,7 @@ pub mod pallet {
|
||||
+ RuntimeAppPublic
|
||||
+ MaybeSerializeDeserialize
|
||||
+ MaxEncodedLen;
|
||||
/// The maximum number of authorities that the pallet can hold.
|
||||
/// The maximum number of authorities that the pezpallet can hold.
|
||||
type MaxAuthorities: Get<u32>;
|
||||
|
||||
/// A way to check whether a given validator is disabled and should not be authoring blocks.
|
||||
@@ -100,15 +100,15 @@ pub mod pallet {
|
||||
|
||||
/// Whether to allow block authors to create multiple blocks per slot.
|
||||
///
|
||||
/// If this is `true`, the pallet will allow slots to stay the same across sequential
|
||||
/// blocks. If this is `false`, the pallet will require that subsequent blocks always have
|
||||
/// If this is `true`, the pezpallet will allow slots to stay the same across sequential
|
||||
/// blocks. If this is `false`, the pezpallet will require that subsequent blocks always have
|
||||
/// higher slots than previous ones.
|
||||
///
|
||||
/// Regardless of the setting of this storage value, the pallet will always enforce the
|
||||
/// Regardless of the setting of this storage value, the pezpallet will always enforce the
|
||||
/// invariant that slots don't move backwards as the chain progresses.
|
||||
///
|
||||
/// The typical value for this should be 'false' unless this pallet is being augmented by
|
||||
/// another pallet which enforces some limitation on the number of blocks authors can create
|
||||
/// The typical value for this should be 'false' unless this pezpallet is being augmented by
|
||||
/// another pezpallet which enforces some limitation on the number of blocks authors can create
|
||||
/// using the same slot.
|
||||
type AllowMultipleBlocksPerSlot: Get<bool>;
|
||||
|
||||
@@ -116,15 +116,15 @@ pub mod pallet {
|
||||
/// The effective value of this type should not change while the chain is running.
|
||||
///
|
||||
/// For backwards compatibility either use [`MinimumPeriodTimesTwo`] or a const.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type SlotDuration: Get<<Self as pezpallet_timestamp::Config>::Moment>;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(core::marker::PhantomData<T>);
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T>(core::marker::PhantomData<T>);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
|
||||
#[pezpallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {
|
||||
fn on_initialize(_: BlockNumberFor<T>) -> Weight {
|
||||
if let Some(new_slot) = Self::current_slot_from_digests() {
|
||||
let current_slot = CurrentSlot::<T>::get();
|
||||
@@ -163,31 +163,31 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
/// The current authority set.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type Authorities<T: Config> =
|
||||
StorageValue<_, BoundedVec<T::AuthorityId, T::MaxAuthorities>, ValueQuery>;
|
||||
|
||||
/// The current slot of this block.
|
||||
///
|
||||
/// This will be set in `on_initialize`.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type CurrentSlot<T: Config> = StorageValue<_, Slot, ValueQuery>;
|
||||
|
||||
#[pallet::genesis_config]
|
||||
#[pezpallet::genesis_config]
|
||||
#[derive(pezframe_support::DefaultNoBound)]
|
||||
pub struct GenesisConfig<T: Config> {
|
||||
pub authorities: Vec<T::AuthorityId>,
|
||||
}
|
||||
|
||||
#[pallet::genesis_build]
|
||||
#[pezpallet::genesis_build]
|
||||
impl<T: Config> BuildGenesisConfig for GenesisConfig<T> {
|
||||
fn build(&self) {
|
||||
Pallet::<T>::initialize_authorities(&self.authorities);
|
||||
Pezpallet::<T>::initialize_authorities(&self.authorities);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> Pallet<T> {
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// Change authorities.
|
||||
///
|
||||
/// The storage will be applied immediately.
|
||||
@@ -207,7 +207,7 @@ impl<T: Config> Pallet<T> {
|
||||
AURA_ENGINE_ID,
|
||||
ConsensusLog::AuthoritiesChange(new.into_inner()).encode(),
|
||||
);
|
||||
<pezframe_system::Pallet<T>>::deposit_log(log);
|
||||
<pezframe_system::Pezpallet<T>>::deposit_log(log);
|
||||
}
|
||||
|
||||
/// Initial authorities.
|
||||
@@ -231,7 +231,7 @@ impl<T: Config> Pallet<T> {
|
||||
|
||||
/// Get the current slot from the pre-runtime digests.
|
||||
fn current_slot_from_digests() -> Option<Slot> {
|
||||
let digest = pezframe_system::Pallet::<T>::digest();
|
||||
let digest = pezframe_system::Pezpallet::<T>::digest();
|
||||
let pre_runtime_digests = digest.logs.iter().filter_map(|d| d.as_pre_runtime());
|
||||
for (id, mut data) in pre_runtime_digests {
|
||||
if id == AURA_ENGINE_ID {
|
||||
@@ -247,9 +247,9 @@ impl<T: Config> Pallet<T> {
|
||||
T::SlotDuration::get()
|
||||
}
|
||||
|
||||
/// Ensure the correctness of the state of this pallet.
|
||||
/// Ensure the correctness of the state of this pezpallet.
|
||||
///
|
||||
/// This should be valid before or after each state transition of this pallet.
|
||||
/// This should be valid before or after each state transition of this pezpallet.
|
||||
///
|
||||
/// # Invariants
|
||||
///
|
||||
@@ -297,11 +297,11 @@ impl<T: Config> Pallet<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> pezsp_runtime::BoundToRuntimeAppPublic for Pallet<T> {
|
||||
impl<T: Config> pezsp_runtime::BoundToRuntimeAppPublic for Pezpallet<T> {
|
||||
type Public = T::AuthorityId;
|
||||
}
|
||||
|
||||
impl<T: Config> OneSessionHandler<T::AccountId> for Pallet<T> {
|
||||
impl<T: Config> OneSessionHandler<T::AccountId> for Pezpallet<T> {
|
||||
type Key = T::AuthorityId;
|
||||
|
||||
fn on_genesis_session<'a, I: 'a>(validators: I)
|
||||
@@ -340,11 +340,11 @@ impl<T: Config> OneSessionHandler<T::AccountId> for Pallet<T> {
|
||||
ConsensusLog::<T::AuthorityId>::OnDisabled(i as AuthorityIndex).encode(),
|
||||
);
|
||||
|
||||
<pezframe_system::Pallet<T>>::deposit_log(log);
|
||||
<pezframe_system::Pezpallet<T>>::deposit_log(log);
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> FindAuthor<u32> for Pallet<T> {
|
||||
impl<T: Config> FindAuthor<u32> for Pezpallet<T> {
|
||||
fn find_author<'a, I>(digests: I) -> Option<u32>
|
||||
where
|
||||
I: 'a + IntoIterator<Item = (ConsensusEngineId, &'a [u8])>,
|
||||
@@ -381,15 +381,15 @@ impl<T: Config, Inner: FindAuthor<u32>> FindAuthor<T::AuthorityId>
|
||||
}
|
||||
|
||||
/// Find the authority ID of the Aura authority who authored the current block.
|
||||
pub type AuraAuthorId<T> = FindAccountFromAuthorIndex<T, Pallet<T>>;
|
||||
pub type AuraAuthorId<T> = FindAccountFromAuthorIndex<T, Pezpallet<T>>;
|
||||
|
||||
impl<T: Config> IsMember<T::AuthorityId> for Pallet<T> {
|
||||
impl<T: Config> IsMember<T::AuthorityId> for Pezpallet<T> {
|
||||
fn is_member(authority_id: &T::AuthorityId) -> bool {
|
||||
Authorities::<T>::get().iter().any(|id| id == authority_id)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> OnTimestampSet<T::Moment> for Pallet<T> {
|
||||
impl<T: Config> OnTimestampSet<T::Moment> for Pezpallet<T> {
|
||||
fn on_timestamp_set(moment: T::Moment) {
|
||||
let slot_duration = Self::slot_duration();
|
||||
assert!(!slot_duration.is_zero(), "Aura slot duration cannot be zero.");
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Migrations for the AURA pallet.
|
||||
//! Migrations for the AURA pezpallet.
|
||||
|
||||
use pezframe_support::{pezpallet_prelude::*, traits::Get, weights::Weight};
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#![cfg(test)]
|
||||
|
||||
use super::pallet;
|
||||
use super::pezpallet;
|
||||
use crate::mock::{build_ext_and_execute_test, Aura, MockDisabledValidators, System, Test};
|
||||
use codec::Encode;
|
||||
use pezframe_support::traits::OnInitialize;
|
||||
@@ -29,8 +29,8 @@ use pezsp_runtime::{Digest, DigestItem};
|
||||
#[test]
|
||||
fn initial_values() {
|
||||
build_ext_and_execute_test(vec![0, 1, 2, 3], || {
|
||||
assert_eq!(pallet::CurrentSlot::<Test>::get(), 0u64);
|
||||
assert_eq!(pallet::Authorities::<Test>::get().len(), Aura::authorities_len());
|
||||
assert_eq!(pezpallet::CurrentSlot::<Test>::get(), 0u64);
|
||||
assert_eq!(pezpallet::Authorities::<Test>::get().len(), Aura::authorities_len());
|
||||
assert_eq!(Aura::authorities_len(), 4);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ edition.workspace = true
|
||||
license = "Apache-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
description = "FRAME pallet for authority discovery"
|
||||
description = "FRAME pezpallet for authority discovery"
|
||||
readme = "README.md"
|
||||
documentation = "https://docs.rs/pezpallet-authority-discovery"
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! # Authority discovery pallet.
|
||||
//! # Authority discovery pezpallet.
|
||||
//!
|
||||
//! This pallet is used by the `client/authority-discovery` and by pezkuwi's teyrchain logic
|
||||
//! This pezpallet is used by the `client/authority-discovery` and by pezkuwi's teyrchain logic
|
||||
//! to retrieve the current and the next set of authorities.
|
||||
|
||||
// Ensure we're `no_std` when compiling for Wasm.
|
||||
@@ -32,50 +32,50 @@ use pezframe_support::{
|
||||
};
|
||||
use pezsp_authority_discovery::AuthorityId;
|
||||
|
||||
pub use pallet::*;
|
||||
pub use pezpallet::*;
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
#[pezframe_support::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use super::*;
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T>(_);
|
||||
|
||||
#[pallet::config]
|
||||
/// The pallet's config trait.
|
||||
#[pezpallet::config]
|
||||
/// The pezpallet's config trait.
|
||||
pub trait Config: pezframe_system::Config + pezpallet_session::Config {
|
||||
/// The maximum number of authorities that can be added.
|
||||
type MaxAuthorities: Get<u32>;
|
||||
}
|
||||
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
/// Keys of the current authority set.
|
||||
pub type Keys<T: Config> =
|
||||
StorageValue<_, WeakBoundedVec<AuthorityId, T::MaxAuthorities>, ValueQuery>;
|
||||
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
/// Keys of the next authority set.
|
||||
pub type NextKeys<T: Config> =
|
||||
StorageValue<_, WeakBoundedVec<AuthorityId, T::MaxAuthorities>, ValueQuery>;
|
||||
|
||||
#[derive(pezframe_support::DefaultNoBound)]
|
||||
#[pallet::genesis_config]
|
||||
#[pezpallet::genesis_config]
|
||||
pub struct GenesisConfig<T: Config> {
|
||||
pub keys: Vec<AuthorityId>,
|
||||
#[serde(skip)]
|
||||
pub _config: core::marker::PhantomData<T>,
|
||||
}
|
||||
|
||||
#[pallet::genesis_build]
|
||||
#[pezpallet::genesis_build]
|
||||
impl<T: Config> BuildGenesisConfig for GenesisConfig<T> {
|
||||
fn build(&self) {
|
||||
Pallet::<T>::initialize_keys(&self.keys)
|
||||
Pezpallet::<T>::initialize_keys(&self.keys)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> Pallet<T> {
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// Retrieve authority identifiers of the current and next authority set
|
||||
/// sorted and deduplicated.
|
||||
pub fn authorities() -> Vec<AuthorityId> {
|
||||
@@ -113,11 +113,11 @@ impl<T: Config> Pallet<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> pezsp_runtime::BoundToRuntimeAppPublic for Pallet<T> {
|
||||
impl<T: Config> pezsp_runtime::BoundToRuntimeAppPublic for Pezpallet<T> {
|
||||
type Public = AuthorityId;
|
||||
}
|
||||
|
||||
impl<T: Config> OneSessionHandler<T::AccountId> for Pallet<T> {
|
||||
impl<T: Config> OneSessionHandler<T::AccountId> for Pezpallet<T> {
|
||||
type Key = AuthorityId;
|
||||
|
||||
fn on_genesis_session<'a, I: 'a>(authorities: I)
|
||||
@@ -255,7 +255,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn authorities_returns_current_and_next_authority_set() {
|
||||
// The whole authority discovery pallet ignores account ids, but we still need them for
|
||||
// The whole authority discovery pezpallet ignores account ids, but we still need them for
|
||||
// `pezpallet_session::OneSessionHandler::on_new_session`, thus its safe to use the same value
|
||||
// everywhere.
|
||||
let account_id = AuthorityPair::from_seed_slice(vec![10; 32].as_ref()).unwrap().public();
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
|
||||
use pezframe_support::traits::FindAuthor;
|
||||
|
||||
pub use pallet::*;
|
||||
pub use pezpallet::*;
|
||||
|
||||
/// An event handler for the authorship pallet. There is a dummy implementation
|
||||
/// An event handler for the authorship pezpallet. There is a dummy implementation
|
||||
/// for `()`, which does nothing.
|
||||
#[impl_trait_for_tuples::impl_for_tuples(30)]
|
||||
pub trait EventHandler<Author, BlockNumber> {
|
||||
@@ -33,13 +33,13 @@ pub trait EventHandler<Author, BlockNumber> {
|
||||
fn note_author(author: Author);
|
||||
}
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
#[pezframe_support::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use super::*;
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::config]
|
||||
#[pezpallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
/// Find the author of a block.
|
||||
type FindAuthor: FindAuthor<Self::AccountId>;
|
||||
@@ -47,11 +47,11 @@ pub mod pallet {
|
||||
type EventHandler: EventHandler<Self::AccountId, BlockNumberFor<Self>>;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T>(_);
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
|
||||
#[pezpallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {
|
||||
fn on_initialize(_: BlockNumberFor<T>) -> Weight {
|
||||
if let Some(author) = Self::author() {
|
||||
T::EventHandler::note_author(author);
|
||||
@@ -66,13 +66,13 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
#[pallet::storage]
|
||||
#[pallet::whitelist_storage]
|
||||
#[pezpallet::storage]
|
||||
#[pezpallet::whitelist_storage]
|
||||
/// Author of current block.
|
||||
pub(super) type Author<T: Config> = StorageValue<_, T::AccountId, OptionQuery>;
|
||||
}
|
||||
|
||||
impl<T: Config> Pallet<T> {
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// Fetch the author of the block.
|
||||
///
|
||||
/// This is safe to invoke in `on_initialize` implementations, as well
|
||||
@@ -83,7 +83,7 @@ impl<T: Config> Pallet<T> {
|
||||
return Some(author);
|
||||
}
|
||||
|
||||
let digest = <pezframe_system::Pallet<T>>::digest();
|
||||
let digest = <pezframe_system::Pezpallet<T>>::digest();
|
||||
let pre_runtime_digests = digest.logs.iter().filter_map(|d| d.as_pre_runtime());
|
||||
T::FindAuthor::find_author(pre_runtime_digests).inspect(|a| {
|
||||
<Author<T>>::put(&a);
|
||||
@@ -117,7 +117,7 @@ mod tests {
|
||||
type Block = Block;
|
||||
}
|
||||
|
||||
impl pallet::Config for Test {
|
||||
impl pezpallet::Config for Test {
|
||||
type FindAuthor = AuthorGiven;
|
||||
type EventHandler = ();
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user