diff --git a/.claude-session-state.md b/.claude-session-state.md deleted file mode 100644 index 956ac09e..00000000 --- a/.claude-session-state.md +++ /dev/null @@ -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 && -``` - -## SONRAKI ADIMLAR -1. cargo check --workspace ile doğrulama -2. Git commit -3. Kellnr publish test - diff --git a/.config/taplo.toml b/.config/taplo.toml index a3f5f94d..bf53c912 100644 --- a/.config/taplo.toml +++ b/.config/taplo.toml @@ -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/**", diff --git a/.docs-deployment-summary.md b/.docs-deployment-summary.md deleted file mode 100644 index c076631b..00000000 --- a/.docs-deployment-summary.md +++ /dev/null @@ -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. diff --git a/.link-checker-errors.md b/.link-checker-errors.md deleted file mode 100644 index 54593ffe..00000000 --- a/.link-checker-errors.md +++ /dev/null @@ -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. diff --git a/Cargo.lock b/Cargo.lock index 745b16b5..f7cd5efe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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" diff --git a/Cargo.toml b/Cargo.toml index ec8c31f8..ffa8506d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" } diff --git a/README.md b/README.md index 0f0ac3a4..7282ba0a 100644 --- a/README.md +++ b/README.md @@ -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) | ---
-![SDK Logo](./docs/images/Pezkuwi_Logo_Horizontal_Pink_White.png#gh-dark-mode-only) -![SDK Logo](./docs/images/Pezkuwi_Logo_Horizontal_Pink_Black.png#gh-light-mode-only) +![SDK Logo](./docs/images/Kurdistan_Logo_Horizontal_Pink_White.png#gh-dark-mode-only) +![SDK Logo](./docs/images/Kurdistan_Logo_Horizontal_Pink_Black.png#gh-light-mode-only) -# Pezkuwi SDK +# Kurdistan SDK -![GitHub stars](https://img.shields.io/github/stars/pezkuwichain/pezkuwi-sdk)  ![GitHub -forks](https://img.shields.io/github/forks/pezkuwichain/pezkuwi-sdk) +![GitHub stars](https://img.shields.io/github/stars/pezkuwichain/kurdistan-sdk)  ![GitHub +forks](https://img.shields.io/github/forks/pezkuwichain/kurdistan-sdk) -[![StackExchange](https://img.shields.io/badge/StackExchange-Community%20&%20Support-222222?logo=stackexchange)](https://pezkuwichain.app/community)  ![GitHub contributors](https://img.shields.io/github/contributors/pezkuwichain/pezkuwi-sdk)  ![GitHub commit activity](https://img.shields.io/github/commit-activity/m/pezkuwichain/pezkuwi-sdk)  ![GitHub last commit](https://img.shields.io/github/last-commit/pezkuwichain/pezkuwi-sdk) +[![StackExchange](https://img.shields.io/badge/StackExchange-Community%20&%20Support-222222?logo=stackexchange)](https://pezkuwichain.app/community)  ![GitHub contributors](https://img.shields.io/github/contributors/pezkuwichain/kurdistan-sdk)  ![GitHub commit activity](https://img.shields.io/github/commit-activity/m/pezkuwichain/kurdistan-sdk)  ![GitHub last commit](https://img.shields.io/github/last-commit/pezkuwichain/kurdistan-sdk) -> 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.
@@ -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 -![Current Stable Release](https://raw.githubusercontent.com/pezkuwichain/release-registry/main/badges/pezkuwi-sdk-latest.svg)  ![Next Stable Release](https://raw.githubusercontent.com/pezkuwichain/release-registry/main/badges/pezkuwi-sdk-next.svg) +![Current Stable Release](https://raw.githubusercontent.com/pezkuwichain/release-registry/main/badges/kurdistan-sdk-latest.svg)  ![Next Stable Release](https://raw.githubusercontent.com/pezkuwichain/release-registry/main/badges/kurdistan-sdk-next.svg) -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). \ No newline at end of file diff --git a/bizinikiwi/bin/node/cli/src/benchmarking.rs b/bizinikiwi/bin/node/cli/src/benchmarking.rs index 6d0f382e..da6817c2 100644 --- a/bizinikiwi/bin/node/cli/src/benchmarking.rs +++ b/bizinikiwi/bin/node/cli/src/benchmarking.rs @@ -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" } diff --git a/bizinikiwi/bin/node/cli/src/cli.rs b/bizinikiwi/bin/node/cli/src/cli.rs index f9bba380..9d2687e9 100644 --- a/bizinikiwi/bin/node/cli/src/cli.rs +++ b/bizinikiwi/bin/node/cli/src/cli.rs @@ -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), diff --git a/bizinikiwi/bin/node/cli/src/command.rs b/bizinikiwi/bin/node/cli/src/command.rs index cc7a1438..d2edd724 100644 --- a/bizinikiwi/bin/node/cli/src/command.rs +++ b/bizinikiwi/bin/node/cli/src/command.rs @@ -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. \ diff --git a/bizinikiwi/bin/node/cli/tests/basic.rs b/bizinikiwi/bin/node/cli/tests/basic.rs index 26885801..06af5110 100644 --- a/bizinikiwi/bin/node/cli/tests/basic.rs +++ b/bizinikiwi/bin/node/cli/tests/basic.rs @@ -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::::account_id(), + who: pezpallet_treasury::Pezpallet::::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::::account_id(), + who: pezpallet_treasury::Pezpallet::::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::::account_id(), + who: pezpallet_treasury::Pezpallet::::account_id(), amount: fees_after_refund, }), topics: vec![], @@ -701,7 +701,7 @@ fn deploying_wasm_contract_should_work() { let transfer_ch = ::Hashing::hash(&transfer_code); let addr = - pezpallet_contracts::Pallet::::contract_address(&charlie(), &transfer_ch, &[], &[]); + pezpallet_contracts::Pezpallet::::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::::get_storage(addr, vec![]).is_ok()); + assert!(&pezpallet_contracts::Pezpallet::::get_storage(addr, vec![]).is_ok()); }); } diff --git a/bizinikiwi/bin/node/cli/tests/benchmark_extrinsic_works.rs b/bizinikiwi/bin/node/cli/tests/benchmark_extrinsic_works.rs index a010ed71..95d5af34 100644 --- a/bizinikiwi/bin/node/cli/tests/benchmark_extrinsic_works.rs +++ b/bizinikiwi/bin/node/cli/tests/benchmark_extrinsic_works.rs @@ -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"]) diff --git a/bizinikiwi/bin/node/cli/tests/benchmark_pallet_works.rs b/bizinikiwi/bin/node/cli/tests/benchmark_pallet_works.rs index 408eb991..e4fc11bc 100644 --- a/bizinikiwi/bin/node/cli/tests/benchmark_pallet_works.rs +++ b/bizinikiwi/bin/node/cli/tests/benchmark_pallet_works.rs @@ -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(); diff --git a/bizinikiwi/bin/node/cli/tests/benchmark_pezpallet_works.rs b/bizinikiwi/bin/node/cli/tests/benchmark_pezpallet_works.rs new file mode 100644 index 00000000..d5990f34 --- /dev/null +++ b/bizinikiwi/bin/node/cli/tests/benchmark_pezpallet_works.rs @@ -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 . + +#![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); +} diff --git a/bizinikiwi/bin/node/runtime/src/constants.rs b/bizinikiwi/bin/node/runtime/src/constants.rs index 637c28b2..ed4077d0 100644 --- a/bizinikiwi/bin/node/runtime/src/constants.rs +++ b/bizinikiwi/bin/node/runtime/src/constants.rs @@ -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 diff --git a/bizinikiwi/bin/node/runtime/src/genesis_config_presets.rs b/bizinikiwi/bin/node/runtime/src/genesis_config_presets.rs index a2dc8a3a..b0c3e1d7 100644 --- a/bizinikiwi/bin/node/runtime/src/genesis_config_presets.rs +++ b/bizinikiwi/bin/node/runtime/src/genesis_config_presets.rs @@ -75,7 +75,7 @@ pub fn kitchensink_genesis( .map(|x| x.0.clone()) .collect::>() .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() }, diff --git a/bizinikiwi/bin/node/runtime/src/impls.rs b/bizinikiwi/bin/node/runtime/src/impls.rs index bb9e6c48..9ddc003b 100644 --- a/bizinikiwi/bin/node/runtime/src/impls.rs +++ b/bizinikiwi/bin/node/runtime/src/impls.rs @@ -49,7 +49,7 @@ impl OnUnbalanced for Author { pub struct CreditToBlockAuthor; impl HandleCredit for CreditToBlockAuthor { fn handle_credit(credit: Credit) { - if let Some(author) = pezpallet_authorship::Pallet::::author() { + if let Some(author) = pezpallet_authorship::Pezpallet::::author() { // Drop the result which will trigger the `OnDrop` of the imbalance in case of error. let _ = Assets::resolve(&author, credit); } diff --git a/bizinikiwi/bin/node/runtime/src/lib.rs b/bizinikiwi/bin/node/runtime/src/lib.rs index 3c19262a..dd5149c3 100644 --- a/bizinikiwi/bin/node/runtime/src/lib.rs +++ b/bizinikiwi/bin/node/runtime/src/lib.rs @@ -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 for SafeModeWhitelistedCalls { fn contains(call: &RuntimeCall) -> bool { @@ -250,7 +250,7 @@ impl Contains 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> 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; - type BlockNumberProvider = pezframe_system::Pallet; + type BlockNumberProvider = pezframe_system::Pezpallet; } 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; + type BlockNumberProvider = pezframe_system::Pezpallet; } parameter_types! { @@ -510,7 +510,7 @@ impl pezpallet_scheduler::Config for Runtime { type WeightInfo = pezpallet_scheduler::weights::BizinikiwiWeight; type OriginPrivilegeCmp = EqualPrivilegeOnly; type Preimages = Preimage; - type BlockNumberProvider = pezframe_system::Pallet; + type BlockNumberProvider = pezframe_system::Pezpallet; } 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; + type AccountStore = pezframe_system::Pezpallet; type WeightInfo = pezpallet_balances::weights::BizinikiwiWeight; type FreezeIdentifier = RuntimeFreezeReason; type MaxFreezes = VariantCountOf; @@ -821,14 +821,14 @@ parameter_types! { pub MaxNominations: u32 = ::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 for Runtime { type RuntimeEvent = RuntimeEvent; type WeightInfo = pezpallet_bags_list::weights::BizinikiwiWeight; /// 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; + type Currency = pezpallet_balances::Pezpallet; type SubmitOrigin = EnsureSigned; type CancelOrigin = EnsureRoot; type KillOrigin = EnsureRoot; @@ -1072,7 +1072,7 @@ impl pezpallet_referenda::Config for Runtime { type RuntimeCall = RuntimeCall; type RuntimeEvent = RuntimeEvent; type Scheduler = Scheduler; - type Currency = pezpallet_balances::Pallet; + type Currency = pezpallet_balances::Pezpallet; type SubmitOrigin = EnsureSigned; type CancelOrigin = EnsureRoot; type KillOrigin = EnsureRoot; @@ -1486,7 +1486,7 @@ impl pezpallet_contracts::Config for Runtime { type DepositPerByte = DepositPerByte; type DefaultDepositLimit = DefaultDepositLimit; type CallStack = [pezpallet_contracts::Frame; 5]; - type WeightPrice = pezpallet_transaction_payment::Pallet; + type WeightPrice = pezpallet_transaction_payment::Pezpallet; type WeightInfo = pezpallet_contracts::weights::BizinikiwiWeight; type ChainExtension = (); type Schedule = Schedule; @@ -2004,7 +2004,7 @@ impl pezpallet_asset_rewards::Config for Runtime { CreationHoldReason, ConstantStoragePrice, >; - type BlockNumberProvider = pezframe_system::Pallet; + type BlockNumberProvider = pezframe_system::Pezpallet; #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper = AssetRewardsBenchmarkHelper; } @@ -2204,7 +2204,7 @@ impl pezpallet_nfts::Config for Runtime { type Helper = (); type CreateOrigin = AsEnsureOriginWithArg>; type Locker = (); - type BlockNumberProvider = pezframe_system::Pallet; + type BlockNumberProvider = pezframe_system::Pezpallet; } 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; + pub type System = pezframe_system::Pezpallet; #[runtime::pezpallet_index(1)] - pub type Utility = pezpallet_utility::Pallet; + pub type Utility = pezpallet_utility::Pezpallet; #[runtime::pezpallet_index(2)] - pub type Babe = pezpallet_babe::Pallet; + pub type Babe = pezpallet_babe::Pezpallet; #[runtime::pezpallet_index(3)] - pub type Timestamp = pezpallet_timestamp::Pallet; + pub type Timestamp = pezpallet_timestamp::Pezpallet; // 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; + pub type Authorship = pezpallet_authorship::Pezpallet; #[runtime::pezpallet_index(5)] - pub type Indices = pezpallet_indices::Pallet; + pub type Indices = pezpallet_indices::Pezpallet; #[runtime::pezpallet_index(6)] - pub type Balances = pezpallet_balances::Pallet; + pub type Balances = pezpallet_balances::Pezpallet; #[runtime::pezpallet_index(7)] - pub type TransactionPayment = pezpallet_transaction_payment::Pallet; + pub type TransactionPayment = pezpallet_transaction_payment::Pezpallet; #[runtime::pezpallet_index(9)] - pub type AssetConversionTxPayment = pezpallet_asset_conversion_tx_payment::Pallet; + pub type AssetConversionTxPayment = pezpallet_asset_conversion_tx_payment::Pezpallet; #[runtime::pezpallet_index(10)] - pub type ElectionProviderMultiPhase = pezpallet_election_provider_multi_phase::Pallet; + pub type ElectionProviderMultiPhase = pezpallet_election_provider_multi_phase::Pezpallet; #[runtime::pezpallet_index(11)] - pub type Staking = pezpallet_staking::Pallet; + pub type Staking = pezpallet_staking::Pezpallet; #[runtime::pezpallet_index(12)] - pub type Session = pezpallet_session::Pallet; + pub type Session = pezpallet_session::Pezpallet; #[runtime::pezpallet_index(13)] - pub type Democracy = pezpallet_democracy::Pallet; + pub type Democracy = pezpallet_democracy::Pezpallet; #[runtime::pezpallet_index(14)] - pub type Council = pezpallet_collective::Pallet; + pub type Council = pezpallet_collective::Pezpallet; #[runtime::pezpallet_index(15)] - pub type TechnicalCommittee = pezpallet_collective::Pallet; + pub type TechnicalCommittee = pezpallet_collective::Pezpallet; #[runtime::pezpallet_index(16)] - pub type Elections = pezpallet_elections_phragmen::Pallet; + pub type Elections = pezpallet_elections_phragmen::Pezpallet; #[runtime::pezpallet_index(17)] - pub type TechnicalMembership = pezpallet_membership::Pallet; + pub type TechnicalMembership = pezpallet_membership::Pezpallet; #[runtime::pezpallet_index(18)] - pub type Grandpa = pezpallet_grandpa::Pallet; + pub type Grandpa = pezpallet_grandpa::Pezpallet; #[runtime::pezpallet_index(19)] - pub type Treasury = pezpallet_treasury::Pallet; + pub type Treasury = pezpallet_treasury::Pezpallet; #[runtime::pezpallet_index(20)] - pub type AssetRate = pezpallet_asset_rate::Pallet; + pub type AssetRate = pezpallet_asset_rate::Pezpallet; #[runtime::pezpallet_index(21)] - pub type Contracts = pezpallet_contracts::Pallet; + pub type Contracts = pezpallet_contracts::Pezpallet; #[runtime::pezpallet_index(22)] - pub type Sudo = pezpallet_sudo::Pallet; + pub type Sudo = pezpallet_sudo::Pezpallet; #[runtime::pezpallet_index(23)] - pub type ImOnline = pezpallet_im_online::Pallet; + pub type ImOnline = pezpallet_im_online::Pezpallet; #[runtime::pezpallet_index(24)] - pub type AuthorityDiscovery = pezpallet_authority_discovery::Pallet; + pub type AuthorityDiscovery = pezpallet_authority_discovery::Pezpallet; #[runtime::pezpallet_index(25)] - pub type Offences = pezpallet_offences::Pallet; + pub type Offences = pezpallet_offences::Pezpallet; #[runtime::pezpallet_index(26)] - pub type Historical = pezpallet_session_historical::Pallet; + pub type Historical = pezpallet_session_historical::Pezpallet; #[runtime::pezpallet_index(27)] - pub type RandomnessCollectiveFlip = pezpallet_insecure_randomness_collective_flip::Pallet; + pub type RandomnessCollectiveFlip = pezpallet_insecure_randomness_collective_flip::Pezpallet; #[runtime::pezpallet_index(28)] - pub type Identity = pezpallet_identity::Pallet; + pub type Identity = pezpallet_identity::Pezpallet; #[runtime::pezpallet_index(29)] - pub type Society = pezpallet_society::Pallet; + pub type Society = pezpallet_society::Pezpallet; #[runtime::pezpallet_index(30)] - pub type Recovery = pezpallet_recovery::Pallet; + pub type Recovery = pezpallet_recovery::Pezpallet; #[runtime::pezpallet_index(31)] - pub type Vesting = pezpallet_vesting::Pallet; + pub type Vesting = pezpallet_vesting::Pezpallet; #[runtime::pezpallet_index(32)] - pub type Scheduler = pezpallet_scheduler::Pallet; + pub type Scheduler = pezpallet_scheduler::Pezpallet; #[runtime::pezpallet_index(33)] - pub type Glutton = pezpallet_glutton::Pallet; + pub type Glutton = pezpallet_glutton::Pezpallet; #[runtime::pezpallet_index(34)] - pub type Preimage = pezpallet_preimage::Pallet; + pub type Preimage = pezpallet_preimage::Pezpallet; #[runtime::pezpallet_index(35)] - pub type Proxy = pezpallet_proxy::Pallet; + pub type Proxy = pezpallet_proxy::Pezpallet; #[runtime::pezpallet_index(36)] - pub type Multisig = pezpallet_multisig::Pallet; + pub type Multisig = pezpallet_multisig::Pezpallet; #[runtime::pezpallet_index(37)] - pub type Bounties = pezpallet_bounties::Pallet; + pub type Bounties = pezpallet_bounties::Pezpallet; #[runtime::pezpallet_index(38)] - pub type Tips = pezpallet_tips::Pallet; + pub type Tips = pezpallet_tips::Pezpallet; #[runtime::pezpallet_index(39)] - pub type Assets = pezpallet_assets::Pallet; + pub type Assets = pezpallet_assets::Pezpallet; #[runtime::pezpallet_index(40)] - pub type PoolAssets = pezpallet_assets::Pallet; + pub type PoolAssets = pezpallet_assets::Pezpallet; #[runtime::pezpallet_index(41)] - pub type Beefy = pezpallet_beefy::Pallet; + pub type Beefy = pezpallet_beefy::Pezpallet; // MMR leaf construction must be after session in order to have a leaf's next_auth_set // refer to block. See issue pezkuwi-fellows/runtimes#160 for details. #[runtime::pezpallet_index(42)] - pub type Mmr = pezpallet_mmr::Pallet; + pub type Mmr = pezpallet_mmr::Pezpallet; #[runtime::pezpallet_index(43)] - pub type MmrLeaf = pezpallet_beefy_mmr::Pallet; + pub type MmrLeaf = pezpallet_beefy_mmr::Pezpallet; #[runtime::pezpallet_index(44)] - pub type Lottery = pezpallet_lottery::Pallet; + pub type Lottery = pezpallet_lottery::Pezpallet; #[runtime::pezpallet_index(45)] - pub type Nis = pezpallet_nis::Pallet; + pub type Nis = pezpallet_nis::Pezpallet; #[runtime::pezpallet_index(46)] - pub type Uniques = pezpallet_uniques::Pallet; + pub type Uniques = pezpallet_uniques::Pezpallet; #[runtime::pezpallet_index(47)] - pub type Nfts = pezpallet_nfts::Pallet; + pub type Nfts = pezpallet_nfts::Pezpallet; #[runtime::pezpallet_index(48)] - pub type NftFractionalization = pezpallet_nft_fractionalization::Pallet; + pub type NftFractionalization = pezpallet_nft_fractionalization::Pezpallet; #[runtime::pezpallet_index(49)] - pub type Salary = pezpallet_salary::Pallet; + pub type Salary = pezpallet_salary::Pezpallet; #[runtime::pezpallet_index(50)] - pub type CoreFellowship = pezpallet_core_fellowship::Pallet; + pub type CoreFellowship = pezpallet_core_fellowship::Pezpallet; #[runtime::pezpallet_index(51)] - pub type TransactionStorage = pezpallet_transaction_storage::Pallet; + pub type TransactionStorage = pezpallet_transaction_storage::Pezpallet; #[runtime::pezpallet_index(52)] - pub type VoterList = pezpallet_bags_list::Pallet; + pub type VoterList = pezpallet_bags_list::Pezpallet; #[runtime::pezpallet_index(53)] - pub type StateTrieMigration = pezpallet_state_trie_migration::Pallet; + pub type StateTrieMigration = pezpallet_state_trie_migration::Pezpallet; #[runtime::pezpallet_index(54)] - pub type ChildBounties = pezpallet_child_bounties::Pallet; + pub type ChildBounties = pezpallet_child_bounties::Pezpallet; #[runtime::pezpallet_index(55)] - pub type Referenda = pezpallet_referenda::Pallet; + pub type Referenda = pezpallet_referenda::Pezpallet; #[runtime::pezpallet_index(56)] - pub type Remark = pezpallet_remark::Pallet; + pub type Remark = pezpallet_remark::Pezpallet; #[runtime::pezpallet_index(57)] - pub type RootTesting = pezpallet_root_testing::Pallet; + pub type RootTesting = pezpallet_root_testing::Pezpallet; #[runtime::pezpallet_index(58)] - pub type ConvictionVoting = pezpallet_conviction_voting::Pallet; + pub type ConvictionVoting = pezpallet_conviction_voting::Pezpallet; #[runtime::pezpallet_index(59)] - pub type Whitelist = pezpallet_whitelist::Pallet; + pub type Whitelist = pezpallet_whitelist::Pezpallet; #[runtime::pezpallet_index(60)] - pub type AllianceMotion = pezpallet_collective::Pallet; + pub type AllianceMotion = pezpallet_collective::Pezpallet; #[runtime::pezpallet_index(61)] - pub type Alliance = pezpallet_alliance::Pallet; + pub type Alliance = pezpallet_alliance::Pezpallet; #[runtime::pezpallet_index(62)] - pub type NominationPools = pezpallet_nomination_pools::Pallet; + pub type NominationPools = pezpallet_nomination_pools::Pezpallet; #[runtime::pezpallet_index(63)] - pub type RankedPolls = pezpallet_referenda::Pallet; + pub type RankedPolls = pezpallet_referenda::Pezpallet; #[runtime::pezpallet_index(64)] - pub type RankedCollective = pezpallet_ranked_collective::Pallet; + pub type RankedCollective = pezpallet_ranked_collective::Pezpallet; #[runtime::pezpallet_index(65)] - pub type AssetConversion = pezpallet_asset_conversion::Pallet; + pub type AssetConversion = pezpallet_asset_conversion::Pezpallet; #[runtime::pezpallet_index(66)] - pub type FastUnstake = pezpallet_fast_unstake::Pallet; + pub type FastUnstake = pezpallet_fast_unstake::Pezpallet; #[runtime::pezpallet_index(67)] - pub type MessageQueue = pezpallet_message_queue::Pallet; + pub type MessageQueue = pezpallet_message_queue::Pezpallet; #[runtime::pezpallet_index(68)] - pub type Pov = pezframe_benchmarking_pallet_pov::Pallet; + pub type Pov = pezframe_benchmarking_pallet_pov::Pezpallet; #[runtime::pezpallet_index(69)] - pub type TxPause = pezpallet_tx_pause::Pallet; + pub type TxPause = pezpallet_tx_pause::Pezpallet; #[runtime::pezpallet_index(70)] - pub type SafeMode = pezpallet_safe_mode::Pallet; + pub type SafeMode = pezpallet_safe_mode::Pezpallet; #[runtime::pezpallet_index(71)] - pub type Statement = pezpallet_statement::Pallet; + pub type Statement = pezpallet_statement::Pezpallet; #[runtime::pezpallet_index(72)] - pub type MultiBlockMigrations = pezpallet_migrations::Pallet; + pub type MultiBlockMigrations = pezpallet_migrations::Pezpallet; #[runtime::pezpallet_index(73)] - pub type Broker = pezpallet_broker::Pallet; + pub type Broker = pezpallet_broker::Pezpallet; #[runtime::pezpallet_index(74)] - pub type TasksExample = pezpallet_example_tasks::Pallet; + pub type TasksExample = pezpallet_example_tasks::Pezpallet; #[runtime::pezpallet_index(75)] - pub type Mixnet = pezpallet_mixnet::Pallet; + pub type Mixnet = pezpallet_mixnet::Pezpallet; #[runtime::pezpallet_index(76)] - pub type Parameters = pezpallet_parameters::Pallet; + pub type Parameters = pezpallet_parameters::Pezpallet; #[runtime::pezpallet_index(77)] - pub type SkipFeelessPayment = pezpallet_skip_feeless_payment::Pallet; + pub type SkipFeelessPayment = pezpallet_skip_feeless_payment::Pezpallet; #[runtime::pezpallet_index(78)] - pub type PalletExampleMbms = pezpallet_example_mbm::Pallet; + pub type PalletExampleMbms = pezpallet_example_mbm::Pezpallet; #[runtime::pezpallet_index(79)] - pub type AssetConversionMigration = pezpallet_asset_conversion_ops::Pallet; + pub type AssetConversionMigration = pezpallet_asset_conversion_ops::Pezpallet; #[runtime::pezpallet_index(80)] - pub type Revive = pezpallet_revive::Pallet; + pub type Revive = pezpallet_revive::Pezpallet; #[runtime::pezpallet_index(81)] - pub type VerifySignature = pezpallet_verify_signature::Pallet; + pub type VerifySignature = pezpallet_verify_signature::Pezpallet; #[runtime::pezpallet_index(82)] - pub type DelegatedStaking = pezpallet_delegated_staking::Pallet; + pub type DelegatedStaking = pezpallet_delegated_staking::Pezpallet; #[runtime::pezpallet_index(83)] - pub type AssetRewards = pezpallet_asset_rewards::Pallet; + pub type AssetRewards = pezpallet_asset_rewards::Pezpallet; #[runtime::pezpallet_index(84)] - pub type AssetsFreezer = pezpallet_assets_freezer::Pallet; + pub type AssetsFreezer = pezpallet_assets_freezer::Pezpallet; #[runtime::pezpallet_index(85)] - pub type Oracle = pezpallet_oracle::Pallet; + pub type Oracle = pezpallet_oracle::Pezpallet; #[runtime::pezpallet_index(89)] - pub type MetaTx = pezpallet_meta_tx::Pallet; + pub type MetaTx = pezpallet_meta_tx::Pezpallet; #[runtime::pezpallet_index(90)] - pub type MultiAssetBounties = pezpallet_multi_asset_bounties::Pallet; + pub type MultiAssetBounties = pezpallet_multi_asset_bounties::Pezpallet; } /// 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 for Runtime { fn get_value(_provider_id: u32, key: u32) -> Option { // ProviderId is unused as we only have 1 provider - pezpallet_oracle::Pallet::::get(&key).map(|v| v.value) + pezpallet_oracle::Pezpallet::::get(&key).map(|v| v.value) } fn get_all_values(_provider_id: u32) -> Vec<(u32, Option)> { use pezpallet_oracle::DataProviderExtended; - pezpallet_oracle::Pallet::::get_all_values() + pezpallet_oracle::Pezpallet::::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::::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 {} diff --git a/bizinikiwi/bin/utils/chain-spec-builder/README.docify.md b/bizinikiwi/bin/utils/chain-spec-builder/README.docify.md index 95033ff5..dfce9172 100644 --- a/bizinikiwi/bin/utils/chain-spec-builder/README.docify.md +++ b/bizinikiwi/bin/utils/chain-spec-builder/README.docify.md @@ -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`. diff --git a/bizinikiwi/bin/utils/chain-spec-builder/README.md b/bizinikiwi/bin/utils/chain-spec-builder/README.md index 7c03b0c6..c25291fc 100644 --- a/bizinikiwi/bin/utils/chain-spec-builder/README.md +++ b/bizinikiwi/bin/utils/chain-spec-builder/README.md @@ -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`. diff --git a/bizinikiwi/client/chain-spec/derive/src/impls.rs b/bizinikiwi/client/chain-spec/derive/src/impls.rs index 100b9bf6..e406ef4a 100644 --- a/bizinikiwi/client/chain-spec/derive/src/impls.rs +++ b/bizinikiwi/client/chain-spec/derive/src/impls.rs @@ -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. diff --git a/bizinikiwi/client/chain-spec/src/lib.rs b/bizinikiwi/client/chain-spec/src/lib.rs index dffee2ef..a8c8438c 100644 --- a/bizinikiwi/client/chain-spec/src/lib.rs +++ b/bizinikiwi/client/chain-spec/src/lib.rs @@ -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). //! diff --git a/bizinikiwi/client/consensus/babe/src/authorship.rs b/bizinikiwi/client/consensus/babe/src/authorship.rs index 004ada08..5119279e 100644 --- a/bizinikiwi/client/consensus/babe/src/authorship.rs +++ b/bizinikiwi/client/consensus/babe/src/authorship.rs @@ -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() { diff --git a/bizinikiwi/client/consensus/beefy/src/lib.rs b/bizinikiwi/client/consensus/beefy/src/lib.rs index 399bf22d..41db550b 100644 --- a/bizinikiwi/client/consensus/beefy/src/lib.rs +++ b/bizinikiwi/client/consensus/beefy/src/lib.rs @@ -283,7 +283,7 @@ where finality_notifications: &mut Fuse>, is_authority: bool, ) -> Result { - // 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, 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( 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( runtime: &R, @@ -729,7 +729,7 @@ where R: ProvideRuntimeApi, R::Api: BeefyApi, { - 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)); diff --git a/bizinikiwi/client/consensus/beefy/src/tests.rs b/bizinikiwi/client/consensus/beefy/src/tests.rs index e9ef432c..e2cefccb 100644 --- a/bizinikiwi/client/consensus/beefy/src/tests.rs +++ b/bizinikiwi/client/consensus/beefy/src/tests.rs @@ -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. diff --git a/bizinikiwi/client/consensus/beefy/src/worker.rs b/bizinikiwi/client/consensus/beefy/src/worker.rs index bd5e61dd..24809252 100644 --- a/bizinikiwi/client/consensus/beefy/src/worker.rs +++ b/bizinikiwi/client/consensus/beefy/src/worker.rs @@ -280,7 +280,7 @@ pub(crate) struct PersistedState { /// Chooses which incoming votes to accept and which votes to generate. /// Keeps track of voting seen for current and future rounds. voting_oracle: VoterOracle, - /// 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, } diff --git a/bizinikiwi/client/merkle-mountain-range/rpc/Cargo.toml b/bizinikiwi/client/merkle-mountain-range/rpc/Cargo.toml index 1ea8ed56..6ffafb8a 100644 --- a/bizinikiwi/client/merkle-mountain-range/rpc/Cargo.toml +++ b/bizinikiwi/client/merkle-mountain-range/rpc/Cargo.toml @@ -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] diff --git a/bizinikiwi/client/merkle-mountain-range/rpc/src/lib.rs b/bizinikiwi/client/merkle-mountain-range/rpc/src/lib.rs index 14f8f821..72181d5f 100644 --- a/bizinikiwi/client/merkle-mountain-range/rpc/src/lib.rs +++ b/bizinikiwi/client/merkle-mountain-range/rpc/src/lib.rs @@ -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 { /// 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 { /// 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 { /// 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 { /// 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. diff --git a/bizinikiwi/client/merkle-mountain-range/src/aux_schema.rs b/bizinikiwi/client/merkle-mountain-range/src/aux_schema.rs index 1627269c..65c897ad 100644 --- a/bizinikiwi/client/merkle-mountain-range/src/aux_schema.rs +++ b/bizinikiwi/client/merkle-mountain-range/src/aux_schema.rs @@ -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::(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)?; diff --git a/bizinikiwi/client/merkle-mountain-range/src/lib.rs b/bizinikiwi/client/merkle-mountain-range/src/lib.rs index c1cae4a7..3741e568 100644 --- a/bizinikiwi/client/merkle-mountain-range/src/lib.rs +++ b/bizinikiwi/client/merkle-mountain-range/src/lib.rs @@ -66,7 +66,7 @@ where BE: Backend, Self::Api: MmrApi>, { - /// 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) -> Option> { let best_block_hash = notification.header.hash(); let best_block_number = *notification.header.number(); diff --git a/bizinikiwi/client/merkle-mountain-range/src/offchain_mmr.rs b/bizinikiwi/client/merkle-mountain-range/src/offchain_mmr.rs index 8de8fad8..720b1db9 100644 --- a/bizinikiwi/client/merkle-mountain-range/src/offchain_mmr.rs +++ b/bizinikiwi/client/merkle-mountain-range/src/offchain_mmr.rs @@ -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) { - // 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(); diff --git a/bizinikiwi/client/offchain/src/lib.rs b/bizinikiwi/client/offchain/src/lib.rs index c95c94cb..429153ea 100644 --- a/bizinikiwi/client/offchain/src/lib.rs +++ b/bizinikiwi/client/offchain/src/lib.rs @@ -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, }; diff --git a/bizinikiwi/client/rpc-api/src/state/mod.rs b/bizinikiwi/client/rpc-api/src/state/mod.rs index 0ae7a3c5..a725723f 100644 --- a/bizinikiwi/client/rpc-api/src/state/mod.rs +++ b/bizinikiwi/client/rpc-api/src/state/mod.rs @@ -206,7 +206,7 @@ pub trait StateApi { /// 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/ /// ``` /// diff --git a/bizinikiwi/client/tracing/src/block/mod.rs b/bizinikiwi/client/tracing/src/block/mod.rs index a49a15ff..1643472c 100644 --- a/bizinikiwi/client/tracing/src/block/mod.rs +++ b/bizinikiwi/client/tracing/src/block/mod.rs @@ -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. diff --git a/bizinikiwi/client/tracing/src/lib.rs b/bizinikiwi/client/tracing/src/lib.rs index 10d2642d..f2e60d29 100644 --- a/bizinikiwi/client/tracing/src/lib.rs +++ b/bizinikiwi/client/tracing/src/lib.rs @@ -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, targets: &str) -> Self { let targets: Vec<_> = targets.split(',').map(parse_target).collect(); diff --git a/bizinikiwi/client/transaction-pool/src/common/tests.rs b/bizinikiwi/client/transaction-pool/src/common/tests.rs index 96a20760..e4836a9a 100644 --- a/bizinikiwi/client/transaction-pool/src/common/tests.rs +++ b/bizinikiwi/client/transaction-pool/src/common/tests.rs @@ -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, }; diff --git a/bizinikiwi/client/transaction-pool/tests/zombienet/mod.rs b/bizinikiwi/client/transaction-pool/tests/zombienet/mod.rs index 54114df9..9f563b4b 100644 --- a/bizinikiwi/client/transaction-pool/tests/zombienet/mod.rs +++ b/bizinikiwi/client/transaction-pool/tests/zombienet/mod.rs @@ -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 { diff --git a/bizinikiwi/docs/CHANGELOG.md b/bizinikiwi/docs/CHANGELOG.md index 69149050..756f478a 100644 --- a/bizinikiwi/docs/CHANGELOG.md +++ b/bizinikiwi/docs/CHANGELOG.md @@ -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(_)` (#8091) +* pezpallet macro: easier syntax for `#[pezpallet::pezpallet]` with `struct Pezpallet(_)` (#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 diff --git a/bizinikiwi/docs/Upgrading-2.0-to-3.0.md b/bizinikiwi/docs/Upgrading-2.0-to-3.0.md index efc85cf4..828da805 100644 --- a/bizinikiwi/docs/Upgrading-2.0-to-3.0.md +++ b/bizinikiwi/docs/Upgrading-2.0-to-3.0.md @@ -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: diff --git a/bizinikiwi/pezframe/alliance/Cargo.toml b/bizinikiwi/pezframe/alliance/Cargo.toml index 8692019c..523da214 100644 --- a/bizinikiwi/pezframe/alliance/Cargo.toml +++ b/bizinikiwi/pezframe/alliance/Cargo.toml @@ -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" diff --git a/bizinikiwi/pezframe/alliance/README.md b/bizinikiwi/pezframe/alliance/README.md index 16335a98..b558a52f 100644 --- a/bizinikiwi/pezframe/alliance/README.md +++ b/bizinikiwi/pezframe/alliance/README.md @@ -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 diff --git a/bizinikiwi/pezframe/alliance/src/benchmarking.rs b/bizinikiwi/pezframe/alliance/src/benchmarking.rs index 915b6002..3f984cc3 100644 --- a/bizinikiwi/pezframe/alliance/src/benchmarking.rs +++ b/bizinikiwi/pezframe/alliance/src/benchmarking.rs @@ -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, I: 'static>(generic_event: >::RuntimeEvent) { - pezframe_system::Pallet::::assert_last_event(generic_event.into()); + pezframe_system::Pezpallet::::assert_last_event(generic_event.into()); } fn cid(input: impl AsRef<[u8]>) -> Cid { diff --git a/bizinikiwi/pezframe/alliance/src/lib.rs b/bizinikiwi/pezframe/alliance/src/lib.rs index 46ac1b8a..d875cce4 100644 --- a/bizinikiwi/pezframe/alliance/src/lib.rs +++ b/bizinikiwi/pezframe/alliance/src/lib.rs @@ -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 = BoundedVec>::MaxWebsiteUrlLength>; +type UrlOf = BoundedVec>::MaxWebsiteUrlLength>; type BalanceOf = <>::Currency as Currency<::AccountId>>::Balance; @@ -225,15 +225,15 @@ type UnscrupulousItemOf = type AccountIdLookupOf = <::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(PhantomData<(T, I)>); + #[pezpallet::pezpallet] + #[pezpallet::storage_version(migration::STORAGE_VERSION)] + pub struct Pezpallet(PhantomData<(T, I)>); - #[pallet::config] + #[pezpallet::config] pub trait Config: 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; - /// 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; - /// 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; - /// 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; /// The maximum length of a website URL. - #[pallet::constant] + #[pezpallet::constant] type MaxWebsiteUrlLength: Get; /// The deposit required for submitting candidacy. - #[pallet::constant] + #[pezpallet::constant] type AllyDeposit: Get>; /// The maximum number of announcements. - #[pallet::constant] + #[pezpallet::constant] type MaxAnnouncementsCount: Get; /// The maximum number of members per member role. - #[pallet::constant] + #[pezpallet::constant] type MaxMembersCount: Get; - /// 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>; } - #[pallet::error] + #[pezpallet::error] pub enum Error { /// 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, 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, I: 'static = ()> { pub fellows: Vec, @@ -418,24 +418,24 @@ pub mod pallet { pub phantom: PhantomData<(T, I)>, } - #[pallet::hooks] - impl, I: 'static> Hooks> for Pallet { + #[pezpallet::hooks] + impl, I: 'static> Hooks> for Pezpallet { #[cfg(feature = "try-runtime")] fn try_state(_n: BlockNumberFor) -> Result<(), pezsp_runtime::TryRuntimeError> { Self::do_try_state() } } - #[pallet::genesis_build] + #[pezpallet::genesis_build] impl, I: 'static> BuildGenesisConfig for GenesisConfig { fn build(&self) { for m in self.fellows.iter().chain(self.allies.iter()) { - assert!(Pallet::::has_identity(m).is_ok(), "Member does not set identity!"); + assert!(Pezpallet::::has_identity(m).is_ok(), "Member does not set identity!"); } if !self.fellows.is_empty() { assert!( - !Pallet::::has_member(MemberRole::Fellow), + !Pezpallet::::has_member(MemberRole::Fellow), "Fellows are already initialized!" ); let members: BoundedVec = @@ -444,7 +444,7 @@ pub mod pallet { } if !self.allies.is_empty() { assert!( - !Pallet::::has_member(MemberRole::Ally), + !Pezpallet::::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, I: 'static = ()> = StorageValue<_, Cid, OptionQuery>; /// The current IPFS CIDs of any announcements. - #[pallet::storage] + #[pezpallet::storage] pub type Announcements, I: 'static = ()> = StorageValue<_, BoundedVec, ValueQuery>; /// Maps members to their candidacy deposit. - #[pallet::storage] + #[pezpallet::storage] pub type DepositOf, I: 'static = ()> = StorageMap<_, Blake2_128Concat, T::AccountId, BalanceOf, OptionQuery>; /// Maps member type to members of each type. - #[pallet::storage] + #[pezpallet::storage] pub type Members, 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, I: 'static = ()> = StorageMap<_, Blake2_128Concat, T::AccountId, BlockNumberFor, OptionQuery>; /// The current list of accounts deemed unscrupulous. These accounts non grata cannot submit /// candidacy. - #[pallet::storage] + #[pezpallet::storage] pub type UnscrupulousAccounts, I: 'static = ()> = StorageValue<_, BoundedVec, ValueQuery>; /// The current list of websites deemed unscrupulous. - #[pallet::storage] + #[pezpallet::storage] pub type UnscrupulousWebsites, I: 'static = ()> = StorageValue<_, BoundedVec, T::MaxUnscrupulousItems>, ValueQuery>; - #[pallet::call(weight(>::WeightInfo))] - impl, I: 'static> Pallet { + #[pezpallet::call(weight(>::WeightInfo))] + impl, I: 'static> Pezpallet { /// 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, - #[pallet::compact] threshold: u32, + #[pezpallet::compact] threshold: u32, proposal: Box<>::Proposal>, - #[pallet::compact] length_bound: u32, + #[pezpallet::compact] length_bound: u32, ) -> DispatchResult { let proposer = ensure_signed(origin)?; ensure!(Self::has_voting_rights(&proposer), Error::::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, 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, 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, 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, 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) -> 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, who: AccountIdLookupOf) -> DispatchResult { let nominator = ensure_signed(origin)?; ensure!(Self::has_voting_rights(&nominator), Error::::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, ally: AccountIdLookupOf) -> 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) -> DispatchResult { let who = ensure_signed(origin)?; let role = Self::member_role_of(&who).ok_or(Error::::NotMember)?; @@ -782,7 +782,7 @@ pub mod pallet { Self::add_member(&who, MemberRole::Retiring)?; >::insert( &who, - pezframe_system::Pallet::::block_number() + pezframe_system::Pezpallet::::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) -> DispatchResult { let who = ensure_signed(origin)?; let retirement_period_end = RetiringMembers::::get(&who) .ok_or(Error::::RetirementNoticeNotGiven)?; ensure!( - pezframe_system::Pallet::::block_number() >= retirement_period_end, + pezframe_system::Pezpallet::::block_number() >= retirement_period_end, Error::::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, who: AccountIdLookupOf) -> 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, items: Vec>, @@ -863,8 +863,8 @@ pub mod pallet { } /// Deem some items no longer unscrupulous. - #[pallet::call_index(15)] - #[pallet::weight(>::WeightInfo::remove_unscrupulous_items( + #[pezpallet::call_index(15)] + #[pezpallet::weight(>::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, 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::::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) -> DispatchResult { let who = ensure_signed(origin)?; let role = Self::member_role_of(&who).ok_or(Error::::NotMember)?; @@ -933,7 +933,7 @@ pub mod pallet { } } -impl, I: 'static> Pallet { +impl, I: 'static> Pezpallet { /// 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, I: 'static> Pallet { } #[cfg(any(feature = "try-runtime", test))] -impl, I: 'static> Pallet { - /// Ensure the correctness of the state of this pallet. +impl, I: 'static> Pezpallet { + /// 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()?; diff --git a/bizinikiwi/pezframe/alliance/src/migration.rs b/bizinikiwi/pezframe/alliance/src/migration.rs index 9d1b1879..cc37c07d 100644 --- a/bizinikiwi/pezframe/alliance/src/migration.rs +++ b/bizinikiwi/pezframe/alliance/src/migration.rs @@ -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, I: 'static>() -> Weight { - let on_chain_version = Pallet::::on_chain_storage_version(); + let on_chain_version = Pezpallet::::on_chain_storage_version(); let mut weight: Weight = Weight::zero(); if on_chain_version < 1 { @@ -35,7 +35,7 @@ pub fn migrate, I: 'static>() -> Weight { weight = weight.saturating_add(v1_to_v2::migrate::()); } - STORAGE_VERSION.put::>(); + STORAGE_VERSION.put::>(); 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( - >::name().as_bytes(), + >::name().as_bytes(), b"UpForKicking", b"", None, @@ -154,7 +154,7 @@ pub(crate) mod v1_to_v2 { MemberRoleV1, BoundedVec, Twox64Concat, - >(>::name().as_bytes(), b"Members", role) + >(>::name().as_bytes(), b"Members", role) .unwrap_or_default() } } diff --git a/bizinikiwi/pezframe/alliance/src/tests.rs b/bizinikiwi/pezframe/alliance/src/tests.rs index 7cac7838..19ac8e09 100644 --- a/bizinikiwi/pezframe/alliance/src/tests.rs +++ b/bizinikiwi/pezframe/alliance/src/tests.rs @@ -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}; diff --git a/bizinikiwi/pezframe/alliance/src/weights.rs b/bizinikiwi/pezframe/alliance/src/weights.rs index fc24f705..4e567881 100644 --- a/bizinikiwi/pezframe/alliance/src/weights.rs +++ b/bizinikiwi/pezframe/alliance/src/weights.rs @@ -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 diff --git a/bizinikiwi/pezframe/asset-conversion/Cargo.toml b/bizinikiwi/pezframe/asset-conversion/Cargo.toml index 041c6d70..621d9ac9 100644 --- a/bizinikiwi/pezframe/asset-conversion/Cargo.toml +++ b/bizinikiwi/pezframe/asset-conversion/Cargo.toml @@ -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" diff --git a/bizinikiwi/pezframe/asset-conversion/README.md b/bizinikiwi/pezframe/asset-conversion/README.md index 48064040..ddf88e04 100644 --- a/bizinikiwi/pezframe/asset-conversion/README.md +++ b/bizinikiwi/pezframe/asset-conversion/README.md @@ -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 diff --git a/bizinikiwi/pezframe/asset-conversion/ops/Cargo.toml b/bizinikiwi/pezframe/asset-conversion/ops/Cargo.toml index ac8a25a2..fc9aa71a 100644 --- a/bizinikiwi/pezframe/asset-conversion/ops/Cargo.toml +++ b/bizinikiwi/pezframe/asset-conversion/ops/Cargo.toml @@ -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] diff --git a/bizinikiwi/pezframe/asset-conversion/ops/src/benchmarking.rs b/bizinikiwi/pezframe/asset-conversion/ops/src/benchmarking.rs index 66f80fa9..ae65dc15 100644 --- a/bizinikiwi/pezframe/asset-conversion/ops/src/benchmarking.rs +++ b/bizinikiwi/pezframe/asset-conversion/ops/src/benchmarking.rs @@ -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(generic_event: ::RuntimeEvent) { - let events = pezframe_system::Pallet::::events(); + let events = pezframe_system::Pezpallet::::events(); let system_event: ::RuntimeEvent = generic_event.into(); // compare to the last event record let pezframe_system::EventRecord { event, .. } = &events[events.len() - 1]; diff --git a/bizinikiwi/pezframe/asset-conversion/ops/src/lib.rs b/bizinikiwi/pezframe/asset-conversion/ops/src/lib.rs index a15c438e..dbaffc25 100644 --- a/bizinikiwi/pezframe/asset-conversion/ops/src/lib.rs +++ b/bizinikiwi/pezframe/asset-conversion/ops/src/lib.rs @@ -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(_); + #[pezpallet::pezpallet] + pub struct Pezpallet(_); - #[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; - /// 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 { /// 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 { /// Provided asset pair is not supported for pool. InvalidAssetPair, @@ -140,15 +140,15 @@ pub mod pallet { PartialTransfer, } - /// Pallet's callable functions. - #[pallet::call] - impl Pallet { + /// Pezpallet's callable functions. + #[pezpallet::call] + impl Pezpallet { /// 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(::WeightInfo::migrate_to_new_account())] + #[pezpallet::call_index(0)] + #[pezpallet::weight(::WeightInfo::migrate_to_new_account())] pub fn migrate_to_new_account( origin: OriginFor, asset1: Box, @@ -301,7 +301,7 @@ pub mod pallet { } } - impl Pallet { + impl Pezpallet { /// 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"))] diff --git a/bizinikiwi/pezframe/asset-conversion/ops/src/mock.rs b/bizinikiwi/pezframe/asset-conversion/ops/src/mock.rs index ec50ba32..9d7a5d4b 100644 --- a/bizinikiwi/pezframe/asset-conversion/ops/src/mock.rs +++ b/bizinikiwi/pezframe/asset-conversion/ops/src/mock.rs @@ -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; diff --git a/bizinikiwi/pezframe/asset-conversion/ops/src/tests.rs b/bizinikiwi/pezframe/asset-conversion/ops/src/tests.rs index a22454a8..b5a34931 100644 --- a/bizinikiwi/pezframe/asset-conversion/ops/src/tests.rs +++ b/bizinikiwi/pezframe/asset-conversion/ops/src/tests.rs @@ -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::{ diff --git a/bizinikiwi/pezframe/asset-conversion/ops/src/weights.rs b/bizinikiwi/pezframe/asset-conversion/ops/src/weights.rs index 643b9038..e021a552 100644 --- a/bizinikiwi/pezframe/asset-conversion/ops/src/weights.rs +++ b/bizinikiwi/pezframe/asset-conversion/ops/src/weights.rs @@ -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 diff --git a/bizinikiwi/pezframe/asset-conversion/src/benchmarking.rs b/bizinikiwi/pezframe/asset-conversion/src/benchmarking.rs index 46d6c7da..0afe5e5e 100644 --- a/bizinikiwi/pezframe/asset-conversion/src/benchmarking.rs +++ b/bizinikiwi/pezframe/asset-conversion/src/benchmarking.rs @@ -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(generic_event: ::RuntimeEvent) { - let events = pezframe_system::Pallet::::events(); + let events = pezframe_system::Pezpallet::::events(); let system_event: ::RuntimeEvent = generic_event.into(); // compare to the last event record let pezframe_system::EventRecord { event, .. } = &events[events.len() - 1]; diff --git a/bizinikiwi/pezframe/asset-conversion/src/lib.rs b/bizinikiwi/pezframe/asset-conversion/src/lib.rs index 8a4eeeec..56d25c3f 100644 --- a/bizinikiwi/pezframe/asset-conversion/src/lib.rs +++ b/bizinikiwi/pezframe/asset-conversion/src/lib.rs @@ -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(_); + #[pezpallet::pezpallet] + pub struct Pezpallet(_); - #[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; - /// 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 + Create @@ -158,37 +158,37 @@ pub mod pallet { + Refund; /// A % the liquidity providers will take of every swap. Represents 10ths of a percent. - #[pallet::constant] + #[pezpallet::constant] type LPFee: Get; /// A one-time fee to setup the pool. - #[pallet::constant] + #[pezpallet::constant] type PoolSetupFee: Get; /// Asset class from [`Config::Assets`] used to pay the [`Config::PoolSetupFee`]. - #[pallet::constant] + #[pezpallet::constant] type PoolSetupFeeAsset: Get; /// Handler for the [`Config::PoolSetupFee`]. type PoolSetupFeeTarget: OnUnbalanced>; /// A fee to withdraw the liquidity. - #[pallet::constant] + #[pezpallet::constant] type LiquidityWithdrawalFee: Get; /// The minimum LP token amount that could be minted. Ameliorates rounding errors. - #[pallet::constant] + #[pezpallet::constant] type MintMinLiquidity: Get; /// The max number of hops in a swap. - #[pallet::constant] + #[pezpallet::constant] type MaxSwapPathLength: Get; - /// 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; - /// 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 = StorageMap<_, Blake2_128Concat, T::PoolId, PoolInfo, 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 = 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 { /// 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 { /// Provided asset pair is not supported for pool. InvalidAssetPair, @@ -349,8 +349,8 @@ pub mod pallet { BelowMinimum, } - #[pallet::hooks] - impl Hooks> for Pallet { + #[pezpallet::hooks] + impl Hooks> for Pezpallet { fn integrity_test() { assert!( T::MaxSwapPathLength::get() > 1, @@ -359,15 +359,15 @@ pub mod pallet { } } - /// Pallet's callable functions. - #[pallet::call] - impl Pallet { + /// Pezpallet's callable functions. + #[pezpallet::call] + impl Pezpallet { /// 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, asset1: Box, @@ -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, asset1: Box, @@ -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, asset1: Box, @@ -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, path: Vec>, @@ -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, path: Vec>, @@ -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, asset1: Box, @@ -545,7 +545,7 @@ pub mod pallet { } } - impl Pallet { + impl Pezpallet { /// 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 Pallet { + #[pezpallet::view_functions] + impl Pezpallet { /// 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; - /// 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.) diff --git a/bizinikiwi/pezframe/asset-conversion/src/liquidity.rs b/bizinikiwi/pezframe/asset-conversion/src/liquidity.rs index d0a07a6a..bf5fbb64 100644 --- a/bizinikiwi/pezframe/asset-conversion/src/liquidity.rs +++ b/bizinikiwi/pezframe/asset-conversion/src/liquidity.rs @@ -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 { @@ -82,7 +82,7 @@ pub trait MutateLiquidity { ) -> Result<(Self::Balance, Self::Balance), DispatchError>; } -impl MutateLiquidity for Pallet { +impl MutateLiquidity for Pezpallet { type Balance = T::Balance; type AssetKind = T::AssetKind; type PoolId = T::PoolId; diff --git a/bizinikiwi/pezframe/asset-conversion/src/mock.rs b/bizinikiwi/pezframe/asset-conversion/src/mock.rs index 8b8c1fda..de5f15c7 100644 --- a/bizinikiwi/pezframe/asset-conversion/src/mock.rs +++ b/bizinikiwi/pezframe/asset-conversion/src/mock.rs @@ -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; diff --git a/bizinikiwi/pezframe/asset-conversion/src/swap.rs b/bizinikiwi/pezframe/asset-conversion/src/swap.rs index 6eb65b11..f8b056cb 100644 --- a/bizinikiwi/pezframe/asset-conversion/src/swap.rs +++ b/bizinikiwi/pezframe/asset-conversion/src/swap.rs @@ -144,7 +144,7 @@ pub trait QuotePrice { ) -> Option; } -impl Swap for Pallet { +impl Swap for Pezpallet { type Balance = T::Balance; type AssetKind = T::AssetKind; @@ -191,7 +191,7 @@ impl Swap for Pallet { } } -impl SwapCredit for Pallet { +impl SwapCredit for Pezpallet { type Balance = T::Balance; type AssetKind = T::AssetKind; type Credit = CreditOf; @@ -239,7 +239,7 @@ impl SwapCredit for Pallet { } } -impl QuotePrice for Pallet { +impl QuotePrice for Pezpallet { type Balance = T::Balance; type AssetKind = T::AssetKind; fn quote_price_exact_tokens_for_tokens( diff --git a/bizinikiwi/pezframe/asset-conversion/src/weights.rs b/bizinikiwi/pezframe/asset-conversion/src/weights.rs index eb1c4f54..04a24e8a 100644 --- a/bizinikiwi/pezframe/asset-conversion/src/weights.rs +++ b/bizinikiwi/pezframe/asset-conversion/src/weights.rs @@ -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 diff --git a/bizinikiwi/pezframe/asset-rate/src/benchmarking.rs b/bizinikiwi/pezframe/asset-rate/src/benchmarking.rs index d9289a0a..d84feee5 100644 --- a/bizinikiwi/pezframe/asset-rate/src/benchmarking.rs +++ b/bizinikiwi/pezframe/asset-rate/src/benchmarking.rs @@ -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::*; diff --git a/bizinikiwi/pezframe/asset-rate/src/lib.rs b/bizinikiwi/pezframe/asset-rate/src/lib.rs index 079e75e4..3d58af66 100644 --- a/bizinikiwi/pezframe/asset-rate/src/lib.rs +++ b/bizinikiwi/pezframe/asset-rate/src/lib.rs @@ -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 = ::AccountId; -// This pallet's asset kind and balance type. +// This pezpallet's asset kind and balance type. type AssetKindOf = ::AssetKind; // Generic fungible balance type. type BalanceOf = <::Currency as Inspect>>::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(_); + #[pezpallet::pezpallet] + pub struct Pezpallet(_); - #[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; - /// The currency mechanism for this pallet. + /// The currency mechanism for this pezpallet. type Currency: Inspect; /// 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::::get(asset_kind)` - #[pallet::storage] + #[pezpallet::storage] pub type ConversionRateToNative = 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 { // 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 { /// The given asset ID is unknown. UnknownAssetKind, @@ -157,14 +157,14 @@ pub mod pallet { Overflow, } - #[pallet::call] - impl Pallet { + #[pezpallet::call] + impl Pezpallet { /// 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, asset_kind: Box, @@ -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, asset_kind: Box, @@ -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, asset_kind: Box) -> 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 ConversionFromAssetBalance, AssetKindOf, BalanceOf> for Pallet +impl ConversionFromAssetBalance, AssetKindOf, BalanceOf> for Pezpallet where T: Config, { - type Error = pallet::Error; + type Error = pezpallet::Error; fn from_asset_balance( balance: BalanceOf, asset_kind: AssetKindOf, - ) -> Result, pallet::Error> { - let rate = pallet::ConversionRateToNative::::get(asset_kind) - .ok_or(pallet::Error::::UnknownAssetKind.into())?; + ) -> Result, pezpallet::Error> { + let rate = pezpallet::ConversionRateToNative::::get(asset_kind) + .ok_or(pezpallet::Error::::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) { - pallet::ConversionRateToNative::::set(asset_id.clone(), Some(1.into())); + pezpallet::ConversionRateToNative::::set(asset_id.clone(), Some(1.into())); } } /// Exposes conversion of a native balance to an asset balance. -impl ConversionToAssetBalance, AssetKindOf, BalanceOf> for Pallet +impl ConversionToAssetBalance, AssetKindOf, BalanceOf> for Pezpallet where T: Config, { - type Error = pallet::Error; + type Error = pezpallet::Error; fn to_asset_balance( balance: BalanceOf, asset_kind: AssetKindOf, - ) -> Result, pallet::Error> { - let rate = pallet::ConversionRateToNative::::get(asset_kind) - .ok_or(pallet::Error::::UnknownAssetKind.into())?; + ) -> Result, pezpallet::Error> { + let rate = pezpallet::ConversionRateToNative::::get(asset_kind) + .ok_or(pezpallet::Error::::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::::Overflow.into())? + .ok_or(pezpallet::Error::::Overflow.into())? .saturating_mul_int(balance)) } } diff --git a/bizinikiwi/pezframe/asset-rate/src/tests.rs b/bizinikiwi/pezframe/asset-rate/src/tests.rs index 97e2b983..75532ee7 100644 --- a/bizinikiwi/pezframe/asset-rate/src/tests.rs +++ b/bizinikiwi/pezframe/asset-rate/src/tests.rs @@ -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; diff --git a/bizinikiwi/pezframe/asset-rate/src/weights.rs b/bizinikiwi/pezframe/asset-rate/src/weights.rs index dc56d45a..981649c5 100644 --- a/bizinikiwi/pezframe/asset-rate/src/weights.rs +++ b/bizinikiwi/pezframe/asset-rate/src/weights.rs @@ -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 diff --git a/bizinikiwi/pezframe/asset-rewards/Cargo.toml b/bizinikiwi/pezframe/asset-rewards/Cargo.toml index 4752b676..6299c876 100644 --- a/bizinikiwi/pezframe/asset-rewards/Cargo.toml +++ b/bizinikiwi/pezframe/asset-rewards/Cargo.toml @@ -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] diff --git a/bizinikiwi/pezframe/asset-rewards/src/benchmarking.rs b/bizinikiwi/pezframe/asset-rewards/src/benchmarking.rs index 93398e9f..36f235b4 100644 --- a/bizinikiwi/pezframe/asset-rewards/src/benchmarking.rs +++ b/bizinikiwi/pezframe/asset-rewards/src/benchmarking.rs @@ -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::*; diff --git a/bizinikiwi/pezframe/asset-rewards/src/lib.rs b/bizinikiwi/pezframe/asset-rewards/src/lib.rs index 64e94377..df6af1a4 100644 --- a/bizinikiwi/pezframe/asset-rewards/src/lib.rs +++ b/bizinikiwi/pezframe/asset-rewards/src/lib.rs @@ -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 = PoolInfo< BlockNumberFor, >; -/// 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 = <::BlockNumberProvider as BlockNumberProvider>::BlockNumber; @@ -167,7 +167,7 @@ pub struct PoolInfo { } pezsp_api::decl_runtime_apis! { - /// The runtime API for the asset rewards pallet. + /// The runtime API for the asset rewards pezpallet. pub trait AssetRewards { /// 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(_); + #[pezpallet::pezpallet] + pub struct Pezpallet(_); - /// 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> + IsType<::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; /// 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; - /// 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 = StorageDoubleMap< _, Blake2_128Concat, @@ -296,25 +296,25 @@ pub mod pallet { >; /// State and configuration of each staking pool. - #[pallet::storage] + #[pezpallet::storage] pub type Pools = StorageMap<_, Blake2_128Concat, PoolId, PoolInfoFor>; /// 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 = 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 = 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 { /// An account staked some tokens in a pool. Staked { @@ -392,7 +392,7 @@ pub mod pallet { }, } - #[pallet::error] + #[pezpallet::error] pub enum Error { /// The staker does not have enough tokens to perform the operation. NotEnoughTokens, @@ -416,8 +416,8 @@ pub mod pallet { NonEmptyPool, } - #[pallet::hooks] - impl Hooks> for Pallet { + #[pezpallet::hooks] + impl Hooks> for Pezpallet { 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(::WeightInfo))] - impl Pallet { + /// Pezpallet's callable functions. + #[pezpallet::call(weight(::WeightInfo))] + impl Pezpallet { /// 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, staked_asset_id: Box, @@ -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, 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, 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, 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, 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, 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, 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, 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, pool_id: PoolId) -> DispatchResult { let who = ensure_signed(origin)?; @@ -729,7 +729,7 @@ pub mod pallet { } } - impl Pallet { + impl Pezpallet { /// 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 RewardsPool for Pallet { +impl RewardsPool for Pezpallet { type AssetId = T::AssetId; type BlockNumber = BlockNumberFor; type PoolId = PoolId; diff --git a/bizinikiwi/pezframe/asset-rewards/src/mock.rs b/bizinikiwi/pezframe/asset-rewards/src/mock.rs index b3dba650..adbf53d3 100644 --- a/bizinikiwi/pezframe/asset-rewards/src/mock.rs +++ b/bizinikiwi/pezframe/asset-rewards/src/mock.rs @@ -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 for MockPermissionedOrigin { } } -/// Allow Freezes for the `Assets` pallet +/// Allow Freezes for the `Assets` pezpallet impl pezpallet_assets_freezer::Config for MockRuntime { type RuntimeFreezeReason = RuntimeFreezeReason; type RuntimeEvent = RuntimeEvent; @@ -168,7 +168,7 @@ impl Config for MockRuntime { CreationHoldReason, LinearStoragePrice, ConstU128<0>, u128>, >; - type BlockNumberProvider = pezframe_system::Pallet; + type BlockNumberProvider = pezframe_system::Pezpallet; #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper = AssetRewardsBenchmarkHelper; } diff --git a/bizinikiwi/pezframe/asset-rewards/src/weights.rs b/bizinikiwi/pezframe/asset-rewards/src/weights.rs index be427a20..d7a1c0f4 100644 --- a/bizinikiwi/pezframe/asset-rewards/src/weights.rs +++ b/bizinikiwi/pezframe/asset-rewards/src/weights.rs @@ -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 diff --git a/bizinikiwi/pezframe/assets-freezer/src/impls.rs b/bizinikiwi/pezframe/assets-freezer/src/impls.rs index 73c00de7..31a710e6 100644 --- a/bizinikiwi/pezframe/assets-freezer/src/impls.rs +++ b/bizinikiwi/pezframe/assets-freezer/src/impls.rs @@ -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, I: 'static> FrozenBalance - for Pallet + for Pezpallet { fn frozen_balance(asset: T::AssetId, who: &T::AccountId) -> Option { FrozenBalances::::get(asset, who) @@ -58,24 +58,24 @@ impl, I: 'static> FrozenBalance, I: 'static> Inspect for Pallet { +impl, I: 'static> Inspect for Pezpallet { type AssetId = T::AssetId; type Balance = T::Balance; fn total_issuance(asset: Self::AssetId) -> Self::Balance { - pezpallet_assets::Pallet::::total_issuance(asset) + pezpallet_assets::Pezpallet::::total_issuance(asset) } fn minimum_balance(asset: Self::AssetId) -> Self::Balance { - pezpallet_assets::Pallet::::minimum_balance(asset) + pezpallet_assets::Pezpallet::::minimum_balance(asset) } fn total_balance(asset: Self::AssetId, who: &T::AccountId) -> Self::Balance { - pezpallet_assets::Pallet::::total_balance(asset, who) + pezpallet_assets::Pezpallet::::total_balance(asset, who) } fn balance(asset: Self::AssetId, who: &T::AccountId) -> Self::Balance { - pezpallet_assets::Pallet::::balance(asset, who) + pezpallet_assets::Pezpallet::::balance(asset, who) } fn reducible_balance( @@ -84,7 +84,7 @@ impl, I: 'static> Inspect for Pallet { preservation: Preservation, force: Fortitude, ) -> Self::Balance { - pezpallet_assets::Pallet::::reducible_balance(asset, who, preservation, force) + pezpallet_assets::Pezpallet::::reducible_balance(asset, who, preservation, force) } fn can_deposit( @@ -93,7 +93,7 @@ impl, I: 'static> Inspect for Pallet { amount: Self::Balance, provenance: Provenance, ) -> DepositConsequence { - pezpallet_assets::Pallet::::can_deposit(asset, who, amount, provenance) + pezpallet_assets::Pezpallet::::can_deposit(asset, who, amount, provenance) } fn can_withdraw( @@ -101,15 +101,15 @@ impl, I: 'static> Inspect for Pallet { who: &T::AccountId, amount: Self::Balance, ) -> WithdrawConsequence { - pezpallet_assets::Pallet::::can_withdraw(asset, who, amount) + pezpallet_assets::Pezpallet::::can_withdraw(asset, who, amount) } fn asset_exists(asset: Self::AssetId) -> bool { - pezpallet_assets::Pallet::::asset_exists(asset) + pezpallet_assets::Pezpallet::::asset_exists(asset) } } -impl, I: 'static> InspectFreeze for Pallet { +impl, I: 'static> InspectFreeze for Pezpallet { type Id = T::RuntimeFreezeReason; fn balance_frozen(asset: Self::AssetId, id: &Self::Id, who: &T::AccountId) -> Self::Balance { @@ -123,7 +123,7 @@ impl, I: 'static> InspectFreeze for Pallet { } } -impl, I: 'static> MutateFreeze for Pallet { +impl, I: 'static> MutateFreeze for Pezpallet { fn set_freeze( asset: Self::AssetId, id: &Self::Id, diff --git a/bizinikiwi/pezframe/assets-freezer/src/lib.rs b/bizinikiwi/pezframe/assets-freezer/src/lib.rs index 291f1f07..9eb485e0 100644 --- a/bizinikiwi/pezframe/assets-freezer/src/lib.rs +++ b/bizinikiwi/pezframe/assets-freezer/src/lib.rs @@ -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: pezframe_system::Config + pezpallet_assets::Config { /// 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> + IsType<::RuntimeEvent>; } - #[pallet::error] + #[pezpallet::error] pub enum Error { /// Number of freezes on an account would exceed `MaxFreezes`. TooManyFreezes, } - #[pallet::pallet] - pub struct Pallet(_); + #[pezpallet::pezpallet] + pub struct Pezpallet(_); - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] + #[pezpallet::event] + #[pezpallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event, 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, 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, I: 'static = ()> = StorageDoubleMap< _, Blake2_128Concat, @@ -130,8 +130,8 @@ pub mod pallet { T::Balance, >; - #[pallet::hooks] - impl, I: 'static> Hooks> for Pallet { + #[pezpallet::hooks] + impl, I: 'static> Hooks> for Pezpallet { #[cfg(feature = "try-runtime")] fn try_state(_: BlockNumberFor) -> Result<(), TryRuntimeError> { Self::do_try_state() @@ -139,7 +139,7 @@ pub mod pallet { } } -impl, I: 'static> Pallet { +impl, I: 'static> Pezpallet { fn update_freezes( asset: T::AssetId, who: &T::AccountId, diff --git a/bizinikiwi/pezframe/assets-holder/src/impl_fungibles.rs b/bizinikiwi/pezframe/assets-holder/src/impl_fungibles.rs index db3c47aa..0299f8a4 100644 --- a/bizinikiwi/pezframe/assets-holder/src/impl_fungibles.rs +++ b/bizinikiwi/pezframe/assets-holder/src/impl_fungibles.rs @@ -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, I: 'static> BalanceOnHold - for Pallet + for Pezpallet { fn balance_on_hold(asset: T::AssetId, who: &T::AccountId) -> Option { BalancesOnHold::::get(asset, who) @@ -63,24 +63,24 @@ impl, I: 'static> BalanceOnHold, I: 'static> Inspect for Pallet { +impl, I: 'static> Inspect for Pezpallet { type AssetId = T::AssetId; type Balance = T::Balance; fn total_issuance(asset: Self::AssetId) -> Self::Balance { - pezpallet_assets::Pallet::::total_issuance(asset) + pezpallet_assets::Pezpallet::::total_issuance(asset) } fn minimum_balance(asset: Self::AssetId) -> Self::Balance { - pezpallet_assets::Pallet::::minimum_balance(asset) + pezpallet_assets::Pezpallet::::minimum_balance(asset) } fn total_balance(asset: Self::AssetId, who: &T::AccountId) -> Self::Balance { - pezpallet_assets::Pallet::::total_balance(asset, who) + pezpallet_assets::Pezpallet::::total_balance(asset, who) } fn balance(asset: Self::AssetId, who: &T::AccountId) -> Self::Balance { - pezpallet_assets::Pallet::::balance(asset, who) + pezpallet_assets::Pezpallet::::balance(asset, who) } fn reducible_balance( @@ -89,7 +89,7 @@ impl, I: 'static> Inspect for Pallet { preservation: Preservation, force: Fortitude, ) -> Self::Balance { - pezpallet_assets::Pallet::::reducible_balance(asset, who, preservation, force) + pezpallet_assets::Pezpallet::::reducible_balance(asset, who, preservation, force) } fn can_deposit( @@ -98,7 +98,7 @@ impl, I: 'static> Inspect for Pallet { amount: Self::Balance, provenance: Provenance, ) -> DepositConsequence { - pezpallet_assets::Pallet::::can_deposit(asset, who, amount, provenance) + pezpallet_assets::Pezpallet::::can_deposit(asset, who, amount, provenance) } fn can_withdraw( @@ -106,15 +106,15 @@ impl, I: 'static> Inspect for Pallet { who: &T::AccountId, amount: Self::Balance, ) -> WithdrawConsequence { - pezpallet_assets::Pallet::::can_withdraw(asset, who, amount) + pezpallet_assets::Pezpallet::::can_withdraw(asset, who, amount) } fn asset_exists(asset: Self::AssetId) -> bool { - pezpallet_assets::Pallet::::asset_exists(asset) + pezpallet_assets::Pezpallet::::asset_exists(asset) } } -impl, I: 'static> InspectHold for Pallet { +impl, I: 'static> InspectHold for Pezpallet { type Reason = T::RuntimeHoldReason; fn total_balance_on_hold(asset: Self::AssetId, who: &T::AccountId) -> Self::Balance { @@ -134,10 +134,10 @@ impl, I: 'static> InspectHold for Pallet { } } -impl, I: 'static> Unbalanced for Pallet { +impl, I: 'static> Unbalanced for Pezpallet { fn handle_dust(dust: Dust) { let Dust(id, balance) = dust; - pezpallet_assets::Pallet::::handle_dust(Dust(id, balance)); + pezpallet_assets::Pezpallet::::handle_dust(Dust(id, balance)); } fn write_balance( @@ -145,11 +145,11 @@ impl, I: 'static> Unbalanced for Pallet { who: &T::AccountId, amount: Self::Balance, ) -> Result, DispatchError> { - pezpallet_assets::Pallet::::write_balance(asset, who, amount) + pezpallet_assets::Pezpallet::::write_balance(asset, who, amount) } fn set_total_issuance(asset: Self::AssetId, amount: Self::Balance) { - pezpallet_assets::Pallet::::set_total_issuance(asset, amount) + pezpallet_assets::Pezpallet::::set_total_issuance(asset, amount) } fn decrease_balance( @@ -160,7 +160,7 @@ impl, I: 'static> Unbalanced for Pallet { preservation: Preservation, force: Fortitude, ) -> Result { - pezpallet_assets::Pallet::::decrease_balance( + pezpallet_assets::Pezpallet::::decrease_balance( asset, who, amount, @@ -176,11 +176,11 @@ impl, I: 'static> Unbalanced for Pallet { amount: Self::Balance, precision: Precision, ) -> Result { - pezpallet_assets::Pallet::::increase_balance(asset, who, amount, precision) + pezpallet_assets::Pezpallet::::increase_balance(asset, who, amount, precision) } } -impl, I: 'static> UnbalancedHold for Pallet { +impl, I: 'static> UnbalancedHold for Pezpallet { fn set_balance_on_hold( asset: Self::AssetId, reason: &Self::Reason, @@ -245,7 +245,7 @@ impl, I: 'static> UnbalancedHold for Pallet { } } -impl, I: 'static> MutateHold for Pallet { +impl, I: 'static> MutateHold for Pezpallet { fn done_hold( asset_id: Self::AssetId, reason: &Self::Reason, diff --git a/bizinikiwi/pezframe/assets-holder/src/lib.rs b/bizinikiwi/pezframe/assets-holder/src/lib.rs index 033f9ffa..6b52fe3b 100644 --- a/bizinikiwi/pezframe/assets-holder/src/lib.rs +++ b/bizinikiwi/pezframe/assets-holder/src/lib.rs @@ -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: - pezframe_system::Config + pezpallet_assets::Config> + pezframe_system::Config + pezpallet_assets::Config> { /// 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> + IsType<::RuntimeEvent>; } - #[pallet::error] + #[pezpallet::error] pub enum Error { /// Number of holds on an account would exceed the count of `RuntimeHoldReason`. TooManyHolds, } - #[pallet::pallet] - pub struct Pallet(_); + #[pezpallet::pezpallet] + pub struct Pezpallet(_); - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] + #[pezpallet::event] + #[pezpallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event, 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, 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, I: 'static = ()> = StorageDoubleMap< _, Blake2_128Concat, @@ -140,8 +140,8 @@ pub mod pallet { T::Balance, >; - #[pallet::hooks] - impl, I: 'static> Hooks> for Pallet { + #[pezpallet::hooks] + impl, I: 'static> Hooks> for Pezpallet { #[cfg(feature = "try-runtime")] fn try_state(_: BlockNumberFor) -> Result<(), pezsp_runtime::TryRuntimeError> { Self::do_try_state() @@ -149,7 +149,7 @@ pub mod pallet { } } -impl, I: 'static> Pallet { +impl, I: 'static> Pezpallet { #[cfg(any(test, feature = "try-runtime"))] fn do_try_state() -> Result<(), pezsp_runtime::TryRuntimeError> { use pezsp_runtime::{ diff --git a/bizinikiwi/pezframe/assets-holder/src/tests.rs b/bizinikiwi/pezframe/assets-holder/src/tests.rs index 0b0be6cd..65eb4033 100644 --- a/bizinikiwi/pezframe/assets-holder/src/tests.rs +++ b/bizinikiwi/pezframe/assets-holder/src/tests.rs @@ -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() { diff --git a/bizinikiwi/pezframe/assets/Cargo.toml b/bizinikiwi/pezframe/assets/Cargo.toml index 7a095d90..047afde7 100644 --- a/bizinikiwi/pezframe/assets/Cargo.toml +++ b/bizinikiwi/pezframe/assets/Cargo.toml @@ -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" diff --git a/bizinikiwi/pezframe/assets/README.md b/bizinikiwi/pezframe/assets/README.md index 34bc8e9b..bf9759d2 100644 --- a/bizinikiwi/pezframe/assets/README.md +++ b/bizinikiwi/pezframe/assets/README.md @@ -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(_); + #[pezpallet::pezpallet] + pub struct Pezpallet(_); - #[pallet::config] + #[pezpallet::config] pub trait Config: frame_system::Config + assets::Config {} - #[pallet::call] - impl Pallet { + #[pezpallet::call] + impl Pezpallet { pub fn issue_token_airdrop(origin: OriginFor) -> DispatchResult { let sender = ensure_signed(origin)?; diff --git a/bizinikiwi/pezframe/assets/precompiles/src/lib.rs b/bizinikiwi/pezframe/assets/precompiles/src/lib.rs index 51ecfe83..d7b6a234 100644 --- a/bizinikiwi/pezframe/assets/precompiles/src/lib.rs +++ b/bizinikiwi/pezframe/assets/precompiles/src/lib.rs @@ -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<>::Balance, Error> { @@ -189,7 +189,7 @@ where ); let f = TransferFlags { keep_alive: false, best_effort: false, burn_dust: false }; - pezpallet_assets::Pallet::::do_transfer( + pezpallet_assets::Pezpallet::::do_transfer( asset_id, &::AddressMapper::to_account_id(&from), &dest, @@ -219,7 +219,7 @@ where env.charge(>::WeightInfo::total_issuance())?; let value = - Self::to_u256(pezpallet_assets::Pallet::::total_issuance(asset_id))?; + Self::to_u256(pezpallet_assets::Pezpallet::::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 = ::AddressMapper::to_account_id(&account); let value = - Self::to_u256(pezpallet_assets::Pallet::::balance(asset_id, account))?; + Self::to_u256(pezpallet_assets::Pezpallet::::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 = ::AddressMapper::to_account_id(&spender); - let value = Self::to_u256(pezpallet_assets::Pallet::::allowance( + let value = Self::to_u256(pezpallet_assets::Pezpallet::::allowance( asset_id, &owner, &spender, ))?; @@ -268,7 +268,7 @@ where let spender = call.spender.into_array().into(); let spender = ::AddressMapper::to_account_id(&spender); - pezpallet_assets::Pallet::::do_approve_transfer( + pezpallet_assets::Pezpallet::::do_approve_transfer( asset_id, &::AddressMapper::to_account_id(&owner), &spender, @@ -303,7 +303,7 @@ where let to = call.to.into_array().into(); let to = ::AddressMapper::to_account_id(&to); - pezpallet_assets::Pallet::::do_transfer_approved( + pezpallet_assets::Pezpallet::::do_transfer_approved( asset_id, &from, &spender, diff --git a/bizinikiwi/pezframe/assets/precompiles/src/tests.rs b/bizinikiwi/pezframe/assets/precompiles/src/tests.rs index 1e527d3d..a6b6f49b 100644 --- a/bizinikiwi/pezframe/assets/precompiles/src/tests.rs +++ b/bizinikiwi/pezframe/assets/precompiles/src/tests.rs @@ -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::::bare_call( + pezpallet_revive::Pezpallet::::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::::bare_call( + let data = pezpallet_revive::Pezpallet::::bare_call( RuntimeOrigin::signed(owner), H160::from(asset_addr), 0u32.into(), @@ -144,7 +144,7 @@ fn balance_of_works() { let account = ::AddressMapper::to_address(&owner).0.into(); let data = IERC20::balanceOfCall { account }.abi_encode(); - let data = pezpallet_revive::Pallet::::bare_call( + let data = pezpallet_revive::Pezpallet::::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::::bare_call( + pezpallet_revive::Pezpallet::::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::::bare_call( + let data = pezpallet_revive::Pezpallet::::bare_call( RuntimeOrigin::signed(owner), H160::from(asset_addr), 0u32.into(), @@ -236,7 +236,7 @@ fn approval_works() { } .abi_encode(); - pezpallet_revive::Pallet::::bare_call( + pezpallet_revive::Pezpallet::::bare_call( RuntimeOrigin::signed(spender), H160::from(asset_addr), 0u32.into(), diff --git a/bizinikiwi/pezframe/assets/src/benchmarking.rs b/bizinikiwi/pezframe/assets/src/benchmarking.rs index a54c05b5..13c76a4a 100644 --- a/bizinikiwi/pezframe/assets/src/benchmarking.rs +++ b/bizinikiwi/pezframe/assets/src/benchmarking.rs @@ -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, I: 'static>(minter: T::AccountId, n: u32) { } fn assert_last_event, I: 'static>(generic_event: >::RuntimeEvent) { - pezframe_system::Pallet::::assert_last_event(generic_event.into()); + pezframe_system::Pezpallet::::assert_last_event(generic_event.into()); } fn assert_event, I: 'static>(generic_event: >::RuntimeEvent) { - pezframe_system::Pallet::::assert_has_event(generic_event.into()); + pezframe_system::Pezpallet::::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::::account_exists(&caller)); + assert!(pezframe_system::Pezpallet::::account_exists(&caller)); assert_last_event::(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::(true, 100u32.into()); let amount; }: { - amount = Pallet::::total_issuance(asset_id.into()); + amount = Pezpallet::::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::(true, 100u32.into()); let amount; }: { - amount = Pallet::::balance(asset_id.into(), caller); + amount = Pezpallet::::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::::allowance(asset_id.into(), &caller, &delegate); + amount = Pezpallet::::allowance(asset_id.into(), &caller, &delegate); } verify { assert_eq!(amount, 100u32.into()); } migration_v2_foreign_asset_set_reserve_weight { let (id, _, _) = create_default_asset::(true); - let id: >::AssetId = id.into(); + let id: >::AssetId = id.into(); let reserve = T::BenchmarkHelper::create_reserve_id_parameter(42); }: { let asset_id = Asset::::iter_keys().next() .ok_or_else(|| BenchmarkError::Override(BenchmarkResult::from_weight(Weight::MAX)))?; assert_eq!(id, asset_id); - Pallet::::unchecked_update_reserves(asset_id, vec![reserve.clone()]).unwrap(); + Pezpallet::::unchecked_update_reserves(asset_id, vec![reserve.clone()]).unwrap(); } verify { assert_eq!(Reserves::::get(id)[0], reserve); diff --git a/bizinikiwi/pezframe/assets/src/extra_mutator.rs b/bizinikiwi/pezframe/assets/src/extra_mutator.rs index da9e9c99..30e0c9b1 100644 --- a/bizinikiwi/pezframe/assets/src/extra_mutator.rs +++ b/bizinikiwi/pezframe/assets/src/extra_mutator.rs @@ -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. diff --git a/bizinikiwi/pezframe/assets/src/functions.rs b/bizinikiwi/pezframe/assets/src/functions.rs index 92b91072..9df2cec5 100644 --- a/bizinikiwi/pezframe/assets/src/functions.rs +++ b/bizinikiwi/pezframe/assets/src/functions.rs @@ -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, I: 'static> Pallet { +impl, I: 'static> Pezpallet { // Public immutables /// Return the extra "sid-car" data for `id`/`who`, or `None` if the account doesn't exist. @@ -77,16 +77,16 @@ impl, I: 'static> Pallet { ExistenceReason::DepositFrom(depositor.clone(), deposit) } } else if d.is_sufficient { - pezframe_system::Pallet::::inc_sufficients(who); + pezframe_system::Pezpallet::::inc_sufficients(who); d.sufficients.saturating_inc(); ExistenceReason::Sufficient } else { - pezframe_system::Pallet::::inc_consumers(who) + pezframe_system::Pezpallet::::inc_consumers(who) .map_err(|_| Error::::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::::can_inc_consumer(who) { - pezframe_system::Pallet::::dec_consumers(who); + if !pezframe_system::Pezpallet::::can_inc_consumer(who) { + pezframe_system::Pezpallet::::dec_consumers(who); return Err(Error::::UnavailableConsumer.into()); } ExistenceReason::Consumer @@ -113,10 +113,10 @@ impl, I: 'static> Pallet { use ExistenceReason::*; match *reason { - Consumer => pezframe_system::Pallet::::dec_consumers(who), + Consumer => pezframe_system::Pezpallet::::dec_consumers(who), Sufficient => { d.sufficients = d.sufficients.saturating_sub(1); - pezframe_system::Pallet::::dec_sufficients(who); + pezframe_system::Pezpallet::::dec_sufficients(who); }, DepositRefunded => {}, DepositHeld(_) | DepositFrom(..) if !force => return Keep, @@ -160,7 +160,7 @@ impl, I: 'static> Pallet { if amount < details.min_balance { return DepositConsequence::BelowMinimum; } - if !details.is_sufficient && !pezframe_system::Pallet::::can_accrue_consumers(who, 2) { + if !details.is_sufficient && !pezframe_system::Pezpallet::::can_accrue_consumers(who, 2) { return DepositConsequence::CannotCreate; } if details.is_sufficient && details.sufficients.checked_add(1).is_none() { diff --git a/bizinikiwi/pezframe/assets/src/impl_fungibles.rs b/bizinikiwi/pezframe/assets/src/impl_fungibles.rs index 00e8b95c..4aa3d13f 100644 --- a/bizinikiwi/pezframe/assets/src/impl_fungibles.rs +++ b/bizinikiwi/pezframe/assets/src/impl_fungibles.rs @@ -30,7 +30,7 @@ use pezframe_support::{ use super::*; -impl, I: 'static> fungibles::Inspect<::AccountId> for Pallet { +impl, I: 'static> fungibles::Inspect<::AccountId> for Pezpallet { type AssetId = T::AssetId; type Balance = T::Balance; @@ -43,11 +43,11 @@ impl, I: 'static> fungibles::Inspect<::AccountId } fn balance(asset: Self::AssetId, who: &::AccountId) -> Self::Balance { - Pallet::::balance(asset, who) + Pezpallet::::balance(asset, who) } fn total_balance(asset: Self::AssetId, who: &::AccountId) -> Self::Balance { - Pallet::::balance(asset.clone(), who) + Pezpallet::::balance(asset.clone(), who) .saturating_add(T::Holder::balance_on_hold(asset, who).unwrap_or_default()) } @@ -57,7 +57,7 @@ impl, I: 'static> fungibles::Inspect<::AccountId preservation: Preservation, _: Fortitude, ) -> Self::Balance { - Pallet::::reducible_balance(asset, who, !matches!(preservation, Expendable)) + Pezpallet::::reducible_balance(asset, who, !matches!(preservation, Expendable)) .unwrap_or(Zero::zero()) } @@ -67,7 +67,7 @@ impl, I: 'static> fungibles::Inspect<::AccountId amount: Self::Balance, provenance: Provenance, ) -> DepositConsequence { - Pallet::::can_increase(asset, who, amount, provenance == Minted) + Pezpallet::::can_increase(asset, who, amount, provenance == Minted) } fn can_withdraw( @@ -75,7 +75,7 @@ impl, I: 'static> fungibles::Inspect<::AccountId who: &::AccountId, amount: Self::Balance, ) -> WithdrawConsequence { - Pallet::::can_decrease(asset, who, amount, false) + Pezpallet::::can_decrease(asset, who, amount, false) } fn asset_exists(asset: Self::AssetId) -> bool { @@ -83,7 +83,7 @@ impl, I: 'static> fungibles::Inspect<::AccountId } } -impl, I: 'static> fungibles::Mutate<::AccountId> for Pallet { +impl, I: 'static> fungibles::Mutate<::AccountId> for Pezpallet { fn done_mint_into( asset_id: Self::AssetId, beneficiary: &::AccountId, @@ -116,7 +116,7 @@ impl, I: 'static> fungibles::Mutate<::AccountId> } impl, I: 'static> fungibles::Balanced<::AccountId> - for Pallet + for Pezpallet { type OnDropCredit = fungibles::DecreaseIssuance; type OnDropDebt = fungibles::IncreaseIssuance; @@ -138,7 +138,7 @@ impl, I: 'static> fungibles::Balanced<::AccountI } } -impl, I: 'static> fungibles::Unbalanced for Pallet { +impl, I: 'static> fungibles::Unbalanced for Pezpallet { fn handle_raw_dust(_: Self::AssetId, _: Self::Balance) {} fn handle_dust(_: fungibles::Dust) { defensive!("`decrease_balance` and `increase_balance` have non-default impls; nothing else calls this; qed"); @@ -185,7 +185,7 @@ impl, I: 'static> fungibles::Unbalanced for Pallet, I: 'static> fungibles::Create for Pallet { +impl, I: 'static> fungibles::Create for Pezpallet { fn create( id: T::AssetId, admin: T::AccountId, @@ -196,7 +196,7 @@ impl, I: 'static> fungibles::Create for Pallet } } -impl, I: 'static> fungibles::Destroy for Pallet { +impl, I: 'static> fungibles::Destroy for Pezpallet { fn start_destroy(id: T::AssetId, maybe_check_owner: Option) -> DispatchResult { Self::do_start_destroy(id, maybe_check_owner) } @@ -215,7 +215,7 @@ impl, I: 'static> fungibles::Destroy for Pallet } impl, I: 'static> fungibles::metadata::Inspect<::AccountId> - for Pallet + for Pezpallet { fn name(asset: T::AssetId) -> Vec { Metadata::::get(asset).name.to_vec() @@ -231,7 +231,7 @@ impl, I: 'static> fungibles::metadata::Inspect<: } impl, I: 'static> fungibles::metadata::Mutate<::AccountId> - for Pallet + for Pezpallet { fn set( asset: T::AssetId, @@ -247,7 +247,7 @@ impl, I: 'static> fungibles::metadata::Mutate<:: impl, I: 'static> fungibles::metadata::MetadataDeposit< ::AccountId>>::Balance, - > for Pallet + > for Pezpallet { fn calc_metadata_deposit( name: &[u8], @@ -258,7 +258,7 @@ impl, I: 'static> } impl, I: 'static> fungibles::approvals::Inspect<::AccountId> - for Pallet + for Pezpallet { // Check the amount approved to be spent by an owner to a delegate fn allowance( @@ -273,7 +273,7 @@ impl, I: 'static> fungibles::approvals::Inspect< } impl, I: 'static> fungibles::approvals::Mutate<::AccountId> - for Pallet + for Pezpallet { // Approve spending tokens from a given account fn approve( @@ -297,7 +297,7 @@ impl, I: 'static> fungibles::approvals::Mutate<: } impl, I: 'static> fungibles::roles::Inspect<::AccountId> - for Pallet + for Pezpallet { fn owner(asset: T::AssetId) -> Option<::AccountId> { Asset::::get(asset).map(|x| x.owner) @@ -316,7 +316,7 @@ impl, I: 'static> fungibles::roles::Inspect<::Ac } } -impl, I: 'static> fungibles::InspectEnumerable for Pallet { +impl, I: 'static> fungibles::InspectEnumerable for Pezpallet { type AssetsIterator = KeyPrefixIterator<>::AssetId>; /// Returns an iterator of the assets in existence. @@ -327,7 +327,7 @@ impl, I: 'static> fungibles::InspectEnumerable for Pa } } -impl, I: 'static> fungibles::roles::ResetTeam for Pallet { +impl, I: 'static> fungibles::roles::ResetTeam for Pezpallet { fn reset_team( id: T::AssetId, owner: T::AccountId, @@ -339,7 +339,7 @@ impl, I: 'static> fungibles::roles::ResetTeam for Pal } } -impl, I: 'static> fungibles::Refund for Pallet { +impl, I: 'static> fungibles::Refund for Pezpallet { type AssetId = T::AssetId; type Balance = DepositBalanceOf; fn deposit_held(id: Self::AssetId, who: T::AccountId) -> Option<(T::AccountId, Self::Balance)> { diff --git a/bizinikiwi/pezframe/assets/src/impl_stored_map.rs b/bizinikiwi/pezframe/assets/src/impl_stored_map.rs index 53bf9014..c2f120e8 100644 --- a/bizinikiwi/pezframe/assets/src/impl_stored_map.rs +++ b/bizinikiwi/pezframe/assets/src/impl_stored_map.rs @@ -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, I: 'static> StoredMap<(T::AssetId, T::AccountId), T::Extra> for Pallet { +impl, I: 'static> StoredMap<(T::AssetId, T::AccountId), T::Extra> for Pezpallet { fn get(id_who: &(T::AssetId, T::AccountId)) -> T::Extra { let (id, who) = id_who; Account::::get(id, who).map(|a| a.extra).unwrap_or_default() diff --git a/bizinikiwi/pezframe/assets/src/lib.rs b/bizinikiwi/pezframe/assets/src/lib.rs index 0442514b..beb04cf8 100644 --- a/bizinikiwi/pezframe/assets/src/lib.rs +++ b/bizinikiwi/pezframe/assets/src/lib.rs @@ -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 = <::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(_); + #[pezpallet::pezpallet] + #[pezpallet::storage_version(STORAGE_VERSION)] + pub struct Pezpallet(_); #[cfg(feature = "runtime-benchmarks")] pub trait BenchmarkHelper { @@ -316,11 +316,11 @@ pub mod pallet { } } - #[pallet::config(with_default)] + #[pezpallet::config(with_default)] /// The module configuration trait. pub trait Config: pezframe_system::Config { /// The overarching event type. - #[pallet::no_default_bounds] + #[pezpallet::no_default_bounds] #[allow(deprecated)] type RuntimeEvent: From> + IsType<::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; /// 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` 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; /// 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; /// 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>; /// 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>; /// 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>; /// 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>; /// 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>; /// The maximum length of a name or symbol stored on-chain. - #[pallet::constant] + #[pezpallet::constant] type StringLimit: Get; /// 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; - /// 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; } - #[pallet::storage] + #[pezpallet::storage] /// Details of an asset. pub type Asset, I: 'static = ()> = StorageMap< _, @@ -442,7 +442,7 @@ pub mod pallet { AssetDetails>, >; - #[pallet::storage] + #[pezpallet::storage] /// The holdings of a specific account for a specific asset. pub type Account, I: 'static = ()> = StorageDoubleMap< _, @@ -453,7 +453,7 @@ pub mod pallet { AssetAccountOf, >; - #[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>, >; - #[pallet::storage] + #[pezpallet::storage] /// Metadata of an asset. pub type Metadata, 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, 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, I: 'static = ()> = StorageValue<_, T::AssetId, OptionQuery>; - #[pallet::genesis_config] + #[pezpallet::genesis_config] #[derive(pezframe_support::DefaultNoBound)] pub struct GenesisConfig, I: 'static = ()> { /// Genesis assets: id, owner, is_sufficient, min_balance @@ -519,7 +519,7 @@ pub mod pallet { pub reserves: Vec<(T::AssetId, Vec)>, } - #[pallet::genesis_build] + #[pezpallet::genesis_build] impl, I: 'static> BuildGenesisConfig for GenesisConfig { 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 = >::increase_balance( + let result = >::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, 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 { /// Account balance must be greater than or equal to the transfer amount. BalanceLow, @@ -739,8 +739,8 @@ pub mod pallet { TooManyReserves, } - #[pallet::call(weight(>::WeightInfo))] - impl, I: 'static> Pallet { + #[pezpallet::call(weight(>::WeightInfo))] + impl, I: 'static> Pezpallet { /// 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, 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, id: T::AssetIdParameter, owner: AccountIdLookupOf, 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, 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, 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, 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, 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, id: T::AssetIdParameter, beneficiary: AccountIdLookupOf, - #[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, id: T::AssetIdParameter, who: AccountIdLookupOf, - #[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, id: T::AssetIdParameter, target: AccountIdLookupOf, - #[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, id: T::AssetIdParameter, target: AccountIdLookupOf, - #[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, id: T::AssetIdParameter, source: AccountIdLookupOf, dest: AccountIdLookupOf, - #[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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, id: T::AssetIdParameter, @@ -1467,7 +1467,7 @@ pub mod pallet { issuer: AccountIdLookupOf, admin: AccountIdLookupOf, freezer: AccountIdLookupOf, - #[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, id: T::AssetIdParameter, delegate: AccountIdLookupOf, - #[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, 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, 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, id: T::AssetIdParameter, owner: AccountIdLookupOf, destination: AccountIdLookupOf, - #[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, 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, 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, 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, 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, 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, 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, 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, id: T::AssetIdParameter, @@ -1886,8 +1886,8 @@ pub mod pallet { } } - #[pallet::view_functions] - impl, I: 'static> Pallet { + #[pezpallet::view_functions] + impl, I: 'static> Pezpallet { /// 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, I: 'static> AccountTouch for Pallet { + impl, I: 'static> AccountTouch for Pezpallet { type Balance = DepositBalanceOf; fn deposit_required(_: T::AssetId) -> Self::Balance { @@ -1926,7 +1926,7 @@ pub mod pallet { match Asset::::get(&asset) { // refer to the [`Self::new_account`] function for more details. Some(info) if info.is_sufficient => false, - Some(_) if pezframe_system::Pallet::::can_accrue_consumers(who, 2) => false, + Some(_) if pezframe_system::Pezpallet::::can_accrue_consumers(who, 2) => false, Some(_) => !Account::::contains_key(asset, who), _ => true, } @@ -1942,7 +1942,7 @@ pub mod pallet { } /// Implements [`ContainsPair`] trait for a pair of asset and account IDs. - impl, I: 'static> ContainsPair for Pallet { + impl, I: 'static> ContainsPair for Pezpallet { /// Check if an account with the given asset ID and account address exists. fn contains(asset: &T::AssetId, who: &T::AccountId) -> bool { Account::::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, I: 'static> ProvideAssetReserves for Pallet { + impl, I: 'static> ProvideAssetReserves for Pezpallet { /// Provide the configured reserves for asset `id`. fn reserves(id: &T::AssetId) -> Vec { Reserves::::get(id).into_inner() diff --git a/bizinikiwi/pezframe/assets/src/migration.rs b/bizinikiwi/pezframe/assets/src/migration.rs index 53714d0e..798f2b40 100644 --- a/bizinikiwi/pezframe/assets/src/migration.rs +++ b/bizinikiwi/pezframe/assets/src/migration.rs @@ -91,8 +91,8 @@ pub mod v1 { pub struct MigrateToV1(core::marker::PhantomData); impl OnRuntimeUpgrade for MigrateToV1 { fn on_runtime_upgrade() -> Weight { - let in_code_version = Pallet::::in_code_storage_version(); - let on_chain_version = Pallet::::on_chain_storage_version(); + let in_code_version = Pezpallet::::in_code_storage_version(); + let on_chain_version = Pezpallet::::on_chain_storage_version(); if on_chain_version == 0 && in_code_version == 1 { let mut translated = 0u64; Asset::::translate::< @@ -102,7 +102,7 @@ pub mod v1 { translated.saturating_inc(); Some(old_value.migrate_to_v1()) }); - in_code_version.put::>(); + in_code_version.put::>(); 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, TryRuntimeError> { pezframe_support::ensure!( - Pallet::::on_chain_storage_version() == 0, + Pezpallet::::on_chain_storage_version() == 0, "must upgrade linearly" ); let prev_count = Asset::::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::::in_code_storage_version(); - let on_chain_version = Pallet::::on_chain_storage_version(); + let in_code_version = Pezpallet::::in_code_storage_version(); + let on_chain_version = Pezpallet::::on_chain_storage_version(); pezframe_support::ensure!(in_code_version == 1, "must_upgrade"); ensure!( diff --git a/bizinikiwi/pezframe/assets/src/mock.rs b/bizinikiwi/pezframe/assets/src/mock.rs index 1b3e0d35..b3babfaa 100644 --- a/bizinikiwi/pezframe/assets/src/mock.rs +++ b/bizinikiwi/pezframe/assets/src/mock.rs @@ -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; diff --git a/bizinikiwi/pezframe/assets/src/tests.rs b/bizinikiwi/pezframe/assets/src/tests.rs index 3b89feb4..24a97506 100644 --- a/bizinikiwi/pezframe/assets/src/tests.rs +++ b/bizinikiwi/pezframe/assets/src/tests.rs @@ -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::::contains_key(0)); // Enable auto increment. Next asset id must be 5. - pallet::NextAssetId::::put(5); + pezpallet::NextAssetId::::put(5); assert_noop!(Assets::create(RuntimeOrigin::signed(1), 0, 1, 1), Error::::BadAssetId); assert_noop!(Assets::create(RuntimeOrigin::signed(1), 1, 1, 1), Error::::BadAssetId); diff --git a/bizinikiwi/pezframe/assets/src/tests/sets.rs b/bizinikiwi/pezframe/assets/src/tests/sets.rs index a0c56190..0f88ad80 100644 --- a/bizinikiwi/pezframe/assets/src/tests/sets.rs +++ b/bizinikiwi/pezframe/assets/src/tests/sets.rs @@ -70,7 +70,7 @@ type LeftFungibles = fungibles::UnionOf, T, ConvertToValue = fungibles::UnionOf, ConvertToValue, (), u64>; #[test] diff --git a/bizinikiwi/pezframe/assets/src/types.rs b/bizinikiwi/pezframe/assets/src/types.rs index 861fac9f..83a09219 100644 --- a/bizinikiwi/pezframe/assets/src/types.rs +++ b/bizinikiwi/pezframe/assets/src/types.rs @@ -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 { pub status: AccountStatus, /// The reason for the existence of the account. pub reason: ExistenceReason, - /// 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 = ::AccountId; -// This pallet's asset id and balance type. +// This pezpallet's asset id and balance type. type AssetIdOf = >::AssetId; type AssetBalanceOf = >::Balance; // Generic fungible balance type. diff --git a/bizinikiwi/pezframe/assets/src/weights.rs b/bizinikiwi/pezframe/assets/src/weights.rs index 4f780b03..0076d6fe 100644 --- a/bizinikiwi/pezframe/assets/src/weights.rs +++ b/bizinikiwi/pezframe/assets/src/weights.rs @@ -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 diff --git a/bizinikiwi/pezframe/atomic-swap/Cargo.toml b/bizinikiwi/pezframe/atomic-swap/Cargo.toml index 75c135bd..76f69def 100644 --- a/bizinikiwi/pezframe/atomic-swap/Cargo.toml +++ b/bizinikiwi/pezframe/atomic-swap/Cargo.toml @@ -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" diff --git a/bizinikiwi/pezframe/atomic-swap/src/lib.rs b/bizinikiwi/pezframe/atomic-swap/src/lib.rs index f3d9a27d..37c8069a 100644 --- a/bizinikiwi/pezframe/atomic-swap/src/lib.rs +++ b/bizinikiwi/pezframe/atomic-swap/src/lib.rs @@ -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; } - #[pallet::pallet] - pub struct Pallet(_); + #[pezpallet::pezpallet] + pub struct Pezpallet(_); - #[pallet::storage] + #[pezpallet::storage] pub type PendingSwaps = StorageDoubleMap< _, Twox64Concat, @@ -212,7 +212,7 @@ pub mod pallet { PendingSwap, >; - #[pallet::error] + #[pezpallet::error] pub enum Error { /// 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 { /// Swap created. NewSwap { account: T::AccountId, proof: HashedProof, swap: PendingSwap }, @@ -244,8 +244,8 @@ pub mod pallet { SwapCancelled { account: T::AccountId, proof: HashedProof }, } - #[pallet::call] - impl Pallet { + #[pezpallet::call] + impl Pezpallet { /// 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, target: T::AccountId, @@ -278,7 +278,7 @@ pub mod pallet { let swap = PendingSwap { source, action, - end_block: pezframe_system::Pallet::::block_number() + duration, + end_block: pezframe_system::Pezpallet::::block_number() + duration, }; PendingSwaps::::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, target: T::AccountId, @@ -347,7 +347,7 @@ pub mod pallet { let swap = PendingSwaps::::get(&target, hashed_proof).ok_or(Error::::NotExist)?; ensure!(swap.source == source, Error::::SourceMismatch); ensure!( - pezframe_system::Pallet::::block_number() >= swap.end_block, + pezframe_system::Pezpallet::::block_number() >= swap.end_block, Error::::DurationNotPassed, ); diff --git a/bizinikiwi/pezframe/aura/Cargo.toml b/bizinikiwi/pezframe/aura/Cargo.toml index 74972eea..0068a4b0 100644 --- a/bizinikiwi/pezframe/aura/Cargo.toml +++ b/bizinikiwi/pezframe/aura/Cargo.toml @@ -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" diff --git a/bizinikiwi/pezframe/aura/README.md b/bizinikiwi/pezframe/aura/README.md index 2a64f24b..93141649 100644 --- a/bizinikiwi/pezframe/aura/README.md +++ b/bizinikiwi/pezframe/aura/README.md @@ -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 diff --git a/bizinikiwi/pezframe/aura/src/lib.rs b/bizinikiwi/pezframe/aura/src/lib.rs index 9af8ce67..70367b77 100644 --- a/bizinikiwi/pezframe/aura/src/lib.rs +++ b/bizinikiwi/pezframe/aura/src/lib.rs @@ -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(core::marker::PhantomData); @@ -76,13 +76,13 @@ impl Get for MinimumPeriodTimesTwo } } -#[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; /// 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; @@ -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<::Moment>; } - #[pallet::pallet] - pub struct Pallet(core::marker::PhantomData); + #[pezpallet::pezpallet] + pub struct Pezpallet(core::marker::PhantomData); - #[pallet::hooks] - impl Hooks> for Pallet { + #[pezpallet::hooks] + impl Hooks> for Pezpallet { fn on_initialize(_: BlockNumberFor) -> Weight { if let Some(new_slot) = Self::current_slot_from_digests() { let current_slot = CurrentSlot::::get(); @@ -163,31 +163,31 @@ pub mod pallet { } /// The current authority set. - #[pallet::storage] + #[pezpallet::storage] pub type Authorities = StorageValue<_, BoundedVec, ValueQuery>; /// The current slot of this block. /// /// This will be set in `on_initialize`. - #[pallet::storage] + #[pezpallet::storage] pub type CurrentSlot = StorageValue<_, Slot, ValueQuery>; - #[pallet::genesis_config] + #[pezpallet::genesis_config] #[derive(pezframe_support::DefaultNoBound)] pub struct GenesisConfig { pub authorities: Vec, } - #[pallet::genesis_build] + #[pezpallet::genesis_build] impl BuildGenesisConfig for GenesisConfig { fn build(&self) { - Pallet::::initialize_authorities(&self.authorities); + Pezpallet::::initialize_authorities(&self.authorities); } } } -impl Pallet { +impl Pezpallet { /// Change authorities. /// /// The storage will be applied immediately. @@ -207,7 +207,7 @@ impl Pallet { AURA_ENGINE_ID, ConsensusLog::AuthoritiesChange(new.into_inner()).encode(), ); - >::deposit_log(log); + >::deposit_log(log); } /// Initial authorities. @@ -231,7 +231,7 @@ impl Pallet { /// Get the current slot from the pre-runtime digests. fn current_slot_from_digests() -> Option { - let digest = pezframe_system::Pallet::::digest(); + let digest = pezframe_system::Pezpallet::::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 Pallet { 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 Pallet { } } -impl pezsp_runtime::BoundToRuntimeAppPublic for Pallet { +impl pezsp_runtime::BoundToRuntimeAppPublic for Pezpallet { type Public = T::AuthorityId; } -impl OneSessionHandler for Pallet { +impl OneSessionHandler for Pezpallet { type Key = T::AuthorityId; fn on_genesis_session<'a, I: 'a>(validators: I) @@ -340,11 +340,11 @@ impl OneSessionHandler for Pallet { ConsensusLog::::OnDisabled(i as AuthorityIndex).encode(), ); - >::deposit_log(log); + >::deposit_log(log); } } -impl FindAuthor for Pallet { +impl FindAuthor for Pezpallet { fn find_author<'a, I>(digests: I) -> Option where I: 'a + IntoIterator, @@ -381,15 +381,15 @@ impl> FindAuthor } /// Find the authority ID of the Aura authority who authored the current block. -pub type AuraAuthorId = FindAccountFromAuthorIndex>; +pub type AuraAuthorId = FindAccountFromAuthorIndex>; -impl IsMember for Pallet { +impl IsMember for Pezpallet { fn is_member(authority_id: &T::AuthorityId) -> bool { Authorities::::get().iter().any(|id| id == authority_id) } } -impl OnTimestampSet for Pallet { +impl OnTimestampSet for Pezpallet { fn on_timestamp_set(moment: T::Moment) { let slot_duration = Self::slot_duration(); assert!(!slot_duration.is_zero(), "Aura slot duration cannot be zero."); diff --git a/bizinikiwi/pezframe/aura/src/migrations.rs b/bizinikiwi/pezframe/aura/src/migrations.rs index a8bd4b39..d49f4434 100644 --- a/bizinikiwi/pezframe/aura/src/migrations.rs +++ b/bizinikiwi/pezframe/aura/src/migrations.rs @@ -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}; diff --git a/bizinikiwi/pezframe/aura/src/tests.rs b/bizinikiwi/pezframe/aura/src/tests.rs index 9a8f90ed..275706ca 100644 --- a/bizinikiwi/pezframe/aura/src/tests.rs +++ b/bizinikiwi/pezframe/aura/src/tests.rs @@ -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::::get(), 0u64); - assert_eq!(pallet::Authorities::::get().len(), Aura::authorities_len()); + assert_eq!(pezpallet::CurrentSlot::::get(), 0u64); + assert_eq!(pezpallet::Authorities::::get().len(), Aura::authorities_len()); assert_eq!(Aura::authorities_len(), 4); }); } diff --git a/bizinikiwi/pezframe/authority-discovery/Cargo.toml b/bizinikiwi/pezframe/authority-discovery/Cargo.toml index 295474fa..4ef590ed 100644 --- a/bizinikiwi/pezframe/authority-discovery/Cargo.toml +++ b/bizinikiwi/pezframe/authority-discovery/Cargo.toml @@ -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" diff --git a/bizinikiwi/pezframe/authority-discovery/src/lib.rs b/bizinikiwi/pezframe/authority-discovery/src/lib.rs index 1a3a06ac..0925a8d9 100644 --- a/bizinikiwi/pezframe/authority-discovery/src/lib.rs +++ b/bizinikiwi/pezframe/authority-discovery/src/lib.rs @@ -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(_); + #[pezpallet::pezpallet] + pub struct Pezpallet(_); - #[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; } - #[pallet::storage] + #[pezpallet::storage] /// Keys of the current authority set. pub type Keys = StorageValue<_, WeakBoundedVec, ValueQuery>; - #[pallet::storage] + #[pezpallet::storage] /// Keys of the next authority set. pub type NextKeys = StorageValue<_, WeakBoundedVec, ValueQuery>; #[derive(pezframe_support::DefaultNoBound)] - #[pallet::genesis_config] + #[pezpallet::genesis_config] pub struct GenesisConfig { pub keys: Vec, #[serde(skip)] pub _config: core::marker::PhantomData, } - #[pallet::genesis_build] + #[pezpallet::genesis_build] impl BuildGenesisConfig for GenesisConfig { fn build(&self) { - Pallet::::initialize_keys(&self.keys) + Pezpallet::::initialize_keys(&self.keys) } } } -impl Pallet { +impl Pezpallet { /// Retrieve authority identifiers of the current and next authority set /// sorted and deduplicated. pub fn authorities() -> Vec { @@ -113,11 +113,11 @@ impl Pallet { } } -impl pezsp_runtime::BoundToRuntimeAppPublic for Pallet { +impl pezsp_runtime::BoundToRuntimeAppPublic for Pezpallet { type Public = AuthorityId; } -impl OneSessionHandler for Pallet { +impl OneSessionHandler for Pezpallet { 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(); diff --git a/bizinikiwi/pezframe/authorship/src/lib.rs b/bizinikiwi/pezframe/authorship/src/lib.rs index 3f344bb1..993f890f 100644 --- a/bizinikiwi/pezframe/authorship/src/lib.rs +++ b/bizinikiwi/pezframe/authorship/src/lib.rs @@ -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 { @@ -33,13 +33,13 @@ pub trait EventHandler { 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; @@ -47,11 +47,11 @@ pub mod pallet { type EventHandler: EventHandler>; } - #[pallet::pallet] - pub struct Pallet(_); + #[pezpallet::pezpallet] + pub struct Pezpallet(_); - #[pallet::hooks] - impl Hooks> for Pallet { + #[pezpallet::hooks] + impl Hooks> for Pezpallet { fn on_initialize(_: BlockNumberFor) -> 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 = StorageValue<_, T::AccountId, OptionQuery>; } -impl Pallet { +impl Pezpallet { /// Fetch the author of the block. /// /// This is safe to invoke in `on_initialize` implementations, as well @@ -83,7 +83,7 @@ impl Pallet { return Some(author); } - let digest = >::digest(); + let digest = >::digest(); let pre_runtime_digests = digest.logs.iter().filter_map(|d| d.as_pre_runtime()); T::FindAuthor::find_author(pre_runtime_digests).inspect(|a| { >::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 = (); } diff --git a/bizinikiwi/pezframe/babe/src/benchmarking.rs b/bizinikiwi/pezframe/babe/src/benchmarking.rs index 86bdd0e7..60e4e585 100644 --- a/bizinikiwi/pezframe/babe/src/benchmarking.rs +++ b/bizinikiwi/pezframe/babe/src/benchmarking.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Benchmarks for the BABE Pallet. +//! Benchmarks for the BABE Pezpallet. #![cfg(feature = "runtime-benchmarks")] @@ -71,5 +71,5 @@ mod benchmarks { assert!(pezsp_consensus_babe::check_equivocation_proof::
(equivocation_proof2)); } - impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(3), crate::mock::Test,); + impl_benchmark_test_suite!(Pezpallet, crate::mock::new_test_ext(3), crate::mock::Test,); } diff --git a/bizinikiwi/pezframe/babe/src/default_weights.rs b/bizinikiwi/pezframe/babe/src/default_weights.rs index 41361e7d..012184cf 100644 --- a/bizinikiwi/pezframe/babe/src/default_weights.rs +++ b/bizinikiwi/pezframe/babe/src/default_weights.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Default weights for the Babe Pallet +//! Default weights for the Babe Pezpallet //! This file was not auto-generated. use pezframe_support::weights::{ diff --git a/bizinikiwi/pezframe/babe/src/equivocation.rs b/bizinikiwi/pezframe/babe/src/equivocation.rs index c68be85b..d30d4cb8 100644 --- a/bizinikiwi/pezframe/babe/src/equivocation.rs +++ b/bizinikiwi/pezframe/babe/src/equivocation.rs @@ -25,12 +25,12 @@ //! //! These can be used in an offchain context in order to submit equivocation //! reporting extrinsics (from the client that's import BABE blocks). -//! And in a runtime context, so that the BABE pallet can validate the +//! And in a runtime context, so that the BABE pezpallet can validate the //! equivocation proofs in the extrinsic and report the offences. //! //! IMPORTANT: //! When using this module for enabling equivocation reporting it is required -//! that the `ValidateUnsigned` for the BABE pallet is used in the runtime +//! that the `ValidateUnsigned` for the BABE pezpallet is used in the runtime //! definition. use alloc::{boxed::Box, vec, vec::Vec}; @@ -52,7 +52,7 @@ use pezsp_staking::{ SessionIndex, }; -use crate::{Call, Config, Error, Pallet, LOG_TARGET}; +use crate::{Call, Config, Error, Pezpallet, LOG_TARGET}; /// BABE equivocation offence report. /// @@ -103,7 +103,7 @@ impl Offence for EquivocationOffence { /// `offchain::CreateTransactionBase`. /// - On-chain validity checks and processing are mostly delegated to the user provided generic /// types implementing `KeyOwnerProofSystem` and `ReportOffence` traits. -/// - Offence reporter for unsigned transactions is fetched via the the authorship pallet. +/// - Offence reporter for unsigned transactions is fetched via the the authorship pezpallet. pub struct EquivocationReportSystem(core::marker::PhantomData<(T, R, P, L)>); impl @@ -164,7 +164,7 @@ where evidence: (EquivocationProof>, T::KeyOwnerProof), ) -> Result<(), DispatchError> { let (equivocation_proof, key_owner_proof) = evidence; - let reporter = reporter.or_else(|| >::author()); + let reporter = reporter.or_else(|| >::author()); let offender = equivocation_proof.offender.clone(); let slot = equivocation_proof.slot; @@ -181,7 +181,7 @@ where // Check that the slot number is consistent with the session index // in the key ownership proof (i.e. slot is for that epoch) - if Pallet::::session_index_for_epoch(epoch_index) != session_index { + if Pezpallet::::session_index_for_epoch(epoch_index) != session_index { return Err(Error::::InvalidKeyOwnershipProof.into()); } @@ -202,7 +202,7 @@ where /// It restricts calls to `report_equivocation_unsigned` to local calls (i.e. extrinsics generated /// on this node) or that already in a block. This guarantees that only block authors can include /// unsigned equivocation reports. -impl Pallet { +impl Pezpallet { pub fn validate_unsigned(source: TransactionSource, call: &Call) -> TransactionValidity { if let Call::report_equivocation_unsigned { equivocation_proof, key_owner_proof } = call { // discard equivocation report not coming from the local node diff --git a/bizinikiwi/pezframe/babe/src/lib.rs b/bizinikiwi/pezframe/babe/src/lib.rs index b3860cee..ab435f4d 100644 --- a/bizinikiwi/pezframe/babe/src/lib.rs +++ b/bizinikiwi/pezframe/babe/src/lib.rs @@ -70,7 +70,7 @@ pub use randomness::{ ParentBlockRandomness, RandomnessFromOneEpochAgo, RandomnessFromTwoEpochsAgo, }; -pub use pallet::*; +pub use pezpallet::*; pub trait WeightInfo { fn plan_config_change() -> Weight; @@ -98,34 +98,34 @@ pub struct SameAuthoritiesForever; impl EpochChangeTrigger for SameAuthoritiesForever { fn trigger(now: BlockNumberFor) { - if Pallet::::should_epoch_change(now) { + if Pezpallet::::should_epoch_change(now) { let authorities = Authorities::::get(); let next_authorities = authorities.clone(); - Pallet::::enact_epoch_change(authorities, next_authorities, None); + Pezpallet::::enact_epoch_change(authorities, next_authorities, None); } } } const UNDER_CONSTRUCTION_SEGMENT_LENGTH: u32 = 256; -#[pezframe_support::pallet] -pub mod pallet { +#[pezframe_support::pezpallet] +pub mod pezpallet { use super::*; use pezframe_support::pezpallet_prelude::*; use pezframe_system::pezpallet_prelude::*; - /// The BABE Pallet - #[pallet::pallet] - pub struct Pallet(_); + /// The BABE Pezpallet + #[pezpallet::pezpallet] + pub struct Pezpallet(_); - #[pallet::config] - #[pallet::disable_pezframe_system_supertrait_check] + #[pezpallet::config] + #[pezpallet::disable_pezframe_system_supertrait_check] pub trait Config: pezpallet_timestamp::Config { /// The amount of time, in slots, that each epoch should last. /// NOTE: Currently it is not possible to change the epoch duration after /// the chain has started. Attempting to do so will brick block production. - #[pallet::constant] + #[pezpallet::constant] type EpochDuration: Get; /// The expected average block time at which BABE should be creating @@ -133,7 +133,7 @@ pub mod pallet { /// what the expected average block time should be based on the slot /// duration and the security parameter `c` (where `1 - c` represents /// the probability of a slot being empty). - #[pallet::constant] + #[pezpallet::constant] type ExpectedBlockTime: Get; /// BABE requires some logic to be triggered on every block to query for whether an epoch @@ -152,11 +152,11 @@ pub mod pallet { type WeightInfo: WeightInfo; /// Max number of authorities allowed - #[pallet::constant] + #[pezpallet::constant] type MaxAuthorities: Get; /// The maximum number of nominators for each validator. - #[pallet::constant] + #[pezpallet::constant] type MaxNominators: Get; /// The proof of key ownership, used for validating equivocation reports. @@ -173,7 +173,7 @@ pub mod pallet { >; } - #[pallet::error] + #[pezpallet::error] pub enum Error { /// An equivocation proof provided as part of an equivocation report is invalid. InvalidEquivocationProof, @@ -186,11 +186,11 @@ pub mod pallet { } /// Current epoch index. - #[pallet::storage] + #[pezpallet::storage] pub type EpochIndex = StorageValue<_, u64, ValueQuery>; /// Current epoch authorities. - #[pallet::storage] + #[pezpallet::storage] pub type Authorities = StorageValue< _, WeakBoundedVec<(AuthorityId, BabeAuthorityWeight), T::MaxAuthorities>, @@ -199,11 +199,11 @@ pub mod pallet { /// The slot at which the first epoch actually started. This is 0 /// until the first block of the chain. - #[pallet::storage] + #[pezpallet::storage] pub type GenesisSlot = StorageValue<_, Slot, ValueQuery>; /// Current slot number. - #[pallet::storage] + #[pezpallet::storage] pub type CurrentSlot = StorageValue<_, Slot, ValueQuery>; /// The epoch randomness for the *current* epoch. @@ -219,19 +219,19 @@ pub mod pallet { // NOTE: the following fields don't use the constants to define the // array size because the metadata API currently doesn't resolve the // variable to its underlying value. - #[pallet::storage] + #[pezpallet::storage] pub type Randomness = StorageValue<_, BabeRandomness, ValueQuery>; /// Pending epoch configuration change that will be applied when the next epoch is enacted. - #[pallet::storage] + #[pezpallet::storage] pub type PendingEpochConfigChange = StorageValue<_, NextConfigDescriptor>; /// Next epoch randomness. - #[pallet::storage] + #[pezpallet::storage] pub type NextRandomness = StorageValue<_, BabeRandomness, ValueQuery>; /// Next epoch authorities. - #[pallet::storage] + #[pezpallet::storage] pub type NextAuthorities = StorageValue< _, WeakBoundedVec<(AuthorityId, BabeAuthorityWeight), T::MaxAuthorities>, @@ -247,11 +247,11 @@ pub mod pallet { /// Once a segment reaches this length, we begin the next one. /// We reset all segments and return to `0` at the beginning of every /// epoch. - #[pallet::storage] + #[pezpallet::storage] pub type SegmentIndex = StorageValue<_, u32, ValueQuery>; /// TWOX-NOTE: `SegmentIndex` is an increasing integer, so this is okay. - #[pallet::storage] + #[pezpallet::storage] pub type UnderConstruction = StorageMap< _, Twox64Concat, @@ -262,14 +262,14 @@ pub mod pallet { /// Temporary value (cleared at block finalization) which is `Some` /// if per-block initialization has already been called for current block. - #[pallet::storage] + #[pezpallet::storage] pub type Initialized = StorageValue<_, Option>; /// This field should always be populated during block processing unless /// secondary plain slots are enabled (which don't contain a VRF output). /// /// It is set in `on_finalize`, before it will contain the value from the last block. - #[pallet::storage] + #[pezpallet::storage] pub type AuthorVrfRandomness = StorageValue<_, Option, ValueQuery>; /// The block numbers when the last and current epoch have started, respectively `N-1` and @@ -277,7 +277,7 @@ pub mod pallet { /// NOTE: We track this is in order to annotate the block number when a given pool of /// entropy was fixed (i.e. it was known to chain observers). Since epochs are defined in /// slots, which may be skipped, the block numbers may not line up with the slot numbers. - #[pallet::storage] + #[pezpallet::storage] pub type EpochStart = StorageValue<_, (BlockNumberFor, BlockNumberFor), ValueQuery>; @@ -286,17 +286,17 @@ pub mod pallet { /// This entry is populated as part of block execution and is cleaned up /// on block finalization. Querying this storage entry outside of block /// execution context should always yield zero. - #[pallet::storage] + #[pezpallet::storage] pub type Lateness = StorageValue<_, BlockNumberFor, ValueQuery>; /// The configuration for the current epoch. Should never be `None` as it is initialized in /// genesis. - #[pallet::storage] + #[pezpallet::storage] pub type EpochConfig = StorageValue<_, BabeEpochConfiguration>; /// The configuration for the next epoch, `None` if the config will not change /// (you can fallback to `EpochConfig` instead in that case). - #[pallet::storage] + #[pezpallet::storage] pub type NextEpochConfig = StorageValue<_, BabeEpochConfiguration>; /// A list of the last 100 skipped epochs and the corresponding session index @@ -307,12 +307,12 @@ pub mod pallet { /// way to tie together sessions and epoch indices, i.e. we need to validate that /// a validator was the owner of a given key on a given session, and what the /// active epoch index was during that session. - #[pallet::storage] + #[pezpallet::storage] pub type SkippedEpochs = StorageValue<_, BoundedVec<(u64, SessionIndex), ConstU32<100>>, ValueQuery>; #[derive(pezframe_support::DefaultNoBound)] - #[pallet::genesis_config] + #[pezpallet::genesis_config] pub struct GenesisConfig { pub authorities: Vec<(AuthorityId, BabeAuthorityWeight)>, pub epoch_config: BabeEpochConfiguration, @@ -320,17 +320,17 @@ pub mod pallet { pub _config: core::marker::PhantomData, } - #[pallet::genesis_build] + #[pezpallet::genesis_build] impl BuildGenesisConfig for GenesisConfig { fn build(&self) { SegmentIndex::::put(0); - Pallet::::initialize_genesis_authorities(&self.authorities); + Pezpallet::::initialize_genesis_authorities(&self.authorities); EpochConfig::::put(&self.epoch_config); } } - #[pallet::hooks] - impl Hooks> for Pallet { + #[pezpallet::hooks] + impl Hooks> for Pezpallet { /// Initialization fn on_initialize(now: BlockNumberFor) -> Weight { Self::initialize(now); @@ -396,14 +396,14 @@ pub mod pallet { } } - #[pallet::call] - impl Pallet { + #[pezpallet::call] + impl Pezpallet { /// Report authority equivocation/misbehavior. This method will verify /// the equivocation proof and validate the given key ownership proof /// against the extracted offender. If both are valid, the offence will /// be reported. - #[pallet::call_index(0)] - #[pallet::weight(::WeightInfo::report_equivocation( + #[pezpallet::call_index(0)] + #[pezpallet::weight(::WeightInfo::report_equivocation( key_owner_proof.validator_count(), T::MaxNominators::get(), ))] @@ -429,8 +429,8 @@ pub mod pallet { /// block authors will call it (validated in `ValidateUnsigned`), as such /// if the block author is defined it will be defined as the equivocation /// reporter. - #[pallet::call_index(1)] - #[pallet::weight(::WeightInfo::report_equivocation( + #[pezpallet::call_index(1)] + #[pezpallet::weight(::WeightInfo::report_equivocation( key_owner_proof.validator_count(), T::MaxNominators::get(), ))] @@ -451,8 +451,8 @@ pub mod pallet { /// the next call to `enact_epoch_change`. The config will be activated one epoch after. /// Multiple calls to this method will replace any existing planned config change that had /// not been enacted yet. - #[pallet::call_index(2)] - #[pallet::weight(::WeightInfo::plan_config_change())] + #[pezpallet::call_index(2)] + #[pezpallet::weight(::WeightInfo::plan_config_change())] pub fn plan_config_change( origin: OriginFor, config: NextConfigDescriptor, @@ -471,8 +471,8 @@ pub mod pallet { } } - #[pallet::validate_unsigned] - impl ValidateUnsigned for Pallet { + #[pezpallet::validate_unsigned] + impl ValidateUnsigned for Pezpallet { type Call = Call; fn validate_unsigned(source: TransactionSource, call: &Self::Call) -> TransactionValidity { Self::validate_unsigned(source, call) @@ -484,7 +484,7 @@ pub mod pallet { } } -impl FindAuthor for Pallet { +impl FindAuthor for Pezpallet { fn find_author<'a, I>(digests: I) -> Option where I: 'a + IntoIterator, @@ -500,24 +500,24 @@ impl FindAuthor for Pallet { } } -impl IsMember for Pallet { +impl IsMember for Pezpallet { fn is_member(authority_id: &AuthorityId) -> bool { Authorities::::get().iter().any(|id| &id.0 == authority_id) } } -impl pezpallet_session::ShouldEndSession> for Pallet { +impl pezpallet_session::ShouldEndSession> for Pezpallet { fn should_end_session(now: BlockNumberFor) -> bool { // it might be (and it is in current implementation) that session module is calling // `should_end_session` from it's own `on_initialize` handler, in which case it's // possible that babe's own `on_initialize` has not run yet, so let's ensure that we - // have initialized the pallet and updated the current slot. + // have initialized the pezpallet and updated the current slot. Self::initialize(now); Self::should_epoch_change(now) } } -impl Pallet { +impl Pezpallet { /// Public function to access epoch_index storage. pub fn epoch_index() -> u64 { EpochIndex::::get() @@ -690,7 +690,7 @@ impl Pallet { // Update the start blocks of the previous and new current epoch. EpochStart::::mutate(|(previous_epoch_start_block, current_epoch_start_block)| { *previous_epoch_start_block = core::mem::take(current_epoch_start_block); - *current_epoch_start_block = >::block_number(); + *current_epoch_start_block = >::block_number(); }); // After we update the current epoch, we signal the *next* epoch change @@ -771,7 +771,7 @@ impl Pallet { fn deposit_consensus(new: U) { let log = DigestItem::Consensus(BABE_ENGINE_ID, new.encode()); - >::deposit_log(log) + >::deposit_log(log) } fn deposit_randomness(randomness: &BabeRandomness) { @@ -828,7 +828,7 @@ impl Pallet { } let pre_digest = - >::digest() + >::digest() .logs .iter() .filter_map(|s| s.as_pre_runtime()) @@ -927,7 +927,7 @@ impl Pallet { } } -impl OnTimestampSet for Pallet { +impl OnTimestampSet for Pezpallet { fn on_timestamp_set(moment: T::Moment) { let slot_duration = Self::slot_duration(); assert!(!slot_duration.is_zero(), "Babe slot duration cannot be zero."); @@ -944,7 +944,7 @@ impl OnTimestampSet for Pallet { } impl pezframe_support::traits::EstimateNextSessionRotation> - for Pallet + for Pezpallet { fn average_session_length() -> BlockNumberFor { T::EpochDuration::get().saturated_into() @@ -971,17 +971,17 @@ impl pezframe_support::traits::EstimateNextSessionRotation pezframe_support::traits::Lateness> for Pallet { +impl pezframe_support::traits::Lateness> for Pezpallet { fn lateness(&self) -> BlockNumberFor { Lateness::::get() } } -impl pezsp_runtime::BoundToRuntimeAppPublic for Pallet { +impl pezsp_runtime::BoundToRuntimeAppPublic for Pezpallet { type Public = AuthorityId; } -impl OneSessionHandler for Pallet +impl OneSessionHandler for Pezpallet where T: pezpallet_session::Config, { @@ -1017,7 +1017,7 @@ where ), ); - let session_index = >::current_index(); + let session_index = >::current_index(); Self::enact_epoch_change(bounded_authorities, next_bounded_authorities, Some(session_index)) } @@ -1052,7 +1052,7 @@ pub mod migrations { use super::*; use pezframe_support::pezpallet_prelude::{StorageValue, ValueQuery}; - /// Something that can return the storage prefix of the `Babe` pallet. + /// Something that can return the storage prefix of the `Babe` pezpallet. pub trait BabePalletPrefix: Config { fn pezpallet_prefix() -> &'static str; } diff --git a/bizinikiwi/pezframe/babe/src/mock.rs b/bizinikiwi/pezframe/babe/src/mock.rs index 54aad7d9..c29bd834 100644 --- a/bizinikiwi/pezframe/babe/src/mock.rs +++ b/bizinikiwi/pezframe/babe/src/mock.rs @@ -87,7 +87,7 @@ where impl_opaque_keys! { pub struct MockSessionKeys { - pub babe_authority: super::Pallet, + pub babe_authority: super::Pezpallet, } } @@ -170,7 +170,7 @@ impl pezpallet_staking::Config for Test { type BondingDuration = BondingDuration; type AdminOrigin = pezframe_system::EnsureRoot; type SessionInterface = Self; - type UnixTime = pezpallet_timestamp::Pallet; + type UnixTime = pezpallet_timestamp::Pezpallet; type EraPayout = pezpallet_staking::ConvertCurve; type NextNewSession = Session; type ElectionProvider = onchain::OnChainExecution; diff --git a/bizinikiwi/pezframe/babe/src/randomness.rs b/bizinikiwi/pezframe/babe/src/randomness.rs index 0ab3be8c..4510b4e0 100644 --- a/bizinikiwi/pezframe/babe/src/randomness.rs +++ b/bizinikiwi/pezframe/babe/src/randomness.rs @@ -160,7 +160,7 @@ impl RandomnessT, BlockNumberFor> for ParentBlockR T::Hashing::hash(&subject[..]) }); - (random, >::block_number().saturating_sub(One::one())) + (random, >::block_number().saturating_sub(One::one())) } } @@ -168,6 +168,6 @@ impl RandomnessT, BlockNumberFor> for ParentBlockR impl RandomnessT, BlockNumberFor> for CurrentBlockRandomness { fn random(subject: &[u8]) -> (Option, BlockNumberFor) { let (random, _) = ParentBlockRandomness::::random(subject); - (random, >::block_number()) + (random, >::block_number()) } } diff --git a/bizinikiwi/pezframe/babe/src/weights.rs b/bizinikiwi/pezframe/babe/src/weights.rs index ce72d529..be2b1bc3 100644 --- a/bizinikiwi/pezframe/babe/src/weights.rs +++ b/bizinikiwi/pezframe/babe/src/weights.rs @@ -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_babe +// --pezpallet=pezpallet_babe // --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2 // --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/babe/src/weights.rs // --wasm-execution=compiled diff --git a/bizinikiwi/pezframe/bags-list/Cargo.toml b/bizinikiwi/pezframe/bags-list/Cargo.toml index b8866740..1cea4607 100644 --- a/bizinikiwi/pezframe/bags-list/Cargo.toml +++ b/bizinikiwi/pezframe/bags-list/Cargo.toml @@ -6,7 +6,7 @@ edition.workspace = true license = "Apache-2.0" homepage.workspace = true repository.workspace = true -description = "FRAME pallet bags list" +description = "FRAME pezpallet bags list" documentation = "https://docs.rs/pezpallet-bags-list" [lints] diff --git a/bizinikiwi/pezframe/bags-list/fuzzer/Cargo.toml b/bizinikiwi/pezframe/bags-list/fuzzer/Cargo.toml index bdec8984..fc5e19e2 100644 --- a/bizinikiwi/pezframe/bags-list/fuzzer/Cargo.toml +++ b/bizinikiwi/pezframe/bags-list/fuzzer/Cargo.toml @@ -6,7 +6,7 @@ edition.workspace = true license = "Apache-2.0" homepage.workspace = true repository.workspace = true -description = "Fuzzer for FRAME pallet bags list" +description = "Fuzzer for FRAME pezpallet bags list" publish = false documentation = "https://docs.rs/pezpallet-bags-list-fuzzer" diff --git a/bizinikiwi/pezframe/bags-list/remote-tests/Cargo.toml b/bizinikiwi/pezframe/bags-list/remote-tests/Cargo.toml index 22ff600b..eb09ce79 100644 --- a/bizinikiwi/pezframe/bags-list/remote-tests/Cargo.toml +++ b/bizinikiwi/pezframe/bags-list/remote-tests/Cargo.toml @@ -6,7 +6,7 @@ edition.workspace = true license = "Apache-2.0" homepage.workspace = true repository.workspace = true -description = "FRAME pallet bags list remote test" +description = "FRAME pezpallet bags list remote test" publish = false documentation = "https://docs.rs/pezpallet-bags-list-remote-tests" diff --git a/bizinikiwi/pezframe/bags-list/remote-tests/src/lib.rs b/bizinikiwi/pezframe/bags-list/remote-tests/src/lib.rs index 4a6a8176..4d2edf75 100644 --- a/bizinikiwi/pezframe/bags-list/remote-tests/src/lib.rs +++ b/bizinikiwi/pezframe/bags-list/remote-tests/src/lib.rs @@ -73,7 +73,7 @@ pub fn display_and_check_bags>( let vote_weight_thresh_as_unit = vote_weight_thresh_u64 as f64 / currency_unit as f64; let pretty_thresh = format!("Threshold: {}. {}", vote_weight_thresh_as_unit, currency_name); - let bag = match pezpallet_bags_list::Pallet::::list_bags_get( + let bag = match pezpallet_bags_list::Pezpallet::::list_bags_get( *vote_weight_thresh, ) { Some(bag) => bag, diff --git a/bizinikiwi/pezframe/bags-list/remote-tests/src/migration.rs b/bizinikiwi/pezframe/bags-list/remote-tests/src/migration.rs index f3a916e4..f20ae497 100644 --- a/bizinikiwi/pezframe/bags-list/remote-tests/src/migration.rs +++ b/bizinikiwi/pezframe/bags-list/remote-tests/src/migration.rs @@ -36,7 +36,7 @@ pub async fn execute( let mut ext = Builder::::new() .mode(Mode::Online(OnlineConfig { transport: ws_url.to_string().into(), - pallets: vec![pezpallet_staking::Pallet::::name().to_string()], + pallets: vec![pezpallet_staking::Pezpallet::::name().to_string()], ..Default::default() })) .build() @@ -52,7 +52,7 @@ pub async fn execute( // run the actual migration let moved = ::VoterList::unsafe_regenerate( pezpallet_staking::Nominators::::iter().map(|(n, _)| n), - Box::new(|x| Some(pezpallet_staking::Pallet::::weight_of(x))), + Box::new(|x| Some(pezpallet_staking::Pezpallet::::weight_of(x))), ); log::info!(target: LOG_TARGET, "Moved {} nominators", moved); diff --git a/bizinikiwi/pezframe/bags-list/remote-tests/src/snapshot.rs b/bizinikiwi/pezframe/bags-list/remote-tests/src/snapshot.rs index 1d42d77c..baee0d4e 100644 --- a/bizinikiwi/pezframe/bags-list/remote-tests/src/snapshot.rs +++ b/bizinikiwi/pezframe/bags-list/remote-tests/src/snapshot.rs @@ -41,7 +41,7 @@ where transport: ws_url.to_string().into(), // NOTE: we don't scrape pezpallet-staking, this kinda ensures that the source of the data // is bags-list. - pallets: vec![pezpallet_bags_list::Pallet::::name() + pallets: vec![pezpallet_bags_list::Pezpallet::::name() .to_string()], at: None, hashed_prefixes: vec![ @@ -75,7 +75,7 @@ where // single page voter snapshot, thus page index == 0. let voters = - as ElectionDataProvider>::electing_voters(bounds, Zero::zero()) + as ElectionDataProvider>::electing_voters(bounds, Zero::zero()) .unwrap(); let mut voters_nominator_only = voters diff --git a/bizinikiwi/pezframe/bags-list/remote-tests/src/try_state.rs b/bizinikiwi/pezframe/bags-list/remote-tests/src/try_state.rs index bab521ab..fa99e7cc 100644 --- a/bizinikiwi/pezframe/bags-list/remote-tests/src/try_state.rs +++ b/bizinikiwi/pezframe/bags-list/remote-tests/src/try_state.rs @@ -36,7 +36,7 @@ pub async fn execute( let mut ext = Builder::::new() .mode(Mode::Online(OnlineConfig { transport: ws_url.to_string().into(), - pallets: vec![pezpallet_bags_list::Pallet::::name() + pallets: vec![pezpallet_bags_list::Pezpallet::::name() .to_string()], hashed_prefixes: vec![ >::prefix_hash().to_vec(), @@ -51,7 +51,7 @@ pub async fn execute( ext.execute_with(|| { pezsp_core::crypto::set_default_ss58_version(Runtime::SS58Prefix::get().try_into().unwrap()); - pezpallet_bags_list::Pallet::::do_try_state().unwrap(); + pezpallet_bags_list::Pezpallet::::do_try_state().unwrap(); log::info!(target: crate::LOG_TARGET, "executed bags-list sanity check with no errors."); diff --git a/bizinikiwi/pezframe/bags-list/src/benchmarks.rs b/bizinikiwi/pezframe/bags-list/src/benchmarks.rs index 720d3056..95611d6c 100644 --- a/bizinikiwi/pezframe/bags-list/src/benchmarks.rs +++ b/bizinikiwi/pezframe/bags-list/src/benchmarks.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Benchmarks for the bags list pallet. +//! Benchmarks for the bags list pezpallet. use super::*; use crate::list::List; @@ -58,7 +58,7 @@ benchmarks_instance_pallet! { ] ); }: { - let voters = as SortedListProvider>::iter(); + let voters = as SortedListProvider>::iter(); let len = voters.collect::>().len(); assert_eq!(len as u32, n,"len is {}, expected {}", len, n); } @@ -93,7 +93,7 @@ benchmarks_instance_pallet! { ); }: { // this should only go into one of the bags - let voters = as SortedListProvider>::iter().take(n as usize / 4 ); + let voters = as SortedListProvider>::iter().take(n as usize / 4 ); let len = voters.collect::>().len(); assert_eq!(len as u32, n / 4,"len is {}, expected {}", len, n / 4); } @@ -127,7 +127,7 @@ benchmarks_instance_pallet! { ); }: { // this should only go into one of the bags - let mut iter_var = as SortedListProvider>::iter(); + let mut iter_var = as SortedListProvider>::iter(); let mut voters = Vec::::with_capacity((n/4) as usize); for _ in 0..(n/4) { let next = iter_var.next().unwrap(); @@ -182,7 +182,7 @@ benchmarks_instance_pallet! { // iter from someone in the 3rd bag, so this should touch ~75 nodes and 3 bags let from: T::AccountId = account("node", 0, 2); }: { - let voters = as SortedListProvider>::iter_from(&from).unwrap(); + let voters = as SortedListProvider>::iter_from(&from).unwrap(); let len = voters.collect::>().len(); assert_eq!(len as u32, 74,"len is {}, expected {}", len, 74); } @@ -386,7 +386,7 @@ benchmarks_instance_pallet! { } // Lock the list and simulate pending rebag insertions - >::lock(); + >::lock(); // Create pending rebag entries (mix of valid and corrupted) for i in 0..pending_count { @@ -402,12 +402,12 @@ benchmarks_instance_pallet! { T::ScoreProvider::set_score_of(&pending_node, pending_score); } - let _ = as SortedListProvider>::on_insert( + let _ = as SortedListProvider>::on_insert( pending_node, pending_score ); } - >::unlock(); + >::unlock(); // Now set new scores that will move nodes into higher bags for i in 0..regular_count { @@ -431,7 +431,7 @@ benchmarks_instance_pallet! { } : { use pezframe_support::traits::Hooks; - as Hooks<_>>::on_idle(Default::default(), Weight::MAX); + as Hooks<_>>::on_idle(Default::default(), Weight::MAX); } verify { // Verify all pending rebag entries were processed. @@ -451,7 +451,7 @@ benchmarks_instance_pallet! { } impl_benchmark_test_suite!( - Pallet, + Pezpallet, mock::ExtBuilder::default().skip_genesis_ids().build(), mock::Runtime ); diff --git a/bizinikiwi/pezframe/bags-list/src/lib.rs b/bizinikiwi/pezframe/bags-list/src/lib.rs index 112e273d..86447817 100644 --- a/bizinikiwi/pezframe/bags-list/src/lib.rs +++ b/bizinikiwi/pezframe/bags-list/src/lib.rs @@ -25,35 +25,35 @@ //! [github]: //! https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github //! -//! # Bags-List Pallet +//! # Bags-List Pezpallet //! //! An onchain implementation of a semi-sorted linked list, with permissionless sorting and update //! operations. //! -//! ## 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. //! -//! This pallet provides an implementation of +//! This pezpallet provides an implementation of //! [`pezframe_election_provider_support::SortedListProvider`] and it can typically be used by another -//! pallet via this API. +//! pezpallet via this API. //! //! ## Overview //! -//! This pallet splits `AccountId`s into different bags. Within a bag, these `AccountId`s are stored -//! as nodes in a linked-list manner. This pallet then provides iteration over all bags, which +//! This pezpallet splits `AccountId`s into different bags. Within a bag, these `AccountId`s are stored +//! as nodes in a linked-list manner. This pezpallet then provides iteration over all bags, which //! basically allows an infinitely large list of items to be kept in a sorted manner. //! //! Each bags has a upper and lower range of scores, denoted by [`Config::BagThresholds`]. All nodes -//! within a bag must be within the range of the bag. If not, the permissionless [`Pallet::rebag`] +//! within a bag must be within the range of the bag. If not, the permissionless [`Pezpallet::rebag`] //! can be used to move any node to the right bag. //! //! Once a `rebag` happens, the order within a node is still not enforced. To move a node to the -//! optimal position in a bag, the [`Pallet::put_in_front_of`] or [`Pallet::put_in_front_of_other`] +//! optimal position in a bag, the [`Pezpallet::put_in_front_of`] or [`Pezpallet::put_in_front_of_other`] //! can be used. //! -//! Additional reading, about how this pallet is used in the context of Pezkuwi's staking system: +//! Additional reading, about how this pezpallet is used in the context of Pezkuwi's staking system: //! //! //! ## Examples @@ -62,7 +62,7 @@ //! //! ## Low Level / Implementation Details //! -//! The data structure exposed by this pallet aims to be optimized for: +//! The data structure exposed by this pezpallet aims to be optimized for: //! //! - insertions and removals. //! - iteration over the top* N items by score, where the precise ordering of items doesn't @@ -148,7 +148,7 @@ mod tests; pub mod weights; pub use list::{notional_bag_for, Bag, List, ListError, Node}; -pub use pallet::*; +pub use pezpallet::*; pub use weights::WeightInfo; pub(crate) const LOG_TARGET: &str = "runtime::bags-list"; @@ -160,8 +160,8 @@ macro_rules! log { log::$level!( target: crate::LOG_TARGET, concat!("[{:?}] 👜 [{}]", $patter), - >::block_number(), - as pezframe_support::traits::PalletInfoAccess>::name() + >::block_number(), + as pezframe_support::traits::PalletInfoAccess>::name() $(, $values)* ) }; @@ -169,23 +169,23 @@ macro_rules! log { type AccountIdLookupOf = <::Lookup as StaticLookup>::Source; -#[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(_); + #[pezpallet::pezpallet] + pub struct Pezpallet(_); - #[pallet::config] + #[pezpallet::config] pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] type RuntimeEvent: From> + IsType<::RuntimeEvent>; - /// Weight information for extrinsics in this pallet. + /// Weight information for extrinsics in this pezpallet. type WeightInfo: weights::WeightInfo; /// Something that provides the scores of ids. @@ -234,14 +234,14 @@ pub mod pallet { /// /// In the event that this list ever changes, a copy of the old bags list must be retained. /// With that `List::migrate` can be called, which will perform the appropriate migration. - #[pallet::constant] + #[pezpallet::constant] type BagThresholds: Get<&'static [Self::Score]>; /// Maximum number of accounts that may be re-bagged automatically in `on_idle`. /// /// A value of `0` (obtained by configuring `type MaxAutoRebagPerBlock = ();`) disables /// the feature. - #[pallet::constant] + #[pezpallet::constant] type MaxAutoRebagPerBlock: Get; /// The type used to dictate a node position relative to other nodes. @@ -263,28 +263,28 @@ pub mod pallet { /// A single node, within some bag. /// /// Nodes store links forward and back within their respective bags. - #[pallet::storage] + #[pezpallet::storage] pub type ListNodes, I: 'static = ()> = CountedStorageMap<_, Twox64Concat, T::AccountId, list::Node>; /// A bag stored in storage. /// /// Stores a `Bag` struct, which stores head and tail pointers to itself. - #[pallet::storage] + #[pezpallet::storage] pub type ListBags, I: 'static = ()> = StorageMap<_, Twox64Concat, T::Score, list::Bag>; /// Pointer that remembers the next node that will be auto-rebagged. /// When `None`, the next scan will start from the list head again. - #[pallet::storage] + #[pezpallet::storage] pub type NextNodeAutoRebagged, I: 'static = ()> = StorageValue<_, T::AccountId, OptionQuery>; - /// Lock all updates to this pallet. + /// Lock all updates to this pezpallet. /// /// If any nodes needs updating, removal or addition due to a temporary lock, the /// [`Call::rebag`] can be used. - #[pallet::storage] + #[pezpallet::storage] pub type Lock, I: 'static = ()> = StorageValue<_, (), OptionQuery>; /// Accounts that failed to be inserted into the bags-list due to locking. @@ -293,7 +293,7 @@ pub mod pallet { /// Note: This storage is intentionally unbounded. The following factors make bounding /// unnecessary: /// 1. The storage usage is temporary - accounts are processed and removed in `on_idle` - /// 2. The pallet is only locked during snapshot generation, which is weight-limited + /// 2. The pezpallet is only locked during snapshot generation, which is weight-limited /// 3. Processing happens at multiple accounts per block, clearing even large backlogs quickly /// 4. An artificial limit could be exhausted by an attacker, preventing legitimate /// auto-rebagging from putting accounts in the correct position @@ -301,12 +301,12 @@ pub mod pallet { /// We don't store the score here - it's always fetched from `ScoreProvider` when processing, /// ensuring we use the most up-to-date score (accounts may have been slashed, rewarded, etc. /// while waiting in the queue). - #[pallet::storage] + #[pezpallet::storage] pub type PendingRebag, I: 'static = ()> = CountedStorageMap<_, Twox64Concat, T::AccountId, ()>; - #[pallet::event] - #[pallet::generate_deposit(pub(crate) fn deposit_event)] + #[pezpallet::event] + #[pezpallet::generate_deposit(pub(crate) fn deposit_event)] pub enum Event, I: 'static = ()> { /// Moved an account from one bag to another. Rebagged { who: T::AccountId, from: T::Score, to: T::Score }, @@ -314,11 +314,11 @@ pub mod pallet { ScoreUpdated { who: T::AccountId, new_score: T::Score }, } - #[pallet::error] + #[pezpallet::error] pub enum Error { /// A error in the list interface implementation. List(ListError), - /// Could not update a node, because the pallet is locked. + /// Could not update a node, because the pezpallet is locked. Locked, } @@ -328,11 +328,11 @@ pub mod pallet { } } - #[pallet::view_functions] - impl, I: 'static> Pallet { + #[pezpallet::view_functions] + impl, I: 'static> Pezpallet { /// Get the current `score` of a given account. /// - /// Returns `(current, real_score)`, the former being the current score that this pallet is + /// Returns `(current, real_score)`, the former being the current score that this pezpallet is /// aware of, which may or may not be up to date, and the latter being the real score, as /// provided by // [`Config::ScoreProvider`]. @@ -343,8 +343,8 @@ pub mod pallet { } } - #[pallet::call] - impl, I: 'static> Pallet { + #[pezpallet::call] + impl, I: 'static> Pezpallet { /// Declare that some `dislocated` account has, through rewards or penalties, sufficiently /// changed its score that it should properly fall into a different bag than its current /// one. @@ -355,8 +355,8 @@ pub mod pallet { /// `ScoreProvider`. /// /// If `dislocated` does not exists, it returns an error. - #[pallet::call_index(0)] - #[pallet::weight(T::WeightInfo::rebag_non_terminal().max(T::WeightInfo::rebag_terminal()))] + #[pezpallet::call_index(0)] + #[pezpallet::weight(T::WeightInfo::rebag_non_terminal().max(T::WeightInfo::rebag_terminal()))] pub fn rebag(origin: OriginFor, dislocated: AccountIdLookupOf) -> DispatchResult { ensure_signed(origin)?; let dislocated = T::Lookup::lookup(dislocated)?; @@ -377,8 +377,8 @@ pub mod pallet { /// /// - both nodes are within the same bag, /// - and `origin` has a greater `Score` than `lighter`. - #[pallet::call_index(1)] - #[pallet::weight(T::WeightInfo::put_in_front_of())] + #[pezpallet::call_index(1)] + #[pezpallet::weight(T::WeightInfo::put_in_front_of())] pub fn put_in_front_of( origin: OriginFor, lighter: AccountIdLookupOf, @@ -391,11 +391,11 @@ pub mod pallet { .map_err::(Into::into) } - /// Same as [`Pallet::put_in_front_of`], but it can be called by anyone. + /// Same as [`Pezpallet::put_in_front_of`], but it can be called by anyone. /// /// Fee is paid by the origin under all circumstances. - #[pallet::call_index(2)] - #[pallet::weight(T::WeightInfo::put_in_front_of())] + #[pezpallet::call_index(2)] + #[pezpallet::weight(T::WeightInfo::put_in_front_of())] pub fn put_in_front_of_other( origin: OriginFor, heavier: AccountIdLookupOf, @@ -411,8 +411,8 @@ pub mod pallet { } } - #[pallet::hooks] - impl, I: 'static> Hooks> for Pallet { + #[pezpallet::hooks] + impl, I: 'static> Hooks> for Pezpallet { fn integrity_test() { // to ensure they are strictly increasing, this also implies that duplicates are // detected. @@ -461,7 +461,7 @@ pub mod pallet { } if Self::ensure_unlocked().is_err() { - log!(debug, "Auto-rebag skipped: pallet is locked"); + log!(debug, "Auto-rebag skipped: pezpallet is locked"); return meter.consumed(); } @@ -515,7 +515,7 @@ pub mod pallet { match Self::rebag_internal(&account) { Err(Error::::Locked) => { - defensive!("Pallet became locked during auto-rebag, stopping"); + defensive!("Pezpallet became locked during auto-rebag, stopping"); break; }, Err(e) => { @@ -587,13 +587,13 @@ pub mod pallet { } #[cfg(any(test, feature = "try-runtime", feature = "fuzz"))] -impl, I: 'static> Pallet { +impl, I: 'static> Pezpallet { pub fn do_try_state() -> Result<(), TryRuntimeError> { List::::do_try_state() } } -impl, I: 'static> Pallet { +impl, I: 'static> Pezpallet { /// Move an account from one bag to another, depositing an event on success. /// /// If the account changed bags, returns `Ok(Some((from, to)))`. @@ -631,7 +631,7 @@ impl, I: 'static> Pallet { /// /// Returns `Ok(Some((from, to)))` if rebagging occurred, or `Ok(None)` if nothing changed. fn rebag_internal(account: &T::AccountId) -> Result, Error> { - // Ensure the pallet is not locked + // Ensure the pezpallet is not locked Self::ensure_unlocked().map_err(|_| Error::::Locked)?; PendingRebag::::remove(account); @@ -644,7 +644,7 @@ impl, I: 'static> Pallet { (true, Some(current_score)) => { // The account exists and has a valid score, so try to rebag log!(debug, "Attempting to rebag node {:?}", account); - Pallet::::do_rebag(account, current_score) + Pezpallet::::do_rebag(account, current_score) .map_err::, _>(Into::into) }, (false, Some(current_score)) => { @@ -668,7 +668,7 @@ impl, I: 'static> Pallet { } } -impl, I: 'static> SortedListProvider for Pallet { +impl, I: 'static> SortedListProvider for Pezpallet { type Error = ListError; type Score = T::Score; @@ -708,8 +708,8 @@ impl, I: 'static> SortedListProvider for Pallet } fn on_insert(id: T::AccountId, score: T::Score) -> Result<(), ListError> { - Pallet::::ensure_unlocked().inspect_err(|_| { - // Pallet is locked - store in PendingRebag for later processing + Pezpallet::::ensure_unlocked().inspect_err(|_| { + // Pezpallet is locked - store in PendingRebag for later processing // Only queue if auto-rebagging is enabled if T::MaxAutoRebagPerBlock::get() > 0u32 { PendingRebag::::insert(&id, ()); @@ -719,8 +719,8 @@ impl, I: 'static> SortedListProvider for Pallet } fn on_update(id: &T::AccountId, new_score: T::Score) -> Result<(), ListError> { - Pallet::::ensure_unlocked()?; - Pallet::::do_rebag(id, new_score).map(|_| ()) + Pezpallet::::ensure_unlocked()?; + Pezpallet::::do_rebag(id, new_score).map(|_| ()) } fn get_score(id: &T::AccountId) -> Result { @@ -728,7 +728,7 @@ impl, I: 'static> SortedListProvider for Pallet } fn on_remove(id: &T::AccountId) -> Result<(), ListError> { - Pallet::::ensure_unlocked()?; + Pezpallet::::ensure_unlocked()?; List::::remove(id) } @@ -778,8 +778,8 @@ impl, I: 'static> SortedListProvider for Pallet } } -impl, I: 'static> ScoreProvider for Pallet { - type Score = as SortedListProvider>::Score; +impl, I: 'static> ScoreProvider for Pezpallet { + type Score = as SortedListProvider>::Score; fn score(id: &T::AccountId) -> Option { Node::::get(id).map(|node| node.score()) diff --git a/bizinikiwi/pezframe/bags-list/src/list/mod.rs b/bizinikiwi/pezframe/bags-list/src/list/mod.rs index 13e9c826..1afa4886 100644 --- a/bizinikiwi/pezframe/bags-list/src/list/mod.rs +++ b/bizinikiwi/pezframe/bags-list/src/list/mod.rs @@ -127,7 +127,7 @@ impl, I: 'static> List { /// generated from scratch. Care needs to be taken to ensure /// /// This may or may not need to be called at genesis as well, based on the configuration of the - /// pallet using this `List`. + /// pezpallet using this `List`. /// /// Returns the number of ids migrated. pub fn unsafe_regenerate( diff --git a/bizinikiwi/pezframe/bags-list/src/list/tests.rs b/bizinikiwi/pezframe/bags-list/src/list/tests.rs index d527dfc1..fa8e284d 100644 --- a/bizinikiwi/pezframe/bags-list/src/list/tests.rs +++ b/bizinikiwi/pezframe/bags-list/src/list/tests.rs @@ -373,7 +373,7 @@ mod list { // not exposed as mutable in any sense. #[pezframe_support::storage_alias] type CounterForListNodes = - StorageValue, u32, pezframe_support::pezpallet_prelude::ValueQuery>; + StorageValue, u32, pezframe_support::pezpallet_prelude::ValueQuery>; CounterForListNodes::::mutate(|counter| *counter += 1); assert_eq!(crate::ListNodes::::count(), 5); diff --git a/bizinikiwi/pezframe/bags-list/src/migrations.rs b/bizinikiwi/pezframe/bags-list/src/migrations.rs index e8b33214..526cb65e 100644 --- a/bizinikiwi/pezframe/bags-list/src/migrations.rs +++ b/bizinikiwi/pezframe/bags-list/src/migrations.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! The migrations of this pallet. +//! The migrations of this pezpallet. use codec::{Decode, Encode}; use core::marker::PhantomData; @@ -42,7 +42,7 @@ impl, I: 'static> OnRuntimeUpgrade for CheckCounterPrefix, I: 'static> = - StorageValue, u32>; + StorageValue, u32>; // ensure that a value exists in the counter struct. ensure!( @@ -76,7 +76,7 @@ mod old { #[pezframe_support::storage_alias] pub type ListNodes, I: 'static> = StorageMap< - crate::Pallet, + crate::Pezpallet, Twox64Concat, ::AccountId, PreScoreNode, @@ -84,7 +84,7 @@ mod old { #[pezframe_support::storage_alias] pub type CounterForListNodes, I: 'static> = - StorageValue, u32, ValueQuery>; + StorageValue, u32, ValueQuery>; } /// A struct that migrates all bags lists to contain a score value. diff --git a/bizinikiwi/pezframe/bags-list/src/tests.rs b/bizinikiwi/pezframe/bags-list/src/tests.rs index 63d4851c..41b16212 100644 --- a/bizinikiwi/pezframe/bags-list/src/tests.rs +++ b/bizinikiwi/pezframe/bags-list/src/tests.rs @@ -79,7 +79,7 @@ fn examples_work() { }) } -mod pallet { +mod pezpallet { use super::*; #[test] @@ -496,7 +496,7 @@ mod pallet { // then assert_noop!( BagsList::put_in_front_of(RuntimeOrigin::signed(3), 2), - crate::pallet::Error::::List(ListError::NotHeavier) + crate::pezpallet::Error::::List(ListError::NotHeavier) ); }); } @@ -510,7 +510,7 @@ mod pallet { // then assert_noop!( BagsList::put_in_front_of(RuntimeOrigin::signed(3), 4), - crate::pallet::Error::::List(ListError::NotHeavier) + crate::pezpallet::Error::::List(ListError::NotHeavier) ); }); } @@ -527,7 +527,7 @@ mod pallet { // then assert_noop!( BagsList::put_in_front_of(RuntimeOrigin::signed(5), 4), - crate::pallet::Error::::List(ListError::NodeNotFound) + crate::pezpallet::Error::::List(ListError::NodeNotFound) ); }); @@ -541,7 +541,7 @@ mod pallet { // then assert_noop!( BagsList::put_in_front_of(RuntimeOrigin::signed(4), 5), - crate::pallet::Error::::List(ListError::NodeNotFound) + crate::pezpallet::Error::::List(ListError::NodeNotFound) ); }); } @@ -555,7 +555,7 @@ mod pallet { // then assert_noop!( BagsList::put_in_front_of(RuntimeOrigin::signed(4), 1), - crate::pallet::Error::::List(ListError::NotInSameBag) + crate::pezpallet::Error::::List(ListError::NotInSameBag) ); }); } diff --git a/bizinikiwi/pezframe/bags-list/src/weights.rs b/bizinikiwi/pezframe/bags-list/src/weights.rs index fafa07b4..f954f16d 100644 --- a/bizinikiwi/pezframe/bags-list/src/weights.rs +++ b/bizinikiwi/pezframe/bags-list/src/weights.rs @@ -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_bags_list +// --pezpallet=pezpallet_bags_list // --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2 // --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/bags-list/src/weights.rs // --wasm-execution=compiled diff --git a/bizinikiwi/pezframe/balances/Cargo.toml b/bizinikiwi/pezframe/balances/Cargo.toml index d2e8899e..91b98476 100644 --- a/bizinikiwi/pezframe/balances/Cargo.toml +++ b/bizinikiwi/pezframe/balances/Cargo.toml @@ -6,7 +6,7 @@ edition.workspace = true license = "Apache-2.0" homepage.workspace = true repository.workspace = true -description = "FRAME pallet to manage balances" +description = "FRAME pezpallet to manage balances" readme = "README.md" documentation = "https://docs.rs/pezpallet-balances" diff --git a/bizinikiwi/pezframe/balances/README.md b/bizinikiwi/pezframe/balances/README.md index 4dbb2c5f..49d862b4 100644 --- a/bizinikiwi/pezframe/balances/README.md +++ b/bizinikiwi/pezframe/balances/README.md @@ -2,9 +2,9 @@ The Balances module provides functionality for handling accounts and balances. -- [`Config`](https://docs.rs/pezpallet-balances/latest/pallet_balances/pallet/trait.Config.html) -- [`Call`](https://docs.rs/pezpallet-balances/latest/pallet_balances/pallet/enum.Call.html) -- [`Pallet`](https://docs.rs/pezpallet-balances/latest/pallet_balances/pallet/struct.Pallet.html) +- [`Config`](https://docs.rs/pezpallet-balances/latest/pallet_balances/pezpallet/trait.Config.html) +- [`Call`](https://docs.rs/pezpallet-balances/latest/pallet_balances/pezpallet/enum.Call.html) +- [`Pezpallet`](https://docs.rs/pezpallet-balances/latest/pallet_balances/pezpallet/struct.Pezpallet.html) ## Overview @@ -113,7 +113,7 @@ fn update_ledger( ## Genesis config The Balances module depends on the -[`GenesisConfig`](https://docs.rs/pezpallet-balances/latest/pallet_balances/pallet/struct.GenesisConfig.html). +[`GenesisConfig`](https://docs.rs/pezpallet-balances/latest/pallet_balances/pezpallet/struct.GenesisConfig.html). ## Assumptions diff --git a/bizinikiwi/pezframe/balances/src/benchmarking.rs b/bizinikiwi/pezframe/balances/src/benchmarking.rs index cec749cd..ce974e08 100644 --- a/bizinikiwi/pezframe/balances/src/benchmarking.rs +++ b/bizinikiwi/pezframe/balances/src/benchmarking.rs @@ -15,12 +15,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Balances pallet benchmarking. +//! Balances pezpallet benchmarking. #![cfg(feature = "runtime-benchmarks")] use super::*; -use crate::Pallet as Balances; +use crate::Pezpallet as Balances; use pezframe_benchmarking::v2::*; use pezframe_system::RawOrigin; @@ -283,15 +283,15 @@ mod benchmarks { frozen: Zero::zero(), flags: ExtraFlags::old_logic(), }; - pezframe_system::Pallet::::inc_providers(&user); + pezframe_system::Pezpallet::::inc_providers(&user); assert!(T::AccountStore::try_mutate_exists(&user, |a| -> DispatchResult { *a = Some(account); Ok(()) }) .is_ok()); assert!(!Balances::::account(&user).flags.is_new_logic()); - assert_eq!(pezframe_system::Pallet::::providers(&user), 1); - assert_eq!(pezframe_system::Pallet::::consumers(&user), 0); + assert_eq!(pezframe_system::Pezpallet::::providers(&user), 1); + assert_eq!(pezframe_system::Pezpallet::::consumers(&user), 0); user }) .collect(); @@ -302,8 +302,8 @@ mod benchmarks { for i in 0..u { let user: T::AccountId = account("old_user", i, SEED); assert!(Balances::::account(&user).flags.is_new_logic()); - assert_eq!(pezframe_system::Pallet::::providers(&user), 1); - assert_eq!(pezframe_system::Pallet::::consumers(&user), 1); + assert_eq!(pezframe_system::Pezpallet::::providers(&user), 1); + assert_eq!(pezframe_system::Pezpallet::::consumers(&user), 1); } } diff --git a/bizinikiwi/pezframe/balances/src/impl_currency.rs b/bizinikiwi/pezframe/balances/src/impl_currency.rs index 0ce3516a..acdae703 100644 --- a/bizinikiwi/pezframe/balances/src/impl_currency.rs +++ b/bizinikiwi/pezframe/balances/src/impl_currency.rs @@ -214,7 +214,7 @@ mod imbalances { fn drop(&mut self) { if !self.0.is_zero() { >::mutate(|v| *v = v.saturating_add(self.0)); - Pallet::::deposit_event(Event::::Issued { amount: self.0 }); + Pezpallet::::deposit_event(Event::::Issued { amount: self.0 }); } } } @@ -224,7 +224,7 @@ mod imbalances { fn drop(&mut self) { if !self.0.is_zero() { >::mutate(|v| *v = v.saturating_sub(self.0)); - Pallet::::deposit_event(Event::::Rescinded { amount: self.0 }); + Pezpallet::::deposit_event(Event::::Rescinded { amount: self.0 }); } } } @@ -234,7 +234,7 @@ mod imbalances { { fn handle(amount: T::Balance) { >::mutate(|v| *v = v.saturating_sub(amount)); - Pallet::::deposit_event(Event::::BurnedDebt { amount }); + Pezpallet::::deposit_event(Event::::BurnedDebt { amount }); } } @@ -243,12 +243,12 @@ mod imbalances { { fn handle(amount: T::Balance) { >::mutate(|v| *v = v.saturating_add(amount)); - Pallet::::deposit_event(Event::::MintedCredit { amount }); + Pezpallet::::deposit_event(Event::::MintedCredit { amount }); } } } -impl, I: 'static> Currency for Pallet +impl, I: 'static> Currency for Pezpallet where T::Balance: MaybeSerializeDeserialize + Debug, { @@ -301,7 +301,7 @@ where }); }); - Pallet::::deposit_event(Event::::Rescinded { amount }); + Pezpallet::::deposit_event(Event::::Rescinded { amount }); PositiveImbalance::new(amount) } @@ -319,7 +319,7 @@ where }) }); - Pallet::::deposit_event(Event::::Issued { amount }); + Pezpallet::::deposit_event(Event::::Issued { amount }); NegativeImbalance::new(amount) } @@ -385,7 +385,7 @@ where |account, _is_new| -> Result<(Self::NegativeImbalance, Self::Balance), DispatchError> { // Best value is the most amount we can slash following liveness rules. let ed = T::ExistentialDeposit::get(); - let actual = match system::Pallet::::can_dec_provider(who) { + let actual = match system::Pezpallet::::can_dec_provider(who) { true => value.min(account.free), false => value.min(account.free.saturating_sub(ed)), }; @@ -544,7 +544,7 @@ fn ensure_can_reserve, I: 'static>( value: T::Balance, check_existential_deposit: bool, ) -> DispatchResult { - let AccountData { free, .. } = Pallet::::account(who); + let AccountData { free, .. } = Pezpallet::::account(who); // Early validation: Check sufficient free balance let new_free_balance = free.checked_sub(&value).ok_or(Error::::InsufficientBalance)?; @@ -558,7 +558,7 @@ fn ensure_can_reserve, I: 'static>( Ok(()) } -impl, I: 'static> ReservableCurrency for Pallet +impl, I: 'static> ReservableCurrency for Pezpallet where T::Balance: MaybeSerializeDeserialize + Debug, { @@ -689,7 +689,7 @@ where } } -impl, I: 'static> NamedReservableCurrency for Pallet +impl, I: 'static> NamedReservableCurrency for Pezpallet where T::Balance: MaybeSerializeDeserialize + Debug, { @@ -918,7 +918,7 @@ where } } -impl, I: 'static> LockableCurrency for Pallet +impl, I: 'static> LockableCurrency for Pezpallet where T::Balance: MaybeSerializeDeserialize + Debug, { @@ -988,7 +988,7 @@ where } } -impl, I: 'static> InspectLockableCurrency for Pallet { +impl, I: 'static> InspectLockableCurrency for Pezpallet { fn balance_locked(id: LockIdentifier, who: &T::AccountId) -> Self::Balance { Self::locks(who) .into_iter() diff --git a/bizinikiwi/pezframe/balances/src/impl_fungible.rs b/bizinikiwi/pezframe/balances/src/impl_fungible.rs index 81688974..f2970853 100644 --- a/bizinikiwi/pezframe/balances/src/impl_fungible.rs +++ b/bizinikiwi/pezframe/balances/src/impl_fungible.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Implementation of `fungible` traits for Balances pallet. +//! Implementation of `fungible` traits for Balances pezpallet. use super::*; use pezframe_support::traits::{ tokens::{ @@ -26,7 +26,7 @@ use pezframe_support::traits::{ AccountTouch, }; -impl, I: 'static> fungible::Inspect for Pallet { +impl, I: 'static> fungible::Inspect for Pezpallet { type Balance = T::Balance; fn total_issuance() -> Self::Balance { @@ -60,10 +60,10 @@ impl, I: 'static> fungible::Inspect for Pallet if preservation == Preserve // ..or we don't want the account to die and our provider ref is needed for it to live.. || preservation == Protect && !a.free.is_zero() && - pezframe_system::Pallet::::providers(who) == 1 + pezframe_system::Pezpallet::::providers(who) == 1 // ..or we don't care about the account dying but our provider ref is required.. || preservation == Expendable && !a.free.is_zero() && - !pezframe_system::Pallet::::can_dec_provider(who) + !pezframe_system::Pezpallet::::can_dec_provider(who) { // ..then the ED needed.. untouchable = untouchable.max(T::ExistentialDeposit::get()); @@ -126,11 +126,11 @@ impl, I: 'static> fungible::Inspect for Pallet // Provider restriction - total account balance cannot be reduced to zero if it cannot // sustain the loss of a provider reference. - // NOTE: This assumes that the pallet is a provider (which is true). Is this ever changes, + // NOTE: This assumes that the pezpallet is a provider (which is true). Is this ever changes, // then this will need to adapt accordingly. let ed = T::ExistentialDeposit::get(); let success = if new_free_balance < ed { - if pezframe_system::Pallet::::can_dec_provider(who) { + if pezframe_system::Pezpallet::::can_dec_provider(who) { WithdrawConsequence::ReducedToZero(new_free_balance) } else { return WithdrawConsequence::WouldDie; @@ -150,7 +150,7 @@ impl, I: 'static> fungible::Inspect for Pallet } } -impl, I: 'static> fungible::Unbalanced for Pallet { +impl, I: 'static> fungible::Unbalanced for Pezpallet { fn handle_dust(dust: fungible::Dust) { T::DustRemoval::on_unbalanced(dust.into_credit()); } @@ -188,7 +188,7 @@ impl, I: 'static> fungible::Unbalanced for Pallet, I: 'static> fungible::Mutate for Pallet { +impl, I: 'static> fungible::Mutate for Pezpallet { fn done_mint_into(who: &T::AccountId, amount: Self::Balance) { Self::deposit_event(Event::::Minted { who: who.clone(), amount }); } @@ -210,7 +210,7 @@ impl, I: 'static> fungible::Mutate for Pallet { } } -impl, I: 'static> fungible::MutateHold for Pallet { +impl, I: 'static> fungible::MutateHold for Pezpallet { fn done_hold(reason: &Self::Reason, who: &T::AccountId, amount: Self::Balance) { Self::deposit_event(Event::::Held { reason: *reason, who: who.clone(), amount }); } @@ -253,7 +253,7 @@ impl, I: 'static> fungible::MutateHold for Pallet, I: 'static> fungible::InspectHold for Pallet { +impl, I: 'static> fungible::InspectHold for Pezpallet { type Reason = T::RuntimeHoldReason; fn total_balance_on_hold(who: &T::AccountId) -> T::Balance { @@ -278,7 +278,7 @@ impl, I: 'static> fungible::InspectHold for Pallet bool { - if pezframe_system::Pallet::::providers(who) == 0 { + if pezframe_system::Pezpallet::::providers(who) == 0 { return false; } let holds = Holds::::get(who); @@ -289,7 +289,7 @@ impl, I: 'static> fungible::InspectHold for Pallet, I: 'static> fungible::UnbalancedHold for Pallet { +impl, I: 'static> fungible::UnbalancedHold for Pezpallet { fn set_balance_on_hold( reason: &Self::Reason, who: &T::AccountId, @@ -333,7 +333,7 @@ impl, I: 'static> fungible::UnbalancedHold for Pallet } } -impl, I: 'static> fungible::InspectFreeze for Pallet { +impl, I: 'static> fungible::InspectFreeze for Pezpallet { type Id = T::FreezeIdentifier; fn balance_frozen(id: &Self::Id, who: &T::AccountId) -> Self::Balance { @@ -347,7 +347,7 @@ impl, I: 'static> fungible::InspectFreeze for Pallet< } } -impl, I: 'static> fungible::MutateFreeze for Pallet { +impl, I: 'static> fungible::MutateFreeze for Pezpallet { fn set_freeze(id: &Self::Id, who: &T::AccountId, amount: Self::Balance) -> DispatchResult { if amount.is_zero() { return Self::thaw(id, who); @@ -385,7 +385,7 @@ impl, I: 'static> fungible::MutateFreeze for Pallet, I: 'static> fungible::Balanced for Pallet { +impl, I: 'static> fungible::Balanced for Pezpallet { type OnDropCredit = NegativeImbalance; type OnDropDebt = PositiveImbalance; @@ -405,17 +405,17 @@ impl, I: 'static> fungible::Balanced for Pallet } } -impl, I: 'static> fungible::BalancedHold for Pallet {} +impl, I: 'static> fungible::BalancedHold for Pezpallet {} impl, I: 'static> - fungible::hold::DoneSlash for Pallet + fungible::hold::DoneSlash for Pezpallet { fn done_slash(reason: &T::RuntimeHoldReason, who: &T::AccountId, amount: T::Balance) { T::DoneSlashHandler::done_slash(reason, who, amount); } } -impl, I: 'static> AccountTouch<(), T::AccountId> for Pallet { +impl, I: 'static> AccountTouch<(), T::AccountId> for Pezpallet { type Balance = T::Balance; fn deposit_required(_: ()) -> Self::Balance { Self::Balance::zero() diff --git a/bizinikiwi/pezframe/balances/src/lib.rs b/bizinikiwi/pezframe/balances/src/lib.rs index 3c567f80..7540096a 100644 --- a/bizinikiwi/pezframe/balances/src/lib.rs +++ b/bizinikiwi/pezframe/balances/src/lib.rs @@ -15,21 +15,21 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! # Balances Pallet +//! # Balances Pezpallet //! -//! The Balances pallet provides functionality for handling accounts and balances for a single +//! The Balances pezpallet provides functionality for handling accounts and balances for a single //! token. //! //! It 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. //! //! Also see the [`frame_tokens`] reference docs for higher level information regarding the //! place of this palet in FRAME. //! //! ## Overview //! -//! The Balances pallet provides functions for: +//! The Balances pezpallet provides functions for: //! //! - Getting and setting free balances. //! - Retrieving total, reserved and unreserved balances. @@ -47,9 +47,9 @@ //! //! ### Implementations //! -//! The Balances pallet provides implementations for the following [`fungible`] traits. If these +//! The Balances pezpallet provides implementations for the following [`fungible`] traits. If these //! traits provide the functionality that you need, then you should avoid tight coupling with the -//! Balances pallet. +//! Balances pezpallet. //! //! - [`fungible::Inspect`] //! - [`fungible::Mutate`] @@ -77,11 +77,11 @@ //! //! ## Usage //! -//! The following examples show how to use the Balances pallet in your custom pallet. +//! The following examples show how to use the Balances pezpallet in your custom pezpallet. //! //! ### Examples from the FRAME //! -//! The Contract pallet uses the `Currency` trait to handle gas payment, and its types inherit from +//! The Contract pezpallet uses the `Currency` trait to handle gas payment, and its types inherit from //! `Currency`: //! //! ``` @@ -96,7 +96,7 @@ //! # fn main() {} //! ``` //! -//! The Staking pallet uses the `LockableCurrency` trait to lock a stash account's funds: +//! The Staking pezpallet uses the `LockableCurrency` trait to lock a stash account's funds: //! //! ``` //! use pezframe_support::traits::{WithdrawReasons, LockableCurrency}; @@ -128,14 +128,14 @@ //! //! ## Genesis config //! -//! The Balances pallet depends on the [`GenesisConfig`]. +//! The Balances pezpallet depends on the [`GenesisConfig`]. //! //! ## Assumptions //! //! * Total issued balanced of all accounts should be less than `Config::Balance::max_value()`. //! * Existential Deposit is set to a value greater than zero. //! -//! Note, you may find the Balances pallet still functions with an ED of zero when the +//! Note, you may find the Balances pezpallet still functions with an ED of zero when the //! `insecure_zero_ed` cargo feature is enabled. However this is not a configuration which is //! generally supported, nor will it be. //! @@ -191,7 +191,7 @@ pub use types::{ }; pub use weights::WeightInfo; -pub use pallet::*; +pub use pezpallet::*; const LOG_TARGET: &str = "runtime::balances"; @@ -200,8 +200,8 @@ const DEFAULT_ADDRESS_URI: &str = "//Sender//{}"; type AccountIdLookupOf = <::Lookup as StaticLookup>::Source; -#[pezframe_support::pallet] -pub mod pallet { +#[pezframe_support::pezpallet] +pub mod pezpallet { use super::*; use codec::HasCompact; use pezframe_support::{ @@ -210,7 +210,7 @@ pub mod pallet { }; use pezframe_system::pezpallet_prelude::*; - pub type CreditOf = Credit<::AccountId, Pallet>; + pub type CreditOf = Credit<::AccountId, Pezpallet>; /// Default implementations of [`DefaultConfig`], which can be used to implement [`Config`]. pub mod config_preludes { @@ -248,23 +248,23 @@ pub mod pallet { } } - #[pallet::config(with_default)] + #[pezpallet::config(with_default)] pub trait Config: pezframe_system::Config { /// The overarching event type. - #[pallet::no_default_bounds] + #[pezpallet::no_default_bounds] #[allow(deprecated)] type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The overarching hold reason. - #[pallet::no_default_bounds] + #[pezpallet::no_default_bounds] type RuntimeHoldReason: Parameter + Member + MaxEncodedLen + Copy + VariantCount; /// The overarching freeze reason. - #[pallet::no_default_bounds] + #[pezpallet::no_default_bounds] type RuntimeFreezeReason: VariantCount; - /// Weight information for extrinsics in this pallet. + /// Weight information for extrinsics in this pezpallet. type WeightInfo: WeightInfo; /// The balance of an account. @@ -282,23 +282,23 @@ pub mod pallet { + FixedPointOperand; /// Handler for the unbalanced reduction when removing a dust account. - #[pallet::no_default_bounds] + #[pezpallet::no_default_bounds] type DustRemoval: OnUnbalanced>; /// The minimum amount required to keep an account open. MUST BE GREATER THAN ZERO! /// /// If you *really* need it to be zero, you can enable the feature `insecure_zero_ed` for - /// this pallet. However, you do so at your own risk: this will open up a major DoS vector. + /// this pezpallet. However, you do so at your own risk: this will open up a major DoS vector. /// In case you have multiple sources of provider references, you may also get unexpected /// behaviour if you set this to zero. /// /// Bottom line: Do yourself a favour and make it at least one! - #[pallet::constant] - #[pallet::no_default_bounds] + #[pezpallet::constant] + #[pezpallet::no_default_bounds] type ExistentialDeposit: Get; /// The means of storing the balances of an account. - #[pallet::no_default] + #[pezpallet::no_default] type AccountStore: StoredMap>; /// The ID type for reserves. @@ -313,17 +313,17 @@ pub mod pallet { /// Not strictly enforced, but used for weight estimation. /// /// Use of locks is deprecated in favour of freezes. See `https://github.com/pezkuwichain/kurdistan-sdk/issues/40/` - #[pallet::constant] + #[pezpallet::constant] type MaxLocks: Get; /// The maximum number of named reserves that can exist on an account. /// /// Use of reserves is deprecated in favour of holds. See `https://github.com/pezkuwichain/kurdistan-sdk/issues/40/` - #[pallet::constant] + #[pezpallet::constant] type MaxReserves: Get; /// The maximum number of individual freeze locks that can exist on an account at any time. - #[pallet::constant] + #[pezpallet::constant] type MaxFreezes: Get; /// Allows callbacks to other pallets so they can update their bookkeeping when a slash @@ -339,12 +339,12 @@ pub mod pallet { const STORAGE_VERSION: pezframe_support::traits::StorageVersion = pezframe_support::traits::StorageVersion::new(1); - #[pallet::pallet] - #[pallet::storage_version(STORAGE_VERSION)] - pub struct Pallet(PhantomData<(T, I)>); + #[pezpallet::pezpallet] + #[pezpallet::storage_version(STORAGE_VERSION)] + pub struct Pezpallet(PhantomData<(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, I: 'static = ()> { /// An account was created with some free balance. Endowed { account: T::AccountId, free_balance: T::Balance }, @@ -437,7 +437,7 @@ pub mod pallet { FailedToMutateAccount, } - #[pallet::error] + #[pezpallet::error] pub enum Error { /// Vesting balance too high to send value. VestingBalance, @@ -466,17 +466,17 @@ pub mod pallet { } /// The total units issued in the system. - #[pallet::storage] - #[pallet::whitelist_storage] + #[pezpallet::storage] + #[pezpallet::whitelist_storage] pub type TotalIssuance, I: 'static = ()> = StorageValue<_, T::Balance, ValueQuery>; /// The total units of outstanding deactivated balance in the system. - #[pallet::storage] - #[pallet::whitelist_storage] + #[pezpallet::storage] + #[pezpallet::whitelist_storage] pub type InactiveIssuance, I: 'static = ()> = StorageValue<_, T::Balance, ValueQuery>; - /// The Balances pallet example of storing the balance of an account. + /// The Balances pezpallet example of storing the balance of an account. /// /// # Example /// @@ -486,7 +486,7 @@ pub mod pallet { /// } /// ``` /// - /// You can also store the balance of an account in the `System` pallet. + /// You can also store the balance of an account in the `System` pezpallet. /// /// # Example /// @@ -496,11 +496,11 @@ pub mod pallet { /// } /// ``` /// - /// But this comes with tradeoffs, storing account balances in the system pallet stores + /// But this comes with tradeoffs, storing account balances in the system pezpallet stores /// `pezframe_system` data alongside the account data contrary to storing account balances in the - /// `Balances` pallet, which uses a `StorageMap` to store balances data only. - /// NOTE: This is only used in the case that this pallet is used to store balances. - #[pallet::storage] + /// `Balances` pezpallet, which uses a `StorageMap` to store balances data only. + /// NOTE: This is only used in the case that this pezpallet is used to store balances. + #[pezpallet::storage] pub type Account, I: 'static = ()> = StorageMap<_, Blake2_128Concat, T::AccountId, AccountData, ValueQuery>; @@ -508,7 +508,7 @@ pub mod pallet { /// NOTE: Should only be accessed when setting, changing and freeing a lock. /// /// Use of locks is deprecated in favour of freezes. See `https://github.com/pezkuwichain/kurdistan-sdk/issues/40/` - #[pallet::storage] + #[pezpallet::storage] pub type Locks, I: 'static = ()> = StorageMap< _, Blake2_128Concat, @@ -520,7 +520,7 @@ pub mod pallet { /// Named reserves on some account balances. /// /// Use of reserves is deprecated in favour of holds. See `https://github.com/pezkuwichain/kurdistan-sdk/issues/40/` - #[pallet::storage] + #[pezpallet::storage] pub type Reserves, I: 'static = ()> = StorageMap< _, Blake2_128Concat, @@ -530,7 +530,7 @@ pub mod pallet { >; /// Holds on account balances. - #[pallet::storage] + #[pezpallet::storage] pub type Holds, I: 'static = ()> = StorageMap< _, Blake2_128Concat, @@ -543,7 +543,7 @@ pub mod pallet { >; /// Freeze locks on account balances. - #[pallet::storage] + #[pezpallet::storage] pub type Freezes, I: 'static = ()> = StorageMap< _, Blake2_128Concat, @@ -552,7 +552,7 @@ pub mod pallet { ValueQuery, >; - #[pallet::genesis_config] + #[pezpallet::genesis_config] pub struct GenesisConfig, I: 'static = ()> { pub balances: Vec<(T::AccountId, T::Balance)>, /// Derived development accounts(Optional): @@ -570,7 +570,7 @@ pub mod pallet { } } - #[pallet::genesis_build] + #[pezpallet::genesis_build] impl, I: 'static> BuildGenesisConfig for GenesisConfig { fn build(&self) { let total = self.balances.iter().fold(Zero::zero(), |acc: T::Balance, &(_, n)| acc + n); @@ -600,22 +600,22 @@ pub mod pallet { // Generate additional dev accounts. if let Some((num_accounts, balance, ref derivation)) = self.dev_accounts { // Using the provided derivation string or default to `"//Sender//{}`". - Pallet::::derive_dev_account( + Pezpallet::::derive_dev_account( num_accounts, balance, derivation.as_deref().unwrap_or(DEFAULT_ADDRESS_URI), ); } for &(ref who, free) in self.balances.iter() { - pezframe_system::Pallet::::inc_providers(who); + pezframe_system::Pezpallet::::inc_providers(who); assert!(T::AccountStore::insert(who, AccountData { free, ..Default::default() }) .is_ok()); } } } - #[pallet::hooks] - impl, I: 'static> Hooks> for Pallet { + #[pezpallet::hooks] + impl, I: 'static> Hooks> for Pezpallet { fn integrity_test() { #[cfg(not(feature = "insecure_zero_ed"))] assert!( @@ -636,8 +636,8 @@ pub mod pallet { } } - #[pallet::call(weight(>::WeightInfo))] - impl, I: 'static> Pallet { + #[pezpallet::call(weight(>::WeightInfo))] + impl, I: 'static> Pezpallet { /// Transfer some liquid free balance to another account. /// /// `transfer_allow_death` will set the `FreeBalance` of the sender and receiver. @@ -645,11 +645,11 @@ pub mod pallet { /// of the transfer, the account will be reaped. /// /// The dispatch origin for this call must be `Signed` by the transactor. - #[pallet::call_index(0)] + #[pezpallet::call_index(0)] pub fn transfer_allow_death( origin: OriginFor, dest: AccountIdLookupOf, - #[pallet::compact] value: T::Balance, + #[pezpallet::compact] value: T::Balance, ) -> DispatchResult { let source = ensure_signed(origin)?; let dest = T::Lookup::lookup(dest)?; @@ -659,12 +659,12 @@ pub mod pallet { /// Exactly as `transfer_allow_death`, except the origin must be root and the source account /// may be specified. - #[pallet::call_index(2)] + #[pezpallet::call_index(2)] pub fn force_transfer( origin: OriginFor, source: AccountIdLookupOf, dest: AccountIdLookupOf, - #[pallet::compact] value: T::Balance, + #[pezpallet::compact] value: T::Balance, ) -> DispatchResult { ensure_root(origin)?; let source = T::Lookup::lookup(source)?; @@ -678,12 +678,12 @@ pub mod pallet { /// /// 99% of the time you want [`transfer_allow_death`] instead. /// - /// [`transfer_allow_death`]: struct.Pallet.html#method.transfer - #[pallet::call_index(3)] + /// [`transfer_allow_death`]: struct.Pezpallet.html#method.transfer + #[pezpallet::call_index(3)] pub fn transfer_keep_alive( origin: OriginFor, dest: AccountIdLookupOf, - #[pallet::compact] value: T::Balance, + #[pezpallet::compact] value: T::Balance, ) -> DispatchResult { let source = ensure_signed(origin)?; let dest = T::Lookup::lookup(dest)?; @@ -706,7 +706,7 @@ pub mod pallet { /// of the funds the account has, causing the sender account to be killed (false), or /// transfer everything except at least the existential deposit, which will guarantee to /// keep the sender account alive (true). - #[pallet::call_index(4)] + #[pezpallet::call_index(4)] pub fn transfer_all( origin: OriginFor, dest: AccountIdLookupOf, @@ -732,7 +732,7 @@ pub mod pallet { /// Unreserve some balance from a user by force. /// /// Can only be called by ROOT. - #[pallet::call_index(5)] + #[pezpallet::call_index(5)] pub fn force_unreserve( origin: OriginFor, who: AccountIdLookupOf, @@ -752,8 +752,8 @@ pub mod pallet { /// This will waive the transaction fee if at least all but 10% of the accounts needed to /// be upgraded. (We let some not have to be upgraded just in order to allow for the /// possibility of churn). - #[pallet::call_index(6)] - #[pallet::weight(T::WeightInfo::upgrade_accounts(who.len() as u32))] + #[pezpallet::call_index(6)] + #[pezpallet::weight(T::WeightInfo::upgrade_accounts(who.len() as u32))] pub fn upgrade_accounts( origin: OriginFor, who: Vec, @@ -780,15 +780,15 @@ pub mod pallet { /// Set the regular balance of a given account. /// /// The dispatch origin for this call is `root`. - #[pallet::call_index(8)] - #[pallet::weight( + #[pezpallet::call_index(8)] + #[pezpallet::weight( T::WeightInfo::force_set_balance_creating() // Creates a new account. .max(T::WeightInfo::force_set_balance_killing()) // Kills an existing account. )] pub fn force_set_balance( origin: OriginFor, who: AccountIdLookupOf, - #[pallet::compact] new_free: T::Balance, + #[pezpallet::compact] new_free: T::Balance, ) -> DispatchResult { ensure_root(origin)?; let who = T::Lookup::lookup(who)?; @@ -822,12 +822,12 @@ pub mod pallet { /// /// # Example #[doc = docify::embed!("./src/tests/dispatchable_tests.rs", force_adjust_total_issuance_example)] - #[pallet::call_index(9)] - #[pallet::weight(T::WeightInfo::force_adjust_total_issuance())] + #[pezpallet::call_index(9)] + #[pezpallet::weight(T::WeightInfo::force_adjust_total_issuance())] pub fn force_adjust_total_issuance( origin: OriginFor, direction: AdjustmentDirection, - #[pallet::compact] delta: T::Balance, + #[pezpallet::compact] delta: T::Balance, ) -> DispatchResult { ensure_root(origin)?; @@ -854,11 +854,11 @@ pub mod pallet { /// /// Unlike sending funds to a _burn_ address, which merely makes the funds inaccessible, /// this `burn` operation will reduce total issuance by the amount _burned_. - #[pallet::call_index(10)] - #[pallet::weight(if *keep_alive {T::WeightInfo::burn_allow_death() } else {T::WeightInfo::burn_keep_alive()})] + #[pezpallet::call_index(10)] + #[pezpallet::weight(if *keep_alive {T::WeightInfo::burn_allow_death() } else {T::WeightInfo::burn_keep_alive()})] pub fn burn( origin: OriginFor, - #[pallet::compact] value: T::Balance, + #[pezpallet::compact] value: T::Balance, keep_alive: bool, ) -> DispatchResult { let source = ensure_signed(origin)?; @@ -874,7 +874,7 @@ pub mod pallet { } } - impl, I: 'static> Pallet { + impl, I: 'static> Pezpallet { /// Public function to get the total issuance. pub fn total_issuance() -> T::Balance { TotalIssuance::::get() @@ -910,7 +910,7 @@ pub mod pallet { } a.flags.set_new_logic(); if !a.reserved.is_zero() && a.frozen.is_zero() { - if system::Pallet::::providers(who) == 0 { + if system::Pezpallet::::providers(who) == 0 { // Gah!! We have no provider refs :( // This shouldn't practically happen, but we need a failsafe anyway: let's give // them enough for an ED. @@ -920,9 +920,9 @@ pub mod pallet { who ); a.free = a.free.max(Self::ed()); - system::Pallet::::inc_providers(who); + system::Pezpallet::::inc_providers(who); } - let _ = system::Pallet::::inc_consumers_without_limit(who).defensive(); + let _ = system::Pezpallet::::inc_consumers_without_limit(who).defensive(); } // Should never fail - we're only setting a bit. let _ = T::AccountStore::try_mutate_exists(who, |account| -> DispatchResult { @@ -1045,7 +1045,7 @@ pub mod pallet { /// Returns `false` otherwise. #[cfg(feature = "insecure_zero_ed")] fn have_providers_or_no_zero_ed(who: &T::AccountId) -> bool { - pezframe_system::Pallet::::providers(who) > 0 + pezframe_system::Pezpallet::::providers(who) > 0 } /// Mutate an account to some new value, or delete it entirely with `None`. Will enforce @@ -1081,35 +1081,35 @@ pub mod pallet { let does_consume = !account.reserved.is_zero() || !account.frozen.is_zero(); if !did_provide && does_provide { - pezframe_system::Pallet::::inc_providers(who); + pezframe_system::Pezpallet::::inc_providers(who); } if did_consume && !does_consume { - pezframe_system::Pallet::::dec_consumers(who); + pezframe_system::Pezpallet::::dec_consumers(who); } if !did_consume && does_consume { if force_consumer_bump { // If we are forcing a consumer bump, we do it without limit. - pezframe_system::Pallet::::inc_consumers_without_limit(who)?; + pezframe_system::Pezpallet::::inc_consumers_without_limit(who)?; } else { - pezframe_system::Pallet::::inc_consumers(who)?; + pezframe_system::Pezpallet::::inc_consumers(who)?; } } - if does_consume && pezframe_system::Pallet::::consumers(who) == 0 { + if does_consume && pezframe_system::Pezpallet::::consumers(who) == 0 { // NOTE: This is a failsafe and should not happen for normal accounts. A normal // account should have gotten a consumer ref in `!did_consume && does_consume` // at some point. log::error!(target: LOG_TARGET, "Defensively bumping a consumer ref."); - pezframe_system::Pallet::::inc_consumers(who)?; + pezframe_system::Pezpallet::::inc_consumers(who)?; } if did_provide && !does_provide { // This could reap the account so must go last. - pezframe_system::Pallet::::dec_providers(who).inspect_err(|_| { + pezframe_system::Pezpallet::::dec_providers(who).inspect_err(|_| { // best-effort revert consumer change. if did_consume && !does_consume { - let _ = pezframe_system::Pallet::::inc_consumers(who).defensive(); + let _ = pezframe_system::Pezpallet::::inc_consumers(who).defensive(); } if !did_consume && does_consume { - let _ = pezframe_system::Pallet::::dec_consumers(who); + let _ = pezframe_system::Pezpallet::::dec_consumers(who); } })?; } @@ -1151,7 +1151,7 @@ pub mod pallet { }); } if let Some(amount) = maybe_dust { - Pallet::::deposit_event(Event::DustLost { account: who.clone(), amount }); + Pezpallet::::deposit_event(Event::DustLost { account: who.clone(), amount }); } (result, maybe_dust) }) @@ -1362,7 +1362,7 @@ pub mod pallet { } #[cfg(any(test, feature = "try-runtime"))] - impl, I: 'static> Pallet { + impl, I: 'static> Pezpallet { pub(crate) fn do_try_state( _n: BlockNumberFor, ) -> Result<(), pezsp_runtime::TryRuntimeError> { diff --git a/bizinikiwi/pezframe/balances/src/migration.rs b/bizinikiwi/pezframe/balances/src/migration.rs index 6f865a11..81a8283c 100644 --- a/bizinikiwi/pezframe/balances/src/migration.rs +++ b/bizinikiwi/pezframe/balances/src/migration.rs @@ -22,23 +22,23 @@ use pezframe_support::{ }; fn migrate_v0_to_v1, I: 'static>(accounts: &[T::AccountId]) -> Weight { - let on_chain_version = Pallet::::on_chain_storage_version(); + let on_chain_version = Pezpallet::::on_chain_storage_version(); if on_chain_version == 0 { let total = accounts .iter() - .map(|a| Pallet::::total_balance(a)) + .map(|a| Pezpallet::::total_balance(a)) .fold(T::Balance::zero(), |a, e| a.saturating_add(e)); - Pallet::::deactivate(total); + Pezpallet::::deactivate(total); // Remove the old `StorageVersion` type. pezframe_support::storage::unhashed::kill(&pezframe_support::storage::storage_prefix( - Pallet::::name().as_bytes(), + Pezpallet::::name().as_bytes(), "StorageVersion".as_bytes(), )); // Set storage version to `1`. - StorageVersion::new(1).put::>(); + StorageVersion::new(1).put::>(); log::info!(target: LOG_TARGET, "Storage to version 1"); T::DbWeight::get().reads_writes(2 + accounts.len() as u64, 3) @@ -76,19 +76,19 @@ impl, A: Get>, I: 'static> OnRuntimeUpgrade pub struct ResetInactive(PhantomData<(T, I)>); impl, I: 'static> OnRuntimeUpgrade for ResetInactive { fn on_runtime_upgrade() -> Weight { - let on_chain_version = Pallet::::on_chain_storage_version(); + let on_chain_version = Pezpallet::::on_chain_storage_version(); if on_chain_version == 1 { // Remove the old `StorageVersion` type. pezframe_support::storage::unhashed::kill(&pezframe_support::storage::storage_prefix( - Pallet::::name().as_bytes(), + Pezpallet::::name().as_bytes(), "StorageVersion".as_bytes(), )); InactiveIssuance::::kill(); // Set storage version to `0`. - StorageVersion::new(0).put::>(); + StorageVersion::new(0).put::>(); log::info!(target: LOG_TARGET, "Storage to version 0"); T::DbWeight::get().reads_writes(1, 3) diff --git a/bizinikiwi/pezframe/balances/src/tests/dispatchable_tests.rs b/bizinikiwi/pezframe/balances/src/tests/dispatchable_tests.rs index 819222ad..7006ec6e 100644 --- a/bizinikiwi/pezframe/balances/src/tests/dispatchable_tests.rs +++ b/bizinikiwi/pezframe/balances/src/tests/dispatchable_tests.rs @@ -176,7 +176,7 @@ fn transfer_all_works_4() { fn set_balance_handles_killing_account() { ExtBuilder::default().build_and_execute_with(|| { let _ = Balances::mint_into(&1, 111); - assert_ok!(pezframe_system::Pallet::::inc_consumers(&1)); + assert_ok!(pezframe_system::Pezpallet::::inc_consumers(&1)); assert_noop!( Balances::force_set_balance(RuntimeOrigin::root(), 1, 0), DispatchError::ConsumerRemaining, diff --git a/bizinikiwi/pezframe/balances/src/tests/fungible_tests.rs b/bizinikiwi/pezframe/balances/src/tests/fungible_tests.rs index c4f907a8..01bf8592 100644 --- a/bizinikiwi/pezframe/balances/src/tests/fungible_tests.rs +++ b/bizinikiwi/pezframe/balances/src/tests/fungible_tests.rs @@ -579,8 +579,8 @@ fn sufficients_work_properly_with_reference_counting() { .existential_deposit(1) .monied(true) .build_and_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 if UseSystem::get() { // Start with a balance of 100 >::set_balance(&1, 100); diff --git a/bizinikiwi/pezframe/balances/src/tests/mod.rs b/bizinikiwi/pezframe/balances/src/tests/mod.rs index 2bf8120c..1f33be61 100644 --- a/bizinikiwi/pezframe/balances/src/tests/mod.rs +++ b/bizinikiwi/pezframe/balances/src/tests/mod.rs @@ -20,7 +20,7 @@ #![cfg(test)] use crate::{ - self as pezpallet_balances, AccountData, Config, CreditOf, Error, Pallet, TotalIssuance, + self as pezpallet_balances, AccountData, Config, CreditOf, Error, Pezpallet, TotalIssuance, DEFAULT_ADDRESS_URI, }; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; @@ -109,7 +109,7 @@ impl pezframe_system::Config for Test { #[derive_impl(pezpallet_transaction_payment::config_preludes::TestDefaultConfig)] impl pezpallet_transaction_payment::Config for Test { type RuntimeEvent = RuntimeEvent; - type OnChargeTransaction = FungibleAdapter, ()>; + type OnChargeTransaction = FungibleAdapter, ()>; type OperationalFeeMultiplier = ConstU8<5>; type WeightToFee = IdentityFee; type LengthToFee = IdentityFee; @@ -239,7 +239,7 @@ parameter_types! { } type BalancesAccountStore = StorageMapShim, u64, super::AccountData>; -type SystemAccountStore = pezframe_system::Pallet; +type SystemAccountStore = pezframe_system::Pezpallet; pub struct TestAccountStore; impl StoredMap> for TestAccountStore { @@ -336,9 +336,9 @@ pub fn ensure_ti_valid() { continue; } - // Check if we are using the system pallet or some other custom storage for accounts. + // Check if we are using the system pezpallet or some other custom storage for accounts. if UseSystem::get() { - let data = pezframe_system::Pallet::::account(acc); + let data = pezframe_system::Pezpallet::::account(acc); sum += data.data.total(); } else { let data = crate::Account::::get(acc); @@ -371,7 +371,7 @@ fn check_whitelist() { assert!(whitelist.contains("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80")); } -/// This pallet runs tests twice, once with system as `type AccountStore` and once this pallet. This +/// This pezpallet runs tests twice, once with system as `type AccountStore` and once this pezpallet. This /// function will return the right value based on the `UseSystem` flag. pub(crate) fn get_test_account_data(who: AccountId) -> AccountData { if UseSystem::get() { diff --git a/bizinikiwi/pezframe/balances/src/types.rs b/bizinikiwi/pezframe/balances/src/types.rs index 85f9a2c9..201a211e 100644 --- a/bizinikiwi/pezframe/balances/src/types.rs +++ b/bizinikiwi/pezframe/balances/src/types.rs @@ -15,9 +15,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Types used in the pallet. +//! Types used in the pezpallet. -use crate::{Config, CreditOf, Event, Pallet}; +use crate::{Config, CreditOf, Event, Pezpallet}; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use core::ops::BitOr; use pezframe_support::traits::{Imbalance, LockIdentifier, OnUnbalanced, WithdrawReasons}; @@ -190,7 +190,7 @@ pub struct DustCleaner, I: 'static = ()>( impl, I: 'static> Drop for DustCleaner { fn drop(&mut self) { if let Some((who, dust)) = self.0.take() { - Pallet::::deposit_event(Event::DustLost { account: who, amount: dust.peek() }); + Pezpallet::::deposit_event(Event::DustLost { account: who, amount: dust.peek() }); T::DustRemoval::on_unbalanced(dust); } } diff --git a/bizinikiwi/pezframe/balances/src/weights.rs b/bizinikiwi/pezframe/balances/src/weights.rs index 63cc94b5..9a292ec9 100644 --- a/bizinikiwi/pezframe/balances/src/weights.rs +++ b/bizinikiwi/pezframe/balances/src/weights.rs @@ -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_balances +// --pezpallet=pezpallet_balances // --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2 // --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/balances/src/weights.rs // --wasm-execution=compiled diff --git a/bizinikiwi/pezframe/beefy-mmr/src/benchmarking.rs b/bizinikiwi/pezframe/beefy-mmr/src/benchmarking.rs index 6457dc8b..5fde6a44 100644 --- a/bizinikiwi/pezframe/beefy-mmr/src/benchmarking.rs +++ b/bizinikiwi/pezframe/beefy-mmr/src/benchmarking.rs @@ -15,17 +15,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Beefy pallet benchmarking. +//! Beefy pezpallet benchmarking. #![cfg(feature = "runtime-benchmarks")] use super::*; -use crate::Pallet as BeefyMmr; +use crate::Pezpallet as BeefyMmr; use codec::Encode; use pezframe_benchmarking::v2::*; use pezframe_support::traits::Hooks; -use pezframe_system::{Config as SystemConfig, Pallet as System}; -use pezpallet_mmr::{Nodes, Pallet as Mmr}; +use pezframe_system::{Config as SystemConfig, Pezpallet as System}; +use pezpallet_mmr::{Nodes, Pezpallet as Mmr}; use pezsp_consensus_beefy::Payload; use pezsp_runtime::traits::One; @@ -134,7 +134,7 @@ mod benchmarks { } impl_benchmark_test_suite!( - Pallet, + Pezpallet, crate::mock::new_test_ext(Default::default()), crate::mock::Test ); diff --git a/bizinikiwi/pezframe/beefy-mmr/src/lib.rs b/bizinikiwi/pezframe/beefy-mmr/src/lib.rs index 764b39b5..a3e0ca9d 100644 --- a/bizinikiwi/pezframe/beefy-mmr/src/lib.rs +++ b/bizinikiwi/pezframe/beefy-mmr/src/lib.rs @@ -18,12 +18,12 @@ #![cfg_attr(not(feature = "std"), no_std)] #![warn(missing_docs)] -//! A BEEFY+MMR pallet combo. +//! A BEEFY+MMR pezpallet combo. //! //! While both BEEFY and Merkle Mountain Range (MMR) can be used separately, //! these tools were designed to work together in unison. //! -//! The pallet provides a standardized MMR Leaf format that can be used +//! The pezpallet provides a standardized MMR Leaf format that can be used //! to bridge BEEFY+MMR-based networks (both standalone and Pezkuwi-like). //! //! The MMR leaf contains: @@ -54,7 +54,7 @@ use pezsp_consensus_beefy::{ use pezframe_support::{crypto::ecdsa::ECDSAExt, pezpallet_prelude::Weight, traits::Get}; use pezframe_system::pezpallet_prelude::{BlockNumberFor, HeaderFor}; -pub use pallet::*; +pub use pezpallet::*; pub use weights::WeightInfo; mod benchmarking; @@ -79,7 +79,7 @@ where ::BeefyId, >::MmrRoot(*root)), ); - pezframe_system::Pallet::::deposit_log(digest); + pezframe_system::Pezpallet::::deposit_log(digest); } } @@ -99,20 +99,20 @@ impl Convert> for Beef type MerkleRootOf = <::Hashing as pezsp_runtime::traits::Hash>::Output; -#[pezframe_support::pallet] -pub mod pallet { +#[pezframe_support::pezpallet] +pub mod pezpallet { #![allow(missing_docs)] use super::*; use pezframe_support::pezpallet_prelude::*; - /// BEEFY-MMR pallet. - #[pallet::pallet] - pub struct Pallet(_); + /// BEEFY-MMR pezpallet. + #[pezpallet::pezpallet] + pub struct Pezpallet(_); /// The module's configuration trait. - #[pallet::config] - #[pallet::disable_pezframe_system_supertrait_check] + #[pezpallet::config] + #[pezpallet::disable_pezframe_system_supertrait_check] pub trait Config: pezpallet_mmr::Config + pezpallet_beefy::Config { /// Current leaf version. /// @@ -138,19 +138,19 @@ pub mod pallet { } /// Details of current BEEFY authority set. - #[pallet::storage] + #[pezpallet::storage] pub type BeefyAuthorities = StorageValue<_, BeefyAuthoritySet>, ValueQuery>; /// Details of next BEEFY authority set. /// /// This storage entry is used as cache for calls to `update_beefy_next_authority_set`. - #[pallet::storage] + #[pezpallet::storage] pub type BeefyNextAuthorities = StorageValue<_, BeefyNextAuthoritySet>, ValueQuery>; } -impl LeafDataProvider for Pallet { +impl LeafDataProvider for Pezpallet { type LeafData = MmrLeaf< BlockNumberFor, ::Hash, @@ -168,24 +168,24 @@ impl LeafDataProvider for Pallet { } } -impl pezsp_consensus_beefy::OnNewValidatorSet<::BeefyId> for Pallet +impl pezsp_consensus_beefy::OnNewValidatorSet<::BeefyId> for Pezpallet where - T: pallet::Config, + T: pezpallet::Config, { /// Compute and cache BEEFY authority sets based on updated BEEFY validator sets. fn on_new_validator_set( current_set: &BeefyValidatorSet<::BeefyId>, next_set: &BeefyValidatorSet<::BeefyId>, ) { - let current = Pallet::::compute_authority_set(current_set); - let next = Pallet::::compute_authority_set(next_set); + let current = Pezpallet::::compute_authority_set(current_set); + let next = Pezpallet::::compute_authority_set(next_set); // cache the result BeefyAuthorities::::put(¤t); BeefyNextAuthorities::::put(&next); } } -impl AncestryHelper> for Pallet +impl AncestryHelper> for Pezpallet where T: pezpallet_mmr::Config, { @@ -193,7 +193,7 @@ where type ValidationContext = MerkleRootOf; fn is_proof_optimal(proof: &Self::Proof) -> bool { - let is_proof_optimal = pezpallet_mmr::Pallet::::is_ancestry_proof_optimal(proof); + let is_proof_optimal = pezpallet_mmr::Pezpallet::::is_ancestry_proof_optimal(proof); // We don't check the proof size when running benchmarks, since we use mock proofs // which would cause the test to fail. @@ -206,7 +206,7 @@ where fn extract_validation_context(header: HeaderFor) -> Option { // Check if the provided header is canonical. - let expected_hash = pezframe_system::Pallet::::block_hash(header.number()); + let expected_hash = pezframe_system::Pezpallet::::block_hash(header.number()); if expected_hash != header.hash() { return None; } @@ -227,7 +227,7 @@ where context: Self::ValidationContext, ) -> bool { let commitment_leaf_count = - match pezpallet_mmr::Pallet::::block_num_to_leaf_count(commitment.block_number) { + match pezpallet_mmr::Pezpallet::::block_num_to_leaf_count(commitment.block_number) { Ok(commitment_leaf_count) => commitment_leaf_count, Err(_) => { // We can't prove that the commitment is non-canonical if the @@ -243,7 +243,7 @@ where let canonical_mmr_root = context; let canonical_prev_root = - match pezpallet_mmr::Pallet::::verify_ancestry_proof(canonical_mmr_root, proof) { + match pezpallet_mmr::Pezpallet::::verify_ancestry_proof(canonical_mmr_root, proof) { Ok(canonical_prev_root) => canonical_prev_root, Err(_) => { // Can't prove that the commitment is non-canonical if the proof @@ -282,7 +282,7 @@ where } } -impl AncestryHelperWeightInfo> for Pallet +impl AncestryHelperWeightInfo> for Pezpallet where T: pezpallet_mmr::Config, { @@ -310,7 +310,7 @@ where } } -impl Pallet { +impl Pezpallet { /// Return the currently active BEEFY authority set proof. pub fn authority_set_proof() -> BeefyAuthoritySet> { BeefyAuthorities::::get() diff --git a/bizinikiwi/pezframe/beefy-mmr/src/mock.rs b/bizinikiwi/pezframe/beefy-mmr/src/mock.rs index 260f85ba..2a872777 100644 --- a/bizinikiwi/pezframe/beefy-mmr/src/mock.rs +++ b/bizinikiwi/pezframe/beefy-mmr/src/mock.rs @@ -41,7 +41,7 @@ use pezsp_core::offchain::{testing::TestOffchainExt, OffchainDbExt, OffchainWork impl_opaque_keys! { pub struct MockSessionKeys { - pub dummy: pezpallet_beefy::Pallet, + pub dummy: pezpallet_beefy::Pezpallet, } } @@ -194,7 +194,7 @@ pub fn new_test_ext_raw_authorities(authorities: Vec<(u64, BeefyId)>) -> TestExt BasicExternalities::execute_with_storage(&mut t, || { for (ref id, ..) in &session_keys { - pezframe_system::Pallet::::inc_providers(id); + pezframe_system::Pezpallet::::inc_providers(id); } }); diff --git a/bizinikiwi/pezframe/beefy-mmr/src/tests.rs b/bizinikiwi/pezframe/beefy-mmr/src/tests.rs index 5c40bb38..080af787 100644 --- a/bizinikiwi/pezframe/beefy-mmr/src/tests.rs +++ b/bizinikiwi/pezframe/beefy-mmr/src/tests.rs @@ -101,7 +101,7 @@ fn should_contain_valid_leaf_data() { let mut ext = new_test_ext(vec![1, 2, 3, 4]); let parent_hash = ext.execute_with(|| { init_block(1, None); - pezframe_system::Pallet::::parent_hash() + pezframe_system::Pezpallet::::parent_hash() }); let mmr_leaf = read_mmr_leaf(&mut ext, node_offchain_key(0, parent_hash)); @@ -126,7 +126,7 @@ fn should_contain_valid_leaf_data() { // build second block on top let parent_hash = ext.execute_with(|| { init_block(2, None); - pezframe_system::Pallet::::parent_hash() + pezframe_system::Pezpallet::::parent_hash() }); let mmr_leaf = read_mmr_leaf(&mut ext, node_offchain_key(1, parent_hash)); diff --git a/bizinikiwi/pezframe/beefy-mmr/src/weights.rs b/bizinikiwi/pezframe/beefy-mmr/src/weights.rs index 57fd0d5b..96596cf3 100644 --- a/bizinikiwi/pezframe/beefy-mmr/src/weights.rs +++ b/bizinikiwi/pezframe/beefy-mmr/src/weights.rs @@ -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_beefy_mmr +// --pezpallet=pezpallet_beefy_mmr // --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2 // --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/beefy-mmr/src/weights.rs // --wasm-execution=compiled diff --git a/bizinikiwi/pezframe/beefy/Cargo.toml b/bizinikiwi/pezframe/beefy/Cargo.toml index 0ffe1eda..8536a0b7 100644 --- a/bizinikiwi/pezframe/beefy/Cargo.toml +++ b/bizinikiwi/pezframe/beefy/Cargo.toml @@ -5,7 +5,7 @@ authors.workspace = true edition.workspace = true license = "Apache-2.0" repository.workspace = true -description = "BEEFY FRAME pallet" +description = "BEEFY FRAME pezpallet" homepage.workspace = true documentation = "https://docs.rs/pezpallet-beefy" diff --git a/bizinikiwi/pezframe/beefy/src/default_weights.rs b/bizinikiwi/pezframe/beefy/src/default_weights.rs index 698633d6..fd10889e 100644 --- a/bizinikiwi/pezframe/beefy/src/default_weights.rs +++ b/bizinikiwi/pezframe/beefy/src/default_weights.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Default weights for the BEEFY Pallet +//! Default weights for the BEEFY Pezpallet //! This file was not auto-generated. use pezframe_support::weights::{ diff --git a/bizinikiwi/pezframe/beefy/src/equivocation.rs b/bizinikiwi/pezframe/beefy/src/equivocation.rs index 26c9f1a1..2edeed5f 100644 --- a/bizinikiwi/pezframe/beefy/src/equivocation.rs +++ b/bizinikiwi/pezframe/beefy/src/equivocation.rs @@ -26,12 +26,12 @@ //! //! These can be used in an offchain context in order to submit equivocation //! reporting extrinsics (from the client that's running the BEEFY protocol). -//! And in a runtime context, so that the BEEFY pallet can validate the +//! And in a runtime context, so that the BEEFY pezpallet can validate the //! equivocation proofs in the extrinsic and report the offences. //! //! IMPORTANT: //! When using this module for enabling equivocation reporting it is required -//! that the `ValidateUnsigned` for the BEEFY pallet is used in the runtime +//! that the `ValidateUnsigned` for the BEEFY pezpallet is used in the runtime //! definition. use alloc::{vec, vec::Vec}; @@ -56,7 +56,7 @@ use pezsp_staking::{ SessionIndex, }; -use super::{Call, Config, Error, Pallet, LOG_TARGET}; +use super::{Call, Config, Error, Pezpallet, LOG_TARGET}; /// A round number and set id which point on the time of an offence. #[derive(Copy, Clone, PartialOrd, Ord, Eq, PartialEq, Encode, Decode)] @@ -127,7 +127,7 @@ where /// `offchain::CreateTransactionBase`. /// - On-chain validity checks and processing are mostly delegated to the user provided generic /// types implementing `KeyOwnerProofSystem` and `ReportOffence` traits. -/// - Offence reporter for unsigned transactions is fetched via the authorship pallet. +/// - Offence reporter for unsigned transactions is fetched via the authorship pezpallet. pub struct EquivocationReportSystem(core::marker::PhantomData<(T, R, P, L)>); /// Equivocation evidence convenience alias. @@ -255,7 +255,7 @@ impl EquivocationEvidenceFor { EquivocationEvidenceFor::FutureBlockVotingProof(equivocation_proof, _) => { let FutureBlockVotingProof { vote } = equivocation_proof; // Check if the commitment actually targets a future block - if vote.commitment.block_number < pezframe_system::Pallet::::block_number() { + if vote.commitment.block_number < pezframe_system::Pezpallet::::block_number() { return Err(Error::::InvalidFutureBlockVotingProof); } @@ -326,7 +326,7 @@ where evidence: EquivocationEvidenceFor, ) -> Result<(), DispatchError> { let maybe_slash_fraction = evidence.slash_fraction(); - let reporter = reporter.or_else(|| pezpallet_authorship::Pallet::::author()); + let reporter = reporter.or_else(|| pezpallet_authorship::Pezpallet::::author()); // We check the equivocation within the context of its set id (and associated session). let set_id = evidence.set_id(); @@ -365,7 +365,7 @@ where /// It restricts calls to `report_equivocation_unsigned` to local calls (i.e. extrinsics generated /// on this node) or that already in a block. This guarantees that only block authors can include /// unsigned equivocation reports. -impl Pallet { +impl Pezpallet { pub fn validate_unsigned(source: TransactionSource, call: &Call) -> TransactionValidity { // discard equivocation report not coming from the local node match source { diff --git a/bizinikiwi/pezframe/beefy/src/lib.rs b/bizinikiwi/pezframe/beefy/src/lib.rs index cdc2b0d9..958d9f56 100644 --- a/bizinikiwi/pezframe/beefy/src/lib.rs +++ b/bizinikiwi/pezframe/beefy/src/lib.rs @@ -56,16 +56,16 @@ use pezsp_staking::{offence::OffenceReportSystem, SessionIndex}; use crate::equivocation::EquivocationEvidenceFor; pub use crate::equivocation::{EquivocationOffence, EquivocationReportSystem, TimeSlot}; -pub use pallet::*; +pub use pezpallet::*; const LOG_TARGET: &str = "runtime::beefy"; -#[pezframe_support::pallet] -pub mod pallet { +#[pezframe_support::pezpallet] +pub mod pezpallet { use super::*; use pezframe_system::{ensure_root, pezpallet_prelude::BlockNumberFor}; - #[pallet::config] + #[pezpallet::config] pub trait Config: pezframe_system::Config { /// Authority identifier type type BeefyId: Member @@ -76,11 +76,11 @@ pub mod pallet { + MaxEncodedLen; /// The maximum number of authorities that can be added. - #[pallet::constant] + #[pezpallet::constant] type MaxAuthorities: Get; /// The maximum number of nominators for each validator. - #[pallet::constant] + #[pezpallet::constant] type MaxNominators: Get; /// The maximum number of entries to keep in the set id to session index mapping. @@ -89,7 +89,7 @@ pub mod pallet { /// value should relate to the bonding duration of whatever staking system is /// being used (if any). If equivocation handling is not enabled then this value /// can be zero. - #[pallet::constant] + #[pezpallet::constant] type MaxSetIdSessionEntries: Get; /// A hook to act on the new BEEFY validator set. @@ -103,7 +103,7 @@ pub mod pallet { type AncestryHelper: AncestryHelper> + AncestryHelperWeightInfo>; - /// Weights for this pallet. + /// Weights for this pezpallet. type WeightInfo: WeightInfo; /// The proof of key ownership, used for validating equivocation reports @@ -120,21 +120,21 @@ pub mod pallet { >; } - #[pallet::pallet] - pub struct Pallet(_); + #[pezpallet::pezpallet] + pub struct Pezpallet(_); /// The current authorities set - #[pallet::storage] + #[pezpallet::storage] pub type Authorities = StorageValue<_, BoundedVec, ValueQuery>; /// The current validator set id - #[pallet::storage] + #[pezpallet::storage] pub type ValidatorSetId = StorageValue<_, pezsp_consensus_beefy::ValidatorSetId, ValueQuery>; /// Authorities set scheduled to be used with the next session - #[pallet::storage] + #[pezpallet::storage] pub type NextAuthorities = StorageValue<_, BoundedVec, ValueQuery>; @@ -148,17 +148,17 @@ pub mod pallet { /// during that session. /// /// TWOX-NOTE: `ValidatorSetId` is not under user control. - #[pallet::storage] + #[pezpallet::storage] pub type SetIdSession = StorageMap<_, Twox64Concat, pezsp_consensus_beefy::ValidatorSetId, SessionIndex>; /// Block number where BEEFY consensus is enabled/started. /// By changing this (through privileged `set_new_genesis()`), BEEFY consensus is effectively /// restarted from the newly set block number. - #[pallet::storage] + #[pezpallet::storage] pub type GenesisBlock = StorageValue<_, Option>, ValueQuery>; - #[pallet::genesis_config] + #[pezpallet::genesis_config] pub struct GenesisConfig { /// Initial set of BEEFY authorities. pub authorities: Vec, @@ -178,10 +178,10 @@ pub mod pallet { } } - #[pallet::genesis_build] + #[pezpallet::genesis_build] impl BuildGenesisConfig for GenesisConfig { fn build(&self) { - Pallet::::initialize(&self.authorities) + Pezpallet::::initialize(&self.authorities) // we panic here as runtime maintainers can simply reconfigure genesis and restart // the chain easily .expect("Authorities vec too big"); @@ -189,7 +189,7 @@ pub mod pallet { } } - #[pallet::error] + #[pezpallet::error] pub enum Error { /// A key ownership proof provided as part of an equivocation report is invalid. InvalidKeyOwnershipProof, @@ -209,14 +209,14 @@ pub mod pallet { InvalidConfiguration, } - #[pallet::call] - impl Pallet { + #[pezpallet::call] + impl Pezpallet { /// Report voter equivocation/misbehavior. This method will verify the /// equivocation proof and validate the given key ownership proof /// against the extracted offender. If both are valid, the offence /// will be reported. - #[pallet::call_index(0)] - #[pallet::weight(T::WeightInfo::report_double_voting( + #[pezpallet::call_index(0)] + #[pezpallet::weight(T::WeightInfo::report_double_voting( key_owner_proof.validator_count(), T::MaxNominators::get(), ))] @@ -250,8 +250,8 @@ pub mod pallet { /// block authors will call it (validated in `ValidateUnsigned`), as such /// if the block author is defined it will be defined as the equivocation /// reporter. - #[pallet::call_index(1)] - #[pallet::weight(T::WeightInfo::report_double_voting( + #[pezpallet::call_index(1)] + #[pezpallet::weight(T::WeightInfo::report_double_voting( key_owner_proof.validator_count(), T::MaxNominators::get(), ))] @@ -279,15 +279,15 @@ pub mod pallet { /// future. /// /// Note: `delay_in_blocks` has to be at least 1. - #[pallet::call_index(2)] - #[pallet::weight(::WeightInfo::set_new_genesis())] + #[pezpallet::call_index(2)] + #[pezpallet::weight(::WeightInfo::set_new_genesis())] pub fn set_new_genesis( origin: OriginFor, delay_in_blocks: BlockNumberFor, ) -> DispatchResult { ensure_root(origin)?; ensure!(delay_in_blocks >= One::one(), Error::::InvalidConfiguration); - let genesis_block = pezframe_system::Pallet::::block_number() + delay_in_blocks; + let genesis_block = pezframe_system::Pezpallet::::block_number() + delay_in_blocks; GenesisBlock::::put(Some(genesis_block)); Ok(()) } @@ -295,8 +295,8 @@ pub mod pallet { /// Report fork voting equivocation. This method will verify the equivocation proof /// and validate the given key ownership proof against the extracted offender. /// If both are valid, the offence will be reported. - #[pallet::call_index(3)] - #[pallet::weight(T::WeightInfo::report_fork_voting::( + #[pezpallet::call_index(3)] + #[pezpallet::weight(T::WeightInfo::report_fork_voting::( key_owner_proof.validator_count(), T::MaxNominators::get(), &equivocation_proof.ancestry_proof @@ -330,8 +330,8 @@ pub mod pallet { /// block authors will call it (validated in `ValidateUnsigned`), as such /// if the block author is defined it will be defined as the equivocation /// reporter. - #[pallet::call_index(4)] - #[pallet::weight(T::WeightInfo::report_fork_voting::( + #[pezpallet::call_index(4)] + #[pezpallet::weight(T::WeightInfo::report_fork_voting::( key_owner_proof.validator_count(), T::MaxNominators::get(), &equivocation_proof.ancestry_proof @@ -360,8 +360,8 @@ pub mod pallet { /// Report future block voting equivocation. This method will verify the equivocation proof /// and validate the given key ownership proof against the extracted offender. /// If both are valid, the offence will be reported. - #[pallet::call_index(5)] - #[pallet::weight(T::WeightInfo::report_future_block_voting( + #[pezpallet::call_index(5)] + #[pezpallet::weight(T::WeightInfo::report_future_block_voting( key_owner_proof.validator_count(), T::MaxNominators::get(), ))] @@ -391,8 +391,8 @@ pub mod pallet { /// block authors will call it (validated in `ValidateUnsigned`), as such /// if the block author is defined it will be defined as the equivocation /// reporter. - #[pallet::call_index(6)] - #[pallet::weight(T::WeightInfo::report_future_block_voting( + #[pezpallet::call_index(6)] + #[pezpallet::weight(T::WeightInfo::report_future_block_voting( key_owner_proof.validator_count(), T::MaxNominators::get(), ))] @@ -415,16 +415,16 @@ pub mod pallet { } } - #[pallet::hooks] - impl Hooks> for Pallet { + #[pezpallet::hooks] + impl Hooks> for Pezpallet { #[cfg(feature = "try-runtime")] fn try_state(_n: BlockNumberFor) -> Result<(), pezsp_runtime::TryRuntimeError> { Self::do_try_state() } } - #[pallet::validate_unsigned] - impl ValidateUnsigned for Pallet { + #[pezpallet::validate_unsigned] + impl ValidateUnsigned for Pezpallet { type Call = Call; fn pre_dispatch(call: &Self::Call) -> Result<(), TransactionValidityError> { @@ -480,10 +480,10 @@ pub mod pallet { } #[cfg(any(feature = "try-runtime", test))] -impl Pallet { - /// Ensure the correctness of the state of this pallet. +impl Pezpallet { + /// 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_authorities()?; Self::try_state_validators()?; @@ -499,7 +499,7 @@ impl Pallet { if let Some(authorities_len) = >::decode_len() { ensure!( authorities_len as u32 <= T::MaxAuthorities::get(), - "Authorities number exceeds what the pallet config allows." + "Authorities number exceeds what the pezpallet config allows." ); } else { return Err(pezsp_runtime::TryRuntimeError::Other( @@ -510,7 +510,7 @@ impl Pallet { if let Some(next_authorities_len) = >::decode_len() { ensure!( next_authorities_len as u32 <= T::MaxAuthorities::get(), - "Next authorities number exceeds what the pallet config allows." + "Next authorities number exceeds what the pezpallet config allows." ); } else { return Err(pezsp_runtime::TryRuntimeError::Other( @@ -533,7 +533,7 @@ impl Pallet { } } -impl Pallet { +impl Pezpallet { /// Return the current active BEEFY validator set. pub fn validator_set() -> Option> { let validators: BoundedVec = Authorities::::get(); @@ -606,7 +606,7 @@ impl Pallet { BEEFY_ENGINE_ID, ConsensusLog::AuthoritiesChange(validator_set.clone()).encode(), ); - pezframe_system::Pallet::::deposit_log(log); + pezframe_system::Pezpallet::::deposit_log(log); let next_id = new_id + 1; if let Some(next_validator_set) = ValidatorSet::::new(queued, next_id) { @@ -658,11 +658,11 @@ impl Pallet { } } -impl pezsp_runtime::BoundToRuntimeAppPublic for Pallet { +impl pezsp_runtime::BoundToRuntimeAppPublic for Pezpallet { type Public = T::BeefyId; } -impl OneSessionHandler for Pallet +impl OneSessionHandler for Pezpallet where T: pezpallet_session::Config, { @@ -712,7 +712,7 @@ where let validator_set_id = ValidatorSetId::::get(); // Update the mapping for the new set id that corresponds to the latest session (i.e. now). - let session_index = pezpallet_session::Pallet::::current_index(); + let session_index = pezpallet_session::Pezpallet::::current_index(); SetIdSession::::insert(validator_set_id, &session_index); // Prune old entry if limit reached. let max_set_id_session_entries = T::MaxSetIdSessionEntries::get().max(1); @@ -727,11 +727,11 @@ where ConsensusLog::::OnDisabled(i as AuthorityIndex).encode(), ); - pezframe_system::Pallet::::deposit_log(log); + pezframe_system::Pezpallet::::deposit_log(log); } } -impl IsMember for Pallet { +impl IsMember for Pezpallet { fn is_member(authority_id: &T::BeefyId) -> bool { Authorities::::get().iter().any(|id| id == authority_id) } diff --git a/bizinikiwi/pezframe/beefy/src/mock.rs b/bizinikiwi/pezframe/beefy/src/mock.rs index fc6354e1..2f28dd2e 100644 --- a/bizinikiwi/pezframe/beefy/src/mock.rs +++ b/bizinikiwi/pezframe/beefy/src/mock.rs @@ -46,7 +46,7 @@ use pezsp_consensus_beefy::{AncestryHelper, AncestryHelperWeightInfo, Commitment impl_opaque_keys! { pub struct MockSessionKeys { - pub dummy: pezpallet_beefy::Pallet, + pub dummy: pezpallet_beefy::Pezpallet, } } @@ -246,7 +246,7 @@ impl pezpallet_staking::Config for Test { type Currency = Balances; type AdminOrigin = pezframe_system::EnsureRoot; type SessionInterface = Self; - type UnixTime = pezpallet_timestamp::Pallet; + type UnixTime = pezpallet_timestamp::Pezpallet; type EraPayout = pezpallet_staking::ConvertCurve; type NextNewSession = Session; type ElectionProvider = onchain::OnChainExecution; @@ -294,7 +294,7 @@ impl ExtBuilder { BasicExternalities::execute_with_storage(&mut t, || { for (ref id, ..) in &session_keys { - pezframe_system::Pallet::::inc_providers(id); + pezframe_system::Pezpallet::::inc_providers(id); } }); diff --git a/bizinikiwi/pezframe/benchmarking/README.md b/bizinikiwi/pezframe/benchmarking/README.md index 28c32c95..f18f7ee6 100644 --- a/bizinikiwi/pezframe/benchmarking/README.md +++ b/bizinikiwi/pezframe/benchmarking/README.md @@ -56,11 +56,11 @@ blockchain is the fixed block production time for the network. Within FRAME, each dispatchable function must have a `#[weight]` annotation with a function that can return the expected weight for the worst case scenario execution of that function given its inputs. This benchmarking framework will result -in a file that automatically generates those formulas for you, which you can then use in your pallet. +in a file that automatically generates those formulas for you, which you can then use in your pezpallet. ## Writing Benchmarks -Writing a runtime benchmark is much like writing a unit test for your pallet. It needs to be carefully crafted to +Writing a runtime benchmark is much like writing a unit test for your pezpallet. It needs to be carefully crafted to execute a certain logical path in your code. In tests you want to check for various success and failure conditions, but with benchmarks you specifically look for the **most computationally heavy** path, a.k.a the "worst case scenario". @@ -71,7 +71,7 @@ this. It may be that there are multiple paths your function can go down, and it is not clear which one is the heaviest. In this case, you should just create a benchmark for each scenario! You may find that there are paths in your code where complexity may become unbounded depending on user input. This may be a hint that you should enforce sane boundaries for -how a user can use your pallet. For example: limiting the number of elements in a vector, limiting the number of +how a user can use your pezpallet. For example: limiting the number of elements in a vector, limiting the number of iterations in a `for` loop, etc... Examples of end-to-end benchmarks can be found in the [pallets provided by Bizinikiwi](../), and the specific details on @@ -79,7 +79,7 @@ how to use the `benchmarks!` macro can be found in [its documentation](./src/lib ## Testing Benchmarks -You can test your benchmarks using the same test runtime that you created for your pallet's unit tests. By creating your +You can test your benchmarks using the same test runtime that you created for your pezpallet's unit tests. By creating your benchmarks in the `benchmarks!` macro, it automatically generates test functions for you: ```rust @@ -98,7 +98,7 @@ verify any final conditions, such as the final state of your runtime. These additional `verify` blocks will not affect the results of your final benchmarking process. To run the tests, you need to enable the `runtime-benchmarks` feature flag. This may also mean you need to move into -your node's binary folder. For example, with the Bizinikiwi repository, this is how you would test the Balances pallet's +your node's binary folder. For example, with the Bizinikiwi repository, this is how you would test the Balances pezpallet's benchmarks: ```bash @@ -109,7 +109,7 @@ cargo test -p pezpallet-balances --features runtime-benchmarks > ``` > error: --features is not allowed in the root of a virtual workspace` > ``` -> To solve this, navigate to the folder of the node (`cd bin/node/cli`) or pallet (`cd frame/pallet`) and run the +> To solve this, navigate to the folder of the node (`cd bin/node/cli`) or pezpallet (`cd frame/pezpallet`) and run the > command there. This will instance each linear component with different values. The number of values per component is set to six and can @@ -117,7 +117,7 @@ be changed with the `VALUES_PER_COMPONENT` environment variable. ## Adding Benchmarks -The benchmarks included with each pallet are not automatically added to your node. To actually execute these benchmarks, +The benchmarks included with each pezpallet are not automatically added to your node. To actually execute these benchmarks, you need to implement the `frame_benchmarking::Benchmark` trait. You can see an example of how to do this in the [included Bizinikiwi node](../../bin/node/runtime/src/lib.rs). @@ -126,12 +126,12 @@ Assuming there are already some benchmarks set up on your node, you just need to ```rust /// configuration for running benchmarks -/// | name of your pallet's crate (as imported) +/// | name of your pezpallet's crate (as imported) /// v v add_benchmark!(params, batches, pallet_balances, Balances); /// ^ ^ /// where all benchmark results are saved | -/// the `struct` created for your pallet by `construct_runtime!` +/// the `struct` created for your pezpallet by `construct_runtime!` ``` Once you have done this, you will need to compile your node binary with the `runtime-benchmarks` feature flag: @@ -152,23 +152,23 @@ Finally, once you have a node binary with benchmarks enabled, you need to execut You can get a list of the available benchmarks by running: ```bash -./target/production/bizinikiwi benchmark pallet --chain dev --pallet "*" --extrinsic "*" --repeat 0 +./target/production/bizinikiwi benchmark pezpallet --chain dev --pezpallet "*" --extrinsic "*" --repeat 0 ``` Then you can run a benchmark like so: ```bash -./target/production/bizinikiwi benchmark pallet \ +./target/production/bizinikiwi benchmark pezpallet \ --chain dev \ # Configurable Chain Spec --wasm-execution=compiled \ # Always used `wasm-time` - --pallet pallet_balances \ # Select the pallet + --pezpallet pallet_balances \ # Select the pezpallet --extrinsic transfer \ # Select the extrinsic --steps 50 \ # Number of samples across component ranges --repeat 20 \ # Number of times we repeat a benchmark --output \ # Output benchmark results into a folder or file ``` -This will output a file `pallet_name.rs` which implements the `WeightInfo` trait you should include in your pallet. +This will output a file `pallet_name.rs` which implements the `WeightInfo` trait you should include in your pezpallet. Double colons `::` will be replaced with a `_` in the output name if you specify a directory. Each blockchain should generate their own benchmark file with their custom implementation of the `WeightInfo` trait. This means that you will be able to use these modular Bizinikiwi pallets while still keeping your network safe for your specific configuration and @@ -177,8 +177,8 @@ requirements. The benchmarking CLI uses a Handlebars template to format the final output file. You can optionally pass the flag `--template` pointing to a custom template that can be used instead. Within the template, you have access to all the data provided by the `TemplateData` struct in the [benchmarking CLI -writer](../../utils/pezframe/benchmarking-cli/src/pallet/writer.rs). You can find the default template used -[here](../../utils/pezframe/benchmarking-cli/src/pallet/template.hbs). +writer](../../utils/pezframe/benchmarking-cli/src/pezpallet/writer.rs). You can find the default template used +[here](../../utils/pezframe/benchmarking-cli/src/pezpallet/template.hbs). There are some custom Handlebars helpers included with our output generation: diff --git a/bizinikiwi/pezframe/benchmarking/pov/src/benchmarking.rs b/bizinikiwi/pezframe/benchmarking/pov/src/benchmarking.rs index 47094d71..7b169f8f 100644 --- a/bizinikiwi/pezframe/benchmarking/pov/src/benchmarking.rs +++ b/bizinikiwi/pezframe/benchmarking/pov/src/benchmarking.rs @@ -23,7 +23,7 @@ use super::*; use pezframe_benchmarking::v2::*; use pezframe_support::traits::UnfilteredDispatchable; -use pezframe_system::{Pallet as System, RawOrigin}; +use pezframe_system::{Pezpallet as System, RawOrigin}; use pezsp_runtime::traits::Hash; #[benchmarks] @@ -392,7 +392,7 @@ mod benchmarks { } } - impl_benchmark_test_suite!(Pallet, super::mock::new_test_ext(), super::mock::Test,); + impl_benchmark_test_suite!(Pezpallet, super::mock::new_test_ext(), super::mock::Test,); } #[cfg(test)] diff --git a/bizinikiwi/pezframe/benchmarking/pov/src/lib.rs b/bizinikiwi/pezframe/benchmarking/pov/src/lib.rs index 4049be1e..d2842ca6 100644 --- a/bizinikiwi/pezframe/benchmarking/pov/src/lib.rs +++ b/bizinikiwi/pezframe/benchmarking/pov/src/lib.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! End-to-end testing pallet for PoV benchmarking. Should only be deployed in a testing runtime. +//! End-to-end testing pezpallet for PoV benchmarking. Should only be deployed in a testing runtime. #![cfg_attr(not(feature = "std"), no_std)] @@ -25,51 +25,51 @@ mod weights; extern crate alloc; -pub use pallet::*; +pub use pezpallet::*; -#[pezframe_support::pallet] -pub mod pallet { +#[pezframe_support::pezpallet] +pub mod pezpallet { use alloc::vec::Vec; use pezframe_support::pezpallet_prelude::*; use pezframe_system::pezpallet_prelude::*; - #[pallet::pallet] - pub struct Pallet(_); + #[pezpallet::pezpallet] + pub struct Pezpallet(_); - #[pallet::config] + #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] type RuntimeEvent: From> + IsType<::RuntimeEvent>; } - #[pallet::storage] + #[pezpallet::storage] pub(crate) type Value = StorageValue; - #[pallet::storage] + #[pezpallet::storage] pub(crate) type Value2 = StorageValue; /// A value without a MEL bound. - #[pallet::storage] - #[pallet::unbounded] + #[pezpallet::storage] + #[pezpallet::unbounded] pub(crate) type UnboundedValue = StorageValue, QueryKind = OptionQuery>; /// A value with a MEL bound of 32 byte. - #[pallet::storage] + #[pezpallet::storage] pub(crate) type BoundedValue = StorageValue>, QueryKind = OptionQuery>; /// 4MiB value. - #[pallet::storage] + #[pezpallet::storage] pub(crate) type LargeValue = StorageValue>, QueryKind = OptionQuery>; - #[pallet::storage] + #[pezpallet::storage] pub(crate) type LargeValue2 = StorageValue>, QueryKind = OptionQuery>; /// A map with a maximum of 1M entries. - #[pallet::storage] + #[pezpallet::storage] pub(crate) type Map1M = StorageMap< Hasher = Blake2_256, Key = u32, @@ -79,7 +79,7 @@ pub mod pallet { >; /// A map with a maximum of 16M entries. - #[pallet::storage] + #[pezpallet::storage] pub(crate) type Map16M = StorageMap< Hasher = Blake2_256, Key = u32, @@ -88,7 +88,7 @@ pub mod pallet { MaxValues = ConstU32<16_000_000>, >; - #[pallet::storage] + #[pezpallet::storage] pub(crate) type DoubleMap1M = StorageDoubleMap< Hasher1 = Blake2_256, Hasher2 = Blake2_256, @@ -99,38 +99,38 @@ pub mod pallet { MaxValues = ConstU32<1_000_000>, >; - #[pallet::storage] - #[pallet::unbounded] + #[pezpallet::storage] + #[pezpallet::unbounded] pub(crate) type UnboundedMap = StorageMap, QueryKind = OptionQuery>; - #[pallet::storage] - #[pallet::unbounded] + #[pezpallet::storage] + #[pezpallet::unbounded] pub(crate) type UnboundedMap2 = StorageMap, QueryKind = OptionQuery>; - #[pallet::storage] - #[pallet::unbounded] + #[pezpallet::storage] + #[pezpallet::unbounded] pub(crate) type UnboundedMapTwox = StorageMap, QueryKind = OptionQuery>; - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] + #[pezpallet::event] + #[pezpallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { TestEvent, } - #[pallet::call] - impl Pallet { - #[pallet::call_index(0)] - #[pallet::weight({0})] + #[pezpallet::call] + impl Pezpallet { + #[pezpallet::call_index(0)] + #[pezpallet::weight({0})] pub fn emit_event(_origin: OriginFor) -> DispatchResult { Self::deposit_event(Event::TestEvent); Ok(()) } - #[pallet::call_index(1)] - #[pallet::weight({0})] + #[pezpallet::call_index(1)] + #[pezpallet::weight({0})] pub fn noop(_origin: OriginFor) -> DispatchResult { Ok(()) } diff --git a/bizinikiwi/pezframe/benchmarking/pov/src/weights.rs b/bizinikiwi/pezframe/benchmarking/pov/src/weights.rs index 5ce3a3e3..041a65fa 100644 --- a/bizinikiwi/pezframe/benchmarking/pov/src/weights.rs +++ b/bizinikiwi/pezframe/benchmarking/pov/src/weights.rs @@ -44,10 +44,10 @@ // frame-omni-bencher // v1 // benchmark -// pallet +// pezpallet // --extrinsic=* // --runtime=target/production/wbuild/pez-kitchensink-runtime/pez_kitchensink_runtime.wasm -// --pallet=pezframe_benchmarking_pallet_pov +// --pezpallet=pezframe_benchmarking_pallet_pov // --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2 // --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/benchmarking/pov/src/weights.rs // --wasm-execution=compiled diff --git a/bizinikiwi/pezframe/benchmarking/src/baseline.rs b/bizinikiwi/pezframe/benchmarking/src/baseline.rs index 593b6dad..08163780 100644 --- a/bizinikiwi/pezframe/benchmarking/src/baseline.rs +++ b/bizinikiwi/pezframe/benchmarking/src/baseline.rs @@ -16,13 +16,13 @@ // limitations under the License. //! A set of benchmarks which can establish a global baseline for all other -//! benchmarking. These benchmarks do not require a pallet to be deployed. +//! benchmarking. These benchmarks do not require a pezpallet to be deployed. #![cfg(feature = "runtime-benchmarks")] use crate::benchmarks; use alloc::{vec, vec::Vec}; -use pezframe_system::Pallet as System; +use pezframe_system::Pezpallet as System; use pezsp_runtime::{ traits::{AppVerify, Hash}, RuntimeAppPublic, @@ -36,7 +36,7 @@ mod crypto { } pub type SignerId = crypto::Public; -pub struct Pallet(System); +pub struct Pezpallet(System); pub trait Config: pezframe_system::Config {} benchmarks! { @@ -102,7 +102,7 @@ benchmarks! { } impl_benchmark_test_suite!( - Pallet, + Pezpallet, mock::new_test_ext(), mock::Test, ); diff --git a/bizinikiwi/pezframe/benchmarking/src/lib.rs b/bizinikiwi/pezframe/benchmarking/src/lib.rs index 425caa70..5bef6add 100644 --- a/bizinikiwi/pezframe/benchmarking/src/lib.rs +++ b/bizinikiwi/pezframe/benchmarking/src/lib.rs @@ -53,7 +53,7 @@ pub use analysis::{Analysis, AnalysisChoice, BenchmarkSelector}; pub use utils::*; pub use v1::*; -/// Contains macros, structs, and traits associated with v2 of the pallet benchmarking syntax. +/// Contains macros, structs, and traits associated with v2 of the pezpallet benchmarking syntax. /// /// The [`v2::benchmarks`] and [`v2::instance_benchmarks`] macros can be used to designate a /// module as a benchmarking module that can contain benchmarks and benchmark tests. The @@ -71,7 +71,7 @@ pub use v1::*; /// ```ignore /// #![cfg(feature = "runtime-benchmarks")] /// -/// use super::{mock_helpers::*, Pallet as MyPallet}; +/// use super::{mock_helpers::*, Pezpallet as MyPallet}; /// use pezframe_benchmarking::v2::*; /// /// #[benchmarks] @@ -207,7 +207,7 @@ pub use v1::*; /// Some pallets require a where clause specifying constraints on their generics to make /// writing benchmarks feasible. To accommodate this situation, you can provide such a where /// clause as the (only) argument to the `#[benchmarks]` or `#[instance_benchmarks]` attribute -/// macros. Below is an example of this taken from the `message-queue` pallet. +/// macros. Below is an example of this taken from the `message-queue` pezpallet. /// /// ```ignore /// #[benchmarks( @@ -226,7 +226,7 @@ pub use v1::*; /// Benchmark tests can be generated using the old syntax in `pezframe_benchmarking`, /// including the `pezframe_benchmarking::impl_benchmark_test_suite` macro. /// -/// An example is shown below (taken from the `message-queue` pallet's `benchmarking` module): +/// An example is shown below (taken from the `message-queue` pezpallet's `benchmarking` module): /// ```ignore /// #[benchmarks] /// mod benchmarks { @@ -282,7 +282,7 @@ pub use v1::*; /// ```ignore /// #![cfg(feature = "runtime-benchmarks")] /// -/// use super::{mock_helpers::*, Pallet as MyPallet}; +/// use super::{mock_helpers::*, Pezpallet as MyPallet}; /// use pezframe_benchmarking::v2::*; /// /// #[benchmarks] @@ -331,7 +331,7 @@ pub use v1::*; /// function in v2, while `setup(y)?;` will be moved to the body of the function; /// 2. Move all the v1 setup code to the body of the v2 function; /// 3. Move the benchmarked code to the body of the v2 function under the appropriate macro -/// attribute: `#[extrinsic_call]` for extrinsic pallet calls and `#[block]` for blocks of +/// attribute: `#[extrinsic_call]` for extrinsic pezpallet calls and `#[block]` for blocks of /// code; /// 4. Move the v1 verify code block to the body of the v2 function, after the /// `#[extrinsic_call]` or `#[block]` attribute. diff --git a/bizinikiwi/pezframe/benchmarking/src/tests.rs b/bizinikiwi/pezframe/benchmarking/src/tests.rs index 7ac05413..54fac9ca 100644 --- a/bizinikiwi/pezframe/benchmarking/src/tests.rs +++ b/bizinikiwi/pezframe/benchmarking/src/tests.rs @@ -27,26 +27,26 @@ use pezsp_runtime::{ }; use std::cell::RefCell; -#[pezframe_support::pallet(dev_mode)] +#[pezframe_support::pezpallet(dev_mode)] mod pezpallet_test { use pezframe_support::pezpallet_prelude::*; use pezframe_system::pezpallet_prelude::*; - #[pallet::pallet] - pub struct Pallet(_); + #[pezpallet::pezpallet] + pub struct Pezpallet(_); - #[pallet::config] + #[pezpallet::config] pub trait Config: pezframe_system::Config { type LowerBound: Get; type UpperBound: Get; type MaybeItem: Get>; } - #[pallet::storage] + #[pezpallet::storage] pub(crate) type Value = StorageValue<_, u32, OptionQuery>; - #[pallet::call] - impl Pallet { + #[pezpallet::call] + impl Pezpallet { pub fn set_value(origin: OriginFor, n: u32) -> DispatchResult { let _sender = ensure_signed(origin)?; Value::::put(n); @@ -131,7 +131,7 @@ mod benchmarks { use rusty_fork::rusty_fork_test; // Additional used internally by the benchmark macro. - use super::pezpallet_test::{Call, Config, Pallet}; + use super::pezpallet_test::{Call, Config, Pezpallet}; crate::benchmarks! { where_clause { @@ -340,18 +340,18 @@ mod benchmarks { #[test] fn benchmarks_generate_unit_tests() { new_test_ext().execute_with(|| { - assert_ok!(Pallet::::test_benchmark_set_value()); - assert_ok!(Pallet::::test_benchmark_other_name()); - assert_ok!(Pallet::::test_benchmark_sort_vector()); - assert_err!(Pallet::::test_benchmark_bad_origin(), "Bad origin"); - assert_err!(Pallet::::test_benchmark_bad_verify(), "You forgot to sort!"); - assert_ok!(Pallet::::test_benchmark_no_components()); - assert_ok!(Pallet::::test_benchmark_variable_components()); + assert_ok!(Pezpallet::::test_benchmark_set_value()); + assert_ok!(Pezpallet::::test_benchmark_other_name()); + assert_ok!(Pezpallet::::test_benchmark_sort_vector()); + assert_err!(Pezpallet::::test_benchmark_bad_origin(), "Bad origin"); + assert_err!(Pezpallet::::test_benchmark_bad_verify(), "You forgot to sort!"); + assert_ok!(Pezpallet::::test_benchmark_no_components()); + assert_ok!(Pezpallet::::test_benchmark_variable_components()); assert!(matches!( - Pallet::::test_benchmark_override_benchmark(), + Pezpallet::::test_benchmark_override_benchmark(), Err(BenchmarkError::Override(_)), )); - assert_eq!(Pallet::::test_benchmark_skip_benchmark(), Err(BenchmarkError::Skip),); + assert_eq!(Pezpallet::::test_benchmark_skip_benchmark(), Err(BenchmarkError::Skip),); }); } @@ -361,18 +361,18 @@ mod benchmarks { new_test_ext().execute_with(|| { // It resets when the error happens in the setup: assert_err!( - Pallet::::test_benchmark_modify_in_setup_then_error(), + Pezpallet::::test_benchmark_modify_in_setup_then_error(), "Should error" ); assert_eq!(Value::::get(), None); // It resets when the error happens in the call: - assert_err!(Pallet::::test_benchmark_modify_in_call_then_error(), "Should error"); + assert_err!(Pezpallet::::test_benchmark_modify_in_call_then_error(), "Should error"); assert_eq!(Value::::get(), None); // It resets when the error happens in the verify: assert_err!( - Pallet::::test_benchmark_modify_in_verify_then_error(), + Pezpallet::::test_benchmark_modify_in_verify_then_error(), "Should error" ); assert_eq!(Value::::get(), None); @@ -414,7 +414,7 @@ mod benchmarks { } new_test_ext().execute_with(|| { - let got = Pallet::::test_benchmark_values_per_component() + let got = Pezpallet::::test_benchmark_values_per_component() .map(|_| VALUES_PER_COMPONENT.with(|v| v.borrow().clone())); assert_eq!(got, output); diff --git a/bizinikiwi/pezframe/benchmarking/src/tests_instance.rs b/bizinikiwi/pezframe/benchmarking/src/tests_instance.rs index 258d5d73..724ca074 100644 --- a/bizinikiwi/pezframe/benchmarking/src/tests_instance.rs +++ b/bizinikiwi/pezframe/benchmarking/src/tests_instance.rs @@ -26,19 +26,19 @@ use pezsp_runtime::{ BuildStorage, }; -#[pezframe_support::pallet] +#[pezframe_support::pezpallet] mod pezpallet_test { use pezframe_support::pezpallet_prelude::*; use pezframe_system::pezpallet_prelude::*; - #[pallet::pallet] - pub struct Pallet(PhantomData<(T, I)>); + #[pezpallet::pezpallet] + pub struct Pezpallet(PhantomData<(T, I)>); pub trait OtherConfig { type OtherEvent; } - #[pallet::config] + #[pezpallet::config] pub trait Config: pezframe_system::Config + OtherConfig { #[allow(deprecated)] type RuntimeEvent: From> @@ -47,19 +47,19 @@ mod pezpallet_test { type UpperBound: Get; } - #[pallet::storage] + #[pezpallet::storage] pub(crate) type Value, I: 'static = ()> = StorageValue<_, u32, OptionQuery>; - #[pallet::event] + #[pezpallet::event] pub enum Event, I: 'static = ()> {} - #[pallet::call] - impl, I: 'static> Pallet + #[pezpallet::call] + impl, I: 'static> Pezpallet where ::OtherEvent: Into<>::RuntimeEvent>, { - #[pallet::call_index(0)] - #[pallet::weight({0})] + #[pezpallet::call_index(0)] + #[pezpallet::weight({0})] pub fn set_value(origin: OriginFor, n: u32) -> DispatchResult { let _sender = ensure_signed(origin)?; assert!(n >= T::LowerBound::get()); @@ -67,8 +67,8 @@ mod pezpallet_test { Ok(()) } - #[pallet::call_index(1)] - #[pallet::weight({0})] + #[pezpallet::call_index(1)] + #[pezpallet::weight({0})] pub fn dummy(origin: OriginFor, _n: u32) -> DispatchResult { let _sender = ensure_none(origin)?; Ok(()) @@ -147,7 +147,7 @@ mod benchmarks { use pezsp_core::Get; // Additional used internally by the benchmark macro. - use super::pezpallet_test::{Call, Config, Pallet}; + use super::pezpallet_test::{Call, Config, Pezpallet}; crate::benchmarks_instance_pallet! { where_clause { @@ -182,7 +182,7 @@ mod benchmarks { } impl_benchmark_test_suite!( - Pallet, + Pezpallet, crate::tests_instance::new_test_ext(), crate::tests_instance::Test ) @@ -197,7 +197,7 @@ fn ensure_correct_instance_is_selected() { let mut batches = Vec::::new(); let config = crate::BenchmarkConfig { - pallet: "pezpallet_test".bytes().collect::>(), + pezpallet: "pezpallet_test".bytes().collect::>(), // We only want that this `instance` is used. // Otherwise the wrong components are used. instance: "TestPallet".bytes().collect::>(), diff --git a/bizinikiwi/pezframe/benchmarking/src/utils.rs b/bizinikiwi/pezframe/benchmarking/src/utils.rs index a2b6cdc0..0badd363 100644 --- a/bizinikiwi/pezframe/benchmarking/src/utils.rs +++ b/bizinikiwi/pezframe/benchmarking/src/utils.rs @@ -77,10 +77,10 @@ impl std::fmt::Display for BenchmarkParameter { #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] #[derive(Encode, Decode, Clone, PartialEq, Debug, TypeInfo)] pub struct BenchmarkBatch { - /// The pallet containing this benchmark. + /// The pezpallet containing this benchmark. #[cfg_attr(feature = "std", serde(with = "serde_as_str"))] - pub pallet: Vec, - /// The instance of this pallet being benchmarked. + pub pezpallet: Vec, + /// The instance of this pezpallet being benchmarked. #[cfg_attr(feature = "std", serde(with = "serde_as_str"))] pub instance: Vec, /// The extrinsic (or benchmark name) of this benchmark. @@ -95,10 +95,10 @@ pub struct BenchmarkBatch { #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] #[derive(Encode, Decode, Clone, PartialEq, Debug)] pub struct BenchmarkBatchSplitResults { - /// The pallet containing this benchmark. + /// The pezpallet containing this benchmark. #[cfg_attr(feature = "std", serde(with = "serde_as_str"))] - pub pallet: Vec, - /// The instance of this pallet being benchmarked. + pub pezpallet: Vec, + /// The instance of this pezpallet being benchmarked. #[cfg_attr(feature = "std", serde(with = "serde_as_str"))] pub instance: Vec, /// The extrinsic (or benchmark name) of this benchmark. @@ -110,7 +110,7 @@ pub struct BenchmarkBatchSplitResults { pub db_results: Vec, } -/// Result from running benchmarks on a FRAME pallet. +/// Result from running benchmarks on a FRAME pezpallet. /// Contains duration of the function call in nanoseconds along with the benchmark parameters /// used for that benchmark result. #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] @@ -210,9 +210,9 @@ impl From for BenchmarkError { /// Configuration used to setup and run runtime benchmarks. #[derive(Encode, Decode, Default, Clone, PartialEq, Debug, TypeInfo)] pub struct BenchmarkConfig { - /// The encoded name of the pallet to benchmark. - pub pallet: Vec, - /// The encoded name of the pallet instance to benchmark. + /// The encoded name of the pezpallet to benchmark. + pub pezpallet: Vec, + /// The encoded name of the pezpallet instance to benchmark. pub instance: Vec, /// The encoded name of the benchmark/extrinsic to run. pub benchmark: Vec, @@ -224,12 +224,12 @@ pub struct BenchmarkConfig { pub internal_repeats: u32, } -/// A list of benchmarks available for a particular pallet and instance. +/// A list of benchmarks available for a particular pezpallet and instance. /// /// All `Vec` must be valid utf8 strings. #[derive(Encode, Decode, Default, Clone, PartialEq, Debug, TypeInfo)] pub struct BenchmarkList { - pub pallet: Vec, + pub pezpallet: Vec, pub instance: Vec, pub benchmarks: Vec, } @@ -350,9 +350,9 @@ pub trait Benchmarking { } } -/// The pallet benchmarking trait. +/// The pezpallet benchmarking trait. pub trait Benchmarking { - /// Get the benchmarks available for this pallet. Generally there is one benchmark per + /// Get the benchmarks available for this pezpallet. Generally there is one benchmark per /// extrinsic, so these are sometimes just called "extrinsics". /// /// Parameters @@ -360,7 +360,7 @@ pub trait Benchmarking { /// weight calculation. fn benchmarks(extra: bool) -> Vec; - /// Run the benchmarks for this pallet. + /// Run the benchmarks for this pezpallet. fn run_benchmark( name: &[u8], selected_components: &[(BenchmarkParameter, u32)], diff --git a/bizinikiwi/pezframe/benchmarking/src/v1.rs b/bizinikiwi/pezframe/benchmarking/src/v1.rs index c43a554c..edeb5aa9 100644 --- a/bizinikiwi/pezframe/benchmarking/src/v1.rs +++ b/bizinikiwi/pezframe/benchmarking/src/v1.rs @@ -29,7 +29,7 @@ macro_rules! whitelist { }; } -/// Construct pallet benchmarks for weighing dispatchables. +/// Construct pezpallet benchmarks for weighing dispatchables. /// /// Works around the idea of complexity parameters, named by a single letter (which is usually /// upper cased in complexity notation but is lower-cased for use in this macro). @@ -125,7 +125,7 @@ macro_rules! whitelist { /// /// Test functions are automatically generated for each benchmark and are accessible to you when you /// run `cargo test`. All tests are named `test_benchmark_`, implemented on the -/// Pallet struct, and run them in a test externalities environment. The test function runs your +/// Pezpallet struct, and run them in a test externalities environment. The test function runs your /// benchmark just like a regular benchmark, but only testing at the lowest and highest values for /// each component. The function will return `Ok(())` if the benchmarks return no errors. /// @@ -161,10 +161,10 @@ macro_rules! whitelist { /// #[test] /// fn test_benchmarks() { /// new_test_ext().execute_with(|| { -/// assert_ok!(Pallet::::test_benchmark_dummy()); -/// assert_err!(Pallet::::test_benchmark_other_name(), "Bad origin"); -/// assert_ok!(Pallet::::test_benchmark_sort_vector()); -/// assert_err!(Pallet::::test_benchmark_broken_benchmark(), "You forgot to sort!"); +/// assert_ok!(Pezpallet::::test_benchmark_dummy()); +/// assert_err!(Pezpallet::::test_benchmark_other_name(), "Bad origin"); +/// assert_ok!(Pezpallet::::test_benchmark_sort_vector()); +/// assert_err!(Pezpallet::::test_benchmark_broken_benchmark(), "You forgot to sort!"); /// }); /// } /// ``` @@ -188,7 +188,7 @@ macro_rules! benchmarks { /// Same as [`benchmarks`] but for instantiable module. /// -/// NOTE: For pallet declared with [`pezframe_support::pallet`], use [`benchmarks_instance_pallet`]. +/// NOTE: For pezpallet declared with [`pezframe_support::pezpallet`], use [`benchmarks_instance_pallet`]. #[macro_export] macro_rules! benchmarks_instance { ( @@ -207,9 +207,9 @@ macro_rules! benchmarks_instance { } } -/// Same as [`benchmarks`] but for instantiable pallet declared [`pezframe_support::pallet`]. +/// Same as [`benchmarks`] but for instantiable pezpallet declared [`pezframe_support::pezpallet`]. /// -/// NOTE: For pallet declared with `decl_module!`, use [`benchmarks_instance`]. +/// NOTE: For pezpallet declared with `decl_module!`, use [`benchmarks_instance`]. #[macro_export] macro_rules! benchmarks_instance_pallet { ( @@ -363,7 +363,7 @@ macro_rules! benchmarks_iter { $( $rest )* } }; - // detect and extract `#[pov_mode = Mode { Pallet::Storage: Mode ... }]` tag: + // detect and extract `#[pov_mode = Mode { Pezpallet::Storage: Mode ... }]` tag: ( { $($bench_module:ident, $new_test_ext:expr, $test:path $(, $( $args:tt )* )?)? } { $( $instance:ident: $instance_bound:tt )? } @@ -939,7 +939,7 @@ macro_rules! selected_benchmark { { $( $instance:ident: $instance_bound:tt )? } $( { $( $bench_inst:ident )? } $bench:ident )* ) => { - // The list of available benchmarks for this pallet. + // The list of available benchmarks for this pezpallet. #[allow(non_camel_case_types)] enum SelectedBenchmark { $( $bench, )* @@ -992,7 +992,7 @@ macro_rules! impl_benchmark { // We only need to implement benchmarks for the runtime-benchmarks feature or testing. #[cfg(any(feature = "runtime-benchmarks", test))] impl, $instance: $instance_bound )? > - $crate::Benchmarking for Pallet + $crate::Benchmarking for Pezpallet where T: pezframe_system::Config, $( $where_clause )* { fn benchmarks(extra: bool) -> $crate::__private::Vec<$crate::BenchmarkMetadata> { @@ -1076,8 +1076,8 @@ macro_rules! impl_benchmark { let mut results: $crate::__private::Vec<$crate::BenchmarkResult> = $crate::__private::Vec::new(); let on_before_start = || { // Set the block number to at least 1 so events are deposited. - if $crate::__private::Zero::is_zero(&pezframe_system::Pallet::::block_number()) { - pezframe_system::Pallet::::set_block_number(1u32.into()); + if $crate::__private::Zero::is_zero(&pezframe_system::Pezpallet::::block_number()) { + pezframe_system::Pezpallet::::set_block_number(1u32.into()); } // Commit the externalities to the database, flushing the DB cache. @@ -1165,7 +1165,7 @@ macro_rules! impl_benchmark { #[cfg(test)] impl, $instance: $instance_bound )? > - Pallet + Pezpallet where T: pezframe_system::Config, $( $where_clause )* { /// Test a particular benchmark by name. @@ -1175,7 +1175,7 @@ macro_rules! impl_benchmark { /// that case. /// /// This is generally intended to be used by child test modules such as those created - /// by the `impl_benchmark_test_suite` macro. However, it is not an error if a pallet + /// by the `impl_benchmark_test_suite` macro. However, it is not an error if a pezpallet /// author chooses not to implement benchmarks. #[allow(unused)] fn test_bench_by_name(name: &[u8]) -> Result<(), $crate::BenchmarkError> { @@ -1208,7 +1208,7 @@ macro_rules! impl_benchmark_test { $crate::__private::paste::item! { #[cfg(test)] impl, $instance: $instance_bound )? > - Pallet + Pezpallet where T: pezframe_system::Config, $( $where_clause )* { #[allow(unused)] @@ -1226,8 +1226,8 @@ macro_rules! impl_benchmark_test { let on_before_start = || { // Set the block number to at least 1 so events are deposited. - if $crate::__private::Zero::is_zero(&pezframe_system::Pallet::::block_number()) { - pezframe_system::Pallet::::set_block_number(1u32.into()); + if $crate::__private::Zero::is_zero(&pezframe_system::Pezpallet::::block_number()) { + pezframe_system::Pezpallet::::set_block_number(1u32.into()); } }; @@ -1296,7 +1296,7 @@ macro_rules! impl_benchmark_test { /// When called in `pezpallet_example_basic` as /// /// ```rust,ignore -/// impl_benchmark_test_suite!(Pallet, crate::tests::new_test_ext(), crate::tests::Test); +/// impl_benchmark_test_suite!(Pezpallet, crate::tests::new_test_ext(), crate::tests::Test); /// ``` /// /// It expands to the equivalent of: @@ -1325,7 +1325,7 @@ macro_rules! impl_benchmark_test { /// benchmarks! { /// // Benchmarks omitted for brevity /// -/// impl_benchmark_test_suite!(Pallet, crate::tests::new_test_ext(), crate::tests::Test); +/// impl_benchmark_test_suite!(Pezpallet, crate::tests::new_test_ext(), crate::tests::Test); /// } /// ``` /// @@ -1396,11 +1396,11 @@ macro_rules! impl_benchmark_test { /// } /// /// mod tests { -/// // because of macro syntax limitations, neither Pallet nor benches can be paths, but both have +/// // because of macro syntax limitations, neither Pezpallet nor benches can be paths, but both have /// // to be idents in the scope of `impl_benchmark_test_suite`. -/// use crate::{benches, Pallet}; +/// use crate::{benches, Pezpallet}; /// -/// impl_benchmark_test_suite!(Pallet, new_test_ext(), Test, benchmarks_path = benches); +/// impl_benchmark_test_suite!(Pezpallet, new_test_ext(), Test, benchmarks_path = benches); /// /// // new_test_ext and the Test item are defined later in this module /// } @@ -1738,7 +1738,7 @@ pub fn show_benchmark_debug_info( error_message: &str, ) -> alloc::string::String { alloc::format!( - "\n* Pallet: {}\n\ + "\n* Pezpallet: {}\n\ * Benchmark: {}\n\ * Components: {:?}\n\ * Verify: {:?}\n\ @@ -1753,7 +1753,7 @@ pub fn show_benchmark_debug_info( ) } -/// This macro adds pallet benchmarks to a `Vec` object. +/// This macro adds pezpallet benchmarks to a `Vec` object. /// /// First create an object that holds in the input parameters for the benchmark: /// @@ -1799,7 +1799,7 @@ pub fn show_benchmark_debug_info( /// /// At the end of `dispatch_benchmark`, you should return this batches object. /// -/// In the case where you have multiple instances of a pallet that you need to separately benchmark, +/// In the case where you have multiple instances of a pezpallet that you need to separately benchmark, /// the name of your module struct will be used as a suffix to your outputted weight file. For /// example: /// @@ -1822,14 +1822,14 @@ macro_rules! add_benchmark { let instance_string = stringify!($location).replace(" ", "").into_bytes(); let (config, whitelist) = $params; let $crate::BenchmarkConfig { - pallet, + pezpallet, instance, benchmark, selected_components, verify, internal_repeats, } = config; - if &pallet[..] == &pezpallet_string[..] && &instance[..] == &instance_string[..] { + if &pezpallet[..] == &pezpallet_string[..] && &instance[..] == &instance_string[..] { let benchmark_result = <$location as $crate::Benchmarking>::run_benchmark( &benchmark[..], &selected_components[..], @@ -1883,7 +1883,7 @@ macro_rules! add_benchmark { if let Some(final_results) = final_results { $batches.push($crate::BenchmarkBatch { - pallet: pezpallet_string, + pezpallet: pezpallet_string, instance: instance_string, benchmark: benchmark.clone(), results: final_results, @@ -1902,8 +1902,8 @@ macro_rules! add_benchmark { /// let mut list = Vec::::new(); /// ``` /// -/// Then pass this `list` to the macro, along with the `extra` boolean, the pallet crate, and -/// pallet struct: +/// Then pass this `list` to the macro, along with the `extra` boolean, the pezpallet crate, and +/// pezpallet struct: /// /// ```ignore /// list_benchmark!(list, extra, pezpallet_balances, Balances); @@ -1919,7 +1919,7 @@ macro_rules! list_benchmark { let instance_string = stringify!($location).replace(" ", "").into_bytes(); let benchmarks = <$location as $crate::Benchmarking>::benchmarks($extra); let pezpallet_benchmarks = $crate::BenchmarkList { - pallet: pezpallet_string, + pezpallet: pezpallet_string, instance: instance_string, benchmarks: benchmarks.to_vec(), }; @@ -1927,7 +1927,7 @@ macro_rules! list_benchmark { }; } -/// Defines pallet configs that `add_benchmarks` and `list_benchmarks` use. +/// Defines pezpallet configs that `add_benchmarks` and `list_benchmarks` use. /// Should be preferred instead of having a repetitive list of configs /// in `add_benchmark` and `list_benchmark`. #[macro_export] diff --git a/bizinikiwi/pezframe/benchmarking/src/weights.rs b/bizinikiwi/pezframe/benchmarking/src/weights.rs index 0084e211..2af6e7a2 100644 --- a/bizinikiwi/pezframe/benchmarking/src/weights.rs +++ b/bizinikiwi/pezframe/benchmarking/src/weights.rs @@ -44,10 +44,10 @@ // frame-omni-bencher // v1 // benchmark -// pallet +// pezpallet // --extrinsic=* // --runtime=target/production/wbuild/pez-kitchensink-runtime/pez_kitchensink_runtime.wasm -// --pallet=pezframe_benchmarking +// --pezpallet=pezframe_benchmarking // --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2 // --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/benchmarking/src/weights.rs // --wasm-execution=compiled diff --git a/bizinikiwi/pezframe/bounties/Cargo.toml b/bizinikiwi/pezframe/bounties/Cargo.toml index a21aca65..16cbaf5d 100644 --- a/bizinikiwi/pezframe/bounties/Cargo.toml +++ b/bizinikiwi/pezframe/bounties/Cargo.toml @@ -6,7 +6,7 @@ edition.workspace = true license = "Apache-2.0" homepage.workspace = true repository.workspace = true -description = "FRAME pallet to manage bounties" +description = "FRAME pezpallet to manage bounties" readme = "README.md" documentation = "https://docs.rs/pezpallet-bounties" diff --git a/bizinikiwi/pezframe/bounties/README.md b/bizinikiwi/pezframe/bounties/README.md index 151b515e..8dd16d10 100644 --- a/bizinikiwi/pezframe/bounties/README.md +++ b/bizinikiwi/pezframe/bounties/README.md @@ -2,7 +2,7 @@ ## Bounty -> NOTE: This pallet is tightly coupled with pezpallet-treasury. +> NOTE: This pezpallet is tightly coupled with pezpallet-treasury. A Bounty Spending is a reward for a specified body of work - or specified set of objectives - that needs to be executed for a predefined Treasury amount to be paid out. A curator is assigned @@ -18,7 +18,7 @@ election. The Council also gets to cancel the bounty if deemed necessary before curator or once the bounty is active or payout is pending, resulting in the slash of the curator's deposit. -This pallet may opt into using a [`ChildBountyManager`] that enables bounties to be split into +This pezpallet may opt into using a [`ChildBountyManager`] that enables bounties to be split into sub-bounties, as children of an established bounty (called the parent in the context of it's children). diff --git a/bizinikiwi/pezframe/bounties/src/benchmarking.rs b/bizinikiwi/pezframe/bounties/src/benchmarking.rs index fb813ef5..193c6e21 100644 --- a/bizinikiwi/pezframe/bounties/src/benchmarking.rs +++ b/bizinikiwi/pezframe/bounties/src/benchmarking.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Bounties pallet benchmarking. +//! Bounties pezpallet benchmarking. use super::*; @@ -24,8 +24,8 @@ use pezframe_benchmarking::v2::*; use pezframe_system::{pezpallet_prelude::BlockNumberFor as SystemBlockNumberFor, RawOrigin}; use pezsp_runtime::traits::{BlockNumberProvider, Bounded}; -use crate::Pallet as Bounties; -use pezpallet_treasury::Pallet as Treasury; +use crate::Pezpallet as Bounties; +use pezpallet_treasury::Pezpallet as Treasury; const SEED: u32 = 0; @@ -87,7 +87,7 @@ fn create_bounty, I: 'static>( T::SpendOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; Bounties::::approve_bounty(approve_origin.clone(), bounty_id)?; set_block_number::(T::SpendPeriod::get()); - Treasury::::on_initialize(pezframe_system::Pallet::::block_number()); + Treasury::::on_initialize(pezframe_system::Pezpallet::::block_number()); Bounties::::propose_curator(approve_origin, bounty_id, curator_lookup.clone(), fee)?; Bounties::::accept_curator(RawOrigin::Signed(curator).into(), bounty_id)?; Ok((curator_lookup, bounty_id)) @@ -100,7 +100,7 @@ fn setup_pot_account, I: 'static>() { } fn assert_last_event, I: 'static>(generic_event: >::RuntimeEvent) { - pezframe_system::Pallet::::assert_last_event(generic_event.into()); + pezframe_system::Pezpallet::::assert_last_event(generic_event.into()); } #[instance_benchmarks] @@ -141,7 +141,7 @@ mod benchmarks { T::SpendOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; Bounties::::approve_bounty(approve_origin.clone(), bounty_id)?; set_block_number::(T::SpendPeriod::get()); - Treasury::::on_initialize(pezframe_system::Pallet::::block_number()); + Treasury::::on_initialize(pezframe_system::Pezpallet::::block_number()); #[extrinsic_call] _(approve_origin as T::RuntimeOrigin, bounty_id, curator_lookup, fee); @@ -175,7 +175,7 @@ mod benchmarks { fn unassign_curator() -> Result<(), BenchmarkError> { setup_pot_account::(); let (curator_lookup, _) = create_bounty::()?; - Treasury::::on_initialize(pezframe_system::Pallet::::block_number()); + Treasury::::on_initialize(pezframe_system::Pezpallet::::block_number()); let bounty_id = BountyCount::::get() - 1; let bounty_update_period = T::BountyUpdatePeriod::get(); let inactivity_timeout = T::SpendPeriod::get().saturating_add(bounty_update_period); @@ -183,7 +183,7 @@ mod benchmarks { // If `BountyUpdatePeriod` overflows the inactivity timeout the benchmark still executes the // slash - let origin = if Pallet::::treasury_block_number() <= inactivity_timeout { + let origin = if Pezpallet::::treasury_block_number() <= inactivity_timeout { let curator = T::Lookup::lookup(curator_lookup).map_err(<&str>::from)?; T::RejectOrigin::try_successful_origin() .unwrap_or_else(|_| RawOrigin::Signed(curator).into()) @@ -210,7 +210,7 @@ mod benchmarks { T::SpendOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; Bounties::::approve_bounty(approve_origin.clone(), bounty_id)?; set_block_number::(T::SpendPeriod::get()); - Treasury::::on_initialize(pezframe_system::Pallet::::block_number()); + Treasury::::on_initialize(pezframe_system::Pezpallet::::block_number()); Bounties::::propose_curator(approve_origin, bounty_id, curator_lookup, fee)?; #[extrinsic_call] @@ -223,7 +223,7 @@ mod benchmarks { fn award_bounty() -> Result<(), BenchmarkError> { setup_pot_account::(); let (curator_lookup, _) = create_bounty::()?; - Treasury::::on_initialize(pezframe_system::Pallet::::block_number()); + Treasury::::on_initialize(pezframe_system::Pezpallet::::block_number()); let bounty_id = BountyCount::::get() - 1; let curator = T::Lookup::lookup(curator_lookup).map_err(<&str>::from)?; @@ -240,7 +240,7 @@ mod benchmarks { fn claim_bounty() -> Result<(), BenchmarkError> { setup_pot_account::(); let (curator_lookup, _) = create_bounty::()?; - Treasury::::on_initialize(pezframe_system::Pallet::::block_number()); + Treasury::::on_initialize(pezframe_system::Pezpallet::::block_number()); let bounty_id = BountyCount::::get() - 1; let curator = T::Lookup::lookup(curator_lookup).map_err(<&str>::from)?; @@ -291,7 +291,7 @@ mod benchmarks { fn close_bounty_active() -> Result<(), BenchmarkError> { setup_pot_account::(); let (_, _) = create_bounty::()?; - Treasury::::on_initialize(pezframe_system::Pallet::::block_number()); + Treasury::::on_initialize(pezframe_system::Pezpallet::::block_number()); let bounty_id = BountyCount::::get() - 1; let approve_origin = T::RejectOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; @@ -308,7 +308,7 @@ mod benchmarks { fn extend_bounty_expiry() -> Result<(), BenchmarkError> { setup_pot_account::(); let (curator_lookup, _) = create_bounty::()?; - Treasury::::on_initialize(pezframe_system::Pallet::::block_number()); + Treasury::::on_initialize(pezframe_system::Pezpallet::::block_number()); let bounty_id = BountyCount::::get() - 1; let curator = T::Lookup::lookup(curator_lookup).map_err(<&str>::from)?; diff --git a/bizinikiwi/pezframe/bounties/src/lib.rs b/bizinikiwi/pezframe/bounties/src/lib.rs index 790f5881..41fb3627 100644 --- a/bizinikiwi/pezframe/bounties/src/lib.rs +++ b/bizinikiwi/pezframe/bounties/src/lib.rs @@ -19,7 +19,7 @@ //! //! ## Bounty //! -//! > NOTE: This pallet is tightly coupled with pezpallet-treasury. +//! > NOTE: This pezpallet is tightly coupled with pezpallet-treasury. //! //! A Bounty Spending is a reward for a specified body of work - or specified set of objectives - //! that needs to be executed for a predefined Treasury amount to be paid out. A curator is assigned @@ -35,7 +35,7 @@ //! curator or once the bounty is active or payout is pending, resulting in the slash of the //! curator's deposit. //! -//! This pallet may opt into using a [`ChildBountyManager`] that enables bounties to be split into +//! This pezpallet may opt into using a [`ChildBountyManager`] that enables bounties to be split into //! sub-bounties, as children of an established bounty (called the parent in the context of it's //! children). //! @@ -112,7 +112,7 @@ use pezframe_system::pezpallet_prelude::{ use scale_info::TypeInfo; pub use weights::WeightInfo; -pub use pallet::*; +pub use pezpallet::*; type BalanceOf = pezpallet_treasury::BalanceOf; @@ -221,24 +221,24 @@ pub trait ChildBountyManager { fn bounty_removed(bounty_id: BountyIndex); } -#[pezframe_support::pallet] -pub mod pallet { +#[pezframe_support::pezpallet] +pub mod pezpallet { use super::*; const STORAGE_VERSION: StorageVersion = StorageVersion::new(4); - #[pallet::pallet] - #[pallet::storage_version(STORAGE_VERSION)] - pub struct Pallet(_); + #[pezpallet::pezpallet] + #[pezpallet::storage_version(STORAGE_VERSION)] + pub struct Pezpallet(_); - #[pallet::config] + #[pezpallet::config] pub trait Config: pezframe_system::Config + pezpallet_treasury::Config { /// The amount held on deposit for placing a bounty proposal. - #[pallet::constant] + #[pezpallet::constant] type BountyDepositBase: Get>; /// The delay period for which a bounty beneficiary need to wait before claim the payout. - #[pallet::constant] + #[pezpallet::constant] type BountyDepositPayoutDelay: Get>; /// The time limit for a curator to act before a bounty expires. @@ -247,30 +247,30 @@ pub mod pallet { /// update the bounty via `extend_bounty_expiry`. If missed, the bounty expires, and the /// curator may be slashed. If `BlockNumberFor::MAX`, bounties stay active indefinitely, /// removing the need for `extend_bounty_expiry`. - #[pallet::constant] + #[pezpallet::constant] type BountyUpdatePeriod: Get>; /// The curator deposit is calculated as a percentage of the curator fee. /// /// This deposit has optional upper and lower bounds with `CuratorDepositMax` and /// `CuratorDepositMin`. - #[pallet::constant] + #[pezpallet::constant] type CuratorDepositMultiplier: Get; /// Maximum amount of funds that should be placed in a deposit for making a proposal. - #[pallet::constant] + #[pezpallet::constant] type CuratorDepositMax: Get>>; /// Minimum amount of funds that should be placed in a deposit for making a proposal. - #[pallet::constant] + #[pezpallet::constant] type CuratorDepositMin: Get>>; /// Minimum value for a bounty. - #[pallet::constant] + #[pezpallet::constant] type BountyValueMinimum: Get>; /// The amount held on deposit per byte within the tip report reason or bounty description. - #[pallet::constant] + #[pezpallet::constant] type DataDepositPerByte: Get>; /// The overarching event type. @@ -281,10 +281,10 @@ pub mod pallet { /// Maximum acceptable reason length. /// /// Benchmarks depend on this value, be sure to update weights file when changing this value - #[pallet::constant] + #[pezpallet::constant] type MaximumReasonLength: Get; - /// Weight information for extrinsics in this pallet. + /// Weight information for extrinsics in this pezpallet. type WeightInfo: WeightInfo; /// The child bounty manager. @@ -294,7 +294,7 @@ pub mod pallet { type OnSlash: OnUnbalanced>; } - #[pallet::error] + #[pezpallet::error] pub enum Error { /// Proposer's balance is too low. InsufficientProposersBalance, @@ -323,8 +323,8 @@ pub mod pallet { NotProposer, } - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] + #[pezpallet::event] + #[pezpallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event, I: 'static = ()> { /// New bounty proposal. BountyProposed { index: BountyIndex }, @@ -358,11 +358,11 @@ pub mod pallet { } /// Number of bounty proposals that have been made. - #[pallet::storage] + #[pezpallet::storage] pub type BountyCount, I: 'static = ()> = StorageValue<_, BountyIndex, ValueQuery>; /// Bounties that have been made. - #[pallet::storage] + #[pezpallet::storage] pub type Bounties, I: 'static = ()> = StorageMap< _, Twox64Concat, @@ -371,18 +371,18 @@ pub mod pallet { >; /// The description of each bounty. - #[pallet::storage] + #[pezpallet::storage] pub type BountyDescriptions, I: 'static = ()> = StorageMap<_, Twox64Concat, BountyIndex, BoundedVec>; /// Bounty indices that have been approved but not yet funded. - #[pallet::storage] + #[pezpallet::storage] #[allow(deprecated)] pub type BountyApprovals, I: 'static = ()> = StorageValue<_, BoundedVec, ValueQuery>; - #[pallet::call] - impl, I: 'static> Pallet { + #[pezpallet::call] + impl, I: 'static> Pezpallet { /// Propose a new bounty. /// /// The dispatch origin for this call must be _Signed_. @@ -395,11 +395,11 @@ pub mod pallet { /// - `fee`: The curator fee. /// - `value`: The total payment amount of this bounty, curator fee included. /// - `description`: The description of this bounty. - #[pallet::call_index(0)] - #[pallet::weight(>::WeightInfo::propose_bounty(description.len() as u32))] + #[pezpallet::call_index(0)] + #[pezpallet::weight(>::WeightInfo::propose_bounty(description.len() as u32))] pub fn propose_bounty( origin: OriginFor, - #[pallet::compact] value: BalanceOf, + #[pezpallet::compact] value: BalanceOf, description: Vec, ) -> DispatchResult { let proposer = ensure_signed(origin)?; @@ -414,11 +414,11 @@ pub mod pallet { /// /// ## Complexity /// - O(1). - #[pallet::call_index(1)] - #[pallet::weight(>::WeightInfo::approve_bounty())] + #[pezpallet::call_index(1)] + #[pezpallet::weight(>::WeightInfo::approve_bounty())] pub fn approve_bounty( origin: OriginFor, - #[pallet::compact] bounty_id: BountyIndex, + #[pezpallet::compact] bounty_id: BountyIndex, ) -> DispatchResult { let max_amount = T::SpendOrigin::ensure_origin(origin)?; Bounties::::try_mutate_exists(bounty_id, |maybe_bounty| -> DispatchResult { @@ -447,13 +447,13 @@ pub mod pallet { /// /// ## Complexity /// - O(1). - #[pallet::call_index(2)] - #[pallet::weight(>::WeightInfo::propose_curator())] + #[pezpallet::call_index(2)] + #[pezpallet::weight(>::WeightInfo::propose_curator())] pub fn propose_curator( origin: OriginFor, - #[pallet::compact] bounty_id: BountyIndex, + #[pezpallet::compact] bounty_id: BountyIndex, curator: AccountIdLookupOf, - #[pallet::compact] fee: BalanceOf, + #[pezpallet::compact] fee: BalanceOf, ) -> DispatchResult { let max_amount = T::SpendOrigin::ensure_origin(origin)?; @@ -498,11 +498,11 @@ pub mod pallet { /// /// ## Complexity /// - O(1). - #[pallet::call_index(3)] - #[pallet::weight(>::WeightInfo::unassign_curator())] + #[pezpallet::call_index(3)] + #[pezpallet::weight(>::WeightInfo::unassign_curator())] pub fn unassign_curator( origin: OriginFor, - #[pallet::compact] bounty_id: BountyIndex, + #[pezpallet::compact] bounty_id: BountyIndex, ) -> DispatchResult { let maybe_sender = ensure_signed(origin.clone()) .map(Some) @@ -594,11 +594,11 @@ pub mod pallet { /// /// ## Complexity /// - O(1). - #[pallet::call_index(4)] - #[pallet::weight(>::WeightInfo::accept_curator())] + #[pezpallet::call_index(4)] + #[pezpallet::weight(>::WeightInfo::accept_curator())] pub fn accept_curator( origin: OriginFor, - #[pallet::compact] bounty_id: BountyIndex, + #[pezpallet::compact] bounty_id: BountyIndex, ) -> DispatchResult { let signer = ensure_signed(origin)?; @@ -640,11 +640,11 @@ pub mod pallet { /// /// ## Complexity /// - O(1). - #[pallet::call_index(5)] - #[pallet::weight(>::WeightInfo::award_bounty())] + #[pezpallet::call_index(5)] + #[pezpallet::weight(>::WeightInfo::award_bounty())] pub fn award_bounty( origin: OriginFor, - #[pallet::compact] bounty_id: BountyIndex, + #[pezpallet::compact] bounty_id: BountyIndex, beneficiary: AccountIdLookupOf, ) -> DispatchResult { let signer = ensure_signed(origin)?; @@ -686,11 +686,11 @@ pub mod pallet { /// /// ## Complexity /// - O(1). - #[pallet::call_index(6)] - #[pallet::weight(>::WeightInfo::claim_bounty())] + #[pezpallet::call_index(6)] + #[pezpallet::weight(>::WeightInfo::claim_bounty())] pub fn claim_bounty( origin: OriginFor, - #[pallet::compact] bounty_id: BountyIndex, + #[pezpallet::compact] bounty_id: BountyIndex, ) -> DispatchResult { ensure_signed(origin)?; // anyone can trigger claim @@ -747,12 +747,12 @@ pub mod pallet { /// /// ## Complexity /// - O(1). - #[pallet::call_index(7)] - #[pallet::weight(>::WeightInfo::close_bounty_proposed() + #[pezpallet::call_index(7)] + #[pezpallet::weight(>::WeightInfo::close_bounty_proposed() .max(>::WeightInfo::close_bounty_active()))] pub fn close_bounty( origin: OriginFor, - #[pallet::compact] bounty_id: BountyIndex, + #[pezpallet::compact] bounty_id: BountyIndex, ) -> DispatchResultWithPostInfo { T::RejectOrigin::ensure_origin(origin)?; @@ -840,11 +840,11 @@ pub mod pallet { /// /// ## Complexity /// - O(1). - #[pallet::call_index(8)] - #[pallet::weight(>::WeightInfo::extend_bounty_expiry())] + #[pezpallet::call_index(8)] + #[pezpallet::weight(>::WeightInfo::extend_bounty_expiry())] pub fn extend_bounty_expiry( origin: OriginFor, - #[pallet::compact] bounty_id: BountyIndex, + #[pezpallet::compact] bounty_id: BountyIndex, _remark: Vec, ) -> DispatchResult { let signer = ensure_signed(origin)?; @@ -880,13 +880,13 @@ pub mod pallet { /// /// ## Complexity /// - O(1). - #[pallet::call_index(9)] - #[pallet::weight(>::WeightInfo::approve_bounty_with_curator())] + #[pezpallet::call_index(9)] + #[pezpallet::weight(>::WeightInfo::approve_bounty_with_curator())] pub fn approve_bounty_with_curator( origin: OriginFor, - #[pallet::compact] bounty_id: BountyIndex, + #[pezpallet::compact] bounty_id: BountyIndex, curator: AccountIdLookupOf, - #[pallet::compact] fee: BalanceOf, + #[pezpallet::compact] fee: BalanceOf, ) -> DispatchResult { let max_amount = T::SpendOrigin::ensure_origin(origin)?; let curator = T::Lookup::lookup(curator)?; @@ -930,11 +930,11 @@ pub mod pallet { /// The transaction is made free if the deposit is updated and paid otherwise. /// /// Emits `DepositPoked` if the deposit is updated. - #[pallet::call_index(10)] - #[pallet::weight(>::WeightInfo::poke_deposit())] + #[pezpallet::call_index(10)] + #[pezpallet::weight(>::WeightInfo::poke_deposit())] pub fn poke_deposit( origin: OriginFor, - #[pallet::compact] bounty_id: BountyIndex, + #[pezpallet::compact] bounty_id: BountyIndex, ) -> DispatchResultWithPostInfo { ensure_signed(origin)?; @@ -944,8 +944,8 @@ pub mod pallet { } } - #[pallet::hooks] - impl, I: 'static> Hooks> for Pallet { + #[pezpallet::hooks] + impl, I: 'static> Hooks> for Pezpallet { #[cfg(feature = "try-runtime")] fn try_state(_n: SystemBlockNumberFor) -> Result<(), pezsp_runtime::TryRuntimeError> { Self::do_try_state() @@ -954,10 +954,10 @@ pub mod pallet { } #[cfg(any(feature = "try-runtime", test))] -impl, I: 'static> Pallet { - /// Ensure the correctness of the state of this pallet. +impl, I: 'static> Pezpallet { + /// 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_bounties_count()?; @@ -993,8 +993,8 @@ impl, I: 'static> Pallet { } } -impl, I: 'static> Pallet { - /// Get the block number used in the treasury pallet. +impl, I: 'static> Pezpallet { + /// Get the block number used in the treasury pezpallet. /// /// It may be configured to use the relay chain block number on a teyrchain. pub fn treasury_block_number() -> BlockNumberFor { @@ -1117,7 +1117,7 @@ impl, I: 'static> Pallet { } } -impl, I: 'static> pezpallet_treasury::SpendFunds for Pallet { +impl, I: 'static> pezpallet_treasury::SpendFunds for Pezpallet { fn spend_funds( budget_remaining: &mut BalanceOf, imbalance: &mut PositiveImbalanceOf, @@ -1165,7 +1165,7 @@ impl, I: 'static> pezpallet_treasury::SpendFunds for Pallet>::WeightInfo::spend_funds(bounties_len); + *total_weight += >::WeightInfo::spend_funds(bounties_len); } } diff --git a/bizinikiwi/pezframe/bounties/src/migrations/v4.rs b/bizinikiwi/pezframe/bounties/src/migrations/v4.rs index c44efcde..1fd92401 100644 --- a/bizinikiwi/pezframe/bounties/src/migrations/v4.rs +++ b/bizinikiwi/pezframe/bounties/src/migrations/v4.rs @@ -29,7 +29,7 @@ use pezsp_io::{hashing::twox_128, storage}; use crate as pezpallet_bounties; -/// Migrate the storage of the bounties pallet to a new prefix, leaving all other storage untouched +/// Migrate the storage of the bounties pezpallet to a new prefix, leaving all other storage untouched /// /// This new prefix must be the same as the one set in construct_runtime. For safety, use /// `PalletInfo` to get it, as: @@ -52,7 +52,7 @@ pub fn migrate< if new_pallet_name == old_pallet_name { log::info!( target: "runtime::bounties", - "New pallet name is equal to the old prefix. No migration needs to be done.", + "New pezpallet name is equal to the old prefix. No migration needs to be done.", ); return Weight::zero(); } @@ -149,7 +149,7 @@ pub fn pre_migration; + type Currency = pezpallet_balances::Pezpallet; type RejectOrigin = pezframe_system::EnsureRoot; type RuntimeEvent = RuntimeEvent; type SpendPeriod = ConstU64<2>; @@ -111,7 +111,7 @@ impl pezpallet_treasury::Config for Test { impl pezpallet_treasury::Config for Test { type PalletId = TreasuryPalletId2; - type Currency = pezpallet_balances::Pallet; + type Currency = pezpallet_balances::Pezpallet; type RejectOrigin = pezframe_system::EnsureRoot; type RuntimeEvent = RuntimeEvent; type SpendPeriod = ConstU64<2>; @@ -1494,7 +1494,7 @@ fn poke_deposit_fails_for_insufficient_balance() { // BountyDepositBase (80) + DataDepositPerByte (1) * description.len() (5) let deposit = - pezpallet_bounties::Pallet::::calculate_bounty_deposit(&bounded_description); + pezpallet_bounties::Pezpallet::::calculate_bounty_deposit(&bounded_description); // Verify initial state assert_eq!(Balances::reserved_balance(0), deposit); diff --git a/bizinikiwi/pezframe/bounties/src/weights.rs b/bizinikiwi/pezframe/bounties/src/weights.rs index 3c1afdc4..222ec223 100644 --- a/bizinikiwi/pezframe/bounties/src/weights.rs +++ b/bizinikiwi/pezframe/bounties/src/weights.rs @@ -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_bounties +// --pezpallet=pezpallet_bounties // --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2 // --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/bounties/src/weights.rs // --wasm-execution=compiled diff --git a/bizinikiwi/pezframe/broker/README.md b/bizinikiwi/pezframe/broker/README.md index 95055767..56f80395 100644 --- a/bizinikiwi/pezframe/broker/README.md +++ b/bizinikiwi/pezframe/broker/README.md @@ -1,4 +1,4 @@ -# Pallet Broker +# Pezpallet Broker Brokerage tool for managing PezkuwiChain Core scheduling. diff --git a/bizinikiwi/pezframe/broker/src/benchmarking.rs b/bizinikiwi/pezframe/broker/src/benchmarking.rs index 0bb433f2..6ab6722c 100644 --- a/bizinikiwi/pezframe/broker/src/benchmarking.rs +++ b/bizinikiwi/pezframe/broker/src/benchmarking.rs @@ -19,7 +19,7 @@ use super::*; -use crate::{CoreAssignment::Task, Pallet as Broker}; +use crate::{CoreAssignment::Task, Pezpallet as Broker}; use alloc::{vec, vec::Vec}; use pezframe_benchmarking::v2::*; use pezframe_support::{ @@ -29,7 +29,7 @@ use pezframe_support::{ EnsureOrigin, Hooks, }, }; -use pezframe_system::{Pallet as System, RawOrigin}; +use pezframe_system::{Pezpallet as System, RawOrigin}; use pezsp_arithmetic::{FixedU64, Perbill}; use pezsp_core::Get; use pezsp_runtime::{ @@ -41,11 +41,11 @@ const SEED: u32 = 0; const MAX_CORE_COUNT: u16 = 1_000; fn assert_last_event(generic_event: ::RuntimeEvent) { - pezframe_system::Pallet::::assert_last_event(generic_event.into()); + pezframe_system::Pezpallet::::assert_last_event(generic_event.into()); } fn assert_has_event(generic_event: ::RuntimeEvent) { - pezframe_system::Pallet::::assert_has_event(generic_event.into()); + pezframe_system::Pezpallet::::assert_has_event(generic_event.into()); } fn new_config_record() -> ConfigRecordOf { @@ -1321,5 +1321,5 @@ mod benches { // Implements a test for each benchmark. Execute with: // `cargo test -p pezpallet-broker --features runtime-benchmarks`. - impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test); + impl_benchmark_test_suite!(Pezpallet, crate::mock::new_test_ext(), crate::mock::Test); } diff --git a/bizinikiwi/pezframe/broker/src/dispatchable_impls.rs b/bizinikiwi/pezframe/broker/src/dispatchable_impls.rs index 53265586..ef833c1d 100644 --- a/bizinikiwi/pezframe/broker/src/dispatchable_impls.rs +++ b/bizinikiwi/pezframe/broker/src/dispatchable_impls.rs @@ -26,7 +26,7 @@ use pezsp_arithmetic::traits::{CheckedDiv, Saturating, Zero}; use pezsp_runtime::traits::{BlockNumberProvider, Convert}; use CompletionStatus::{Complete, Partial}; -impl Pallet { +impl Pezpallet { pub(crate) fn do_configure(config: ConfigRecordOf) -> DispatchResult { config.validate().map_err(|()| Error::::InvalidConfig)?; Configuration::::put(config); diff --git a/bizinikiwi/pezframe/broker/src/lib.rs b/bizinikiwi/pezframe/broker/src/lib.rs index 57153aef..c94b4471 100644 --- a/bizinikiwi/pezframe/broker/src/lib.rs +++ b/bizinikiwi/pezframe/broker/src/lib.rs @@ -18,7 +18,7 @@ #![cfg_attr(not(feature = "std"), no_std)] #![doc = include_str!("../README.md")] -pub use pallet::*; +pub use pezpallet::*; mod adapt_price; mod benchmarking; @@ -49,11 +49,11 @@ pub use types::*; extern crate alloc; -/// The log target for this pallet. +/// The log target for this pezpallet. const LOG_TARGET: &str = "runtime::broker"; -#[pezframe_support::pallet] -pub mod pallet { +#[pezframe_support::pezpallet] +pub mod pezpallet { use super::*; use alloc::vec::Vec; use pezframe_support::{ @@ -69,22 +69,22 @@ pub mod pallet { const STORAGE_VERSION: StorageVersion = StorageVersion::new(4); - #[pallet::pallet] - #[pallet::storage_version(STORAGE_VERSION)] - pub struct Pallet(_); + #[pezpallet::pezpallet] + #[pezpallet::storage_version(STORAGE_VERSION)] + pub struct Pezpallet(_); - #[pallet::config] + #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] type RuntimeEvent: From> + IsType<::RuntimeEvent>; - /// Weight information for all calls of this pallet. + /// Weight information for all calls of this pezpallet. type WeightInfo: WeightInfo; /// Currency used to pay for Coretime. type Currency: Mutate + Balanced; - /// The origin test needed for administrating this pallet. + /// The origin test needed for administrating this pezpallet. type AdminOrigin: EnsureOrigin; /// What to do with any revenues collected from the sale of Coretime. @@ -107,103 +107,103 @@ pub mod pallet { type SovereignAccountOf: MaybeConvert; /// Identifier from which the internal Pot is generated. - #[pallet::constant] + #[pezpallet::constant] type PalletId: Get; /// Number of Relay-chain blocks per timeslice. - #[pallet::constant] + #[pezpallet::constant] type TimeslicePeriod: Get>; /// Maximum number of legacy leases. - #[pallet::constant] + #[pezpallet::constant] type MaxLeasedCores: Get; /// Maximum number of system cores. - #[pallet::constant] + #[pezpallet::constant] type MaxReservedCores: Get; /// Given that we are performing all auto-renewals in a single block, it has to be limited. - #[pallet::constant] + #[pezpallet::constant] type MaxAutoRenewals: Get; /// The smallest amount of credits a user can purchase. /// /// Needed to prevent spam attacks. - #[pallet::constant] + #[pezpallet::constant] type MinimumCreditPurchase: Get>; } - /// The current configuration of this pallet. - #[pallet::storage] + /// The current configuration of this pezpallet. + #[pezpallet::storage] pub type Configuration = StorageValue<_, ConfigRecordOf, OptionQuery>; /// The Pezkuwi Core reservations (generally tasked with the maintenance of System Chains). - #[pallet::storage] + #[pezpallet::storage] pub type Reservations = StorageValue<_, ReservationsRecordOf, ValueQuery>; /// The Pezkuwi Core legacy leases. - #[pallet::storage] + #[pezpallet::storage] pub type Leases = StorageValue<_, LeasesRecordOf, ValueQuery>; - /// The current status of miscellaneous subsystems of this pallet. - #[pallet::storage] + /// The current status of miscellaneous subsystems of this pezpallet. + #[pezpallet::storage] pub type Status = StorageValue<_, StatusRecord, OptionQuery>; /// The details of the current sale, including its properties and status. - #[pallet::storage] + #[pezpallet::storage] pub type SaleInfo = StorageValue<_, SaleInfoRecordOf, OptionQuery>; /// Records of potential renewals. /// /// Renewals will only actually be allowed if `CompletionStatus` is actually `Complete`. - #[pallet::storage] + #[pezpallet::storage] pub type PotentialRenewals = StorageMap<_, Twox64Concat, PotentialRenewalId, PotentialRenewalRecordOf, OptionQuery>; /// The current (unassigned or provisionally assigend) Regions. - #[pallet::storage] + #[pezpallet::storage] pub type Regions = StorageMap<_, Blake2_128Concat, RegionId, RegionRecordOf, OptionQuery>; /// The work we plan on having each core do at a particular time in the future. - #[pallet::storage] + #[pezpallet::storage] pub type Workplan = StorageMap<_, Twox64Concat, (Timeslice, CoreIndex), Schedule, OptionQuery>; /// The current workload of each core. This gets updated with workplan as timeslices pass. - #[pallet::storage] + #[pezpallet::storage] pub type Workload = StorageMap<_, Twox64Concat, CoreIndex, Schedule, ValueQuery>; /// Record of a single contribution to the Instantaneous Coretime Pool. - #[pallet::storage] + #[pezpallet::storage] pub type InstaPoolContribution = StorageMap<_, Blake2_128Concat, RegionId, ContributionRecordOf, OptionQuery>; /// Record of Coretime entering or leaving the Instantaneous Coretime Pool. - #[pallet::storage] + #[pezpallet::storage] pub type InstaPoolIo = StorageMap<_, Blake2_128Concat, Timeslice, PoolIoRecord, ValueQuery>; /// Total InstaPool rewards for each Timeslice and the number of core parts which contributed. - #[pallet::storage] + #[pezpallet::storage] pub type InstaPoolHistory = StorageMap<_, Blake2_128Concat, Timeslice, InstaPoolHistoryRecordOf>; /// Received core count change from the relay chain. - #[pallet::storage] + #[pezpallet::storage] pub type CoreCountInbox = StorageValue<_, CoreIndex, OptionQuery>; /// Keeping track of cores which have auto-renewal enabled. /// /// Sorted by `CoreIndex` to make the removal of cores from auto-renewal more efficient. - #[pallet::storage] + #[pezpallet::storage] pub type AutoRenewals = StorageValue<_, BoundedVec, ValueQuery>; /// Received revenue info from the relay chain. - #[pallet::storage] + #[pezpallet::storage] pub type RevenueInbox = StorageValue<_, OnDemandRevenueRecordOf, OptionQuery>; - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] + #[pezpallet::event] + #[pezpallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { /// A Region of Bulk Coretime has been purchased. Purchased { @@ -362,7 +362,7 @@ pub mod pallet { SalesStarted { /// The nominal price of an Region of Bulk Coretime. price: BalanceOf, - /// The maximum number of cores which this pallet will attempt to assign. + /// The maximum number of cores which this pezpallet will attempt to assign. core_count: CoreIndex, }, /// The act of claiming revenue has begun. @@ -496,7 +496,7 @@ pub mod pallet { AutoRenewalLimitReached, } - #[pallet::error] + #[pezpallet::error] #[derive(PartialEq)] pub enum Error { /// The given region identity is not known. @@ -513,7 +513,7 @@ pub mod pallet { VoidPivot, /// The pivot mask for the interlacing is complete (and therefore not a strict subset). CompletePivot, - /// The workplan of the pallet's state is invalid. This indicates a state corruption. + /// The workplan of the pezpallet's state is invalid. This indicates a state corruption. CorruptWorkplan, /// There is no sale happening currently. NoSales, @@ -528,7 +528,7 @@ pub mod pallet { WrongTime, /// Invalid attempt to renew. NotAllowed, - /// This pallet has not yet been initialized. + /// This pezpallet has not yet been initialized. Uninitialized, /// The purchase cannot happen yet as the sale period is yet to begin. TooEarly, @@ -580,33 +580,33 @@ pub mod pallet { } #[derive(pezframe_support::DefaultNoBound)] - #[pallet::genesis_config] + #[pezpallet::genesis_config] pub struct GenesisConfig { #[serde(skip)] pub _config: core::marker::PhantomData, } - #[pallet::genesis_build] + #[pezpallet::genesis_build] impl BuildGenesisConfig for GenesisConfig { fn build(&self) { - pezframe_system::Pallet::::inc_providers(&Pallet::::account_id()); + pezframe_system::Pezpallet::::inc_providers(&Pezpallet::::account_id()); } } - #[pallet::hooks] - impl Hooks> for Pallet { + #[pezpallet::hooks] + impl Hooks> for Pezpallet { fn on_initialize(_now: BlockNumberFor) -> Weight { Self::do_tick() } } - #[pallet::call(weight(::WeightInfo))] - impl Pallet { - /// Configure the pallet. + #[pezpallet::call(weight(::WeightInfo))] + impl Pezpallet { + /// Configure the pezpallet. /// /// - `origin`: Must be Root or pass `AdminOrigin`. - /// - `config`: The configuration for this pallet. - #[pallet::call_index(0)] + /// - `config`: The configuration for this pezpallet. + #[pezpallet::call_index(0)] pub fn configure( origin: OriginFor, config: ConfigRecordOf, @@ -623,7 +623,7 @@ pub mod pallet { /// /// - `origin`: Must be Root or pass `AdminOrigin`. /// - `workload`: The workload which should be permanently placed on a core. - #[pallet::call_index(1)] + #[pezpallet::call_index(1)] pub fn reserve(origin: OriginFor, workload: Schedule) -> DispatchResultWithPostInfo { T::AdminOrigin::ensure_origin_or_root(origin)?; Self::do_reserve(workload)?; @@ -637,7 +637,7 @@ pub mod pallet { /// core on which the reservation has been scheduled. However, it is possible that if /// other cores are reserved or unreserved in the same sale rotation that they won't /// correspond, so it's better to look up the core properly in the `Reservations` storage. - #[pallet::call_index(2)] + #[pezpallet::call_index(2)] pub fn unreserve(origin: OriginFor, item_index: u32) -> DispatchResultWithPostInfo { T::AdminOrigin::ensure_origin_or_root(origin)?; Self::do_unreserve(item_index)?; @@ -653,7 +653,7 @@ pub mod pallet { /// - `task`: The workload which should be placed on a core. /// - `until`: The timeslice now earlier than which `task` should be placed as a workload on /// a core. - #[pallet::call_index(3)] + #[pezpallet::call_index(3)] pub fn set_lease( origin: OriginFor, task: TaskId, @@ -673,8 +673,8 @@ pub mod pallet { /// /// This will call [`Self::request_core_count`] internally to set the correct core count on /// the relay chain. - #[pallet::call_index(4)] - #[pallet::weight(T::WeightInfo::start_sales( + #[pezpallet::call_index(4)] + #[pezpallet::weight(T::WeightInfo::start_sales( T::MaxLeasedCores::get() + T::MaxReservedCores::get() + *extra_cores as u32 ))] pub fn start_sales( @@ -692,7 +692,7 @@ pub mod pallet { /// - `origin`: Must be a Signed origin with at least enough funds to pay the current price /// of Bulk Coretime. /// - `price_limit`: An amount no more than which should be paid. - #[pallet::call_index(5)] + #[pezpallet::call_index(5)] pub fn purchase( origin: OriginFor, price_limit: BalanceOf, @@ -707,7 +707,7 @@ pub mod pallet { /// - `origin`: Must be a Signed origin with at least enough funds to pay the renewal price /// of the core. /// - `core`: The core which should be renewed. - #[pallet::call_index(6)] + #[pezpallet::call_index(6)] pub fn renew(origin: OriginFor, core: CoreIndex) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; Self::do_renew(who, core)?; @@ -719,7 +719,7 @@ pub mod pallet { /// - `origin`: Must be a Signed origin of the account which owns the Region `region_id`. /// - `region_id`: The Region whose ownership should change. /// - `new_owner`: The new owner for the Region. - #[pallet::call_index(7)] + #[pezpallet::call_index(7)] pub fn transfer( origin: OriginFor, region_id: RegionId, @@ -736,7 +736,7 @@ pub mod pallet { /// - `origin`: Must be a Signed origin of the account which owns the Region `region_id`. /// - `region_id`: The Region which should be partitioned into two non-overlapping Regions. /// - `pivot`: The offset in time into the Region at which to make the split. - #[pallet::call_index(8)] + #[pezpallet::call_index(8)] pub fn partition( origin: OriginFor, region_id: RegionId, @@ -755,7 +755,7 @@ pub mod pallet { /// regularity. /// - `pivot`: The interlace mask of one of the two new regions (the other is its partial /// complement). - #[pallet::call_index(9)] + #[pezpallet::call_index(9)] pub fn interlace( origin: OriginFor, region_id: RegionId, @@ -774,7 +774,7 @@ pub mod pallet { /// - `finality`: Indication of whether this assignment is final (in which case it may be /// eligible for renewal) or provisional (in which case it may be manipulated and/or /// reassigned at a later stage). - #[pallet::call_index(10)] + #[pezpallet::call_index(10)] pub fn assign( origin: OriginFor, region_id: RegionId, @@ -792,7 +792,7 @@ pub mod pallet { /// - `region_id`: The Region which should be assigned to the Pool. /// - `payee`: The account which is able to collect any revenue due for the usage of this /// Coretime. - #[pallet::call_index(11)] + #[pezpallet::call_index(11)] pub fn pool( origin: OriginFor, region_id: RegionId, @@ -812,8 +812,8 @@ pub mod pallet { /// must be greater than 0. This may affect the weight of the call but should be ideally /// made equivalent to the length of the Region `region_id`. If less, further dispatches /// will be required with the same `region_id` to claim revenue for the remainder. - #[pallet::call_index(12)] - #[pallet::weight(T::WeightInfo::claim_revenue(*max_timeslices))] + #[pezpallet::call_index(12)] + #[pezpallet::weight(T::WeightInfo::claim_revenue(*max_timeslices))] pub fn claim_revenue( origin: OriginFor, region_id: RegionId, @@ -830,7 +830,7 @@ pub mod pallet { /// - `amount`: The amount of credit to purchase. /// - `beneficiary`: The account on the Relay-chain which controls the credit (generally /// this will be the collator's hot wallet). - #[pallet::call_index(13)] + #[pezpallet::call_index(13)] pub fn purchase_credit( origin: OriginFor, amount: BalanceOf, @@ -845,7 +845,7 @@ pub mod pallet { /// /// - `origin`: Can be any kind of origin. /// - `region_id`: The Region which has expired. - #[pallet::call_index(14)] + #[pezpallet::call_index(14)] pub fn drop_region( _origin: OriginFor, region_id: RegionId, @@ -858,7 +858,7 @@ pub mod pallet { /// /// - `origin`: Can be any kind of origin. /// - `region_id`: The Region identifying the Pool Contribution which has expired. - #[pallet::call_index(15)] + #[pezpallet::call_index(15)] pub fn drop_contribution( _origin: OriginFor, region_id: RegionId, @@ -871,7 +871,7 @@ pub mod pallet { /// /// - `origin`: Can be any kind of origin. /// - `region_id`: The time of the Pool History record which has expired. - #[pallet::call_index(16)] + #[pezpallet::call_index(16)] pub fn drop_history(_origin: OriginFor, when: Timeslice) -> DispatchResultWithPostInfo { Self::do_drop_history(when)?; Ok(Pays::No.into()) @@ -882,7 +882,7 @@ pub mod pallet { /// - `origin`: Can be any kind of origin. /// - `core`: The core to which the expired renewal refers. /// - `when`: The timeslice to which the expired renewal refers. This must have passed. - #[pallet::call_index(17)] + #[pezpallet::call_index(17)] pub fn drop_renewal( _origin: OriginFor, core: CoreIndex, @@ -896,24 +896,24 @@ pub mod pallet { /// /// - `origin`: Must be Root or pass `AdminOrigin`. /// - `core_count`: The desired number of cores to be made available. - #[pallet::call_index(18)] - #[pallet::weight(T::WeightInfo::request_core_count((*core_count).into()))] + #[pezpallet::call_index(18)] + #[pezpallet::weight(T::WeightInfo::request_core_count((*core_count).into()))] pub fn request_core_count(origin: OriginFor, core_count: CoreIndex) -> DispatchResult { T::AdminOrigin::ensure_origin_or_root(origin)?; Self::do_request_core_count(core_count)?; Ok(()) } - #[pallet::call_index(19)] - #[pallet::weight(T::WeightInfo::notify_core_count())] + #[pezpallet::call_index(19)] + #[pezpallet::weight(T::WeightInfo::notify_core_count())] pub fn notify_core_count(origin: OriginFor, core_count: CoreIndex) -> DispatchResult { T::AdminOrigin::ensure_origin_or_root(origin)?; Self::do_notify_core_count(core_count)?; Ok(()) } - #[pallet::call_index(20)] - #[pallet::weight(T::WeightInfo::notify_revenue())] + #[pezpallet::call_index(20)] + #[pezpallet::weight(T::WeightInfo::notify_revenue())] pub fn notify_revenue( origin: OriginFor, revenue: OnDemandRevenueRecordOf, @@ -934,8 +934,8 @@ pub mod pallet { /// - `workload_end_hint`: should be used when enabling auto-renewal for a core that is not /// expiring in the upcoming bulk period (e.g., due to holding a lease) since it would be /// inefficient to look up when the core expires to schedule the next renewal. - #[pallet::call_index(21)] - #[pallet::weight(T::WeightInfo::enable_auto_renew())] + #[pezpallet::call_index(21)] + #[pezpallet::weight(T::WeightInfo::enable_auto_renew())] pub fn enable_auto_renew( origin: OriginFor, core: CoreIndex, @@ -960,8 +960,8 @@ pub mod pallet { /// - `origin`: Must be the sovereign account of the task. /// - `core`: The core for which we want to disable auto renewal. /// - `task`: The task for which we want to disable auto renewal. - #[pallet::call_index(22)] - #[pallet::weight(T::WeightInfo::disable_auto_renew())] + #[pezpallet::call_index(22)] + #[pezpallet::weight(T::WeightInfo::disable_auto_renew())] pub fn disable_auto_renew( origin: OriginFor, core: CoreIndex, @@ -991,7 +991,7 @@ pub mod pallet { /// This reserves the workload and then injects the workload into the Workplan for the next /// two sale periods. This overwrites any existing assignments for this core at the start of /// the next sale period. - #[pallet::call_index(23)] + #[pezpallet::call_index(23)] pub fn force_reserve( origin: OriginFor, workload: Schedule, @@ -1006,7 +1006,7 @@ pub mod pallet { /// /// - `origin`: Must be Root or pass `AdminOrigin`. /// - `task`: The task id of the lease which should be removed. - #[pallet::call_index(24)] + #[pezpallet::call_index(24)] pub fn remove_lease(origin: OriginFor, task: TaskId) -> DispatchResult { T::AdminOrigin::ensure_origin_or_root(origin)?; Self::do_remove_lease(task) @@ -1016,14 +1016,14 @@ pub mod pallet { /// /// - `origin`: Must be Root or pass `AdminOrigin`. /// - `region_id`: The Region to be removed from the workplan. - #[pallet::call_index(26)] + #[pezpallet::call_index(26)] pub fn remove_assignment(origin: OriginFor, region_id: RegionId) -> DispatchResult { T::AdminOrigin::ensure_origin_or_root(origin)?; Self::do_remove_assignment(region_id) } - #[pallet::call_index(99)] - #[pallet::weight(T::WeightInfo::swap_leases())] + #[pezpallet::call_index(99)] + #[pezpallet::weight(T::WeightInfo::swap_leases())] pub fn swap_leases(origin: OriginFor, id: TaskId, other: TaskId) -> DispatchResult { T::AdminOrigin::ensure_origin_or_root(origin)?; Self::do_swap_leases(id, other)?; diff --git a/bizinikiwi/pezframe/broker/src/migration.rs b/bizinikiwi/pezframe/broker/src/migration.rs index 047e9a37..9f19208c 100644 --- a/bizinikiwi/pezframe/broker/src/migration.rs +++ b/bizinikiwi/pezframe/broker/src/migration.rs @@ -86,7 +86,7 @@ mod v2 { #[storage_alias] pub type AllowedRenewals = StorageMap< - Pallet, + Pezpallet, Twox64Concat, PotentialRenewalId, PotentialRenewalRecordOf, @@ -135,14 +135,14 @@ mod v3 { pezpallet_prelude::{OptionQuery, RuntimeDebug, TypeInfo}, storage_alias, }; - use pezframe_system::Pallet as System; + use pezframe_system::Pezpallet as System; use pezsp_arithmetic::Perbill; pub struct MigrateToV3Impl(PhantomData); impl UncheckedOnRuntimeUpgrade for MigrateToV3Impl { fn on_runtime_upgrade() -> pezframe_support::weights::Weight { - let acc = Pallet::::account_id(); + let acc = Pezpallet::::account_id(); System::::inc_providers(&acc); // calculate and return migration weights T::DbWeight::get().writes(1) @@ -150,13 +150,13 @@ mod v3 { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, pezsp_runtime::TryRuntimeError> { - Ok(System::::providers(&Pallet::::account_id()).encode()) + Ok(System::::providers(&Pezpallet::::account_id()).encode()) } #[cfg(feature = "try-runtime")] fn post_upgrade(state: Vec) -> Result<(), pezsp_runtime::TryRuntimeError> { let old_providers = u32::decode(&mut &state[..]).expect("Known good"); - let new_providers = System::::providers(&Pallet::::account_id()) as u32; + let new_providers = System::::providers(&Pezpallet::::account_id()) as u32; ensure!(new_providers == old_providers + 1, "Providers count should increase by one"); Ok(()) @@ -164,7 +164,7 @@ mod v3 { } #[storage_alias] - pub type Configuration = StorageValue, ConfigRecordOf, OptionQuery>; + pub type Configuration = StorageValue, ConfigRecordOf, OptionQuery>; pub type ConfigRecordOf = ConfigRecord, RelayBlockNumberOf>; @@ -193,7 +193,7 @@ mod v3 { } #[storage_alias] - pub type SaleInfo = StorageValue, SaleInfoRecordOf, OptionQuery>; + pub type SaleInfo = StorageValue, SaleInfoRecordOf, OptionQuery>; pub type SaleInfoRecordOf = SaleInfoRecord, pezframe_system::pezpallet_prelude::BlockNumberFor>; @@ -402,12 +402,12 @@ pub mod v4 { } } -/// Migrate the pallet storage from `0` to `1`. +/// Migrate the pezpallet storage from `0` to `1`. pub type MigrateV0ToV1 = pezframe_support::migrations::VersionedMigration< 0, 1, v1::MigrateToV1Impl, - Pallet, + Pezpallet, ::DbWeight, >; @@ -415,7 +415,7 @@ pub type MigrateV1ToV2 = pezframe_support::migrations::VersionedMigration< 1, 2, v2::MigrateToV2Impl, - Pallet, + Pezpallet, ::DbWeight, >; @@ -423,7 +423,7 @@ pub type MigrateV2ToV3 = pezframe_support::migrations::VersionedMigration< 2, 3, v3::MigrateToV3Impl, - Pallet, + Pezpallet, ::DbWeight, >; @@ -431,6 +431,6 @@ pub type MigrateV3ToV4 = pezframe_support::migrations::Versi 3, 4, v4::MigrateToV4Impl, - Pallet, + Pezpallet, ::DbWeight, >; diff --git a/bizinikiwi/pezframe/broker/src/mock.rs b/bizinikiwi/pezframe/broker/src/mock.rs index f5498d05..eb3c3c7e 100644 --- a/bizinikiwi/pezframe/broker/src/mock.rs +++ b/bizinikiwi/pezframe/broker/src/mock.rs @@ -39,7 +39,7 @@ use pezsp_runtime::{ type Block = pezframe_system::mocking::MockBlock; -// Configure a mock runtime to test the pallet. +// Configure a mock runtime to test the pezpallet. pezframe_support::construct_runtime!( pub enum Test { diff --git a/bizinikiwi/pezframe/broker/src/nonfungible_impl.rs b/bizinikiwi/pezframe/broker/src/nonfungible_impl.rs index 48069435..78bca11e 100644 --- a/bizinikiwi/pezframe/broker/src/nonfungible_impl.rs +++ b/bizinikiwi/pezframe/broker/src/nonfungible_impl.rs @@ -22,7 +22,7 @@ use pezframe_support::{ traits::nonfungible::{Inspect, Mutate, Transfer}, }; -impl Inspect for Pallet { +impl Inspect for Pezpallet { type ItemId = u128; fn owner(item: &Self::ItemId) -> Option { @@ -46,7 +46,7 @@ impl Inspect for Pallet { } } -impl Transfer for Pallet { +impl Transfer for Pezpallet { fn transfer(item: &Self::ItemId, dest: &T::AccountId) -> DispatchResult { Self::do_transfer((*item).into(), None, dest.clone()).map_err(Into::into) } @@ -65,7 +65,7 @@ impl Transfer for Pallet { /// of burning, we set the asset's owner to `None`. In essence, 'burning' a region involves setting /// its owner to `None`, whereas 'minting' the region assigns its owner to an actual account. This /// way we never lose track of the associated record data. -impl Mutate for Pallet { +impl Mutate for Pezpallet { /// Deposit a region into an account. fn mint_into(item: &Self::ItemId, who: &T::AccountId) -> DispatchResult { let region_id: RegionId = (*item).into(); diff --git a/bizinikiwi/pezframe/broker/src/runtime_api.rs b/bizinikiwi/pezframe/broker/src/runtime_api.rs index fa6787c6..e3c61178 100644 --- a/bizinikiwi/pezframe/broker/src/runtime_api.rs +++ b/bizinikiwi/pezframe/broker/src/runtime_api.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Runtime API definition for the FRAME Broker pallet. +//! Runtime API definition for the FRAME Broker pezpallet. use codec::Codec; use pezsp_runtime::DispatchError; diff --git a/bizinikiwi/pezframe/broker/src/tick_impls.rs b/bizinikiwi/pezframe/broker/src/tick_impls.rs index 7b5be9c0..1cb29bc1 100644 --- a/bizinikiwi/pezframe/broker/src/tick_impls.rs +++ b/bizinikiwi/pezframe/broker/src/tick_impls.rs @@ -22,7 +22,7 @@ use pezsp_arithmetic::traits::{One, SaturatedConversion, Saturating, Zero}; use pezsp_runtime::traits::{BlockNumberProvider, ConvertBack, MaybeConvert}; use CompletionStatus::Complete; -impl Pallet { +impl Pezpallet { /// Attempt to tick things along. /// /// This may do several things: diff --git a/bizinikiwi/pezframe/broker/src/types.rs b/bizinikiwi/pezframe/broker/src/types.rs index f347ffc9..3f259724 100644 --- a/bizinikiwi/pezframe/broker/src/types.rs +++ b/bizinikiwi/pezframe/broker/src/types.rs @@ -312,7 +312,7 @@ pub struct OnDemandRevenueRecord { pub type OnDemandRevenueRecordOf = OnDemandRevenueRecord, RelayBalanceOf>; -/// Configuration of this pallet. +/// Configuration of this pezpallet. #[derive( Encode, Decode, diff --git a/bizinikiwi/pezframe/broker/src/utility_impls.rs b/bizinikiwi/pezframe/broker/src/utility_impls.rs index 77f6fc8a..b4be39f1 100644 --- a/bizinikiwi/pezframe/broker/src/utility_impls.rs +++ b/bizinikiwi/pezframe/broker/src/utility_impls.rs @@ -30,7 +30,7 @@ use pezsp_arithmetic::{ }; use pezsp_runtime::traits::{AccountIdConversion, BlockNumberProvider}; -impl Pallet { +impl Pezpallet { pub fn current_timeslice() -> Timeslice { let latest = RCBlockNumberProviderOf::::current_block_number(); let timeslice_period = T::TimeslicePeriod::get(); diff --git a/bizinikiwi/pezframe/broker/src/weights.rs b/bizinikiwi/pezframe/broker/src/weights.rs index 9bc9891f..25eeb472 100644 --- a/bizinikiwi/pezframe/broker/src/weights.rs +++ b/bizinikiwi/pezframe/broker/src/weights.rs @@ -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_broker +// --pezpallet=pezpallet_broker // --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2 // --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/broker/src/weights.rs // --wasm-execution=compiled diff --git a/bizinikiwi/pezframe/child-bounties/Cargo.toml b/bizinikiwi/pezframe/child-bounties/Cargo.toml index 5d7b6a45..0ac7837b 100644 --- a/bizinikiwi/pezframe/child-bounties/Cargo.toml +++ b/bizinikiwi/pezframe/child-bounties/Cargo.toml @@ -6,7 +6,7 @@ edition.workspace = true license = "Apache-2.0" homepage.workspace = true repository.workspace = true -description = "FRAME pallet to manage child bounties" +description = "FRAME pezpallet to manage child bounties" readme = "README.md" documentation = "https://docs.rs/pezpallet-child-bounties" diff --git a/bizinikiwi/pezframe/child-bounties/README.md b/bizinikiwi/pezframe/child-bounties/README.md index 5b0098d1..577da992 100644 --- a/bizinikiwi/pezframe/child-bounties/README.md +++ b/bizinikiwi/pezframe/child-bounties/README.md @@ -1,8 +1,8 @@ -# Child Bounties Pallet ( `pezpallet-child-bounties` ) +# Child Bounties Pezpallet ( `pezpallet-child-bounties` ) ## Child Bounty -> NOTE: This pallet is tightly coupled with `pezpallet-treasury` and `pezpallet-bounties`. +> NOTE: This pezpallet is tightly coupled with `pezpallet-treasury` and `pezpallet-bounties`. With child bounties, a large bounty proposal can be divided into smaller chunks, for parallel execution, and for efficient governance and tracking of spent funds. diff --git a/bizinikiwi/pezframe/child-bounties/src/benchmarking.rs b/bizinikiwi/pezframe/child-bounties/src/benchmarking.rs index a7d30d81..a95b02f2 100644 --- a/bizinikiwi/pezframe/child-bounties/src/benchmarking.rs +++ b/bizinikiwi/pezframe/child-bounties/src/benchmarking.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Child-bounties pallet benchmarking. +//! Child-bounties pezpallet benchmarking. #![cfg(feature = "runtime-benchmarks")] @@ -23,8 +23,8 @@ use alloc::vec; use pezframe_benchmarking::{v2::*, BenchmarkError}; use pezframe_support::ensure; use pezframe_system::RawOrigin; -use pezpallet_bounties::Pallet as Bounties; -use pezpallet_treasury::Pallet as Treasury; +use pezpallet_bounties::Pezpallet as Bounties; +use pezpallet_treasury::Pezpallet as Treasury; use pezsp_runtime::traits::BlockNumberProvider; use crate::*; @@ -120,7 +120,7 @@ fn activate_bounty( T::SpendOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; Bounties::::approve_bounty(approve_origin, child_bounty_setup.bounty_id)?; set_block_number::(T::SpendPeriod::get()); - Treasury::::on_initialize(pezframe_system::Pallet::::block_number()); + Treasury::::on_initialize(pezframe_system::Pezpallet::::block_number()); Bounties::::propose_curator( RawOrigin::Root.into(), child_bounty_setup.bounty_id, @@ -142,7 +142,7 @@ fn activate_child_bounty( let mut bounty_setup = activate_bounty::(user, description)?; let child_curator_lookup = T::Lookup::unlookup(bounty_setup.child_curator.clone()); - Pallet::::add_child_bounty( + Pezpallet::::add_child_bounty( RawOrigin::Signed(bounty_setup.curator.clone()).into(), bounty_setup.bounty_id, bounty_setup.child_bounty_value, @@ -151,7 +151,7 @@ fn activate_child_bounty( bounty_setup.child_bounty_id = ParentTotalChildBounties::::get(bounty_setup.bounty_id) - 1; - Pallet::::propose_curator( + Pezpallet::::propose_curator( RawOrigin::Signed(bounty_setup.curator.clone()).into(), bounty_setup.bounty_id, bounty_setup.child_bounty_id, @@ -159,7 +159,7 @@ fn activate_child_bounty( bounty_setup.child_bounty_fee, )?; - Pallet::::accept_curator( + Pezpallet::::accept_curator( RawOrigin::Signed(bounty_setup.child_curator.clone()).into(), bounty_setup.bounty_id, bounty_setup.child_bounty_id, @@ -175,7 +175,7 @@ fn setup_pot_account() { } fn assert_last_event(generic_event: ::RuntimeEvent) { - pezframe_system::Pallet::::assert_last_event(generic_event.into()); + pezframe_system::Pezpallet::::assert_last_event(generic_event.into()); } #[benchmarks] @@ -214,7 +214,7 @@ mod benchmarks { let bounty_setup = activate_bounty::(0, T::MaximumReasonLength::get())?; let child_curator_lookup = T::Lookup::unlookup(bounty_setup.child_curator.clone()); - Pallet::::add_child_bounty( + Pezpallet::::add_child_bounty( RawOrigin::Signed(bounty_setup.curator.clone()).into(), bounty_setup.bounty_id, bounty_setup.child_bounty_value, @@ -240,7 +240,7 @@ mod benchmarks { let mut bounty_setup = activate_bounty::(0, T::MaximumReasonLength::get())?; let child_curator_lookup = T::Lookup::unlookup(bounty_setup.child_curator.clone()); - Pallet::::add_child_bounty( + Pezpallet::::add_child_bounty( RawOrigin::Signed(bounty_setup.curator.clone()).into(), bounty_setup.bounty_id, bounty_setup.child_bounty_value, @@ -249,7 +249,7 @@ mod benchmarks { bounty_setup.child_bounty_id = ParentTotalChildBounties::::get(bounty_setup.bounty_id) - 1; - Pallet::::propose_curator( + Pezpallet::::propose_curator( RawOrigin::Signed(bounty_setup.curator.clone()).into(), bounty_setup.bounty_id, bounty_setup.child_bounty_id, @@ -273,14 +273,14 @@ mod benchmarks { fn unassign_curator() -> Result<(), BenchmarkError> { setup_pot_account::(); let bounty_setup = activate_child_bounty::(0, T::MaximumReasonLength::get())?; - Treasury::::on_initialize(pezframe_system::Pallet::::block_number()); + Treasury::::on_initialize(pezframe_system::Pezpallet::::block_number()); let bounty_update_period = T::BountyUpdatePeriod::get(); let inactivity_timeout = T::SpendPeriod::get().saturating_add(bounty_update_period); set_block_number::(inactivity_timeout.saturating_add(1u32.into())); // If `BountyUpdatePeriod` overflows the inactivity timeout the benchmark still // executes the slash - let origin: T::RuntimeOrigin = if Pallet::::treasury_block_number() <= inactivity_timeout + let origin: T::RuntimeOrigin = if Pezpallet::::treasury_block_number() <= inactivity_timeout { let child_curator = bounty_setup.child_curator; T::RejectOrigin::try_successful_origin() @@ -330,7 +330,7 @@ mod benchmarks { let beneficiary_account = account("beneficiary", 0, SEED); let beneficiary = T::Lookup::unlookup(beneficiary_account); - Pallet::::award_child_bounty( + Pezpallet::::award_child_bounty( RawOrigin::Signed(bounty_setup.child_curator.clone()).into(), bounty_setup.bounty_id, bounty_setup.child_bounty_id, @@ -366,7 +366,7 @@ mod benchmarks { setup_pot_account::(); let mut bounty_setup = activate_bounty::(0, T::MaximumReasonLength::get())?; - Pallet::::add_child_bounty( + Pezpallet::::add_child_bounty( RawOrigin::Signed(bounty_setup.curator.clone()).into(), bounty_setup.bounty_id, bounty_setup.child_bounty_value, @@ -394,7 +394,7 @@ mod benchmarks { fn close_child_bounty_active() -> Result<(), BenchmarkError> { setup_pot_account::(); let bounty_setup = activate_child_bounty::(0, T::MaximumReasonLength::get())?; - Treasury::::on_initialize(pezframe_system::Pallet::::block_number()); + Treasury::::on_initialize(pezframe_system::Pezpallet::::block_number()); #[extrinsic_call] close_child_bounty(RawOrigin::Root, bounty_setup.bounty_id, bounty_setup.child_bounty_id); @@ -411,7 +411,7 @@ mod benchmarks { } impl_benchmark_test_suite! { - Pallet, + Pezpallet, tests::new_test_ext(), tests::Test } diff --git a/bizinikiwi/pezframe/child-bounties/src/lib.rs b/bizinikiwi/pezframe/child-bounties/src/lib.rs index cebf1c7b..b5979894 100644 --- a/bizinikiwi/pezframe/child-bounties/src/lib.rs +++ b/bizinikiwi/pezframe/child-bounties/src/lib.rs @@ -15,11 +15,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! # Child Bounties Pallet ( `pezpallet-child-bounties` ) +//! # Child Bounties Pezpallet ( `pezpallet-child-bounties` ) //! //! ## Child Bounty //! -//! > NOTE: This pallet is tightly coupled with `pezpallet-treasury` and `pezpallet-bounties`. +//! > NOTE: This pezpallet is tightly coupled with `pezpallet-treasury` and `pezpallet-bounties`. //! //! With child bounties, a large bounty proposal can be divided into smaller chunks, //! for parallel execution, and for efficient governance and tracking of spent funds. @@ -44,11 +44,11 @@ //! - `close_child_bounty` - Cancel the child bounty for a specific treasury amount and close the //! bounty. -// Most of the business logic in this pallet has been +// Most of the business logic in this pezpallet has been // originally contributed by "https://github.com/shamb0", // as part of the PR - https://github.com/pezkuwichain/kurdistan-sdk/issues/74. // The code has been moved here and then refactored in order to -// extract child bounties as a separate pallet. +// extract child bounties as a separate pezpallet. #![cfg_attr(not(feature = "std"), no_std)] @@ -59,7 +59,7 @@ pub mod weights; extern crate alloc; -/// The log target for this pallet. +/// The log target for this pezpallet. const LOG_TARGET: &str = "runtime::child-bounties"; use alloc::vec::Vec; @@ -86,7 +86,7 @@ use pezpallet_bounties::BountyStatus; use scale_info::TypeInfo; pub use weights::WeightInfo; -pub use pallet::*; +pub use pezpallet::*; pub type BalanceOf = pezpallet_treasury::BalanceOf; pub type BountiesError = pezpallet_bounties::Error; @@ -137,39 +137,39 @@ pub enum ChildBountyStatus { }, } -#[pezframe_support::pallet] -pub mod pallet { +#[pezframe_support::pezpallet] +pub mod pezpallet { use super::*; /// The in-code storage version. const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); - #[pallet::pallet] - #[pallet::storage_version(STORAGE_VERSION)] - pub struct Pallet(_); + #[pezpallet::pezpallet] + #[pezpallet::storage_version(STORAGE_VERSION)] + pub struct Pezpallet(_); - #[pallet::config] + #[pezpallet::config] pub trait Config: pezframe_system::Config + pezpallet_treasury::Config + pezpallet_bounties::Config { /// Maximum number of child bounties that can be added to a parent bounty. - #[pallet::constant] + #[pezpallet::constant] type MaxActiveChildBountyCount: Get; /// Minimum value for a child-bounty. - #[pallet::constant] + #[pezpallet::constant] type ChildBountyValueMinimum: Get>; /// The overarching event type. #[allow(deprecated)] type RuntimeEvent: From> + IsType<::RuntimeEvent>; - /// Weight information for extrinsics in this pallet. + /// Weight information for extrinsics in this pezpallet. type WeightInfo: WeightInfo; } - #[pallet::error] + #[pezpallet::error] pub enum Error { /// The parent bounty is not in active state. ParentBountyNotActive, @@ -179,8 +179,8 @@ pub mod pallet { TooManyChildBounties, } - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] + #[pezpallet::event] + #[pezpallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { /// A child-bounty is added. Added { index: BountyIndex, child_index: BountyIndex }, @@ -199,22 +199,22 @@ pub mod pallet { /// DEPRECATED: Replaced with `ParentTotalChildBounties` storage item keeping dedicated counts /// for each parent bounty. Number of total child bounties. Will be removed in May 2025. - #[pallet::storage] + #[pezpallet::storage] pub type ChildBountyCount = StorageValue<_, BountyIndex, ValueQuery>; /// Number of active child bounties per parent bounty. /// Map of parent bounty index to number of child bounties. - #[pallet::storage] + #[pezpallet::storage] pub type ParentChildBounties = StorageMap<_, Twox64Concat, BountyIndex, u32, ValueQuery>; /// Number of total child bounties per parent bounty, including completed bounties. - #[pallet::storage] + #[pezpallet::storage] pub type ParentTotalChildBounties = StorageMap<_, Twox64Concat, BountyIndex, u32, ValueQuery>; /// Child bounties that have been added. - #[pallet::storage] + #[pezpallet::storage] pub type ChildBounties = StorageDoubleMap< _, Twox64Concat, @@ -227,7 +227,7 @@ pub mod pallet { /// The description of each child-bounty. Indexed by `(parent_id, child_id)`. /// /// This item replaces the `ChildBountyDescriptions` storage item from the V0 storage version. - #[pallet::storage] + #[pezpallet::storage] pub type ChildBountyDescriptionsV1 = StorageDoubleMap< _, Twox64Concat, @@ -241,18 +241,18 @@ pub mod pallet { /// /// The `V0` ids based on total child bounty count [`ChildBountyCount`]`. The `V1` version ids /// based on the child bounty count per parent bounty [`ParentTotalChildBounties`]. - /// The item intended solely for client convenience and not used in the pallet's core logic. - #[pallet::storage] + /// The item intended solely for client convenience and not used in the pezpallet's core logic. + #[pezpallet::storage] pub type V0ToV1ChildBountyIds = StorageMap<_, Twox64Concat, BountyIndex, (BountyIndex, BountyIndex)>; /// The cumulative child-bounty curator fee for each parent bounty. - #[pallet::storage] + #[pezpallet::storage] pub type ChildrenCuratorFees = StorageMap<_, Twox64Concat, BountyIndex, BalanceOf, ValueQuery>; - #[pallet::call] - impl Pallet { + #[pezpallet::call] + impl Pezpallet { /// Add a new child-bounty. /// /// The dispatch origin for this call must be the curator of parent @@ -272,12 +272,12 @@ pub mod pallet { /// - `parent_bounty_id`: Index of parent bounty for which child-bounty is being added. /// - `value`: Value for executing the proposal. /// - `description`: Text description for the child-bounty. - #[pallet::call_index(0)] - #[pallet::weight(::WeightInfo::add_child_bounty(description.len() as u32))] + #[pezpallet::call_index(0)] + #[pezpallet::weight(::WeightInfo::add_child_bounty(description.len() as u32))] pub fn add_child_bounty( origin: OriginFor, - #[pallet::compact] parent_bounty_id: BountyIndex, - #[pallet::compact] value: BalanceOf, + #[pezpallet::compact] parent_bounty_id: BountyIndex, + #[pezpallet::compact] value: BalanceOf, description: Vec, ) -> DispatchResult { let signer = ensure_signed(origin)?; @@ -297,7 +297,7 @@ pub mod pallet { // Read parent bounty account info. let parent_bounty_account = - pezpallet_bounties::Pallet::::bounty_account_id(parent_bounty_id); + pezpallet_bounties::Pezpallet::::bounty_account_id(parent_bounty_id); // Ensure parent bounty has enough balance after adding child-bounty. let bounty_balance = T::Currency::free_balance(&parent_bounty_account); @@ -351,14 +351,14 @@ pub mod pallet { /// - `child_bounty_id`: Index of child bounty. /// - `curator`: Address of child-bounty curator. /// - `fee`: payment fee to child-bounty curator for execution. - #[pallet::call_index(1)] - #[pallet::weight(::WeightInfo::propose_curator())] + #[pezpallet::call_index(1)] + #[pezpallet::weight(::WeightInfo::propose_curator())] pub fn propose_curator( origin: OriginFor, - #[pallet::compact] parent_bounty_id: BountyIndex, - #[pallet::compact] child_bounty_id: BountyIndex, + #[pezpallet::compact] parent_bounty_id: BountyIndex, + #[pezpallet::compact] child_bounty_id: BountyIndex, curator: AccountIdLookupOf, - #[pallet::compact] fee: BalanceOf, + #[pezpallet::compact] fee: BalanceOf, ) -> DispatchResult { let signer = ensure_signed(origin)?; let child_bounty_curator = T::Lookup::lookup(curator)?; @@ -421,12 +421,12 @@ pub mod pallet { /// /// - `parent_bounty_id`: Index of parent bounty. /// - `child_bounty_id`: Index of child bounty. - #[pallet::call_index(2)] - #[pallet::weight(::WeightInfo::accept_curator())] + #[pezpallet::call_index(2)] + #[pezpallet::weight(::WeightInfo::accept_curator())] pub fn accept_curator( origin: OriginFor, - #[pallet::compact] parent_bounty_id: BountyIndex, - #[pallet::compact] child_bounty_id: BountyIndex, + #[pezpallet::compact] parent_bounty_id: BountyIndex, + #[pezpallet::compact] child_bounty_id: BountyIndex, ) -> DispatchResult { let signer = ensure_signed(origin)?; @@ -498,12 +498,12 @@ pub mod pallet { /// /// - `parent_bounty_id`: Index of parent bounty. /// - `child_bounty_id`: Index of child bounty. - #[pallet::call_index(3)] - #[pallet::weight(::WeightInfo::unassign_curator())] + #[pezpallet::call_index(3)] + #[pezpallet::weight(::WeightInfo::unassign_curator())] pub fn unassign_curator( origin: OriginFor, - #[pallet::compact] parent_bounty_id: BountyIndex, - #[pallet::compact] child_bounty_id: BountyIndex, + #[pezpallet::compact] parent_bounty_id: BountyIndex, + #[pezpallet::compact] child_bounty_id: BountyIndex, ) -> DispatchResult { let maybe_sender = ensure_signed(origin.clone()) .map(Some) @@ -614,12 +614,12 @@ pub mod pallet { /// - `parent_bounty_id`: Index of parent bounty. /// - `child_bounty_id`: Index of child bounty. /// - `beneficiary`: Beneficiary account. - #[pallet::call_index(4)] - #[pallet::weight(::WeightInfo::award_child_bounty())] + #[pezpallet::call_index(4)] + #[pezpallet::weight(::WeightInfo::award_child_bounty())] pub fn award_child_bounty( origin: OriginFor, - #[pallet::compact] parent_bounty_id: BountyIndex, - #[pallet::compact] child_bounty_id: BountyIndex, + #[pezpallet::compact] parent_bounty_id: BountyIndex, + #[pezpallet::compact] child_bounty_id: BountyIndex, beneficiary: AccountIdLookupOf, ) -> DispatchResult { let signer = ensure_signed(origin)?; @@ -681,12 +681,12 @@ pub mod pallet { /// /// - `parent_bounty_id`: Index of parent bounty. /// - `child_bounty_id`: Index of child bounty. - #[pallet::call_index(5)] - #[pallet::weight(::WeightInfo::claim_child_bounty())] + #[pezpallet::call_index(5)] + #[pezpallet::weight(::WeightInfo::claim_child_bounty())] pub fn claim_child_bounty( origin: OriginFor, - #[pallet::compact] parent_bounty_id: BountyIndex, - #[pallet::compact] child_bounty_id: BountyIndex, + #[pezpallet::compact] parent_bounty_id: BountyIndex, + #[pezpallet::compact] child_bounty_id: BountyIndex, ) -> DispatchResult { ensure_signed(origin)?; @@ -792,13 +792,13 @@ pub mod pallet { /// /// - `parent_bounty_id`: Index of parent bounty. /// - `child_bounty_id`: Index of child bounty. - #[pallet::call_index(6)] - #[pallet::weight(::WeightInfo::close_child_bounty_added() + #[pezpallet::call_index(6)] + #[pezpallet::weight(::WeightInfo::close_child_bounty_added() .max(::WeightInfo::close_child_bounty_active()))] pub fn close_child_bounty( origin: OriginFor, - #[pallet::compact] parent_bounty_id: BountyIndex, - #[pallet::compact] child_bounty_id: BountyIndex, + #[pezpallet::compact] parent_bounty_id: BountyIndex, + #[pezpallet::compact] child_bounty_id: BountyIndex, ) -> DispatchResult { let maybe_sender = ensure_signed(origin.clone()) .map(Some) @@ -814,8 +814,8 @@ pub mod pallet { } } - #[pallet::hooks] - impl Hooks> for Pallet { + #[pezpallet::hooks] + impl Hooks> for Pezpallet { fn integrity_test() { let parent_bounty_id: BountyIndex = 1; let child_bounty_id: BountyIndex = 2; @@ -828,8 +828,8 @@ pub mod pallet { } } -impl Pallet { - /// Get the block number used in the treasury pallet. +impl Pezpallet { + /// Get the block number used in the treasury pezpallet. /// /// It may be configured to use the relay chain block number on a teyrchain. pub fn treasury_block_number() -> BlockNumberFor { @@ -846,8 +846,8 @@ impl Pallet { return Zero::zero(); } - // We just use the same logic from the parent bounties pallet. - pezpallet_bounties::Pallet::::calculate_curator_deposit(bounty_fee) + // We just use the same logic from the parent bounties pezpallet. + pezpallet_bounties::Pezpallet::::calculate_curator_deposit(bounty_fee) } /// The account ID of a child-bounty account. @@ -855,7 +855,7 @@ impl Pallet { parent_bounty_id: BountyIndex, child_bounty_id: BountyIndex, ) -> T::AccountId { - // This function is taken from the parent (bounties) pallet, but the + // This function is taken from the parent (bounties) pezpallet, but the // prefix is changed to have different AccountId when the index of // parent and child is same. T::PalletId::get().into_sub_account_truncating(("cb", parent_bounty_id, child_bounty_id)) @@ -933,7 +933,7 @@ impl Pallet { // Transfer fund from child-bounty to parent bounty. let parent_bounty_account = - pezpallet_bounties::Pallet::::bounty_account_id(parent_bounty_id); + pezpallet_bounties::Pezpallet::::bounty_account_id(parent_bounty_id); let child_bounty_account = Self::child_bounty_account_id(parent_bounty_id, child_bounty_id); let balance = T::Currency::free_balance(&child_bounty_account); @@ -960,13 +960,13 @@ impl Pallet { } } -/// Implement ChildBountyManager to connect with the bounties pallet. This is +/// Implement ChildBountyManager to connect with the bounties pezpallet. This is /// where we pass the active child bounties and child curator fees to the parent /// bounty. /// /// Function `children_curator_fees` not only returns the fee but also removes cumulative curator /// fees during call. -impl pezpallet_bounties::ChildBountyManager> for Pallet { +impl pezpallet_bounties::ChildBountyManager> for Pezpallet { /// Returns number of active child bounties for `bounty_id` fn child_bounties_count( bounty_id: pezpallet_bounties::BountyIndex, diff --git a/bizinikiwi/pezframe/child-bounties/src/migration.rs b/bizinikiwi/pezframe/child-bounties/src/migration.rs index 7dd123bd..2440883a 100644 --- a/bizinikiwi/pezframe/child-bounties/src/migration.rs +++ b/bizinikiwi/pezframe/child-bounties/src/migration.rs @@ -42,7 +42,7 @@ pub mod v1 { #[storage_alias] type ChildBountyDescriptions = StorageMap< - Pallet, + Pezpallet, Twox64Concat, BountyIndex, BoundedVec::MaximumReasonLength>, @@ -90,7 +90,7 @@ pub mod v1 { let old_child_bounty_account = Self::old_child_bounty_account_id(old_child_bounty_id); let new_child_bounty_account = - Pallet::::child_bounty_account_id(parent_bounty_id, new_child_bounty_id); + Pezpallet::::child_bounty_account_id(parent_bounty_id, new_child_bounty_id); let old_balance = T::Currency::free_balance(&old_child_bounty_account); log::info!( "Transferring {:?} funds from old child bounty account {:?} to new child bounty account {:?}", @@ -211,7 +211,7 @@ pub mod v1 { impl> MigrateToV1Impl { fn old_child_bounty_account_id(id: BountyIndex) -> T::AccountId { - // This function is taken from the parent (bounties) pallet, but the + // This function is taken from the parent (bounties) pezpallet, but the // prefix is changed to have different AccountId when the index of // parent and child is same. T::PalletId::get().into_sub_account_truncating(("cb", id)) @@ -219,11 +219,11 @@ pub mod v1 { } } -/// Migrate the pallet storage from `0` to `1`. +/// Migrate the pezpallet storage from `0` to `1`. pub type MigrateV0ToV1 = pezframe_support::migrations::VersionedMigration< 0, 1, v1::MigrateToV1Impl, - Pallet, + Pezpallet, ::DbWeight, >; diff --git a/bizinikiwi/pezframe/child-bounties/src/tests.rs b/bizinikiwi/pezframe/child-bounties/src/tests.rs index 75bac070..58d9956c 100644 --- a/bizinikiwi/pezframe/child-bounties/src/tests.rs +++ b/bizinikiwi/pezframe/child-bounties/src/tests.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Child-bounties pallet tests. +//! Child-bounties pezpallet tests. #![cfg(test)] @@ -94,7 +94,7 @@ parameter_types! { impl pezpallet_treasury::Config for Test { type PalletId = TreasuryPalletId; - type Currency = pezpallet_balances::Pallet; + type Currency = pezpallet_balances::Pezpallet; type RejectOrigin = pezframe_system::EnsureRoot; type RuntimeEvent = RuntimeEvent; type SpendPeriod = ConstU64<2>; diff --git a/bizinikiwi/pezframe/child-bounties/src/weights.rs b/bizinikiwi/pezframe/child-bounties/src/weights.rs index 9dad242d..9184b0ee 100644 --- a/bizinikiwi/pezframe/child-bounties/src/weights.rs +++ b/bizinikiwi/pezframe/child-bounties/src/weights.rs @@ -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_child_bounties +// --pezpallet=pezpallet_child_bounties // --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2 // --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/child-bounties/src/weights.rs // --wasm-execution=compiled diff --git a/bizinikiwi/pezframe/collective/README.md b/bizinikiwi/pezframe/collective/README.md index e860edbd..10753999 100644 --- a/bizinikiwi/pezframe/collective/README.md +++ b/bizinikiwi/pezframe/collective/README.md @@ -3,7 +3,7 @@ through dispatched calls from one of two specialized origins. The membership can be provided in one of two ways: either directly, using the Root-dispatchable function `set_members`, or indirectly, through implementing the `ChangeMembers`. -The pallet assumes that the amount of members stays at or below `MaxMembers` for its weight +The pezpallet assumes that the amount of members stays at or below `MaxMembers` for its weight calculations, but enforces this neither in `set_members` nor in `change_members_sorted`. A "prime" member may be set to help determine the default vote behavior based on chain diff --git a/bizinikiwi/pezframe/collective/src/benchmarking.rs b/bizinikiwi/pezframe/collective/src/benchmarking.rs index 39e083a1..4551e9dd 100644 --- a/bizinikiwi/pezframe/collective/src/benchmarking.rs +++ b/bizinikiwi/pezframe/collective/src/benchmarking.rs @@ -15,10 +15,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Staking pallet benchmarking. +//! Staking pezpallet benchmarking. use super::*; -use crate::Pallet as Collective; +use crate::Pezpallet as Collective; use core::mem::size_of; use pezsp_runtime::traits::Bounded; @@ -28,7 +28,7 @@ use pezframe_benchmarking::{ v2::*, }; use pezframe_system::{ - pezpallet_prelude::BlockNumberFor, Call as SystemCall, Pallet as System, RawOrigin as SystemOrigin, + pezpallet_prelude::BlockNumberFor, Call as SystemCall, Pezpallet as System, RawOrigin as SystemOrigin, }; const SEED: u32 = 0; @@ -36,11 +36,11 @@ const SEED: u32 = 0; const MAX_BYTES: u32 = 1_024; fn assert_last_event, I: 'static>(generic_event: >::RuntimeEvent) { - pezframe_system::Pallet::::assert_last_event(generic_event.into()); + pezframe_system::Pezpallet::::assert_last_event(generic_event.into()); } fn assert_has_event, I: 'static>(generic_event: >::RuntimeEvent) { - pezframe_system::Pallet::::assert_has_event(generic_event.into()); + pezframe_system::Pezpallet::::assert_has_event(generic_event.into()); } fn id_to_remark_data(id: u32, length: usize) -> Vec { diff --git a/bizinikiwi/pezframe/collective/src/lib.rs b/bizinikiwi/pezframe/collective/src/lib.rs index 3d484c39..e55aecde 100644 --- a/bizinikiwi/pezframe/collective/src/lib.rs +++ b/bizinikiwi/pezframe/collective/src/lib.rs @@ -20,7 +20,7 @@ //! //! The membership can be provided in one of two ways: either directly, using the Root-dispatchable //! function `set_members`, or indirectly, through implementing the `ChangeMembers`. -//! The pallet assumes that the amount of members stays at or below `MaxMembers` for its weight +//! The pezpallet assumes that the amount of members stays at or below `MaxMembers` for its weight //! calculations, but enforces this neither in `set_members` nor in `change_members_sorted`. //! //! A "prime" member may be set to help determine the default vote behavior based on chain @@ -76,7 +76,7 @@ mod benchmarking; pub mod migrations; pub mod weights; -pub use pallet::*; +pub use pezpallet::*; pub use weights::WeightInfo; const LOG_TARGET: &str = "runtime::collective"; @@ -320,8 +320,8 @@ pub mod deposit { } } -#[pezframe_support::pallet] -pub mod pallet { +#[pezframe_support::pezpallet] +pub mod pezpallet { use super::*; use pezframe_support::pezpallet_prelude::*; use pezframe_system::pezpallet_prelude::*; @@ -329,12 +329,12 @@ pub mod pallet { /// The in-code storage version. const STORAGE_VERSION: StorageVersion = StorageVersion::new(4); - #[pallet::pallet] - #[pallet::storage_version(STORAGE_VERSION)] - #[pallet::without_storage_info] - pub struct Pallet(PhantomData<(T, I)>); + #[pezpallet::pezpallet] + #[pezpallet::storage_version(STORAGE_VERSION)] + #[pezpallet::without_storage_info] + pub struct Pezpallet(PhantomData<(T, I)>); - #[pallet::config] + #[pezpallet::config] pub trait Config: pezframe_system::Config { /// The runtime origin type. type RuntimeOrigin: From>; @@ -358,24 +358,24 @@ pub mod pallet { /// Maximum number of proposals allowed to be active in parallel. type MaxProposals: Get; - /// The maximum number of members supported by the pallet. Used for weight estimation. + /// The maximum number of members 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 dependents keep to the limit without enforcing it. + /// + This pezpallet assumes that dependents keep to the limit without enforcing it. type MaxMembers: Get; /// Default vote strategy of this collective. type DefaultVote: DefaultVote; - /// Weight information for extrinsics in this pallet. + /// Weight information for extrinsics in this pezpallet. type WeightInfo: WeightInfo; /// Origin allowed to set collective members type SetMembersOrigin: EnsureOrigin<::RuntimeOrigin>; /// The maximum weight of a dispatch call that can be proposed and executed. - #[pallet::constant] + #[pezpallet::constant] type MaxProposalWeight: Get; /// Origin from which a proposal in any status may be disapproved without associated cost @@ -400,7 +400,7 @@ pub mod pallet { type Consideration: MaybeConsideration; } - #[pallet::genesis_config] + #[pezpallet::genesis_config] #[derive(pezframe_support::DefaultNoBound)] pub struct GenesisConfig, I: 'static = ()> { #[serde(skip)] @@ -408,7 +408,7 @@ pub mod pallet { pub members: Vec, } - #[pallet::genesis_build] + #[pezpallet::genesis_build] impl, I: 'static> BuildGenesisConfig for GenesisConfig { fn build(&self) { use alloc::collections::btree_set::BTreeSet; @@ -423,21 +423,21 @@ pub mod pallet { "Members length cannot exceed MaxMembers.", ); - Pallet::::initialize_members(&self.members) + Pezpallet::::initialize_members(&self.members) } } - /// Origin for the collective pallet. - #[pallet::origin] + /// Origin for the collective pezpallet. + #[pezpallet::origin] pub type Origin = RawOrigin<::AccountId, I>; /// The hashes of the active proposals. - #[pallet::storage] + #[pezpallet::storage] pub type Proposals, I: 'static = ()> = StorageValue<_, BoundedVec, ValueQuery>; /// Actual proposal for a given hash, if it's current. - #[pallet::storage] + #[pezpallet::storage] pub type ProposalOf, I: 'static = ()> = StorageMap<_, Identity, T::Hash, >::Proposal, OptionQuery>; @@ -445,30 +445,30 @@ pub mod pallet { /// /// Determined by [Config::Consideration] and may be not present for certain proposals (e.g. if /// the proposal count at the time of creation was below threshold N). - #[pallet::storage] + #[pezpallet::storage] pub type CostOf, I: 'static = ()> = StorageMap<_, Identity, T::Hash, (T::AccountId, T::Consideration), OptionQuery>; /// Votes on a given proposal, if it is ongoing. - #[pallet::storage] + #[pezpallet::storage] pub type Voting, I: 'static = ()> = StorageMap<_, Identity, T::Hash, Votes>, OptionQuery>; /// Proposals so far. - #[pallet::storage] + #[pezpallet::storage] pub type ProposalCount, I: 'static = ()> = StorageValue<_, u32, ValueQuery>; /// The current members of the collective. This is stored sorted (just by value). - #[pallet::storage] + #[pezpallet::storage] pub type Members, I: 'static = ()> = StorageValue<_, Vec, ValueQuery>; /// The prime member that helps determine the default vote behavior in case of abstentions. - #[pallet::storage] + #[pezpallet::storage] pub type Prime, I: 'static = ()> = StorageValue<_, T::AccountId, OptionQuery>; - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] + #[pezpallet::event] + #[pezpallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event, I: 'static = ()> { /// A motion (given hash) has been proposed (by given account) with a threshold (given /// `MemberCount`). @@ -505,7 +505,7 @@ pub mod pallet { ProposalCostReleased { proposal_hash: T::Hash, who: T::AccountId }, } - #[pallet::error] + #[pezpallet::error] pub enum Error { /// Account is not a member NotMember, @@ -533,16 +533,16 @@ pub mod pallet { ProposalActive, } - #[pallet::hooks] - impl, I: 'static> Hooks> for Pallet { + #[pezpallet::hooks] + impl, I: 'static> Hooks> for Pezpallet { #[cfg(feature = "try-runtime")] fn try_state(_n: BlockNumberFor) -> Result<(), TryRuntimeError> { Self::do_try_state() } } - /// 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 { /// Funds are held for submitting and storing a proposal. #[codec(index = 0)] @@ -550,8 +550,8 @@ pub mod pallet { } // Note that councillor operations are assigned to the operational class. - #[pallet::call] - impl, I: 'static> Pallet { + #[pezpallet::call] + impl, I: 'static> Pezpallet { /// Set the collective's membership. /// /// - `new_members`: The new member list. Be nice to the chain and provide it sorted. @@ -566,7 +566,7 @@ pub mod pallet { /// /// # WARNING: /// - /// The `pezpallet-collective` can also be managed by logic outside of the pallet through the + /// The `pezpallet-collective` can also be managed by logic outside of the pezpallet through the /// implementation of the trait [`ChangeMembers`]. /// Any call to `set_members` must be careful that the member set doesn't get out of sync /// with other logic managing the member set. @@ -576,8 +576,8 @@ pub mod pallet { /// - `M` old-members-count (code- and governance-bounded) /// - `N` new-members-count (code- and governance-bounded) /// - `P` proposals-count (code-bounded) - #[pallet::call_index(0)] - #[pallet::weight(( + #[pezpallet::call_index(0)] + #[pezpallet::weight(( T::WeightInfo::set_members( *old_count, // M new_members.len() as u32, // N @@ -635,8 +635,8 @@ pub mod pallet { /// - `B` is `proposal` size in bytes (length-fee-bounded) /// - `M` members-count (code-bounded) /// - `P` complexity of dispatching `proposal` - #[pallet::call_index(1)] - #[pallet::weight(( + #[pezpallet::call_index(1)] + #[pezpallet::weight(( T::WeightInfo::execute( *length_bound, // B T::MaxMembers::get(), // M @@ -646,7 +646,7 @@ pub mod pallet { pub fn execute( origin: OriginFor, proposal: Box<>::Proposal>, - #[pallet::compact] length_bound: u32, + #[pezpallet::compact] length_bound: u32, ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; let members = Members::::get(); @@ -686,8 +686,8 @@ pub mod pallet { /// - branching is influenced by `threshold` where: /// - `P1` is proposal execution complexity (`threshold < 2`) /// - `P2` is proposals-count (code-bounded) (`threshold >= 2`) - #[pallet::call_index(2)] - #[pallet::weight(( + #[pezpallet::call_index(2)] + #[pezpallet::weight(( if *threshold < 2 { T::WeightInfo::propose_execute( *length_bound, // B @@ -704,9 +704,9 @@ pub mod pallet { ))] pub fn propose( origin: OriginFor, - #[pallet::compact] threshold: MemberCount, + #[pezpallet::compact] threshold: MemberCount, proposal: Box<>::Proposal>, - #[pallet::compact] length_bound: u32, + #[pezpallet::compact] length_bound: u32, ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; let members = Members::::get(); @@ -746,12 +746,12 @@ pub mod pallet { /// fee. /// ## Complexity /// - `O(M)` where `M` is members-count (code- and governance-bounded) - #[pallet::call_index(3)] - #[pallet::weight((T::WeightInfo::vote(T::MaxMembers::get()), DispatchClass::Operational))] + #[pezpallet::call_index(3)] + #[pezpallet::weight((T::WeightInfo::vote(T::MaxMembers::get()), DispatchClass::Operational))] pub fn vote( origin: OriginFor, proposal: T::Hash, - #[pallet::compact] index: ProposalIndex, + #[pezpallet::compact] index: ProposalIndex, approve: bool, ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; @@ -780,8 +780,8 @@ pub mod pallet { /// /// ## Complexity /// O(P) where P is the number of max proposals - #[pallet::call_index(5)] - #[pallet::weight(T::WeightInfo::disapprove_proposal(T::MaxProposals::get()))] + #[pezpallet::call_index(5)] + #[pezpallet::weight(T::WeightInfo::disapprove_proposal(T::MaxProposals::get()))] pub fn disapprove_proposal( origin: OriginFor, proposal_hash: T::Hash, @@ -815,8 +815,8 @@ pub mod pallet { /// - `M` is members-count (code- and governance-bounded) /// - `P1` is the complexity of `proposal` preimage. /// - `P2` is proposal-count (code-bounded) - #[pallet::call_index(6)] - #[pallet::weight(( + #[pezpallet::call_index(6)] + #[pezpallet::weight(( { let b = *length_bound; let m = T::MaxMembers::get(); @@ -833,9 +833,9 @@ pub mod pallet { pub fn close( origin: OriginFor, 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 { ensure_signed(origin)?; @@ -849,8 +849,8 @@ pub mod pallet { /// - `proposal_hash`: The hash of the proposal that should be killed. /// /// Emits `Killed` and `ProposalCostBurned` if any cost was held for a given proposal. - #[pallet::call_index(7)] - #[pallet::weight(T::WeightInfo::kill(1, T::MaxProposals::get()))] + #[pezpallet::call_index(7)] + #[pezpallet::weight(T::WeightInfo::kill(1, T::MaxProposals::get()))] pub fn kill(origin: OriginFor, proposal_hash: T::Hash) -> DispatchResultWithPostInfo { T::KillOrigin::ensure_origin(origin)?; ensure!( @@ -880,8 +880,8 @@ pub mod pallet { /// - `proposal_hash`: The hash of the proposal. /// /// Emits `ProposalCostReleased` if any cost held for a given proposal. - #[pallet::call_index(8)] - #[pallet::weight(T::WeightInfo::release_proposal_cost())] + #[pezpallet::call_index(8)] + #[pezpallet::weight(T::WeightInfo::release_proposal_cost())] pub fn release_proposal_cost( origin: OriginFor, proposal_hash: T::Hash, @@ -911,7 +911,7 @@ fn get_result_weight(result: DispatchResultWithPostInfo) -> Option { } } -impl, I: 'static> Pallet { +impl, I: 'static> Pezpallet { /// Check whether `who` is a member of the collective. pub fn is_member(who: &T::AccountId) -> bool { // Note: The dispatchables *do not* use this to check membership so make sure @@ -978,7 +978,7 @@ impl, I: 'static> Pallet { >::mutate(|i| *i += 1); >::insert(proposal_hash, proposal); let votes = { - let end = pezframe_system::Pallet::::block_number() + T::MotionDuration::get(); + let end = pezframe_system::Pezpallet::::block_number() + T::MotionDuration::get(); Votes { index, threshold, ayes: vec![], nays: vec![], end } }; >::insert(proposal_hash, votes); @@ -1088,7 +1088,7 @@ impl, I: 'static> Pallet { } // Only allow actual closing of the proposal after the voting period has ended. - ensure!(pezframe_system::Pallet::::block_number() >= voting.end, Error::::TooEarly); + ensure!(pezframe_system::Pezpallet::::block_number() >= voting.end, Error::::TooEarly); let prime_vote = Prime::::get().map(|who| voting.ayes.iter().any(|a| a == &who)); @@ -1182,14 +1182,14 @@ impl, I: 'static> Pallet { (proposal_weight, proposal_count) } - /// Removes a proposal from the pallet, and deposit the `Disapproved` event. + /// Removes a proposal from the pezpallet, and deposit the `Disapproved` event. pub fn do_disapprove_proposal(proposal_hash: T::Hash) -> u32 { // disapproved Self::deposit_event(Event::Disapproved { proposal_hash }); Self::remove_proposal(proposal_hash) } - // Removes a proposal from the pallet, cleaning up votes and the vector of proposals. + // Removes a proposal from the pezpallet, cleaning up votes and the vector of proposals. fn remove_proposal(proposal_hash: T::Hash) -> u32 { // remove proposal and vote ProposalOf::::remove(&proposal_hash); @@ -1201,7 +1201,7 @@ impl, I: 'static> Pallet { num_proposals as u32 } - /// Ensure the correctness of the state of this pallet. + /// Ensure the correctness of the state of this pezpallet. /// /// The following expectation must always apply. /// @@ -1308,7 +1308,7 @@ impl, I: 'static> Pallet { } } -impl, I: 'static> ChangeMembers for Pallet { +impl, I: 'static> ChangeMembers for Pezpallet { /// Update the members of the collective. Votes are updated and the prime is reset. /// /// NOTE: Does not enforce the expected `MaxMembers` limit on the amount of members, but @@ -1365,7 +1365,7 @@ impl, I: 'static> ChangeMembers for Pallet { } } -impl, I: 'static> InitializeMembers for Pallet { +impl, I: 'static> InitializeMembers for Pezpallet { fn initialize_members(members: &[T::AccountId]) { if !members.is_empty() { assert!(>::get().is_empty(), "Members are already initialized!"); diff --git a/bizinikiwi/pezframe/collective/src/migrations/v4.rs b/bizinikiwi/pezframe/collective/src/migrations/v4.rs index e16a6c2c..5ca185cf 100644 --- a/bizinikiwi/pezframe/collective/src/migrations/v4.rs +++ b/bizinikiwi/pezframe/collective/src/migrations/v4.rs @@ -26,7 +26,7 @@ use pezframe_support::{ weights::Weight, }; -/// Migrate the entire storage of this pallet to a new prefix. +/// Migrate the entire storage of this pezpallet to a new prefix. /// /// This new prefix must be the same as the one set in construct_runtime. For safety, use /// `PalletInfo` to get it, as: @@ -44,7 +44,7 @@ pub fn migrate(_); + #[pezpallet::pezpallet] + pub struct Pezpallet(_); - #[pallet::config] + #[pezpallet::config] pub trait Config: pezframe_system::Config + Sized { #[allow(deprecated)] type RuntimeEvent: From> @@ -68,8 +68,8 @@ mod mock_democracy { type ExternalMajorityOrigin: EnsureOrigin; } - #[pallet::call] - impl Pallet { + #[pezpallet::call] + impl Pezpallet { pub fn external_propose_majority(origin: OriginFor) -> DispatchResult { T::ExternalMajorityOrigin::ensure_origin(origin)?; Self::deposit_event(Event::::ExternalProposed); @@ -77,8 +77,8 @@ mod mock_democracy { } } - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] + #[pezpallet::event] + #[pezpallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { ExternalProposed, } @@ -1306,7 +1306,7 @@ fn motions_approval_with_enough_votes_and_lower_voting_threshold_works() { })), record(RuntimeEvent::Collective(CollectiveEvent::Approved { proposal_hash: hash })), record(RuntimeEvent::Democracy( - mock_democracy::pallet::Event::::ExternalProposed + mock_democracy::pezpallet::Event::::ExternalProposed )), record(RuntimeEvent::Collective(CollectiveEvent::Executed { proposal_hash: hash, diff --git a/bizinikiwi/pezframe/collective/src/weights.rs b/bizinikiwi/pezframe/collective/src/weights.rs index c134f052..7cfb5439 100644 --- a/bizinikiwi/pezframe/collective/src/weights.rs +++ b/bizinikiwi/pezframe/collective/src/weights.rs @@ -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_collective +// --pezpallet=pezpallet_collective // --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2 // --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/collective/src/weights.rs // --wasm-execution=compiled diff --git a/bizinikiwi/pezframe/contracts/Cargo.toml b/bizinikiwi/pezframe/contracts/Cargo.toml index 1f476134..5418475f 100644 --- a/bizinikiwi/pezframe/contracts/Cargo.toml +++ b/bizinikiwi/pezframe/contracts/Cargo.toml @@ -7,7 +7,7 @@ build = "build.rs" license = "Apache-2.0" homepage.workspace = true repository.workspace = true -description = "FRAME pallet for WASM contracts" +description = "FRAME pezpallet for WASM contracts" readme = "README.md" include = ["CHANGELOG.md", "README.md", "benchmarks/**", "build.rs", "src/**/*"] documentation = "https://docs.rs/pezpallet-contracts" diff --git a/bizinikiwi/pezframe/contracts/README.md b/bizinikiwi/pezframe/contracts/README.md index d81e0286..acb9d7a6 100644 --- a/bizinikiwi/pezframe/contracts/README.md +++ b/bizinikiwi/pezframe/contracts/README.md @@ -2,10 +2,10 @@ The Contracts module provides functionality for the runtime to deploy and execute WebAssembly smart-contracts. -- [`Call`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_contracts/pallet/enum.Call.html) -- [`Config`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_contracts/pallet/trait.Config.html) -- [`Error`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_contracts/pallet/enum.Error.html) -- [`Event`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_contracts/pallet/enum.Event.html) +- [`Call`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_contracts/pezpallet/enum.Call.html) +- [`Config`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_contracts/pezpallet/trait.Config.html) +- [`Error`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_contracts/pezpallet/enum.Error.html) +- [`Event`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_contracts/pezpallet/enum.Event.html) ## Overview @@ -52,15 +52,15 @@ constraints: 1. No contract can ever be instantiated from an indeterministic code. The only way to execute the code is to use a delegate call from a deterministic contract. 2. The code that wants to use this feature needs to depend on `pezpallet-contracts` and use -[`bare_call()`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_contracts/pallet/struct.Pallet.html#method.bare_call) +[`bare_call()`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_contracts/pezpallet/struct.Pezpallet.html#method.bare_call) directly. This makes sure that by default `pezpallet-contracts` does not expose any indeterminism. #### How to use An indeterministic code can be deployed on-chain by passing `Determinism::Relaxed` to -[`upload_code()`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_contracts/pallet/struct.Pallet.html#method.upload_code). +[`upload_code()`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_contracts/pezpallet/struct.Pezpallet.html#method.upload_code). A deterministic contract can then delegate call into it if and only if it is ran by using -[`bare_call()`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_contracts/pallet/struct.Pallet.html#method.bare_call) +[`bare_call()`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_contracts/pezpallet/struct.Pezpallet.html#method.bare_call) and passing [`Determinism::Relaxed`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_contracts/enum.Determinism.html#variant.Relaxed) to it. **Never use this argument when the contract is called from an on-chain transaction.** @@ -145,7 +145,7 @@ cargo run --release -- --dev -lerror,runtime::contracts::strace=trace,runtime::c ## Unstable Interfaces -Driven by the desire to have an iterative approach in developing new contract interfaces this pallet contains the +Driven by the desire to have an iterative approach in developing new contract interfaces this pezpallet contains the concept of an unstable interface. Akin to the rust nightly compiler it allows us to add new interfaces but mark them as unstable so that contract languages can experiment with them and give feedback before we stabilize those. diff --git a/bizinikiwi/pezframe/contracts/fixtures/Cargo.toml b/bizinikiwi/pezframe/contracts/fixtures/Cargo.toml index 56622c7e..63e20588 100644 --- a/bizinikiwi/pezframe/contracts/fixtures/Cargo.toml +++ b/bizinikiwi/pezframe/contracts/fixtures/Cargo.toml @@ -5,7 +5,7 @@ version = "1.0.0" authors.workspace = true edition.workspace = true license.workspace = true -description = "Fixtures for testing contracts pallet." +description = "Fixtures for testing contracts pezpallet." documentation = "https://docs.rs/pezpallet-contracts-fixtures" repository = { workspace = true } homepage = { workspace = true } diff --git a/bizinikiwi/pezframe/contracts/mock-network/src/lib.rs b/bizinikiwi/pezframe/contracts/mock-network/src/lib.rs index b89c5c5c..6b209632 100644 --- a/bizinikiwi/pezframe/contracts/mock-network/src/lib.rs +++ b/bizinikiwi/pezframe/contracts/mock-network/src/lib.rs @@ -151,5 +151,5 @@ pub fn relay_ext() -> pezsp_io::TestExternalities { ext } -pub type TeyrchainPalletXcm = pezpallet_xcm::Pallet; -pub type TeyrchainBalances = pezpallet_balances::Pallet; +pub type TeyrchainPalletXcm = pezpallet_xcm::Pezpallet; +pub type TeyrchainBalances = pezpallet_balances::Pezpallet; diff --git a/bizinikiwi/pezframe/contracts/mock-network/src/mocks/msg_queue.rs b/bizinikiwi/pezframe/contracts/mock-network/src/mocks/msg_queue.rs index e9d083b1..5af391c5 100644 --- a/bizinikiwi/pezframe/contracts/mock-network/src/mocks/msg_queue.rs +++ b/bizinikiwi/pezframe/contracts/mock-network/src/mocks/msg_queue.rs @@ -27,33 +27,33 @@ use pezsp_runtime::traits::{Get, Hash}; use xcm::{latest::prelude::*, VersionedXcm}; -#[pezframe_support::pallet] -pub mod pallet { +#[pezframe_support::pezpallet] +pub mod pezpallet { use super::*; use pezframe_support::pezpallet_prelude::*; - #[pallet::config] + #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] type RuntimeEvent: From> + IsType<::RuntimeEvent>; type XcmExecutor: ExecuteXcm; } - #[pallet::call] - impl Pallet {} + #[pezpallet::call] + impl Pezpallet {} - #[pallet::pallet] - #[pallet::without_storage_info] - pub struct Pallet(_); + #[pezpallet::pezpallet] + #[pezpallet::without_storage_info] + pub struct Pezpallet(_); - #[pallet::storage] + #[pezpallet::storage] pub(super) type TeyrchainId = StorageValue<_, ParaId, ValueQuery>; - #[pallet::storage] + #[pezpallet::storage] /// A queue of received DMP messages pub(super) type ReceivedDmp = StorageValue<_, Vec>, ValueQuery>; - impl Get for Pallet { + impl Get for Pezpallet { fn get() -> ParaId { TeyrchainId::::get() } @@ -61,8 +61,8 @@ pub mod pallet { pub type MessageId = [u8; 32]; - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] + #[pezpallet::event] + #[pezpallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { /// Some XCM was executed OK. Success(Option), @@ -82,7 +82,7 @@ pub mod pallet { ExecutedDownward(MessageId, Outcome), } - impl Pallet { + impl Pezpallet { pub fn set_para_id(para_id: ParaId) { TeyrchainId::::put(para_id); } @@ -130,7 +130,7 @@ pub mod pallet { } } - impl XcmpMessageHandler for Pallet { + impl XcmpMessageHandler for Pezpallet { fn handle_xcmp_messages<'a, I: Iterator>( iter: I, max_weight: Weight, @@ -155,7 +155,7 @@ pub mod pallet { } } - impl DmpMessageHandler for Pallet { + impl DmpMessageHandler for Pezpallet { fn handle_dmp_messages( iter: impl Iterator)>, limit: Weight, diff --git a/bizinikiwi/pezframe/contracts/mock-network/src/mocks/relay_message_queue.rs b/bizinikiwi/pezframe/contracts/mock-network/src/mocks/relay_message_queue.rs index d0ad2d03..35a3f691 100644 --- a/bizinikiwi/pezframe/contracts/mock-network/src/mocks/relay_message_queue.rs +++ b/bizinikiwi/pezframe/contracts/mock-network/src/mocks/relay_message_queue.rs @@ -29,7 +29,7 @@ parameter_types! { pub const MessageQueueMaxStale: u32 = 16; } -/// Message processor to handle any messages that were enqueued into the `MessageQueue` pallet. +/// Message processor to handle any messages that were enqueued into the `MessageQueue` pezpallet. pub struct MessageProcessor; impl ProcessMessage for MessageProcessor { type Origin = AggregateMessageOrigin; diff --git a/bizinikiwi/pezframe/contracts/mock-network/src/teyrchain.rs b/bizinikiwi/pezframe/contracts/mock-network/src/teyrchain.rs index ad51b060..255d1ca6 100644 --- a/bizinikiwi/pezframe/contracts/mock-network/src/teyrchain.rs +++ b/bizinikiwi/pezframe/contracts/mock-network/src/teyrchain.rs @@ -18,7 +18,7 @@ mod contracts_config; use crate::{ - mocks::msg_queue::pallet as mock_msg_queue, + mocks::msg_queue::pezpallet as mock_msg_queue, primitives::{AccountId, AssetIdForAssets, Balance}, }; use core::marker::PhantomData; diff --git a/bizinikiwi/pezframe/contracts/mock-network/src/teyrchain/contracts_config.rs b/bizinikiwi/pezframe/contracts/mock-network/src/teyrchain/contracts_config.rs index 26f29897..6952d88b 100644 --- a/bizinikiwi/pezframe/contracts/mock-network/src/teyrchain/contracts_config.rs +++ b/bizinikiwi/pezframe/contracts/mock-network/src/teyrchain/contracts_config.rs @@ -29,5 +29,5 @@ impl pezpallet_contracts::Config for Runtime { type Currency = Balances; type Schedule = Schedule; type Time = super::Timestamp; - type Xcm = pezpallet_xcm::Pallet; + type Xcm = pezpallet_xcm::Pezpallet; } diff --git a/bizinikiwi/pezframe/contracts/src/benchmarking/mod.rs b/bizinikiwi/pezframe/contracts/src/benchmarking/mod.rs index f799002e..4db1ccd8 100644 --- a/bizinikiwi/pezframe/contracts/src/benchmarking/mod.rs +++ b/bizinikiwi/pezframe/contracts/src/benchmarking/mod.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Benchmarks for the contracts pallet +//! Benchmarks for the contracts pezpallet #![cfg(feature = "runtime-benchmarks")] mod call_builder; @@ -33,7 +33,7 @@ use crate::{ }, storage::WriteOutcome, wasm::BenchEnv, - Pallet as Contracts, *, + Pezpallet as Contracts, *, }; use alloc::{vec, vec::Vec}; use codec::{Encode, MaxEncodedLen}; @@ -101,7 +101,7 @@ where module: WasmModule, data: Vec, ) -> Result, &'static str> { - let value = Pallet::::min_balance(); + let value = Pezpallet::::min_balance(); T::Currency::set_balance(&caller, caller_funding::()); let salt = vec![0xff]; let addr = Contracts::::contract_address(&caller, &module.hash, &data, &salt); @@ -223,8 +223,8 @@ fn caller_funding() -> BalanceOf { where as codec::HasCompact>::Type: Clone + Eq + PartialEq + core::fmt::Debug + scale_info::TypeInfo + codec::Encode, T: Config + pezpallet_balances::Config, - BalanceOf: From< as Currency>::Balance>, - as Currency>::Balance: From>, + BalanceOf: From< as Currency>::Balance>, + as Currency>::Balance: From>, )] mod benchmarks { use super::*; @@ -272,11 +272,11 @@ mod benchmarks { let contract = >::with_caller(whitelisted_caller(), WasmModule::dummy(), vec![])?; - v10::store_old_contract_info::>( + v10::store_old_contract_info::>( contract.account_id.clone(), contract.info()?, ); - let mut m = v10::Migration::>::default(); + let mut m = v10::Migration::>::default(); #[block] { @@ -304,11 +304,11 @@ mod benchmarks { // and repay deposits). #[benchmark(pov_mode = Measured)] fn v12_migration_step(c: Linear<0, { T::MaxCodeLen::get() }>) { - v12::store_old_dummy_code::>( + v12::store_old_dummy_code::>( c as usize, account::("account", 0, 0), ); - let mut m = v12::Migration::>::default(); + let mut m = v12::Migration::>::default(); #[block] { @@ -338,8 +338,8 @@ mod benchmarks { fn v14_migration_step() { let account = account::("account", 0, 0); T::Currency::set_balance(&account, caller_funding::()); - v14::store_dummy_code::>(account); - let mut m = v14::Migration::>::default(); + v14::store_dummy_code::>(account); + let mut m = v14::Migration::>::default(); #[block] { @@ -378,7 +378,7 @@ mod benchmarks { { m.step(&mut WeightMeter::new()); } - let ed = Pallet::::min_balance(); + let ed = Pezpallet::::min_balance(); let info = v16::ContractInfoOf::::get(&contract.account_id).unwrap(); assert_eq!(info.storage_base_deposit, base_deposit - ed); Ok(()) @@ -388,25 +388,25 @@ mod benchmarks { #[benchmark(pov_mode = Measured)] fn migration_noop() { let version = LATEST_MIGRATION_VERSION; - StorageVersion::new(version).put::>(); + StorageVersion::new(version).put::>(); #[block] { Migration::::migrate(&mut WeightMeter::new()); } - assert_eq!(StorageVersion::get::>(), version); + assert_eq!(StorageVersion::get::>(), version); } // This benchmarks the weight of dispatching migrate to execute 1 `NoopMigration` #[benchmark(pov_mode = Measured)] fn migrate() { let latest_version = LATEST_MIGRATION_VERSION; - StorageVersion::new(latest_version - 2).put::>(); + StorageVersion::new(latest_version - 2).put::>(); as pezframe_support::traits::OnRuntimeUpgrade>::on_runtime_upgrade(); #[extrinsic_call] _(RawOrigin::Signed(whitelisted_caller()), Weight::MAX); - assert_eq!(StorageVersion::get::>(), latest_version - 1); + assert_eq!(StorageVersion::get::>(), latest_version - 1); } // This benchmarks the weight of running on_runtime_upgrade when there are no migration in @@ -414,7 +414,7 @@ mod benchmarks { #[benchmark(pov_mode = Measured)] fn on_runtime_upgrade_noop() { let latest_version = LATEST_MIGRATION_VERSION; - StorageVersion::new(latest_version).put::>(); + StorageVersion::new(latest_version).put::>(); #[block] { as pezframe_support::traits::OnRuntimeUpgrade>::on_runtime_upgrade(); @@ -427,7 +427,7 @@ mod benchmarks { #[benchmark(pov_mode = Measured)] fn on_runtime_upgrade_in_progress() { let latest_version = LATEST_MIGRATION_VERSION; - StorageVersion::new(latest_version - 2).put::>(); + StorageVersion::new(latest_version - 2).put::>(); let v = vec![42u8].try_into().ok(); MigrationInProgress::::set(v.clone()); #[block] @@ -443,7 +443,7 @@ mod benchmarks { #[benchmark(pov_mode = Measured)] fn on_runtime_upgrade() { let latest_version = LATEST_MIGRATION_VERSION; - StorageVersion::new(latest_version - 2).put::>(); + StorageVersion::new(latest_version - 2).put::>(); #[block] { as pezframe_support::traits::OnRuntimeUpgrade>::on_runtime_upgrade(); @@ -466,7 +466,7 @@ mod benchmarks { WasmModule::sized(c, Location::Deploy, false), vec![], )?; - let value = Pallet::::min_balance(); + let value = Pezpallet::::min_balance(); let callee = instance.addr; #[extrinsic_call] @@ -486,7 +486,7 @@ mod benchmarks { ) { let input = vec![42u8; i as usize]; let salt = vec![42u8; s as usize]; - let value = Pallet::::min_balance(); + let value = Pezpallet::::min_balance(); let caller = whitelisted_caller(); T::Currency::set_balance(&caller, caller_funding::()); let WasmModule { code, hash, .. } = WasmModule::::sized(c, Location::Call, false); @@ -502,10 +502,10 @@ mod benchmarks { T::Currency::balance_on_hold(&HoldReason::CodeUploadDepositReserve.into(), &caller); assert_eq!( T::Currency::balance(&caller), - caller_funding::() - value - deposit - code_deposit - Pallet::::min_balance(), + caller_funding::() - value - deposit - code_deposit - Pezpallet::::min_balance(), ); // contract has the full value - assert_eq!(T::Currency::balance(&addr), value + Pallet::::min_balance()); + assert_eq!(T::Currency::balance(&addr), value + Pezpallet::::min_balance()); } // `i`: Size of the input in bytes. @@ -517,7 +517,7 @@ mod benchmarks { ) -> Result<(), BenchmarkError> { let input = vec![42u8; i as usize]; let salt = vec![42u8; s as usize]; - let value = Pallet::::min_balance(); + let value = Pezpallet::::min_balance(); let caller = whitelisted_caller(); T::Currency::set_balance(&caller, caller_funding::()); let WasmModule { code, hash, .. } = WasmModule::::dummy(); @@ -532,10 +532,10 @@ mod benchmarks { // value was removed from the caller assert_eq!( T::Currency::balance(&caller), - caller_funding::() - value - deposit - Pallet::::min_balance(), + caller_funding::() - value - deposit - Pezpallet::::min_balance(), ); // contract has the full value - assert_eq!(T::Currency::balance(&addr), value + Pallet::::min_balance()); + assert_eq!(T::Currency::balance(&addr), value + Pezpallet::::min_balance()); Ok(()) } @@ -552,7 +552,7 @@ mod benchmarks { let data = vec![42u8; 1024]; let instance = Contract::::with_caller(whitelisted_caller(), WasmModule::dummy(), vec![])?; - let value = Pallet::::min_balance(); + let value = Pezpallet::::min_balance(); let origin = RawOrigin::Signed(instance.caller.clone()); let callee = instance.addr.clone(); let before = T::Currency::balance(&instance.account_id); @@ -565,7 +565,7 @@ mod benchmarks { // value and value transferred via call should be removed from the caller assert_eq!( T::Currency::balance(&instance.caller), - caller_funding::() - instance.value - value - deposit - Pallet::::min_balance(), + caller_funding::() - instance.value - value - deposit - Pezpallet::::min_balance(), ); // contract should have received the value assert_eq!(T::Currency::balance(&instance.account_id), before + value); @@ -1587,7 +1587,7 @@ mod benchmarks { #[benchmark(pov_mode = Measured)] fn seal_transfer() { let account = account::("receiver", 0, 0); - let value = Pallet::::min_balance(); + let value = Pezpallet::::min_balance(); assert!(value > 0u32.into()); let mut setup = CallSetup::::default(); @@ -1716,7 +1716,7 @@ mod benchmarks { let mut setup = CallSetup::::default(); setup.set_origin(Origin::from_account_id(setup.contract().account_id.clone())); - setup.set_balance(value + (Pallet::::min_balance() * 2u32.into())); + setup.set_balance(value + (Pezpallet::::min_balance() * 2u32.into())); let account_id = &setup.contract().account_id.clone(); let (mut ext, _) = setup.ext(); @@ -1761,7 +1761,7 @@ mod benchmarks { assert_ok!(result); assert!(ContractInfoOf::::get(&addr).is_some()); - assert_eq!(T::Currency::balance(&addr), Pallet::::min_balance() + value); + assert_eq!(T::Currency::balance(&addr), Pezpallet::::min_balance() + value); Ok(()) } diff --git a/bizinikiwi/pezframe/contracts/src/chain_extension.rs b/bizinikiwi/pezframe/contracts/src/chain_extension.rs index 6f93e900..79fc2e0a 100644 --- a/bizinikiwi/pezframe/contracts/src/chain_extension.rs +++ b/bizinikiwi/pezframe/contracts/src/chain_extension.rs @@ -18,14 +18,14 @@ //! A mechanism for runtime authors to augment the functionality of contracts. //! //! The runtime is able to call into any contract and retrieve the result using -//! [`bare_call`](crate::Pallet::bare_call). This already allows customization of runtime +//! [`bare_call`](crate::Pezpallet::bare_call). This already allows customization of runtime //! behaviour by user generated code (contracts). However, often it is more straightforward //! to allow the reverse behaviour: The contract calls into the runtime. We call the latter //! one a "chain extension" because it allows the chain to extend the set of functions that are //! callable by a contract. //! //! In order to create a chain extension the runtime author implements the [`ChainExtension`] -//! trait and declares it in this pallet's [configuration Trait](crate::Config). All types +//! trait and declares it in this pezpallet's [configuration Trait](crate::Config). All types //! required for this endeavour are defined or re-exported in this module. There is an //! implementation on `()` which can be used to signal that no chain extension is available. //! @@ -53,7 +53,7 @@ //! [`charge_weight`](Environment::charge_weight) function must be called **before** //! carrying out any action that causes the consumption of the chargeable weight. //! It cannot be overstated how delicate of a process the creation of a chain extension -//! is. Check whether using [`bare_call`](crate::Pallet::bare_call) suffices for the +//! is. Check whether using [`bare_call`](crate::Pezpallet::bare_call) suffices for the //! use case at hand. //! //! # Benchmarking @@ -90,7 +90,7 @@ pub type Result = core::result::Result; /// A trait used to extend the set of contract callable functions. /// /// In order to create a custom chain extension this trait must be implemented and supplied -/// to the pallet contracts configuration trait as the associated type of the same name. +/// to the pezpallet contracts configuration trait as the associated type of the same name. /// Consult the [module documentation](self) for a general explanation of chain extensions. /// /// # Lifetime diff --git a/bizinikiwi/pezframe/contracts/src/exec.rs b/bizinikiwi/pezframe/contracts/src/exec.rs index fd76c20c..6e60bc92 100644 --- a/bizinikiwi/pezframe/contracts/src/exec.rs +++ b/bizinikiwi/pezframe/contracts/src/exec.rs @@ -22,7 +22,7 @@ use crate::{ storage::{self, meter::Diff, WriteOutcome}, transient_storage::TransientStorage, BalanceOf, CodeHash, CodeInfo, CodeInfoOf, Config, ContractInfo, ContractInfoOf, - DebugBufferVec, Determinism, Error, Event, Nonce, Origin, Pallet as Contracts, Schedule, + DebugBufferVec, Determinism, Error, Event, Nonce, Origin, Pezpallet as Contracts, Schedule, LOG_TARGET, }; use alloc::vec::Vec; @@ -818,7 +818,7 @@ where gas_meter, storage_meter, timestamp: T::Time::now(), - block_number: >::block_number(), + block_number: >::block_number(), nonce, first_frame, frames: Default::default(), @@ -1727,7 +1727,7 @@ mod tests { use pezsp_runtime::{traits::Hash, DispatchError}; use std::{cell::RefCell, collections::hash_map::HashMap, rc::Rc}; - type System = pezframe_system::Pallet; + type System = pezframe_system::Pezpallet; type MockStack<'a> = Stack<'a, Test, MockExecutable>; diff --git a/bizinikiwi/pezframe/contracts/src/lib.rs b/bizinikiwi/pezframe/contracts/src/lib.rs index 2fca72f9..86561b53 100644 --- a/bizinikiwi/pezframe/contracts/src/lib.rs +++ b/bizinikiwi/pezframe/contracts/src/lib.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! # Contracts Pallet +//! # Contracts Pezpallet //! //! The Contracts module provides functionality for the runtime to deploy and execute WebAssembly //! smart-contracts. @@ -63,19 +63,19 @@ //! //! ### Dispatchable functions //! -//! * [`Pallet::instantiate_with_code`] - Deploys a new contract from the supplied Wasm binary, +//! * [`Pezpallet::instantiate_with_code`] - Deploys a new contract from the supplied Wasm binary, //! optionally transferring //! some balance. This instantiates a new smart contract account with the supplied code and //! calls its constructor to initialize the contract. -//! * [`Pallet::instantiate`] - The same as `instantiate_with_code` but instead of uploading new +//! * [`Pezpallet::instantiate`] - The same as `instantiate_with_code` but instead of uploading new //! code an existing `code_hash` is supplied. -//! * [`Pallet::call`] - Makes a call to an account, optionally transferring some balance. -//! * [`Pallet::upload_code`] - Uploads new code without instantiating a contract from it. -//! * [`Pallet::remove_code`] - Removes the stored code and refunds the deposit to its owner. Only +//! * [`Pezpallet::call`] - Makes a call to an account, optionally transferring some balance. +//! * [`Pezpallet::upload_code`] - Uploads new code without instantiating a contract from it. +//! * [`Pezpallet::remove_code`] - Removes the stored code and refunds the deposit to its owner. Only //! allowed to code owner. -//! * [`Pallet::set_code`] - Changes the code of an existing contract. Only allowed to `Root` +//! * [`Pezpallet::set_code`] - Changes the code of an existing contract. Only allowed to `Root` //! origin. -//! * [`Pallet::migrate`] - Runs migration steps of current multi-block migration in priority, +//! * [`Pezpallet::migrate`] - Runs migration steps of current multi-block migration in priority, //! before [`Hooks::on_idle`][pezframe_support::traits::Hooks::on_idle] activates. //! //! ## Usage @@ -132,7 +132,7 @@ use pezframe_support::{ use pezframe_system::{ ensure_signed, pezpallet_prelude::{BlockNumberFor, OriginFor}, - EventRecord, Pallet as System, + EventRecord, Pezpallet as System, }; use scale_info::TypeInfo; use smallvec::Array; @@ -146,7 +146,7 @@ pub use crate::{ debug::Tracing, exec::Frame, migration::{MigrateSequence, Migration, NoopMigration}, - pallet::*, + pezpallet::*, schedule::{InstructionWeights, Limits, Schedule}, wasm::Determinism, }; @@ -167,7 +167,7 @@ type EventRecordOf = /// The old weight type. /// -/// This is a copy of the [`pezframe_support::weights::OldWeight`] type since the contracts pallet +/// This is a copy of the [`pezframe_support::weights::OldWeight`] type since the contracts pezpallet /// needs to support it indefinitely. type OldWeight = u64; @@ -237,8 +237,8 @@ fn api_version_is_up_to_date() { ); } -#[pezframe_support::pallet] -pub mod pallet { +#[pezframe_support::pezpallet] +pub mod pezpallet { use super::*; use crate::debug::Debugger; use pezframe_support::pezpallet_prelude::*; @@ -248,11 +248,11 @@ pub mod pallet { /// The in-code storage version. pub(crate) const STORAGE_VERSION: StorageVersion = StorageVersion::new(16); - #[pallet::pallet] - #[pallet::storage_version(STORAGE_VERSION)] - pub struct Pallet(_); + #[pezpallet::pezpallet] + #[pezpallet::storage_version(STORAGE_VERSION)] + pub struct Pezpallet(_); - #[pallet::config(with_default)] + #[pezpallet::config(with_default)] pub trait Config: pezframe_system::Config { /// The time implementation used to supply timestamps to contracts through `seal_now`. type Time: Time; @@ -265,29 +265,29 @@ pub mod pallet { /// be instantiated from existing codes that use this deprecated functionality. It will /// be removed eventually. Hence for new `pezpallet-contracts` deployments it is okay /// to supply a dummy implementation for this type (because it is never used). - #[pallet::no_default_bounds] + #[pezpallet::no_default_bounds] type Randomness: Randomness>; /// The fungible in which fees are paid and contract balances are held. - #[pallet::no_default] + #[pezpallet::no_default] type Currency: Inspect + Mutate + MutateHold; /// The overarching event type. - #[pallet::no_default_bounds] + #[pezpallet::no_default_bounds] #[allow(deprecated)] type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The overarching call type. - #[pallet::no_default_bounds] + #[pezpallet::no_default_bounds] type RuntimeCall: Dispatchable + GetDispatchInfo + codec::Decode + IsType<::RuntimeCall>; /// Overarching hold reason. - #[pallet::no_default_bounds] + #[pezpallet::no_default_bounds] type RuntimeHoldReason: From; /// Filter that is applied to calls dispatched by contracts. @@ -311,13 +311,13 @@ pub mod pallet { /// be exploited to drive the runtime into a panic. /// /// This filter does not apply to XCM transact calls. To impose restrictions on XCM transact - /// calls, you must configure them separately within the XCM pallet itself. - #[pallet::no_default_bounds] + /// calls, you must configure them separately within the XCM pezpallet itself. + #[pezpallet::no_default_bounds] type CallFilter: Contains<::RuntimeCall>; /// Used to answer contracts' queries regarding the current weight price. This is **not** /// used to calculate the actual fee and is only for informational purposes. - #[pallet::no_default_bounds] + #[pezpallet::no_default_bounds] type WeightPrice: Convert>; /// Describes the weights of the dispatchables of this module and is also used to @@ -325,12 +325,12 @@ pub mod pallet { type WeightInfo: WeightInfo; /// Type that allows the runtime authors to add new host functions for a contract to call. - #[pallet::no_default_bounds] + #[pezpallet::no_default_bounds] type ChainExtension: chain_extension::ChainExtension + Default; /// Cost schedule and limits. - #[pallet::constant] - #[pallet::no_default] + #[pezpallet::constant] + #[pezpallet::no_default] type Schedule: Get>; /// The type of the call stack determines the maximum nesting depth of contract calls. @@ -341,7 +341,7 @@ pub mod pallet { /// /// This setting along with [`MaxCodeLen`](#associatedtype.MaxCodeLen) directly affects /// memory usage of your runtime. - #[pallet::no_default] + #[pezpallet::no_default] type CallStack: Array>; /// The amount of balance a caller has to pay for each byte of storage. @@ -349,13 +349,13 @@ pub mod pallet { /// # Note /// /// Changing this value for an existing chain might need a storage migration. - #[pallet::constant] - #[pallet::no_default_bounds] + #[pezpallet::constant] + #[pezpallet::no_default_bounds] type DepositPerByte: Get>; /// Fallback value to limit the storage deposit if it's not being set by the caller. - #[pallet::constant] - #[pallet::no_default_bounds] + #[pezpallet::constant] + #[pezpallet::no_default_bounds] type DefaultDepositLimit: Get>; /// The amount of balance a caller has to pay for each storage item. @@ -363,19 +363,19 @@ pub mod pallet { /// # Note /// /// Changing this value for an existing chain might need a storage migration. - #[pallet::constant] - #[pallet::no_default_bounds] + #[pezpallet::constant] + #[pezpallet::no_default_bounds] type DepositPerItem: Get>; /// The percentage of the storage deposit that should be held for using a code hash. /// Instantiating a contract, or calling [`chain_extension::Ext::lock_delegate_dependency`] /// protects the code from being removed. In order to prevent abuse these actions are /// protected with a percentage of the code deposit. - #[pallet::constant] + #[pezpallet::constant] type CodeHashLockupDepositPercent: Get; /// The address generator used to generate the addresses of contracts. - #[pallet::no_default_bounds] + #[pezpallet::no_default_bounds] type AddressGenerator: AddressGenerator; /// The maximum length of a contract code in bytes. @@ -383,21 +383,21 @@ pub mod pallet { /// The value should be chosen carefully taking into the account the overall memory limit /// your runtime has, as well as the [maximum allowed callstack /// depth](#associatedtype.CallStack). Look into the `integrity_test()` for some insights. - #[pallet::constant] + #[pezpallet::constant] type MaxCodeLen: Get; /// The maximum allowable length in bytes for storage keys. - #[pallet::constant] + #[pezpallet::constant] type MaxStorageKeyLen: Get; /// The maximum size of the transient storage in bytes. /// This includes keys, values, and previous entries used for storage rollback. - #[pallet::constant] + #[pezpallet::constant] type MaxTransientStorageSize: Get; /// The maximum number of delegate_dependencies that a contract can lock with /// [`chain_extension::Ext::lock_delegate_dependency`]. - #[pallet::constant] + #[pezpallet::constant] type MaxDelegateDependencies: Get; /// Make contract callable functions marked as `#[unstable]` available. @@ -409,18 +409,18 @@ pub mod pallet { /// # Warning /// /// Do **not** set to `true` on productions chains. - #[pallet::constant] + #[pezpallet::constant] type UnsafeUnstableInterface: Get; /// The maximum length of the debug buffer in bytes. - #[pallet::constant] + #[pezpallet::constant] type MaxDebugBufferLen: Get; /// Origin allowed to upload code. /// /// By default, it is safe to set this to `EnsureSigned`, allowing anyone to upload contract /// code. - #[pallet::no_default_bounds] + #[pezpallet::no_default_bounds] type UploadOrigin: EnsureOrigin; /// Origin allowed to instantiate code. @@ -433,7 +433,7 @@ pub mod pallet { /// /// By default, it is safe to set this to `EnsureSigned`, allowing anyone to instantiate /// contract code. - #[pallet::no_default_bounds] + #[pezpallet::no_default_bounds] type InstantiateOrigin: EnsureOrigin; /// The sequence of migration steps that will be applied during a migration. @@ -459,27 +459,27 @@ pub mod pallet { /// For most production chains, it's recommended to use the `()` implementation of this /// trait. This implementation offers additional logging when the log target /// "runtime::contracts" is set to trace. - #[pallet::no_default_bounds] + #[pezpallet::no_default_bounds] type Debug: Debugger; /// Type that bundles together all the runtime configurable interface types. /// /// This is not a real config. We just mention the type here as constant so that /// its type appears in the metadata. Only valid value is `()`. - #[pallet::constant] - #[pallet::no_default_bounds] + #[pezpallet::constant] + #[pezpallet::no_default_bounds] type Environment: Get>; /// The version of the HostFn APIs that are available in the runtime. /// /// Only valid value is `()`. - #[pallet::constant] - #[pallet::no_default_bounds] + #[pezpallet::constant] + #[pezpallet::no_default_bounds] type ApiVersion: Get; /// A type that exposes XCM APIs, allowing contracts to interact with other teyrchains, and /// execute XCM programs. - #[pallet::no_default_bounds] + #[pezpallet::no_default_bounds] type Xcm: xcm_builder::Controller< OriginFor, ::RuntimeCall, @@ -487,7 +487,7 @@ pub mod pallet { >; } - /// Container for different types that implement [`DefaultConfig`]` of this pallet. + /// Container for different types that implement [`DefaultConfig`]` of this pezpallet. pub mod config_preludes { use super::*; use pezframe_support::{ @@ -514,7 +514,7 @@ pub mod pallet { pub const MaxDelegateDependencies: u32 = 32; } - /// A type providing default configurations for this pallet in testing environment. + /// A type providing default configurations for this pezpallet in testing environment. pub struct TestDefaultConfig; impl Randomness for TestDefaultConfig { @@ -577,8 +577,8 @@ pub mod pallet { } } - #[pallet::hooks] - impl Hooks> for Pallet { + #[pezpallet::hooks] + impl Hooks> for Pezpallet { fn on_idle(_block: BlockNumberFor, limit: Weight) -> Weight { use migration::MigrateResult::*; let mut meter = WeightMeter::with_limit(limit); @@ -624,7 +624,7 @@ pub mod pallet { // encoded one. This is because even a single-byte wasm instruction has 16-byte size in // wasmi. This gives us `MaxCodeLen*16` safety margin. // - // Next, the pallet keeps the Wasm blob for each + // Next, the pezpallet keeps the Wasm blob for each // contract, hence we add up `MaxCodeLen` to the safety margin. // // The inefficiencies of the freeing-bump allocator @@ -636,7 +636,7 @@ pub mod pallet { // memory should be available. Note that maximum allowed heap memory and stack size per // each contract (stack frame) should also be counted. // - // The pallet holds transient storage with a size up to `max_transient_storage_size`. + // The pezpallet holds transient storage with a size up to `max_transient_storage_size`. // // Finally, we allow 50% of the runtime memory to be utilized by the contracts call // stack, keeping the rest for other facilities, such as PoV, etc. @@ -734,21 +734,21 @@ pub mod pallet { } } - #[pallet::call] - impl Pallet + #[pezpallet::call] + impl Pezpallet where as HasCompact>::Type: Clone + Eq + PartialEq + Debug + TypeInfo + Encode, { /// Deprecated version if [`Self::call`] for use in an in-storage `Call`. - #[pallet::call_index(0)] - #[pallet::weight(T::WeightInfo::call().saturating_add(>::compat_weight_limit(*gas_limit)))] + #[pezpallet::call_index(0)] + #[pezpallet::weight(T::WeightInfo::call().saturating_add(>::compat_weight_limit(*gas_limit)))] #[allow(deprecated)] #[deprecated(note = "1D weight is used in this extrinsic, please migrate to `call`")] pub fn call_old_weight( origin: OriginFor, dest: AccountIdLookupOf, - #[pallet::compact] value: BalanceOf, - #[pallet::compact] gas_limit: OldWeight, + #[pezpallet::compact] value: BalanceOf, + #[pezpallet::compact] gas_limit: OldWeight, storage_deposit_limit: Option< as codec::HasCompact>::Type>, data: Vec, ) -> DispatchResultWithPostInfo { @@ -756,17 +756,17 @@ pub mod pallet { origin, dest, value, - >::compat_weight_limit(gas_limit), + >::compat_weight_limit(gas_limit), storage_deposit_limit, data, ) } /// Deprecated version if [`Self::instantiate_with_code`] for use in an in-storage `Call`. - #[pallet::call_index(1)] - #[pallet::weight( + #[pezpallet::call_index(1)] + #[pezpallet::weight( T::WeightInfo::instantiate_with_code(code.len() as u32, data.len() as u32, salt.len() as u32) - .saturating_add(>::compat_weight_limit(*gas_limit)) + .saturating_add(>::compat_weight_limit(*gas_limit)) )] #[allow(deprecated)] #[deprecated( @@ -774,8 +774,8 @@ pub mod pallet { )] pub fn instantiate_with_code_old_weight( origin: OriginFor, - #[pallet::compact] value: BalanceOf, - #[pallet::compact] gas_limit: OldWeight, + #[pezpallet::compact] value: BalanceOf, + #[pezpallet::compact] gas_limit: OldWeight, storage_deposit_limit: Option< as codec::HasCompact>::Type>, code: Vec, data: Vec, @@ -784,7 +784,7 @@ pub mod pallet { Self::instantiate_with_code( origin, value, - >::compat_weight_limit(gas_limit), + >::compat_weight_limit(gas_limit), storage_deposit_limit, code, data, @@ -793,16 +793,16 @@ pub mod pallet { } /// Deprecated version if [`Self::instantiate`] for use in an in-storage `Call`. - #[pallet::call_index(2)] - #[pallet::weight( - T::WeightInfo::instantiate(data.len() as u32, salt.len() as u32).saturating_add(>::compat_weight_limit(*gas_limit)) + #[pezpallet::call_index(2)] + #[pezpallet::weight( + T::WeightInfo::instantiate(data.len() as u32, salt.len() as u32).saturating_add(>::compat_weight_limit(*gas_limit)) )] #[allow(deprecated)] #[deprecated(note = "1D weight is used in this extrinsic, please migrate to `instantiate`")] pub fn instantiate_old_weight( origin: OriginFor, - #[pallet::compact] value: BalanceOf, - #[pallet::compact] gas_limit: OldWeight, + #[pezpallet::compact] value: BalanceOf, + #[pezpallet::compact] gas_limit: OldWeight, storage_deposit_limit: Option< as codec::HasCompact>::Type>, code_hash: CodeHash, data: Vec, @@ -811,7 +811,7 @@ pub mod pallet { Self::instantiate( origin, value, - >::compat_weight_limit(gas_limit), + >::compat_weight_limit(gas_limit), storage_deposit_limit, code_hash, data, @@ -843,8 +843,8 @@ pub mod pallet { /// Use [`Determinism::Relaxed`] exclusively for non-deterministic code. If the uploaded /// code is deterministic, specifying [`Determinism::Relaxed`] will be disregarded and /// result in higher gas costs. - #[pallet::call_index(3)] - #[pallet::weight( + #[pezpallet::call_index(3)] + #[pezpallet::weight( match determinism { Determinism::Enforced => T::WeightInfo::upload_code_determinism_enforced(code.len() as u32), Determinism::Relaxed => T::WeightInfo::upload_code_determinism_relaxed(code.len() as u32), @@ -866,8 +866,8 @@ pub mod pallet { /// /// A code can only be removed by its original uploader (its owner) and only if it is /// not used by any contract. - #[pallet::call_index(4)] - #[pallet::weight(T::WeightInfo::remove_code())] + #[pezpallet::call_index(4)] + #[pezpallet::weight(T::WeightInfo::remove_code())] pub fn remove_code( origin: OriginFor, code_hash: CodeHash, @@ -889,8 +889,8 @@ pub mod pallet { /// This does **not** change the address of the contract in question. This means /// that the contract address is no longer derived from its code hash after calling /// this dispatchable. - #[pallet::call_index(5)] - #[pallet::weight(T::WeightInfo::set_code())] + #[pezpallet::call_index(5)] + #[pezpallet::weight(T::WeightInfo::set_code())] pub fn set_code( origin: OriginFor, dest: AccountIdLookupOf, @@ -933,12 +933,12 @@ pub mod pallet { /// * If the account is a regular account, any value will be transferred. /// * If no account exists and the call value is not less than `existential_deposit`, /// a regular account will be created and any value will be transferred. - #[pallet::call_index(6)] - #[pallet::weight(T::WeightInfo::call().saturating_add(*gas_limit))] + #[pezpallet::call_index(6)] + #[pezpallet::weight(T::WeightInfo::call().saturating_add(*gas_limit))] pub fn call( origin: OriginFor, dest: AccountIdLookupOf, - #[pallet::compact] value: BalanceOf, + #[pezpallet::compact] value: BalanceOf, gas_limit: Weight, storage_deposit_limit: Option< as codec::HasCompact>::Type>, data: Vec, @@ -978,7 +978,7 @@ pub mod pallet { /// from the caller to pay for the storage consumed. /// * `code`: The contract code to deploy in raw bytes. /// * `data`: The input data to pass to the contract constructor. - /// * `salt`: Used for the address derivation. See [`Pallet::contract_address`]. + /// * `salt`: Used for the address derivation. See [`Pezpallet::contract_address`]. /// /// Instantiation is executed as follows: /// @@ -988,14 +988,14 @@ pub mod pallet { /// - The smart-contract account is created at the computed address. /// - The `value` is transferred to the new account. /// - The `deploy` function is executed in the context of the newly-created account. - #[pallet::call_index(7)] - #[pallet::weight( + #[pezpallet::call_index(7)] + #[pezpallet::weight( T::WeightInfo::instantiate_with_code(code.len() as u32, data.len() as u32, salt.len() as u32) .saturating_add(*gas_limit) )] pub fn instantiate_with_code( origin: OriginFor, - #[pallet::compact] value: BalanceOf, + #[pezpallet::compact] value: BalanceOf, gas_limit: Weight, storage_deposit_limit: Option< as codec::HasCompact>::Type>, code: Vec, @@ -1054,13 +1054,13 @@ pub mod pallet { /// This function is identical to [`Self::instantiate_with_code`] but without the /// code deployment step. Instead, the `code_hash` of an on-chain deployed wasm binary /// must be supplied. - #[pallet::call_index(8)] - #[pallet::weight( + #[pezpallet::call_index(8)] + #[pezpallet::weight( T::WeightInfo::instantiate(data.len() as u32, salt.len() as u32).saturating_add(*gas_limit) )] pub fn instantiate( origin: OriginFor, - #[pallet::compact] value: BalanceOf, + #[pezpallet::compact] value: BalanceOf, gas_limit: Weight, storage_deposit_limit: Option< as codec::HasCompact>::Type>, code_hash: CodeHash, @@ -1094,10 +1094,10 @@ pub mod pallet { /// When a migration is in progress, this dispatchable can be used to run migration steps. /// Calls that contribute to advancing the migration have their fees waived, as it's helpful - /// for the chain. Note that while the migration is in progress, the pallet will also + /// for the chain. Note that while the migration is in progress, the pezpallet will also /// leverage the `on_idle` hooks to run migration steps. - #[pallet::call_index(9)] - #[pallet::weight(T::WeightInfo::migrate().saturating_add(*weight_limit))] + #[pezpallet::call_index(9)] + #[pezpallet::weight(T::WeightInfo::migrate().saturating_add(*weight_limit))] pub fn migrate(origin: OriginFor, weight_limit: Weight) -> DispatchResultWithPostInfo { use migration::MigrateResult::*; ensure_signed(origin)?; @@ -1127,7 +1127,7 @@ pub mod pallet { } } - #[pallet::event] + #[pezpallet::event] pub enum Event { /// Contract deployed by address at the specified address. Instantiated { deployer: T::AccountId, contract: T::AccountId }, @@ -1214,7 +1214,7 @@ pub mod pallet { }, } - #[pallet::error] + #[pezpallet::error] pub enum Error { /// Invalid schedule supplied, e.g. with zero weight of a basic operation. InvalidSchedule, @@ -1270,7 +1270,7 @@ pub mod pallet { TerminatedInConstructor, /// A call tried to invoke a contract that is flagged as non-reentrant. /// The only other cause is that a call from a contract into the runtime tried to call back - /// into `pezpallet-contracts`. This would make the whole pallet reentrant with regard to + /// into `pezpallet-contracts`. This would make the whole pezpallet reentrant with regard to /// contract code execution which is not supported. ReentranceDenied, /// A contract attempted to invoke a state modifying API while being in read-only mode. @@ -1313,21 +1313,21 @@ pub mod pallet { OutOfTransientStorage, } - /// A reason for the pallet contracts placing a hold on funds. - #[pallet::composite_enum] + /// A reason for the pezpallet contracts placing a hold on funds. + #[pezpallet::composite_enum] pub enum HoldReason { - /// The Pallet has reserved it for storing code on-chain. + /// The Pezpallet has reserved it for storing code on-chain. CodeUploadDepositReserve, - /// The Pallet has reserved it for storage deposit. + /// The Pezpallet has reserved it for storage deposit. StorageDepositReserve, } /// A mapping from a contract's code hash to its code. - #[pallet::storage] + #[pezpallet::storage] pub(crate) type PristineCode = StorageMap<_, Identity, CodeHash, CodeVec>; /// A mapping from a contract's code hash to its code info. - #[pallet::storage] + #[pezpallet::storage] pub(crate) type CodeInfoOf = StorageMap<_, Identity, CodeHash, CodeInfo>; /// This is a **monotonic** counter incremented on contract instantiation. @@ -1352,13 +1352,13 @@ pub mod pallet { /// /// Do not use it to determine the number of contracts. It won't be decremented if /// a contract is destroyed. - #[pallet::storage] + #[pezpallet::storage] pub(crate) type Nonce = StorageValue<_, u64, ValueQuery>; /// The code associated with a given account. /// /// TWOX-NOTE: SAFE since `AccountId` is a secure hash. - #[pallet::storage] + #[pezpallet::storage] pub(crate) type ContractInfoOf = StorageMap<_, Twox64Concat, T::AccountId, ContractInfo>; @@ -1366,23 +1366,23 @@ pub mod pallet { /// /// Child trie deletion is a heavy operation depending on the amount of storage items /// stored in said trie. Therefore this operation is performed lazily in `on_idle`. - #[pallet::storage] + #[pezpallet::storage] pub(crate) type DeletionQueue = StorageMap<_, Twox64Concat, u32, TrieId>; /// A pair of monotonic counters used to track the latest contract marked for deletion /// and the latest deleted contract in queue. - #[pallet::storage] + #[pezpallet::storage] pub(crate) type DeletionQueueCounter = StorageValue<_, DeletionQueueManager, ValueQuery>; /// A migration can span across multiple blocks. This storage defines a cursor to track the /// progress of the migration, enabling us to resume from the last completed position. - #[pallet::storage] + #[pezpallet::storage] pub(crate) type MigrationInProgress = StorageValue<_, migration::Cursor, OptionQuery>; } -/// The type of origins supported by the contracts pallet. +/// The type of origins supported by the contracts pezpallet. #[derive( Clone, Encode, Decode, DecodeWithMemTracking, PartialEq, TypeInfo, RuntimeDebugNoBound, )] @@ -1668,7 +1668,7 @@ macro_rules! ensure_no_migration_in_progress { }; } -impl Pallet { +impl Pezpallet { /// Perform a call to a specified contract. /// /// This function is similar to [`Self::call`], but doesn't perform any address lookups @@ -1904,14 +1904,14 @@ impl Pallet { Ok(()) } - /// Deposit a pallet contracts event. + /// Deposit a pezpallet contracts event. fn deposit_event(event: Event) { - >::deposit_event(::RuntimeEvent::from(event)) + >::deposit_event(::RuntimeEvent::from(event)) } - /// Deposit a pallet contracts indexed event. + /// Deposit a pezpallet contracts indexed event. fn deposit_indexed_event(topics: Vec, event: Event) { - >::deposit_event_indexed( + >::deposit_event_indexed( &topics, ::RuntimeEvent::from(event).into(), ) @@ -1943,7 +1943,7 @@ pezsp_api::decl_runtime_apis! { { /// Perform a call from a specified account to a given contract. /// - /// See [`crate::Pallet::bare_call`]. + /// See [`crate::Pezpallet::bare_call`]. fn call( origin: AccountId, dest: AccountId, @@ -1955,7 +1955,7 @@ pezsp_api::decl_runtime_apis! { /// Instantiate a new contract. /// - /// See `[crate::Pallet::bare_instantiate]`. + /// See `[crate::Pezpallet::bare_instantiate]`. fn instantiate( origin: AccountId, value: Balance, @@ -1968,7 +1968,7 @@ pezsp_api::decl_runtime_apis! { /// Upload new code without instantiating a contract from it. /// - /// See [`crate::Pallet::bare_upload_code`]. + /// See [`crate::Pezpallet::bare_upload_code`]. fn upload_code( origin: AccountId, code: Vec, diff --git a/bizinikiwi/pezframe/contracts/src/migration.rs b/bizinikiwi/pezframe/contracts/src/migration.rs index 1c016c10..6384b592 100644 --- a/bizinikiwi/pezframe/contracts/src/migration.rs +++ b/bizinikiwi/pezframe/contracts/src/migration.rs @@ -51,7 +51,7 @@ //! //! If the [`MigrationInProgress`] storage item exists, it means a migration is in progress, and its //! value holds a cursor for the current migration step. These migration steps are executed during -//! [`Hooks::on_idle`] or when the [`Pallet::migrate`] dispatchable is +//! [`Hooks::on_idle`] or when the [`Pezpallet::migrate`] dispatchable is //! called. //! //! While the migration is in progress, all dispatchables except `migrate`, are blocked, and returns @@ -67,7 +67,7 @@ pub mod v15; pub mod v16; include!(concat!(env!("OUT_DIR"), "/migration_codegen.rs")); -use crate::{weights::WeightInfo, Config, Error, MigrationInProgress, Pallet, Weight, LOG_TARGET}; +use crate::{weights::WeightInfo, Config, Error, MigrationInProgress, Pezpallet, Weight, LOG_TARGET}; use codec::{Codec, Decode}; use core::marker::PhantomData; use pezframe_support::{ @@ -237,9 +237,9 @@ pub struct Migration(PhantomData Migration { fn run_all_steps() -> Result<(), TryRuntimeError> { let mut meter = &mut WeightMeter::new(); - let name = >::name(); + let name = >::name(); loop { - let in_progress_version = >::on_chain_storage_version() + 1; + let in_progress_version = >::on_chain_storage_version() + 1; let state = T::Migrations::pre_upgrade_step(in_progress_version)?; let before = meter.consumed(); let status = Self::migrate(&mut meter); @@ -255,7 +255,7 @@ impl Migration { } } - let name = >::name(); + let name = >::name(); log::info!(target: LOG_TARGET, "{name}: Migration steps weight = {}", meter.consumed()); Ok(()) } @@ -263,9 +263,9 @@ impl Migration { impl OnRuntimeUpgrade for Migration { fn on_runtime_upgrade() -> Weight { - let name = >::name(); - let in_code_version = >::in_code_storage_version(); - let on_chain_version = >::on_chain_storage_version(); + let name = >::name(); + let in_code_version = >::in_code_storage_version(); + let on_chain_version = >::on_chain_storage_version(); if on_chain_version == in_code_version { log::warn!( @@ -309,8 +309,8 @@ impl OnRuntimeUpgrade for Migration>::on_chain_storage_version(); - let in_code_version = >::in_code_storage_version(); + let on_chain_version = >::on_chain_storage_version(); + let in_code_version = >::in_code_storage_version(); if on_chain_version == in_code_version { return Ok(Default::default()); @@ -319,7 +319,7 @@ impl OnRuntimeUpgrade for Migration>::name(), on_chain_version, in_code_version + >::name(), on_chain_version, in_code_version ); ensure!( @@ -388,7 +388,7 @@ impl Migration { /// Execute the multi-step migration. /// Returns whether or not a migration is in progress pub(crate) fn migrate(mut meter: &mut WeightMeter) -> MigrateResult { - let name = >::name(); + let name = >::name(); if meter.try_consume(T::WeightInfo::migrate()).is_err() { return MigrateResult::NoMigrationPerformed; @@ -401,7 +401,7 @@ impl Migration { }; // if a migration is running it is always upgrading to the next version - let storage_version = >::on_chain_storage_version(); + let storage_version = >::on_chain_storage_version(); let in_progress_version = storage_version + 1; log::info!( @@ -419,8 +419,8 @@ impl Migration { MigrateResult::InProgress { steps_done } }, StepResult::Completed { steps_done } => { - in_progress_version.put::>(); - if >::in_code_storage_version() != in_progress_version { + in_progress_version.put::>(); + if >::in_code_storage_version() != in_progress_version { log::info!( target: LOG_TARGET, "{name}: Next migration is {:?},", @@ -578,7 +578,7 @@ mod test { #[test] fn test_storage_version_matches_last_migration_file() { - assert_eq!(StorageVersion::new(LATEST_MIGRATION_VERSION), crate::pallet::STORAGE_VERSION); + assert_eq!(StorageVersion::new(LATEST_MIGRATION_VERSION), crate::pezpallet::STORAGE_VERSION); } #[test] @@ -619,7 +619,7 @@ mod test { type TestMigration = Migration; ExtBuilder::default().build().execute_with(|| { - assert_eq!(StorageVersion::get::>(), LATEST_MIGRATION_VERSION); + assert_eq!(StorageVersion::get::>(), LATEST_MIGRATION_VERSION); assert_eq!( TestMigration::migrate(&mut WeightMeter::new()), MigrateResult::NoMigrationInProgress @@ -635,7 +635,7 @@ mod test { .set_storage_version(LATEST_MIGRATION_VERSION - 2) .build() .execute_with(|| { - assert_eq!(StorageVersion::get::>(), LATEST_MIGRATION_VERSION - 2); + assert_eq!(StorageVersion::get::>(), LATEST_MIGRATION_VERSION - 2); TestMigration::on_runtime_upgrade(); for (version, status) in [ (LATEST_MIGRATION_VERSION - 1, MigrateResult::InProgress { steps_done: 1 }), @@ -643,7 +643,7 @@ mod test { ] { assert_eq!(TestMigration::migrate(&mut WeightMeter::new()), status); assert_eq!( - >::on_chain_storage_version(), + >::on_chain_storage_version(), StorageVersion::new(version) ); } @@ -652,7 +652,7 @@ mod test { TestMigration::migrate(&mut WeightMeter::new()), MigrateResult::NoMigrationInProgress ); - assert_eq!(StorageVersion::get::>(), LATEST_MIGRATION_VERSION); + assert_eq!(StorageVersion::get::>(), LATEST_MIGRATION_VERSION); }); } } diff --git a/bizinikiwi/pezframe/contracts/src/migration/v09.rs b/bizinikiwi/pezframe/contracts/src/migration/v09.rs index 4e70cb6b..4473c1cb 100644 --- a/bizinikiwi/pezframe/contracts/src/migration/v09.rs +++ b/bizinikiwi/pezframe/contracts/src/migration/v09.rs @@ -20,7 +20,7 @@ use crate::{ migration::{IsFinished, MigrationStep}, weights::WeightInfo, - CodeHash, Config, Determinism, Pallet, Weight, LOG_TARGET, + CodeHash, Config, Determinism, Pezpallet, Weight, LOG_TARGET, }; use alloc::vec::Vec; use codec::{Decode, Encode}; @@ -46,7 +46,7 @@ mod v8 { #[storage_alias] pub type CodeStorage = - StorageMap, Identity, CodeHash, PrefabWasmModule>; + StorageMap, Identity, CodeHash, PrefabWasmModule>; } #[cfg(feature = "runtime-benchmarks")] @@ -75,7 +75,7 @@ struct PrefabWasmModule { } #[storage_alias] -type CodeStorage = StorageMap, Identity, CodeHash, PrefabWasmModule>; +type CodeStorage = StorageMap, Identity, CodeHash, PrefabWasmModule>; #[derive(Encode, Decode, MaxEncodedLen, DefaultNoBound)] pub struct Migration { diff --git a/bizinikiwi/pezframe/contracts/src/migration/v10.rs b/bizinikiwi/pezframe/contracts/src/migration/v10.rs index 2c247617..61375b84 100644 --- a/bizinikiwi/pezframe/contracts/src/migration/v10.rs +++ b/bizinikiwi/pezframe/contracts/src/migration/v10.rs @@ -22,7 +22,7 @@ use crate::{ exec::AccountIdOf, migration::{IsFinished, MigrationStep}, weights::WeightInfo, - CodeHash, Config, Pallet, TrieId, Weight, LOG_TARGET, + CodeHash, Config, Pezpallet, TrieId, Weight, LOG_TARGET, }; use codec::{Decode, Encode}; use core::{ @@ -74,7 +74,7 @@ mod v9 { #[storage_alias] pub type ContractInfoOf = StorageMap< - Pallet, + Pezpallet, Twox64Concat, ::AccountId, ContractInfo, @@ -136,7 +136,7 @@ pub struct Migration { #[storage_alias] type ContractInfoOf = StorageMap< - Pallet, + Pezpallet, Twox64Concat, ::AccountId, ContractInfo, diff --git a/bizinikiwi/pezframe/contracts/src/migration/v11.rs b/bizinikiwi/pezframe/contracts/src/migration/v11.rs index 438dafcb..74be2946 100644 --- a/bizinikiwi/pezframe/contracts/src/migration/v11.rs +++ b/bizinikiwi/pezframe/contracts/src/migration/v11.rs @@ -21,7 +21,7 @@ use crate::{ migration::{IsFinished, MigrationStep}, weights::WeightInfo, - Config, Pallet, TrieId, Weight, LOG_TARGET, + Config, Pezpallet, TrieId, Weight, LOG_TARGET, }; use alloc::vec::Vec; use codec::{Decode, Encode}; @@ -39,7 +39,7 @@ mod v10 { } #[storage_alias] - pub type DeletionQueue = StorageValue, Vec>; + pub type DeletionQueue = StorageValue, Vec>; } #[derive(Encode, Decode, TypeInfo, MaxEncodedLen, DefaultNoBound, Clone)] @@ -60,10 +60,10 @@ pub fn fill_old_queue(len: usize) { } #[storage_alias] -type DeletionQueue = StorageMap, Twox64Concat, u32, TrieId>; +type DeletionQueue = StorageMap, Twox64Concat, u32, TrieId>; #[storage_alias] -type DeletionQueueCounter = StorageValue, DeletionQueueManager, ValueQuery>; +type DeletionQueueCounter = StorageValue, DeletionQueueManager, ValueQuery>; #[derive(Encode, Decode, MaxEncodedLen, DefaultNoBound)] pub struct Migration { diff --git a/bizinikiwi/pezframe/contracts/src/migration/v12.rs b/bizinikiwi/pezframe/contracts/src/migration/v12.rs index 134c11ef..3bcf0ff2 100644 --- a/bizinikiwi/pezframe/contracts/src/migration/v12.rs +++ b/bizinikiwi/pezframe/contracts/src/migration/v12.rs @@ -21,7 +21,7 @@ use crate::{ migration::{IsFinished, MigrationStep}, weights::WeightInfo, - AccountIdOf, BalanceOf, CodeHash, Config, Determinism, Pallet, Weight, LOG_TARGET, + AccountIdOf, BalanceOf, CodeHash, Config, Determinism, Pezpallet, Weight, LOG_TARGET, }; use alloc::vec::Vec; use codec::{Decode, Encode}; @@ -72,11 +72,11 @@ mod v11 { #[storage_alias] pub type OwnerInfoOf = - StorageMap, Identity, CodeHash, OwnerInfo>; + StorageMap, Identity, CodeHash, OwnerInfo>; #[storage_alias] pub type CodeStorage = - StorageMap, Identity, CodeHash, PrefabWasmModule>; + StorageMap, Identity, CodeHash, PrefabWasmModule>; } #[derive(Encode, Decode, scale_info::TypeInfo, MaxEncodedLen)] @@ -97,10 +97,10 @@ where #[storage_alias] pub type CodeInfoOf = - StorageMap, Identity, CodeHash, CodeInfo>; + StorageMap, Identity, CodeHash, CodeInfo>; #[storage_alias] -pub type PristineCode = StorageMap, Identity, CodeHash, Vec>; +pub type PristineCode = StorageMap, Identity, CodeHash, Vec>; #[cfg(feature = "runtime-benchmarks")] pub fn store_old_dummy_code(len: usize, account: T::AccountId) diff --git a/bizinikiwi/pezframe/contracts/src/migration/v13.rs b/bizinikiwi/pezframe/contracts/src/migration/v13.rs index 70e2d406..f954e3cf 100644 --- a/bizinikiwi/pezframe/contracts/src/migration/v13.rs +++ b/bizinikiwi/pezframe/contracts/src/migration/v13.rs @@ -21,7 +21,7 @@ use crate::{ migration::{IsFinished, MigrationStep}, weights::WeightInfo, - AccountIdOf, BalanceOf, CodeHash, Config, Pallet, TrieId, Weight, LOG_TARGET, + AccountIdOf, BalanceOf, CodeHash, Config, Pezpallet, TrieId, Weight, LOG_TARGET, }; use codec::{Decode, Encode}; use pezframe_support::{pezpallet_prelude::*, storage_alias, weights::WeightMeter, DefaultNoBound}; @@ -45,7 +45,7 @@ mod v12 { #[storage_alias] pub type ContractInfoOf = StorageMap< - Pallet, + Pezpallet, Twox64Concat, ::AccountId, ContractInfo, @@ -73,7 +73,7 @@ pub fn store_old_contract_info(account: T::AccountId, info: crate::Co #[storage_alias] pub type ContractInfoOf = - StorageMap, Twox64Concat, ::AccountId, ContractInfo>; + StorageMap, Twox64Concat, ::AccountId, ContractInfo>; #[derive(Encode, Decode, CloneNoBound, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] diff --git a/bizinikiwi/pezframe/contracts/src/migration/v14.rs b/bizinikiwi/pezframe/contracts/src/migration/v14.rs index 53d0c93f..f0296eb2 100644 --- a/bizinikiwi/pezframe/contracts/src/migration/v14.rs +++ b/bizinikiwi/pezframe/contracts/src/migration/v14.rs @@ -24,7 +24,7 @@ use crate::{ exec::AccountIdOf, migration::{IsFinished, MigrationStep}, weights::WeightInfo, - BalanceOf, CodeHash, Config, Determinism, HoldReason, Pallet, Weight, LOG_TARGET, + BalanceOf, CodeHash, Config, Determinism, HoldReason, Pezpallet, Weight, LOG_TARGET, }; #[cfg(feature = "try-runtime")] use alloc::collections::btree_map::BTreeMap; @@ -71,7 +71,7 @@ mod v13 { #[storage_alias] pub type CodeInfoOf = - StorageMap, Identity, CodeHash, CodeInfo>; + StorageMap, Identity, CodeHash, CodeInfo>; } #[cfg(feature = "runtime-benchmarks")] diff --git a/bizinikiwi/pezframe/contracts/src/migration/v15.rs b/bizinikiwi/pezframe/contracts/src/migration/v15.rs index 70e165f7..165024e0 100644 --- a/bizinikiwi/pezframe/contracts/src/migration/v15.rs +++ b/bizinikiwi/pezframe/contracts/src/migration/v15.rs @@ -25,7 +25,7 @@ use crate::{ migration::{IsFinished, MigrationStep}, weights::WeightInfo, - AccountIdOf, BalanceOf, CodeHash, Config, HoldReason, Pallet, TrieId, Weight, LOG_TARGET, + AccountIdOf, BalanceOf, CodeHash, Config, HoldReason, Pezpallet, TrieId, Weight, LOG_TARGET, }; #[cfg(feature = "try-runtime")] use alloc::vec::Vec; @@ -41,7 +41,7 @@ use pezframe_support::{ weights::WeightMeter, BoundedBTreeMap, DefaultNoBound, }; -use pezframe_system::Pallet as System; +use pezframe_system::Pezpallet as System; use pezsp_core::hexdisplay::HexDisplay; #[cfg(feature = "try-runtime")] use pezsp_runtime::TryRuntimeError; @@ -69,7 +69,7 @@ mod v14 { #[storage_alias] pub type ContractInfoOf = StorageMap< - Pallet, + Pezpallet, Twox64Concat, ::AccountId, ContractInfo, @@ -112,7 +112,7 @@ struct ContractInfo { #[storage_alias] type ContractInfoOf = - StorageMap, Twox64Concat, ::AccountId, ContractInfo>; + StorageMap, Twox64Concat, ::AccountId, ContractInfo>; #[derive(Encode, Decode, MaxEncodedLen, DefaultNoBound)] pub struct Migration { diff --git a/bizinikiwi/pezframe/contracts/src/migration/v16.rs b/bizinikiwi/pezframe/contracts/src/migration/v16.rs index 29e6a49b..a7c41f1a 100644 --- a/bizinikiwi/pezframe/contracts/src/migration/v16.rs +++ b/bizinikiwi/pezframe/contracts/src/migration/v16.rs @@ -21,7 +21,7 @@ use crate::{ migration::{IsFinished, MigrationStep}, weights::WeightInfo, - BalanceOf, CodeHash, Config, Pallet, TrieId, Weight, WeightMeter, LOG_TARGET, + BalanceOf, CodeHash, Config, Pezpallet, TrieId, Weight, WeightMeter, LOG_TARGET, }; use codec::{Decode, Encode}; use pezframe_support::{pezpallet_prelude::*, storage_alias, DefaultNoBound}; @@ -32,7 +32,7 @@ pub fn store_old_contract_info( account: T::AccountId, info: &crate::ContractInfo, ) -> BalanceOf { - let storage_base_deposit = Pallet::::min_balance() + 1u32.into(); + let storage_base_deposit = Pezpallet::::min_balance() + 1u32.into(); ContractInfoOf::::insert( account, ContractInfo { @@ -52,7 +52,7 @@ pub fn store_old_contract_info( #[storage_alias] pub type ContractInfoOf = - StorageMap, Twox64Concat, ::AccountId, ContractInfo>; + StorageMap, Twox64Concat, ::AccountId, ContractInfo>; #[derive(Encode, Decode, CloneNoBound, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] @@ -89,7 +89,7 @@ impl MigrationStep for Migration { if let Some(key) = iter.next() { log::debug!(target: LOG_TARGET, "Migrating contract {:?}", key); ContractInfoOf::::mutate(key.clone(), |info| { - let ed = Pallet::::min_balance(); + let ed = Pezpallet::::min_balance(); let mut updated_info = info.take().expect("Item exists; qed"); updated_info.storage_base_deposit.saturating_reduce(ed); *info = Some(updated_info); diff --git a/bizinikiwi/pezframe/contracts/src/storage/meter.rs b/bizinikiwi/pezframe/contracts/src/storage/meter.rs index ca18e628..dfb9c066 100644 --- a/bizinikiwi/pezframe/contracts/src/storage/meter.rs +++ b/bizinikiwi/pezframe/contracts/src/storage/meter.rs @@ -19,7 +19,7 @@ use crate::{ storage::ContractInfo, AccountIdOf, BalanceOf, CodeInfo, Config, Error, Event, HoldReason, - Inspect, Origin, Pallet, StorageDeposit as Deposit, System, LOG_TARGET, + Inspect, Origin, Pezpallet, StorageDeposit as Deposit, System, LOG_TARGET, }; use alloc::vec::Vec; @@ -440,7 +440,7 @@ where debug_assert!(matches!(self.contract_state(), ContractState::Alive)); // We need to make sure that the contract's account exists. - let ed = Pallet::::min_balance(); + let ed = Pezpallet::::min_balance(); self.total_deposit = Deposit::Charge(ed); T::Currency::transfer(origin, contract, ed, Preservation::Preserve)?; @@ -520,7 +520,7 @@ impl Ext for ReservingExt { // as free balance after accounting for all deposits. let max = T::Currency::reducible_balance(origin, Preservation::Preserve, Polite) .saturating_sub(min_leftover) - .saturating_sub(Pallet::::min_balance()); + .saturating_sub(Pezpallet::::min_balance()); let default = max.min(T::DefaultDepositLimit::get()); let limit = limit.unwrap_or(default); ensure!( @@ -552,7 +552,7 @@ impl Ext for ReservingExt { Fortitude::Polite, )?; - Pallet::::deposit_event(Event::StorageDepositTransferredAndHeld { + Pezpallet::::deposit_event(Event::StorageDepositTransferredAndHeld { from: origin.clone(), to: contract.clone(), amount: *amount, @@ -569,7 +569,7 @@ impl Ext for ReservingExt { Fortitude::Polite, )?; - Pallet::::deposit_event(Event::StorageDepositTransferredAndReleased { + Pezpallet::::deposit_event(Event::StorageDepositTransferredAndReleased { from: contract.clone(), to: origin.clone(), amount: transferred, diff --git a/bizinikiwi/pezframe/contracts/src/test_utils/builder.rs b/bizinikiwi/pezframe/contracts/src/test_utils/builder.rs index 252cad8c..71331fcc 100644 --- a/bizinikiwi/pezframe/contracts/src/test_utils/builder.rs +++ b/bizinikiwi/pezframe/contracts/src/test_utils/builder.rs @@ -19,7 +19,7 @@ use super::GAS_LIMIT; use crate::{ AccountIdLookupOf, AccountIdOf, BalanceOf, Code, CodeHash, CollectEvents, Config, ContractExecResult, ContractInstantiateResult, DebugInfo, Determinism, EventRecordOf, - ExecReturnValue, InstantiateReturnValue, OriginFor, Pallet, Weight, + ExecReturnValue, InstantiateReturnValue, OriginFor, Pezpallet, Weight, }; use codec::{Encode, HasCompact}; use core::fmt::Debug; @@ -64,7 +64,7 @@ macro_rules! builder { #[doc = concat!("Build the ", stringify!($method), " call")] pub fn build(self) -> $result { - Pallet::::$method( + Pezpallet::::$method( $(self.$field,)* ) } diff --git a/bizinikiwi/pezframe/contracts/src/tests.rs b/bizinikiwi/pezframe/contracts/src/tests.rs index 696bb808..a45a88ec 100644 --- a/bizinikiwi/pezframe/contracts/src/tests.rs +++ b/bizinikiwi/pezframe/contracts/src/tests.rs @@ -37,7 +37,7 @@ use crate::{ weights::WeightInfo, Array, BalanceOf, Code, CodeHash, CodeInfoOf, CollectEvents, Config, ContractInfo, ContractInfoOf, DebugInfo, DefaultAddressGenerator, DeletionQueueCounter, Error, HoldReason, - MigrationInProgress, Origin, Pallet, PristineCode, Schedule, + MigrationInProgress, Origin, Pezpallet, PristineCode, Schedule, }; use assert_matches::assert_matches; use codec::{Decode, Encode}; @@ -399,7 +399,7 @@ impl pezpallet_proxy::Config for Test { type CallHasher = BlakeTwo256; type AnnouncementDepositBase = ConstU64<1>; type AnnouncementDepositFactor = ConstU64<1>; - type BlockNumberProvider = pezframe_system::Pallet; + type BlockNumberProvider = pezframe_system::Pezpallet; } impl pezpallet_dummy::Config for Test {} @@ -561,9 +561,9 @@ impl ExtBuilder { ext.execute_with(|| { use pezframe_support::traits::OnGenesis; - Pallet::::on_genesis(); + Pezpallet::::on_genesis(); if let Some(storage_version) = self.storage_version { - storage_version.put::>(); + storage_version.put::>(); } System::set_block_number(1) }); @@ -647,7 +647,7 @@ fn migration_on_idle_hooks_works() { .execute_with(|| { MigrationInProgress::::set(Some(Default::default())); Contracts::on_idle(System::block_number(), weight); - assert_eq!(StorageVersion::get::>(), expected_version); + assert_eq!(StorageVersion::get::>(), expected_version); }); } } @@ -2545,7 +2545,7 @@ fn failed_deposit_charge_should_roll_back_call() { let transfer_call = Box::new(RuntimeCall::Balances(pezpallet_balances::Call::transfer_allow_death { dest: CHARLIE, - value: pezpallet_balances::Pallet::::free_balance(&ALICE) - 2 * ED, + value: pezpallet_balances::Pezpallet::::free_balance(&ALICE) - 2 * ED, })); // Wrap the transfer call in a proxy call. diff --git a/bizinikiwi/pezframe/contracts/src/tests/pezpallet_dummy.rs b/bizinikiwi/pezframe/contracts/src/tests/pezpallet_dummy.rs index a0157962..a29eeda4 100644 --- a/bizinikiwi/pezframe/contracts/src/tests/pezpallet_dummy.rs +++ b/bizinikiwi/pezframe/contracts/src/tests/pezpallet_dummy.rs @@ -15,10 +15,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -pub use pallet::*; +pub use pezpallet::*; -#[pezframe_support::pallet(dev_mode)] -pub mod pallet { +#[pezframe_support::pezpallet(dev_mode)] +pub mod pezpallet { use pezframe_support::{ dispatch::{Pays, PostDispatchInfo}, ensure, @@ -27,19 +27,19 @@ pub mod pallet { }; use pezframe_system::pezpallet_prelude::*; - #[pallet::pallet] - pub struct Pallet(_); + #[pezpallet::pezpallet] + pub struct Pezpallet(_); - #[pallet::config] + #[pezpallet::config] pub trait Config: pezframe_system::Config {} - #[pallet::call] - impl Pallet { + #[pezpallet::call] + impl Pezpallet { /// Dummy function that overcharges the predispatch weight, allowing us to test the correct /// values of [`ContractResult::gas_consumed`] and [`ContractResult::gas_required`] in /// tests. - #[pallet::call_index(1)] - #[pallet::weight(*pre_charge)] + #[pezpallet::call_index(1)] + #[pezpallet::weight(*pre_charge)] pub fn overestimate_pre_charge( origin: OriginFor, pre_charge: Weight, diff --git a/bizinikiwi/pezframe/contracts/src/wasm/mod.rs b/bizinikiwi/pezframe/contracts/src/wasm/mod.rs index 60eb294e..ebb50e3c 100644 --- a/bizinikiwi/pezframe/contracts/src/wasm/mod.rs +++ b/bizinikiwi/pezframe/contracts/src/wasm/mod.rs @@ -46,7 +46,7 @@ use crate::{ gas::{GasMeter, Token}, weights::WeightInfo, AccountIdOf, BadOrigin, BalanceOf, CodeHash, CodeInfoOf, CodeVec, Config, Error, Event, - HoldReason, Pallet, PristineCode, Schedule, Weight, LOG_TARGET, + HoldReason, Pezpallet, PristineCode, Schedule, Weight, LOG_TARGET, }; use alloc::vec::Vec; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; @@ -126,7 +126,7 @@ pub enum Determinism { /// Allow calling or uploading an indeterministic code. /// /// This is only possible when calling into `pezpallet-contracts` directly via - /// [`crate::Pallet::bare_call`]. + /// [`crate::Pezpallet::bare_call`]. /// /// # Note /// @@ -191,7 +191,7 @@ impl WasmBlob { *existing = None; >::remove(&code_hash); - >::deposit_event(Event::CodeRemoved { + >::deposit_event(Event::CodeRemoved { code_hash, deposit_released, remover, @@ -279,7 +279,7 @@ impl WasmBlob { self.code_info.refcount = 0; >::insert(code_hash, &self.code); *stored_code_info = Some(self.code_info.clone()); - >::deposit_event(Event::CodeStored { + >::deposit_event(Event::CodeStored { code_hash, deposit_held: deposit, uploader: self.code_info.owner.clone(), @@ -512,7 +512,7 @@ mod tests { storage::WriteOutcome, tests::{RuntimeCall, Test, ALICE, BOB}, transient_storage::TransientStorage, - BalanceOf, CodeHash, Error, Origin, Pallet as Contracts, + BalanceOf, CodeHash, Error, Origin, Pezpallet as Contracts, }; use assert_matches::assert_matches; use pezframe_support::{ diff --git a/bizinikiwi/pezframe/contracts/src/wasm/prepare.rs b/bizinikiwi/pezframe/contracts/src/wasm/prepare.rs index a386b791..082713e8 100644 --- a/bizinikiwi/pezframe/contracts/src/wasm/prepare.rs +++ b/bizinikiwi/pezframe/contracts/src/wasm/prepare.rs @@ -246,7 +246,7 @@ impl LoadedModule { /// /// 1. General engine-side validation makes sure the module is consistent and does not contain /// forbidden WebAssembly features. -/// 2. Additional checks which are specific to smart contracts eligible for this pallet. +/// 2. Additional checks which are specific to smart contracts eligible for this pezpallet. fn validate( code: &[u8], schedule: &Schedule, @@ -293,7 +293,7 @@ where )?, }; - // The we check that module satisfies constraints the pallet puts on contracts. + // The we check that module satisfies constraints the pezpallet puts on contracts. contract_module.scan_exports()?; contract_module.scan_imports::(schedule)?; Ok(contract_module) diff --git a/bizinikiwi/pezframe/contracts/src/weights.rs b/bizinikiwi/pezframe/contracts/src/weights.rs index 0e5fbffe..52b4d6ed 100644 --- a/bizinikiwi/pezframe/contracts/src/weights.rs +++ b/bizinikiwi/pezframe/contracts/src/weights.rs @@ -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_contracts +// --pezpallet=pezpallet_contracts // --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2 // --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/contracts/src/weights.rs // --wasm-execution=compiled diff --git a/bizinikiwi/pezframe/conviction-voting/Cargo.toml b/bizinikiwi/pezframe/conviction-voting/Cargo.toml index 9879a267..9ad00ce1 100644 --- a/bizinikiwi/pezframe/conviction-voting/Cargo.toml +++ b/bizinikiwi/pezframe/conviction-voting/Cargo.toml @@ -6,7 +6,7 @@ edition.workspace = true license = "Apache-2.0" homepage.workspace = true repository.workspace = true -description = "FRAME pallet for conviction voting in referenda" +description = "FRAME pezpallet for conviction voting in referenda" readme = "README.md" documentation = "https://docs.rs/pezpallet-conviction-voting" diff --git a/bizinikiwi/pezframe/conviction-voting/README.md b/bizinikiwi/pezframe/conviction-voting/README.md index 67c4dbe8..25992352 100644 --- a/bizinikiwi/pezframe/conviction-voting/README.md +++ b/bizinikiwi/pezframe/conviction-voting/README.md @@ -1,8 +1,8 @@ -# Voting Pallet +# Voting Pezpallet - [`assembly::Config`](https://docs.rs/pezpallet-assembly/latest/pallet_assembly/trait.Config.html) - [`Call`](https://docs.rs/pezpallet-assembly/latest/pallet_assembly/enum.Call.html) ## Overview -Pallet for voting in referenda. +Pezpallet for voting in referenda. diff --git a/bizinikiwi/pezframe/conviction-voting/src/benchmarking.rs b/bizinikiwi/pezframe/conviction-voting/src/benchmarking.rs index 967c9cf7..9b9bac3d 100644 --- a/bizinikiwi/pezframe/conviction-voting/src/benchmarking.rs +++ b/bizinikiwi/pezframe/conviction-voting/src/benchmarking.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! ConvictionVoting pallet benchmarking. +//! ConvictionVoting pezpallet benchmarking. use super::*; @@ -32,7 +32,7 @@ use pezframe_support::{ }; use pezsp_runtime::traits::Bounded; -use crate::Pallet as ConvictionVoting; +use crate::Pezpallet as ConvictionVoting; const SEED: u32 = 0; diff --git a/bizinikiwi/pezframe/conviction-voting/src/lib.rs b/bizinikiwi/pezframe/conviction-voting/src/lib.rs index a084d61b..bd7d5747 100644 --- a/bizinikiwi/pezframe/conviction-voting/src/lib.rs +++ b/bizinikiwi/pezframe/conviction-voting/src/lib.rs @@ -15,14 +15,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! # Voting Pallet +//! # Voting Pezpallet //! //! - [`Config`] //! - [`Call`] //! //! ## Overview //! -//! Pallet for managing actual voting in polls. +//! Pezpallet for managing actual voting in polls. #![recursion_limit = "256"] #![cfg_attr(not(feature = "std"), no_std)] @@ -50,7 +50,7 @@ pub mod weights; pub use self::{ conviction::Conviction, - pallet::*, + pezpallet::*, traits::{Status, VotingHooks}, types::{Delegations, Tally, UnvoteScope}, vote::{AccountVote, Casting, Delegating, Vote, Voting}, @@ -89,8 +89,8 @@ pub type PollIndexOf = <>::Polls as Polling = <>::Polls as Polling>>::Index; pub type ClassOf = <>::Polls as Polling>>::Class; -#[pezframe_support::pallet] -pub mod pallet { +#[pezframe_support::pezpallet] +pub mod pezpallet { use super::*; use pezframe_support::{ pezpallet_prelude::{ @@ -102,16 +102,16 @@ pub mod pallet { use pezframe_system::pezpallet_prelude::{ensure_signed, OriginFor}; use pezsp_runtime::BoundedVec; - #[pallet::pallet] - pub struct Pallet(_); + #[pezpallet::pezpallet] + pub struct Pezpallet(_); - #[pallet::config] + #[pezpallet::config] pub trait Config: pezframe_system::Config + Sized { // System level stuff. #[allow(deprecated)] type RuntimeEvent: From> + IsType<::RuntimeEvent>; - /// Weight information for extrinsics in this pallet. + /// Weight information for extrinsics in this pezpallet. type WeightInfo: WeightInfo; /// Currency type with which voting happens. type Currency: ReservableCurrency @@ -134,16 +134,16 @@ pub mod pallet { /// /// Also used to compute weight, an overly large value can lead to extrinsics with large /// weight estimation: see `delegate` for instance. - #[pallet::constant] + #[pezpallet::constant] type MaxVotes: Get; /// The minimum period of vote locking. /// /// It should be no shorter than enactment period to ensure that in the case of an approval, /// those successful voters are locked into the consequences that their votes entail. - #[pallet::constant] + #[pezpallet::constant] type VoteLockingPeriod: Get>; - /// Provider for the block number. Normally this is the `pezframe_system` pallet. + /// Provider for the block number. Normally this is the `pezframe_system` pezpallet. type BlockNumberProvider: BlockNumberProvider; /// Hooks are called when a new vote is registered or an existing vote is removed. /// @@ -161,7 +161,7 @@ pub mod pallet { /// All voting for a particular voter in a particular voting class. We store the balance for the /// number of votes that we have recorded. - #[pallet::storage] + #[pezpallet::storage] pub type VotingFor, I: 'static = ()> = StorageDoubleMap< _, Twox64Concat, @@ -173,9 +173,9 @@ pub mod pallet { >; /// The voting classes which have a non-zero lock requirement and the lock amounts which they - /// require. The actual amount locked on behalf of this pallet should always be the maximum of + /// require. The actual amount locked on behalf of this pezpallet should always be the maximum of /// this list. - #[pallet::storage] + #[pezpallet::storage] pub type ClassLocksFor, I: 'static = ()> = StorageMap< _, Twox64Concat, @@ -184,8 +184,8 @@ pub mod pallet { ValueQuery, >; - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] + #[pezpallet::event] + #[pezpallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event, I: 'static = ()> { /// An account has delegated their vote to another account. \[who, target\] Delegated(T::AccountId, T::AccountId, ClassOf), @@ -207,7 +207,7 @@ pub mod pallet { VoteUnlocked { who: T::AccountId, class: ClassOf }, } - #[pallet::error] + #[pezpallet::error] pub enum Error { /// Poll is not ongoing. NotOngoing, @@ -236,8 +236,8 @@ pub mod pallet { BadClass, } - #[pallet::call] - impl, I: 'static> Pallet { + #[pezpallet::call] + impl, I: 'static> Pezpallet { /// Vote in a poll. If `vote.is_aye()`, the vote is to enact the proposal; /// otherwise it is a vote to keep the status quo. /// @@ -247,11 +247,11 @@ pub mod pallet { /// - `vote`: The vote configuration. /// /// Weight: `O(R)` where R is the number of polls the voter has voted on. - #[pallet::call_index(0)] - #[pallet::weight(T::WeightInfo::vote_new().max(T::WeightInfo::vote_existing()))] + #[pezpallet::call_index(0)] + #[pezpallet::weight(T::WeightInfo::vote_new().max(T::WeightInfo::vote_existing()))] pub fn vote( origin: OriginFor, - #[pallet::compact] poll_index: PollIndexOf, + #[pezpallet::compact] poll_index: PollIndexOf, vote: AccountVote>, ) -> DispatchResult { let who = ensure_signed(origin)?; @@ -283,8 +283,8 @@ pub mod pallet { /// voted on. Weight is initially charged as if maximum votes, but is refunded later. // NOTE: weight must cover an incorrect voting of origin with max votes, this is ensure // because a valid delegation cover decoding a direct voting with max votes. - #[pallet::call_index(1)] - #[pallet::weight(T::WeightInfo::delegate(T::MaxVotes::get()))] + #[pezpallet::call_index(1)] + #[pezpallet::weight(T::WeightInfo::delegate(T::MaxVotes::get()))] pub fn delegate( origin: OriginFor, class: ClassOf, @@ -315,8 +315,8 @@ pub mod pallet { /// voted on. Weight is initially charged as if maximum votes, but is refunded later. // NOTE: weight must cover an incorrect voting of origin with max votes, this is ensure // because a valid delegation cover decoding a direct voting with max votes. - #[pallet::call_index(2)] - #[pallet::weight(T::WeightInfo::undelegate(T::MaxVotes::get().into()))] + #[pezpallet::call_index(2)] + #[pezpallet::weight(T::WeightInfo::undelegate(T::MaxVotes::get().into()))] pub fn undelegate( origin: OriginFor, class: ClassOf, @@ -335,8 +335,8 @@ pub mod pallet { /// - `target`: The account to remove the lock on. /// /// Weight: `O(R)` with R number of vote of target. - #[pallet::call_index(3)] - #[pallet::weight(T::WeightInfo::unlock())] + #[pezpallet::call_index(3)] + #[pezpallet::weight(T::WeightInfo::unlock())] pub fn unlock( origin: OriginFor, class: ClassOf, @@ -378,8 +378,8 @@ pub mod pallet { /// /// Weight: `O(R + log R)` where R is the number of polls that `target` has voted on. /// Weight is calculated for the maximum number of vote. - #[pallet::call_index(4)] - #[pallet::weight(T::WeightInfo::remove_vote())] + #[pezpallet::call_index(4)] + #[pezpallet::weight(T::WeightInfo::remove_vote())] pub fn remove_vote( origin: OriginFor, class: Option>, @@ -405,8 +405,8 @@ pub mod pallet { /// /// Weight: `O(R + log R)` where R is the number of polls that `target` has voted on. /// Weight is calculated for the maximum number of vote. - #[pallet::call_index(5)] - #[pallet::weight(T::WeightInfo::remove_other_vote())] + #[pezpallet::call_index(5)] + #[pezpallet::weight(T::WeightInfo::remove_other_vote())] pub fn remove_other_vote( origin: OriginFor, target: AccountIdLookupOf, @@ -422,7 +422,7 @@ pub mod pallet { } } -impl, I: 'static> Pallet { +impl, I: 'static> Pezpallet { /// Actually enact a vote, if legit. fn try_vote( who: &T::AccountId, diff --git a/bizinikiwi/pezframe/conviction-voting/src/tests.rs b/bizinikiwi/pezframe/conviction-voting/src/tests.rs index 636128b3..7b231d25 100644 --- a/bizinikiwi/pezframe/conviction-voting/src/tests.rs +++ b/bizinikiwi/pezframe/conviction-voting/src/tests.rs @@ -139,7 +139,7 @@ impl Polling> for TestPolls { Some(Ongoing(..)) => {}, _ => return Err(()), } - let now = pezframe_system::Pallet::::block_number(); + let now = pezframe_system::Pezpallet::::block_number(); polls.insert(index, Completed(now, approved)); Polls::set(polls); Ok(()) @@ -148,7 +148,7 @@ impl Polling> for TestPolls { impl Config for Test { type RuntimeEvent = RuntimeEvent; - type Currency = pezpallet_balances::Pallet; + type Currency = pezpallet_balances::Pezpallet; type VoteLockingPeriod = ConstU64<3>; type MaxVotes = ConstU32<3>; type WeightInfo = (); diff --git a/bizinikiwi/pezframe/conviction-voting/src/weights.rs b/bizinikiwi/pezframe/conviction-voting/src/weights.rs index 0c4db27d..7e8a6014 100644 --- a/bizinikiwi/pezframe/conviction-voting/src/weights.rs +++ b/bizinikiwi/pezframe/conviction-voting/src/weights.rs @@ -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_conviction_voting +// --pezpallet=pezpallet_conviction_voting // --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2 // --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/conviction-voting/src/weights.rs // --wasm-execution=compiled diff --git a/bizinikiwi/pezframe/core-fellowship/src/benchmarking.rs b/bizinikiwi/pezframe/core-fellowship/src/benchmarking.rs index a3899b11..80165057 100644 --- a/bizinikiwi/pezframe/core-fellowship/src/benchmarking.rs +++ b/bizinikiwi/pezframe/core-fellowship/src/benchmarking.rs @@ -15,12 +15,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Salary pallet benchmarking. +//! Salary pezpallet benchmarking. #![cfg(feature = "runtime-benchmarks")] use super::*; -use crate::Pallet as CoreFellowship; +use crate::Pezpallet as CoreFellowship; use alloc::{boxed::Box, vec}; use pezframe_benchmarking::v2::*; @@ -133,7 +133,7 @@ mod benchmarks { let member = make_member::(0)?; // Set it to the max value to ensure that any possible auto-demotion period has passed. - pezframe_system::Pallet::::set_block_number(BlockNumberFor::::max_value()); + pezframe_system::Pezpallet::::set_block_number(BlockNumberFor::::max_value()); ensure_evidence::(&member)?; assert!(Member::::contains_key(&member)); @@ -154,7 +154,7 @@ mod benchmarks { let member = make_member::(initial_rank)?; // Set it to the max value to ensure that any possible auto-demotion period has passed. - pezframe_system::Pallet::::set_block_number(BlockNumberFor::::max_value()); + pezframe_system::Pezpallet::::set_block_number(BlockNumberFor::::max_value()); ensure_evidence::(&member)?; assert!(Member::::contains_key(&member)); @@ -212,7 +212,7 @@ mod benchmarks { let to_rank = (current_rank + 1).min(max_rank); // Ensure `to_rank` <= `max_rank`. // Set block number to avoid auto-demotion. - pezframe_system::Pallet::::set_block_number(BlockNumberFor::::max_value()); + pezframe_system::Pezpallet::::set_block_number(BlockNumberFor::::max_value()); ensure_evidence::(&member)?; #[extrinsic_call] @@ -299,9 +299,9 @@ mod benchmarks { #[benchmark] fn approve() -> Result<(), BenchmarkError> { let member = make_member::(1)?; - let then = pezframe_system::Pallet::::block_number(); + let then = pezframe_system::Pezpallet::::block_number(); let now = then.saturating_plus_one(); - pezframe_system::Pallet::::set_block_number(now); + pezframe_system::Pezpallet::::set_block_number(now); ensure_evidence::(&member)?; assert_eq!(Member::::get(&member).unwrap().last_proof, then); diff --git a/bizinikiwi/pezframe/core-fellowship/src/lib.rs b/bizinikiwi/pezframe/core-fellowship/src/lib.rs index 7c166b3d..ad7ea3e2 100644 --- a/bizinikiwi/pezframe/core-fellowship/src/lib.rs +++ b/bizinikiwi/pezframe/core-fellowship/src/lib.rs @@ -24,7 +24,7 @@ //! //! - Begin with a call to `induct`, where some privileged origin (perhaps a pre-existing member of //! `rank > 1`) is able to make a candidate from an account and introduce it to be tracked in this -//! pallet in order to allow evidence to be submitted and promotion voted on. +//! pezpallet in order to allow evidence to be submitted and promotion voted on. //! - The candidate then calls `submit_evidence` to apply for their promotion to rank 1. //! - A `PromoteOrigin` of at least rank 1 calls `promote` on the candidate to elevate it to rank 1. //! - Some time later but before rank 1's `demotion_period` elapses, candidate calls @@ -38,15 +38,15 @@ //! - If a candidate fails to be promoted to a member within the `offboard_timeout` period, then //! anyone may call `bump` to remove the account's candidacy. //! - Pre-existing members may call `import_member` on themselves (formerly `import`) to have their -//! rank recognised and be inducted into this pallet (to gain a salary and allow for eventual +//! rank recognised and be inducted into this pezpallet (to gain a salary and allow for eventual //! promotion). -//! - If, externally to this pallet, a member or candidate has their rank removed completely, then -//! `offboard` may be called to remove them entirely from this pallet. +//! - If, externally to this pezpallet, a member or candidate has their rank removed completely, then +//! `offboard` may be called to remove them entirely from this pezpallet. //! //! Note there is a difference between having a rank of 0 (whereby the account is a *candidate*) and //! having no rank at all (whereby we consider it *unranked*). An account can be demoted from rank //! 0 to become unranked. This process is called being offboarded and there is an extrinsic to do -//! this explicitly when external factors to this pallet have caused the tracked account to become +//! this explicitly when external factors to this pezpallet have caused the tracked account to become //! unranked. At rank 0, there is not a "demotion" period after which the account may be bumped to //! become offboarded but rather an "offboard timeout". //! @@ -87,7 +87,7 @@ mod benchmarking; pub mod migration; pub mod weights; -pub use pallet::*; +pub use pezpallet::*; pub use weights::*; /// The desired outcome for which evidence is presented. @@ -112,11 +112,11 @@ pub enum Wish { /// A piece of evidence to underpin a [Wish]. /// -/// From the pallet's perspective, this is just a blob of data without meaning. The fellows can +/// From the pezpallet's perspective, this is just a blob of data without meaning. The fellows can /// decide how to concretely utilise it. This could be an IPFS hash, a URL or structured data. pub type Evidence = BoundedVec>::EvidenceSize>; -/// The status of the pallet instance. +/// The status of the pezpallet instance. #[derive( Encode, Decode, @@ -181,8 +181,8 @@ pub struct MemberStatus { last_proof: BlockNumber, } -#[pezframe_support::pallet] -pub mod pallet { +#[pezframe_support::pezpallet] +pub mod pezpallet { use super::*; use pezframe_support::{ dispatch::Pays, @@ -193,13 +193,13 @@ pub mod pallet { /// The in-code storage version. const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); - #[pallet::pallet] - #[pallet::storage_version(STORAGE_VERSION)] - pub struct Pallet(PhantomData<(T, I)>); + #[pezpallet::pezpallet] + #[pezpallet::storage_version(STORAGE_VERSION)] + pub struct Pezpallet(PhantomData<(T, I)>); - #[pallet::config] + #[pezpallet::config] pub trait Config: pezframe_system::Config { - /// Weight information for extrinsics in this pallet. + /// Weight information for extrinsics in this pezpallet. type WeightInfo: WeightInfo; /// The runtime event type. @@ -219,7 +219,7 @@ pub mod pallet { /// The origin which has permission update the parameters. type ParamsOrigin: EnsureOrigin; - /// The origin which has permission to move a candidate into being tracked in this pallet. + /// The origin which has permission to move a candidate into being tracked in this pezpallet. /// Generally a very low-permission, such as a pre-existing member of rank 1 or above. /// /// This allows the candidate to deposit evidence for their request to be promoted to a @@ -239,13 +239,13 @@ pub mod pallet { type FastPromoteOrigin: EnsureOrigin>; /// The maximum size in bytes submitted evidence is allowed to be. - #[pallet::constant] + #[pezpallet::constant] type EvidenceSize: Get; - /// Represents the highest possible rank in this pallet. + /// Represents the highest possible rank in this pezpallet. /// /// Increasing this value is supported, but decreasing it may lead to a broken state. - #[pallet::constant] + #[pezpallet::constant] type MaxRank: Get; } @@ -263,29 +263,29 @@ pub mod pallet { pub type RankOf = <>::Members as RankedMembers>::Rank; /// The overall status of the system. - #[pallet::storage] + #[pezpallet::storage] pub type Params, I: 'static = ()> = StorageValue<_, ParamsOf, ValueQuery>; /// The status of a claimant. - #[pallet::storage] + #[pezpallet::storage] pub type Member, I: 'static = ()> = StorageMap<_, Twox64Concat, T::AccountId, MemberStatusOf, OptionQuery>; /// Some evidence together with the desired outcome for which it was presented. - #[pallet::storage] + #[pezpallet::storage] pub type MemberEvidence, I: 'static = ()> = StorageMap<_, Twox64Concat, T::AccountId, (Wish, Evidence), OptionQuery>; - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] + #[pezpallet::event] + #[pezpallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event, I: 'static = ()> { - /// Parameters for the pallet have changed. + /// Parameters for the pezpallet have changed. ParamsChanged { params: ParamsOf }, /// Member activity flag has been set. ActiveChanged { who: T::AccountId, is_active: bool }, - /// Member has begun being tracked in this pallet. + /// Member has begun being tracked in this pezpallet. Inducted { who: T::AccountId }, - /// Member has been removed from being tracked in this pallet (i.e. because rank is now + /// Member has been removed from being tracked in this pezpallet (i.e. because rank is now /// zero). Offboarded { who: T::AccountId }, /// Member has been promoted to the given rank. @@ -316,7 +316,7 @@ pub mod pallet { Swapped { who: T::AccountId, new_who: T::AccountId }, } - #[pallet::error] + #[pezpallet::error] pub enum Error { /// Member's rank is too low. Unranked, @@ -332,16 +332,16 @@ pub mod pallet { /// No work needs to be done at present for this member. NothingDoing, /// The candidate has already been inducted. This should never happen since it would - /// require a candidate (rank 0) to already be tracked in the pallet. + /// require a candidate (rank 0) to already be tracked in the pezpallet. AlreadyInducted, - /// The candidate has not been inducted, so cannot be offboarded from this pallet. + /// The candidate has not been inducted, so cannot be offboarded from this pezpallet. NotTracked, /// Operation cannot be done yet since not enough time has passed. TooSoon, } - #[pallet::call] - impl, I: 'static> Pallet { + #[pezpallet::call] + impl, I: 'static> Pezpallet { /// Bump the state of a member. /// /// This will demote a member whose `last_proof` is now beyond their rank's @@ -349,8 +349,8 @@ pub mod pallet { /// /// - `origin`: A `Signed` origin of an account. /// - `who`: A member account whose state is to be updated. - #[pallet::weight(T::WeightInfo::bump_offboard().max(T::WeightInfo::bump_demote()))] - #[pallet::call_index(0)] + #[pezpallet::weight(T::WeightInfo::bump_offboard().max(T::WeightInfo::bump_demote()))] + #[pezpallet::call_index(0)] pub fn bump(origin: OriginFor, who: T::AccountId) -> DispatchResultWithPostInfo { ensure_signed(origin)?; let mut member = Member::::get(&who).ok_or(Error::::NotTracked)?; @@ -371,7 +371,7 @@ pub mod pallet { let demotion_block = member.last_proof.saturating_add(demotion_period); // Ensure enough time has passed. - let now = pezframe_system::Pallet::::block_number(); + let now = pezframe_system::Pezpallet::::block_number(); if now >= demotion_block { T::Members::demote(&who)?; let maybe_to_rank = T::Members::rank_of(&who); @@ -394,9 +394,9 @@ pub mod pallet { /// Set the parameters. /// /// - `origin`: An origin complying with `ParamsOrigin` or root. - /// - `params`: The new parameters for the pallet. - #[pallet::weight(T::WeightInfo::set_params())] - #[pallet::call_index(1)] + /// - `params`: The new parameters for the pezpallet. + #[pezpallet::weight(T::WeightInfo::set_params())] + #[pezpallet::call_index(1)] pub fn set_params(origin: OriginFor, params: Box>) -> DispatchResult { T::ParamsOrigin::ensure_origin_or_root(origin)?; @@ -410,8 +410,8 @@ pub mod pallet { /// /// - `origin`: A `Signed` origin of a member's account. /// - `is_active`: `true` iff the member is active. - #[pallet::weight(T::WeightInfo::set_active())] - #[pallet::call_index(2)] + #[pezpallet::weight(T::WeightInfo::set_active())] + #[pezpallet::call_index(2)] pub fn set_active(origin: OriginFor, is_active: bool) -> DispatchResult { let who = ensure_signed(origin)?; ensure!( @@ -429,13 +429,13 @@ pub mod pallet { /// /// This resets `last_proof` to the current block, thereby delaying any automatic demotion. /// - /// `who` must already be tracked by this pallet for this to have an effect. + /// `who` must already be tracked by this pezpallet for this to have an effect. /// /// - `origin`: An origin which satisfies `ApproveOrigin` or root. /// - `who`: A member (i.e. of non-zero rank). /// - `at_rank`: The rank of member. - #[pallet::weight(T::WeightInfo::approve())] - #[pallet::call_index(3)] + #[pezpallet::weight(T::WeightInfo::approve())] + #[pezpallet::call_index(3)] pub fn approve( origin: OriginFor, who: T::AccountId, @@ -450,7 +450,7 @@ pub mod pallet { ensure!(rank == at_rank, Error::::UnexpectedRank); let mut member = Member::::get(&who).ok_or(Error::::NotTracked)?; - member.last_proof = pezframe_system::Pallet::::block_number(); + member.last_proof = pezframe_system::Pezpallet::::block_number(); Member::::insert(&who, &member); Self::dispose_evidence(who.clone(), at_rank, Some(at_rank)); @@ -463,8 +463,8 @@ pub mod pallet { /// /// - `origin`: An origin which satisfies `InductOrigin` or root. /// - `who`: The account ID of the candidate to be inducted and become a member. - #[pallet::weight(T::WeightInfo::induct())] - #[pallet::call_index(4)] + #[pezpallet::weight(T::WeightInfo::induct())] + #[pezpallet::call_index(4)] pub fn induct(origin: OriginFor, who: T::AccountId) -> DispatchResult { match T::InductOrigin::try_origin(origin) { Ok(_) => {}, @@ -474,7 +474,7 @@ pub mod pallet { ensure!(T::Members::rank_of(&who).is_none(), Error::::Ranked); T::Members::induct(&who)?; - let now = pezframe_system::Pallet::::block_number(); + let now = pezframe_system::Pezpallet::::block_number(); Member::::insert( &who, MemberStatus { is_active: true, last_promotion: now, last_proof: now }, @@ -489,8 +489,8 @@ pub mod pallet { /// `to_rank` or more or root. /// - `who`: The account ID of the member to be promoted to `to_rank`. /// - `to_rank`: One more than the current rank of `who`. - #[pallet::weight(T::WeightInfo::promote())] - #[pallet::call_index(5)] + #[pezpallet::weight(T::WeightInfo::promote())] + #[pezpallet::call_index(5)] pub fn promote( origin: OriginFor, who: T::AccountId, @@ -507,7 +507,7 @@ pub mod pallet { ); let mut member = Member::::get(&who).ok_or(Error::::NotTracked)?; - let now = pezframe_system::Pallet::::block_number(); + let now = pezframe_system::Pezpallet::::block_number(); let params = Params::::get(); let rank_index = Self::rank_to_index(to_rank).ok_or(Error::::InvalidRank)?; @@ -534,8 +534,8 @@ pub mod pallet { /// This is useful for out-of-band promotions, hence it has its own `FastPromoteOrigin` to /// be (possibly) more restrictive than `PromoteOrigin`. Note that the member must already /// be inducted. - #[pallet::weight(T::WeightInfo::promote_fast(*to_rank as u32))] - #[pallet::call_index(10)] + #[pezpallet::weight(T::WeightInfo::promote_fast(*to_rank as u32))] + #[pezpallet::call_index(10)] pub fn promote_fast( origin: OriginFor, who: T::AccountId, @@ -550,7 +550,7 @@ pub mod pallet { ensure!(to_rank > curr_rank, Error::::UnexpectedRank); let mut member = Member::::get(&who).ok_or(Error::::NotTracked)?; - let now = pezframe_system::Pallet::::block_number(); + let now = pezframe_system::Pezpallet::::block_number(); member.last_promotion = now; member.last_proof = now; @@ -570,10 +570,10 @@ pub mod pallet { /// Stop tracking a prior member who is now not a ranked member of the collective. /// /// - `origin`: A `Signed` origin of an account. - /// - `who`: The ID of an account which was tracked in this pallet but which is now not a + /// - `who`: The ID of an account which was tracked in this pezpallet but which is now not a /// ranked member of the collective. - #[pallet::weight(T::WeightInfo::offboard())] - #[pallet::call_index(6)] + #[pezpallet::weight(T::WeightInfo::offboard())] + #[pezpallet::call_index(6)] pub fn offboard(origin: OriginFor, who: T::AccountId) -> DispatchResultWithPostInfo { ensure_signed(origin)?; ensure!(T::Members::rank_of(&who).is_none(), Error::::Ranked); @@ -594,8 +594,8 @@ pub mod pallet { /// - `evidence`: A dump of evidence to be considered. This should generally be either a /// Markdown-encoded document or a series of 32-byte hashes which can be found on a /// decentralised content-based-indexing system such as IPFS. - #[pallet::weight(T::WeightInfo::submit_evidence())] - #[pallet::call_index(7)] + #[pezpallet::weight(T::WeightInfo::submit_evidence())] + #[pezpallet::call_index(7)] pub fn submit_evidence( origin: OriginFor, wish: Wish, @@ -609,15 +609,15 @@ pub mod pallet { Ok(if replaced { Pays::Yes } else { Pays::No }.into()) } - /// Introduce an already-ranked individual of the collective into this pallet. + /// Introduce an already-ranked individual of the collective into this pezpallet. /// /// The rank may still be zero. This resets `last_proof` to the current block and /// `last_promotion` will be set to zero, thereby delaying any automatic demotion but /// allowing immediate promotion. /// /// - `origin`: A signed origin of a ranked, but not tracked, account. - #[pallet::weight(T::WeightInfo::import())] - #[pallet::call_index(8)] + #[pezpallet::weight(T::WeightInfo::import())] + #[pezpallet::call_index(8)] #[deprecated = "Use `import_member` instead"] #[allow(deprecated)] // Otherwise FRAME will complain about using something deprecated. pub fn import(origin: OriginFor) -> DispatchResultWithPostInfo { @@ -627,7 +627,7 @@ pub mod pallet { Ok(Pays::No.into()) // Successful imports are free } - /// Introduce an already-ranked individual of the collective into this pallet. + /// Introduce an already-ranked individual of the collective into this pezpallet. /// /// The rank may still be zero. Can be called by anyone on any collective member - including /// the sender. @@ -637,8 +637,8 @@ pub mod pallet { /// /// - `origin`: A signed origin of a ranked, but not tracked, account. /// - `who`: The account ID of the collective member to be inducted. - #[pallet::weight(T::WeightInfo::set_partial_params())] - #[pallet::call_index(11)] + #[pezpallet::weight(T::WeightInfo::set_partial_params())] + #[pezpallet::call_index(11)] pub fn import_member( origin: OriginFor, who: T::AccountId, @@ -652,12 +652,12 @@ pub mod pallet { /// Set the parameters partially. /// /// - `origin`: An origin complying with `ParamsOrigin` or root. - /// - `partial_params`: The new parameters for the pallet. + /// - `partial_params`: The new parameters for the pezpallet. /// /// This update config with multiple arguments without duplicating /// the fields that does not need to update (set to None). - #[pallet::weight(T::WeightInfo::set_partial_params())] - #[pallet::call_index(9)] + #[pezpallet::weight(T::WeightInfo::set_partial_params())] + #[pezpallet::call_index(9)] pub fn set_partial_params( origin: OriginFor, partial_params: Box>, @@ -687,7 +687,7 @@ pub mod pallet { } } - impl, I: 'static> Pallet { + impl, I: 'static> Pezpallet { /// Partially update the base slice with a new slice /// /// Only elements in the base slice which has a new value in the new slice will be updated. @@ -702,14 +702,14 @@ pub mod pallet { } } - /// Import `who` into the core-fellowship pallet. + /// Import `who` into the core-fellowship pezpallet. /// /// `who` must be a member of the collective but *not* already imported. pub(crate) fn do_import(who: T::AccountId) -> DispatchResult { ensure!(!Member::::contains_key(&who), Error::::AlreadyInducted); let rank = T::Members::rank_of(&who).ok_or(Error::::Unranked)?; - let now = pezframe_system::Pallet::::block_number(); + let now = pezframe_system::Pezpallet::::block_number(); Member::::insert( &who, MemberStatus { is_active: true, last_promotion: 0u32.into(), last_proof: now }, @@ -739,7 +739,7 @@ pub mod pallet { } } - impl, I: 'static> GetSalary, T::AccountId, T::Balance> for Pallet { + impl, I: 'static> GetSalary, T::AccountId, T::Balance> for Pezpallet { fn get_salary(rank: RankOf, who: &T::AccountId) -> T::Balance { let index = match Self::rank_to_index(rank) { Some(i) => i, @@ -757,7 +757,7 @@ pub mod pallet { } } -/// Guard to ensure that the given origin is inducted into this pallet with a given minimum rank. +/// Guard to ensure that the given origin is inducted into this pezpallet with a given minimum rank. /// The account ID of the member is the `Success` value. pub struct EnsureInducted(PhantomData<(T, I)>); impl, I: 'static, const MIN_RANK: u16> EnsureOrigin @@ -794,7 +794,7 @@ impl_ensure_origin_with_arg_ignoring_arg! { {} } -impl, I: 'static> RankedMembersSwapHandler for Pallet { +impl, I: 'static> RankedMembersSwapHandler for Pezpallet { fn swapped(old: &T::AccountId, new: &T::AccountId, _rank: u16) { if old == new { defensive!("Should not try to swap with self"); @@ -822,7 +822,7 @@ impl, I: 'static> RankedMembersSwapHandler for P #[cfg(feature = "runtime-benchmarks")] impl, I: 'static> - pezpallet_ranked_collective::BenchmarkSetup<::AccountId> for Pallet + pezpallet_ranked_collective::BenchmarkSetup<::AccountId> for Pezpallet { fn ensure_member(who: &::AccountId) { #[allow(deprecated)] diff --git a/bizinikiwi/pezframe/core-fellowship/src/migration.rs b/bizinikiwi/pezframe/core-fellowship/src/migration.rs index 0dbe30f8..2d2fa601 100644 --- a/bizinikiwi/pezframe/core-fellowship/src/migration.rs +++ b/bizinikiwi/pezframe/core-fellowship/src/migration.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Storage migrations for the core-fellowship pallet. +//! Storage migrations for the core-fellowship pezpallet. use super::*; use pezframe_support::{ pezpallet_prelude::*, @@ -65,7 +65,7 @@ mod v0 { /// V0 type for [`crate::Params`]. #[storage_alias] pub type Params, I: 'static> = - StorageValue, ParamsOf, ValueQuery>; + StorageValue, ParamsOf, ValueQuery>; } pub struct MigrateToV1(PhantomData<(T, I)>); @@ -108,6 +108,6 @@ pub type MigrateV0ToV1 = pezframe_support::migrations::VersionedMigration< 0, // The migration will only execute when the on-chain storage version is 0 1, // The on-chain storage version will be set to 1 after the migration is complete MigrateToV1, - crate::pallet::Pallet, + crate::pezpallet::Pezpallet, ::DbWeight, >; diff --git a/bizinikiwi/pezframe/core-fellowship/src/tests/integration.rs b/bizinikiwi/pezframe/core-fellowship/src/tests/integration.rs index 431577c1..22d68afe 100644 --- a/bizinikiwi/pezframe/core-fellowship/src/tests/integration.rs +++ b/bizinikiwi/pezframe/core-fellowship/src/tests/integration.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Integration test together with the ranked-collective pallet. +//! Integration test together with the ranked-collective pezpallet. #![allow(deprecated)] @@ -156,7 +156,7 @@ fn signed(who: u64) -> RuntimeOrigin { } fn assert_last_event(generic_event: ::RuntimeEvent) { - let events = pezframe_system::Pallet::::events(); + let events = pezframe_system::Pezpallet::::events(); let system_event: ::RuntimeEvent = generic_event.into(); let pezframe_system::EventRecord { event, .. } = events.last().expect("Event expected"); assert_eq!(event, &system_event.into()); diff --git a/bizinikiwi/pezframe/core-fellowship/src/weights.rs b/bizinikiwi/pezframe/core-fellowship/src/weights.rs index b802e7fd..60ad6f61 100644 --- a/bizinikiwi/pezframe/core-fellowship/src/weights.rs +++ b/bizinikiwi/pezframe/core-fellowship/src/weights.rs @@ -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_core_fellowship +// --pezpallet=pezpallet_core_fellowship // --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2 // --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/core-fellowship/src/weights.rs // --wasm-execution=compiled diff --git a/bizinikiwi/pezframe/delegated-staking/Cargo.toml b/bizinikiwi/pezframe/delegated-staking/Cargo.toml index 97028b10..37581fda 100644 --- a/bizinikiwi/pezframe/delegated-staking/Cargo.toml +++ b/bizinikiwi/pezframe/delegated-staking/Cargo.toml @@ -6,7 +6,7 @@ edition.workspace = true license = "Apache-2.0" homepage.workspace = true repository.workspace = true -description = "FRAME delegated staking pallet" +description = "FRAME delegated staking pezpallet" documentation = "https://docs.rs/pezpallet-delegated-staking" [package.metadata.docs.rs] diff --git a/bizinikiwi/pezframe/delegated-staking/src/impls.rs b/bizinikiwi/pezframe/delegated-staking/src/impls.rs index 708ddd56..c8ed56d0 100644 --- a/bizinikiwi/pezframe/delegated-staking/src/impls.rs +++ b/bizinikiwi/pezframe/delegated-staking/src/impls.rs @@ -20,7 +20,7 @@ use super::*; use pezsp_staking::{DelegationInterface, DelegationMigrator, OnStakingUpdate}; -impl DelegationInterface for Pallet { +impl DelegationInterface for Pezpallet { type Balance = BalanceOf; type AccountId = T::AccountId; @@ -46,7 +46,7 @@ impl DelegationInterface for Pallet { agent: Agent, reward_account: &Self::AccountId, ) -> DispatchResult { - Pallet::::register_agent( + Pezpallet::::register_agent( RawOrigin::Signed(agent.clone().get()).into(), reward_account.clone(), ) @@ -54,7 +54,7 @@ impl DelegationInterface for Pallet { /// Remove `Agent` registration. fn remove_agent(agent: Agent) -> DispatchResult { - Pallet::::remove_agent(RawOrigin::Signed(agent.clone().get()).into()) + Pezpallet::::remove_agent(RawOrigin::Signed(agent.clone().get()).into()) } /// Add more delegation to the `Agent` account. @@ -63,7 +63,7 @@ impl DelegationInterface for Pallet { agent: Agent, amount: Self::Balance, ) -> DispatchResult { - Pallet::::delegate_to_agent(RawOrigin::Signed(who.get()).into(), agent.get(), amount) + Pezpallet::::delegate_to_agent(RawOrigin::Signed(who.get()).into(), agent.get(), amount) } /// Withdraw delegation of `delegator` to `Agent`. @@ -76,7 +76,7 @@ impl DelegationInterface for Pallet { amount: Self::Balance, num_slashing_spans: u32, ) -> DispatchResult { - Pallet::::release_delegation( + Pezpallet::::release_delegation( RawOrigin::Signed(agent.get()).into(), delegator.get(), amount, @@ -95,11 +95,11 @@ impl DelegationInterface for Pallet { value: Self::Balance, maybe_reporter: Option, ) -> pezsp_runtime::DispatchResult { - Pallet::::do_slash(agent, delegator, value, maybe_reporter) + Pezpallet::::do_slash(agent, delegator, value, maybe_reporter) } } -impl DelegationMigrator for Pallet { +impl DelegationMigrator for Pezpallet { type Balance = BalanceOf; type AccountId = T::AccountId; @@ -107,14 +107,14 @@ impl DelegationMigrator for Pallet { agent: Agent, reward_account: &Self::AccountId, ) -> DispatchResult { - Pallet::::migrate_to_agent(RawOrigin::Signed(agent.get()).into(), reward_account.clone()) + Pezpallet::::migrate_to_agent(RawOrigin::Signed(agent.get()).into(), reward_account.clone()) } fn migrate_delegation( agent: Agent, delegator: Delegator, value: Self::Balance, ) -> DispatchResult { - Pallet::::migrate_delegation( + Pezpallet::::migrate_delegation( RawOrigin::Signed(agent.get()).into(), delegator.get(), value, @@ -138,7 +138,7 @@ impl DelegationMigrator for Pallet { } } -impl OnStakingUpdate> for Pallet { +impl OnStakingUpdate> for Pezpallet { fn on_slash( who: &T::AccountId, _slashed_active: BalanceOf, diff --git a/bizinikiwi/pezframe/delegated-staking/src/lib.rs b/bizinikiwi/pezframe/delegated-staking/src/lib.rs index 24ca2932..f6128fac 100644 --- a/bizinikiwi/pezframe/delegated-staking/src/lib.rs +++ b/bizinikiwi/pezframe/delegated-staking/src/lib.rs @@ -15,9 +15,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! # Delegated Staking Pallet +//! # Delegated Staking Pezpallet //! -//! This pallet implements [`pezsp_staking::DelegationInterface`] that provides delegation +//! This pezpallet implements [`pezsp_staking::DelegationInterface`] that provides delegation //! functionality to `delegators` and `agents`. It is designed to be used in conjunction with //! [`StakingInterface`] and relies on [`Config::CoreStaking`] to provide primitive staking //! functions. @@ -38,24 +38,24 @@ //! //! ## Goals //! -//! Direct nomination on the Staking pallet does not scale well. Nominations pools were created to +//! Direct nomination on the Staking pezpallet does not scale well. Nominations pools were created to //! address this by pooling delegator funds into one account and then staking it. This though had //! a very critical limitation that the funds were moved from delegator account to pool account //! and hence the delegator lost control over their funds for using it for other purposes such as -//! governance. This pallet aims to solve this by extending the staking pallet to support a new +//! governance. This pezpallet aims to solve this by extending the staking pezpallet to support a new //! primitive function: delegation of funds to an `agent` with the intent of staking. The agent can //! then stake the delegated funds to [`Config::CoreStaking`] on behalf of the delegators. //! //! ### Withdrawal Management //! Agent unbonding does not regulate ordering of consequent withdrawal for delegators. This is upto -//! the consumer of this pallet to implement in what order unbondable funds from +//! the consumer of this pezpallet to implement in what order unbondable funds from //! [`Config::CoreStaking`] can be withdrawn by the delegators. //! //! ### Reward and Slashing -//! This pallet does not enforce any specific strategy for how rewards or slashes are applied. It +//! This pezpallet does not enforce any specific strategy for how rewards or slashes are applied. It //! is upto the `agent` account to decide how to apply the rewards and slashes. //! -//! This importantly allows clients of this pallet to build their own strategies for reward/slashes. +//! This importantly allows clients of this pezpallet to build their own strategies for reward/slashes. //! For example, an `agent` account can choose to first slash the reward pot before slashing the //! delegators. Or part of the reward can go to an insurance fund that can be used to cover any //! potential future slashes. The goal is to eventually allow foreign MultiLocations @@ -64,42 +64,42 @@ //! ## Core functions //! -//! - Allow an account to receive delegations. See [`Pallet::register_agent`]. -//! - Delegate funds to an `agent` account. See [`Pallet::delegate_to_agent`]. +//! - Allow an account to receive delegations. See [`Pezpallet::register_agent`]. +//! - Delegate funds to an `agent` account. See [`Pezpallet::delegate_to_agent`]. //! - Release delegated funds from an `agent` account to the `delegator`. See -//! [`Pallet::release_delegation`]. -//! - Migrate a `Nominator` account to an `agent` account. See [`Pallet::migrate_to_agent`]. +//! [`Pezpallet::release_delegation`]. +//! - Migrate a `Nominator` account to an `agent` account. See [`Pezpallet::migrate_to_agent`]. //! Explained in more detail in the `Migration` section. //! - Migrate unclaimed delegated funds from `agent` to delegator. When a nominator migrates to an //! agent, the funds are held in a proxy account. This function allows the delegator to claim -//! their share of the funds from the proxy account. See [`Pallet::migrate_delegation`]. +//! their share of the funds from the proxy account. See [`Pezpallet::migrate_delegation`]. //! //! ## Lazy Slashing -//! One of the reasons why direct nominators on staking pallet cannot scale well is because all +//! One of the reasons why direct nominators on staking pezpallet cannot scale well is because all //! nominators are slashed at the same time. This is expensive and needs to be bounded operation. //! -//! This pallet implements a lazy slashing mechanism. Any slashes to the `agent` are posted in its +//! This pezpallet implements a lazy slashing mechanism. Any slashes to the `agent` are posted in its //! `AgentLedger` as a pending slash. Since the actual amount is held in the multiple -//! `delegator` accounts, this pallet has no way to know how to apply slash. It is the `agent`'s -//! responsibility to apply slashes for each delegator, one at a time. Staking pallet ensures the +//! `delegator` accounts, this pezpallet has no way to know how to apply slash. It is the `agent`'s +//! responsibility to apply slashes for each delegator, one at a time. Staking pezpallet ensures the //! pending slash never exceeds staked amount and would freeze further withdraws until all pending //! slashes are cleared. //! -//! The user of this pallet can apply slash using +//! The user of this pezpallet can apply slash using //! [DelegationInterface::delegator_slash](pezsp_staking::DelegationInterface::delegator_slash). //! //! ## Migration from Nominator to Agent //! More details [here](https://hackmd.io/@ak0n/454-np-governance). //! //! ## Nomination Pool vs Delegation Staking -//! This pallet is not a replacement for Nomination Pool but adds a new primitive in addition to -//! staking pallet that can be used by Nomination Pool to support delegation based staking. It can -//! be thought of as an extension to the Staking Pallet in relation to Nomination Pools. +//! This pezpallet is not a replacement for Nomination Pool but adds a new primitive in addition to +//! staking pezpallet that can be used by Nomination Pool to support delegation based staking. It can +//! be thought of as an extension to the Staking Pezpallet in relation to Nomination Pools. //! Technically, these changes could be made in one of those pallets as well but that would have //! meant significant refactoring and high chances of introducing a regression. With this approach, -//! we can keep the existing pallets with minimal changes and introduce a new pallet that can be +//! we can keep the existing pallets with minimal changes and introduce a new pezpallet that can be //! optionally used by Nomination Pool. The vision is to build this in a configurable way such that -//! runtime can choose whether to use this pallet or not. +//! runtime can choose whether to use this pezpallet or not. //! //! With that said, following is the main difference between //! #### Nomination Pool without delegation support @@ -108,14 +108,14 @@ //! //! #### Nomination Pool with delegation support //! 1) delegate fund from delegator to pool account, and -//! 2) stake from pool account as an `Agent` account on the staking pallet. +//! 2) stake from pool account as an `Agent` account on the staking pezpallet. //! //! The difference being, in the second approach, the delegated funds will be locked in-place in //! user's account enabling them to participate in use cases that allows use of `held` funds such //! as participation in governance voting. //! //! Nomination pool still does all the heavy lifting around pool administration, reward -//! distribution, lazy slashing and as such, is not meant to be replaced with this pallet. +//! distribution, lazy slashing and as such, is not meant to be replaced with this pezpallet. //! //! ## Limitations //! - Rewards can not be auto-compounded. @@ -135,7 +135,7 @@ pub mod types; extern crate alloc; -pub use pallet::*; +pub use pezpallet::*; use types::*; @@ -160,7 +160,7 @@ use pezsp_runtime::{ }; use pezsp_staking::{Agent, Delegator, EraIndex, StakingInterface, StakingUnchecked}; -/// The log target of this pallet. +/// The log target of this pezpallet. pub const LOG_TARGET: &str = "runtime::delegated-staking"; // syntactic sugar for logging. #[macro_export] @@ -168,7 +168,7 @@ macro_rules! log { ($level:tt, $patter:expr $(, $values:expr)* $(,)?) => { log::$level!( target: $crate::LOG_TARGET, - concat!("[{:?}] 🏊‍♂️ ", $patter), >::block_number() $(, $values)* + concat!("[{:?}] 🏊‍♂️ ", $patter), >::block_number() $(, $values)* ) }; } @@ -177,24 +177,24 @@ pub type BalanceOf = use pezframe_system::{ensure_signed, pezpallet_prelude::*, RawOrigin}; -#[pezframe_support::pallet] -pub mod pallet { +#[pezframe_support::pezpallet] +pub mod pezpallet { use super::*; /// The in-code storage version. const STORAGE_VERSION: StorageVersion = StorageVersion::new(0); - #[pallet::pallet] - #[pallet::storage_version(STORAGE_VERSION)] - pub struct Pallet(PhantomData); + #[pezpallet::pezpallet] + #[pezpallet::storage_version(STORAGE_VERSION)] + pub struct Pezpallet(PhantomData); - #[pallet::config] + #[pezpallet::config] pub trait Config: pezframe_system::Config { /// The overarching event type. #[allow(deprecated)] type RuntimeEvent: From> + IsType<::RuntimeEvent>; - /// Injected identifier for the pallet. - #[pallet::constant] + /// Injected identifier for the pezpallet. + #[pezpallet::constant] type PalletId: Get; /// Currency type. @@ -206,7 +206,7 @@ pub mod pallet { type OnSlash: OnUnbalanced>; /// Fraction of the slash that is rewarded to the caller of pending slash to the agent. - #[pallet::constant] + #[pezpallet::constant] type SlashRewardFraction: Get; /// Overarching hold reason. @@ -216,7 +216,7 @@ pub mod pallet { type CoreStaking: StakingUnchecked, AccountId = Self::AccountId>; } - #[pallet::error] + #[pezpallet::error] pub enum Error { /// The account cannot perform this operation. NotAllowed, @@ -244,20 +244,20 @@ pub mod pallet { NothingToSlash, /// Failed to withdraw amount from Core Staking. WithdrawFailed, - /// Operation not supported by this pallet. + /// Operation not supported by this pezpallet. NotSupported, } /// A reason for placing a hold on funds. - #[pallet::composite_enum] + #[pezpallet::composite_enum] pub enum HoldReason { /// Funds held for stake delegation to another account. #[codec(index = 0)] StakingDelegation, } - #[pallet::event] - #[pallet::generate_deposit(pub (super) fn deposit_event)] + #[pezpallet::event] + #[pezpallet::generate_deposit(pub (super) fn deposit_event)] pub enum Event { /// Funds delegated by a delegator. Delegated { agent: T::AccountId, delegator: T::AccountId, amount: BalanceOf }, @@ -273,19 +273,19 @@ pub mod pallet { /// /// Implementation note: We are not using a double map with `delegator` and `agent` account /// as keys since we want to restrict delegators to delegate only to one account at a time. - #[pallet::storage] + #[pezpallet::storage] pub type Delegators = CountedStorageMap<_, Twox64Concat, T::AccountId, Delegation, OptionQuery>; /// Map of `Agent` to their `Ledger`. - #[pallet::storage] + #[pezpallet::storage] pub type Agents = CountedStorageMap<_, Twox64Concat, T::AccountId, AgentLedger, OptionQuery>; - // This pallet is not currently written with the intention of exposing any calls. But the + // This pezpallet is not currently written with the intention of exposing any calls. But the // functions defined in the following impl block should act as a good reference for how the // exposed calls would look like when exposed. - impl Pallet { + impl Pezpallet { /// Register an account to become a stake `Agent`. Sometimes also called a `Delegatee`. /// /// Delegators can authorize `Agent`s to stake on their behalf by delegating their funds to @@ -450,8 +450,8 @@ pub mod pallet { } } - #[pallet::hooks] - impl Hooks> for Pallet { + #[pezpallet::hooks] + impl Hooks> for Pezpallet { #[cfg(feature = "try-runtime")] fn try_state(_n: BlockNumberFor) -> Result<(), pezsp_runtime::TryRuntimeError> { Self::do_try_state() @@ -459,7 +459,7 @@ pub mod pallet { } } -impl Pallet { +impl Pezpallet { /// Derive an account from the migrating agent account where the unclaimed delegation funds /// are held. pub fn generate_proxy_delegator(agent: Agent) -> Delegator { @@ -765,7 +765,7 @@ impl Pallet { use alloc::collections::btree_map::BTreeMap; #[cfg(any(test, feature = "try-runtime"))] -impl Pallet { +impl Pezpallet { pub(crate) fn do_try_state() -> Result<(), pezsp_runtime::TryRuntimeError> { // build map to avoid reading storage multiple times. let delegation_map = Delegators::::iter().collect::>(); diff --git a/bizinikiwi/pezframe/delegated-staking/src/migration.rs b/bizinikiwi/pezframe/delegated-staking/src/migration.rs index 18fc2aea..0dab7e9c 100644 --- a/bizinikiwi/pezframe/delegated-staking/src/migration.rs +++ b/bizinikiwi/pezframe/delegated-staking/src/migration.rs @@ -48,11 +48,11 @@ pub mod unversioned { weight.saturating_accrue(T::DbWeight::get().reads_writes(1, 0)); let new_proxy = - Pallet::::generate_proxy_delegator(Agent::from(agent.clone())); + Pezpallet::::generate_proxy_delegator(Agent::from(agent.clone())); // accrue read writes for `do_migrate_delegation` weight.saturating_accrue(T::DbWeight::get().reads_writes(8, 8)); - let _ = Pallet::::do_migrate_delegation( + let _ = Pezpallet::::do_migrate_delegation( Delegator::from(old_proxy.clone()), new_proxy.clone(), delegation.amount, @@ -84,7 +84,7 @@ pub mod unversioned { Agents::::iter_keys().take(MaxAgents::get() as usize).for_each(|agent| { let old_proxy: T::AccountId = old_proxy_delegator(agent.clone()); - let held_balance = Pallet::::held_balance_of(Delegator::from(old_proxy.clone())); + let held_balance = Pezpallet::::held_balance_of(Delegator::from(old_proxy.clone())); let delegation = Delegation::::get(&old_proxy); if delegation.is_some() || !held_balance.is_zero() { log!( diff --git a/bizinikiwi/pezframe/delegated-staking/src/mock.rs b/bizinikiwi/pezframe/delegated-staking/src/mock.rs index 646b8116..d90ab046 100644 --- a/bizinikiwi/pezframe/delegated-staking/src/mock.rs +++ b/bizinikiwi/pezframe/delegated-staking/src/mock.rs @@ -106,7 +106,7 @@ impl onchain::Config for OnChainSeqPhragmen { impl pezpallet_staking::Config for Runtime { type OldCurrency = Balances; type Currency = Balances; - type UnixTime = pezpallet_timestamp::Pallet; + type UnixTime = pezpallet_timestamp::Pezpallet; type AdminOrigin = pezframe_system::EnsureRoot; type EraPayout = pezpallet_staking::ConvertCurve; type ElectionProvider = onchain::OnChainExecution; @@ -236,7 +236,7 @@ impl ExtBuilder { ext.execute_with(|| { // for events to be deposited. - pezframe_system::Pallet::::set_block_number(1); + pezframe_system::Pezpallet::::set_block_number(1); // set era for staking. start_era(0); }); @@ -250,7 +250,7 @@ impl ExtBuilder { ext.execute_with(|| { #[cfg(feature = "try-runtime")] >::try_state( - pezframe_system::Pallet::::block_number(), + pezframe_system::Pezpallet::::block_number(), pezframe_support::traits::TryStateSelect::All, ) .unwrap(); diff --git a/bizinikiwi/pezframe/delegated-staking/src/tests.rs b/bizinikiwi/pezframe/delegated-staking/src/tests.rs index bfa851d5..1bd06976 100644 --- a/bizinikiwi/pezframe/delegated-staking/src/tests.rs +++ b/bizinikiwi/pezframe/delegated-staking/src/tests.rs @@ -650,7 +650,7 @@ mod staking_integration { DelegatedStaking::generate_proxy_delegator(Agent::from(agent)).get(); assert_ok!(DelegatedStaking::migrate_to_agent(RawOrigin::Signed(agent).into(), 201)); - // after migration, no provider left since free balance is 0 and staking pallet released + // after migration, no provider left since free balance is 0 and staking pezpallet released // all funds. assert_eq!(System::providers(&agent), 0); assert_eq!(Balances::free_balance(agent), 0); diff --git a/bizinikiwi/pezframe/delegated-staking/src/types.rs b/bizinikiwi/pezframe/delegated-staking/src/types.rs index b11a2d3d..70f9674a 100644 --- a/bizinikiwi/pezframe/delegated-staking/src/types.rs +++ b/bizinikiwi/pezframe/delegated-staking/src/types.rs @@ -73,12 +73,12 @@ impl Delegation { if self.amount == Zero::zero() { >::remove(key); // Remove provider if no delegation left. - let _ = pezframe_system::Pallet::::dec_providers(key).defensive(); + let _ = pezframe_system::Pezpallet::::dec_providers(key).defensive(); return; } } else { // this is a new delegation. Provide for this account. - pezframe_system::Pallet::::inc_providers(key); + pezframe_system::Pezpallet::::inc_providers(key); } >::insert(key, self); diff --git a/bizinikiwi/pezframe/democracy/Cargo.toml b/bizinikiwi/pezframe/democracy/Cargo.toml index b886c9b7..7d6ac69d 100644 --- a/bizinikiwi/pezframe/democracy/Cargo.toml +++ b/bizinikiwi/pezframe/democracy/Cargo.toml @@ -6,7 +6,7 @@ edition.workspace = true license = "Apache-2.0" homepage.workspace = true repository.workspace = true -description = "FRAME pallet for democracy" +description = "FRAME pezpallet for democracy" readme = "README.md" documentation = "https://docs.rs/pezpallet-democracy" diff --git a/bizinikiwi/pezframe/democracy/README.md b/bizinikiwi/pezframe/democracy/README.md index e6aa360f..374e9994 100644 --- a/bizinikiwi/pezframe/democracy/README.md +++ b/bizinikiwi/pezframe/democracy/README.md @@ -1,18 +1,18 @@ -# Democracy Pallet +# Democracy Pezpallet - [`democracy::Config`](https://docs.rs/pezpallet-democracy/latest/pallet_democracy/trait.Config.html) - [`Call`](https://docs.rs/pezpallet-democracy/latest/pallet_democracy/enum.Call.html) ## Overview -The Democracy pallet handles the administration of general stakeholder voting. +The Democracy pezpallet handles the administration of general stakeholder voting. There are two different queues that a proposal can be added to before it becomes a referendum, 1) the proposal queue consisting of all public proposals and 2) the external queue consisting of a single proposal that originates from one of the _external_ origins (such as a collective group). -Every launch period - a length defined in the runtime - the Democracy pallet +Every launch period - a length defined in the runtime - the Democracy pezpallet launches a referendum from a proposal that it takes from either the proposal queue or the external queue in turn. Any token holder in the system can vote on referenda. The voting system diff --git a/bizinikiwi/pezframe/democracy/src/benchmarking.rs b/bizinikiwi/pezframe/democracy/src/benchmarking.rs index 7bfd658f..e030cedf 100644 --- a/bizinikiwi/pezframe/democracy/src/benchmarking.rs +++ b/bizinikiwi/pezframe/democracy/src/benchmarking.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Democracy pallet benchmarking. +//! Democracy pezpallet benchmarking. #![cfg(feature = "runtime-benchmarks")] @@ -29,7 +29,7 @@ use pezframe_support::{ use pezframe_system::{pezpallet_prelude::BlockNumberFor, RawOrigin}; use pezsp_runtime::{traits::Bounded, BoundedVec}; -use crate::Pallet as Democracy; +use crate::Pezpallet as Democracy; const REFERENDUM_COUNT_HINT: u32 = 10; const SEED: u32 = 0; @@ -78,11 +78,11 @@ fn account_vote(b: BalanceOf) -> AccountVote> { } fn assert_last_event(generic_event: ::RuntimeEvent) { - pezframe_system::Pallet::::assert_last_event(generic_event.into()); + pezframe_system::Pezpallet::::assert_last_event(generic_event.into()); } fn assert_has_event(generic_event: ::RuntimeEvent) { - pezframe_system::Pallet::::assert_has_event(generic_event.into()); + pezframe_system::Pezpallet::::assert_has_event(generic_event.into()); } // note a new preimage. diff --git a/bizinikiwi/pezframe/democracy/src/lib.rs b/bizinikiwi/pezframe/democracy/src/lib.rs index eb27e949..62993dca 100644 --- a/bizinikiwi/pezframe/democracy/src/lib.rs +++ b/bizinikiwi/pezframe/democracy/src/lib.rs @@ -15,21 +15,21 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! # Democracy Pallet +//! # Democracy Pezpallet //! //! - [`Config`] //! - [`Call`] //! //! ## Overview //! -//! The Democracy pallet handles the administration of general stakeholder voting. +//! The Democracy pezpallet handles the administration of general stakeholder voting. //! //! There are two different queues that a proposal can be added to before it //! becomes a referendum, 1) the proposal queue consisting of all public proposals //! and 2) the external queue consisting of a single proposal that originates //! from one of the _external_ origins (such as a collective group). //! -//! Every launch period - a length defined in the runtime - the Democracy pallet +//! Every launch period - a length defined in the runtime - the Democracy pezpallet //! launches a referendum from a proposal that it takes from either the proposal //! queue or the external queue in turn. Any token holder in the system can vote //! on referenda. The voting system @@ -178,7 +178,7 @@ mod vote; mod vote_threshold; pub mod weights; pub use conviction::Conviction; -pub use pallet::*; +pub use pezpallet::*; pub use types::{ Delegations, MetadataOwner, PropIndex, ReferendumIndex, ReferendumInfo, ReferendumStatus, Tally, UnvoteScope, @@ -206,8 +206,8 @@ pub type CallOf = ::RuntimeCall; pub type BoundedCallOf = Bounded, ::Hashing>; type AccountIdLookupOf = <::Lookup as StaticLookup>::Source; -#[pezframe_support::pallet] -pub mod pallet { +#[pezframe_support::pezpallet] +pub mod pezpallet { use super::{DispatchResult, *}; use pezframe_support::pezpallet_prelude::*; use pezframe_system::pezpallet_prelude::*; @@ -215,11 +215,11 @@ pub mod pallet { /// The in-code storage version. const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); - #[pallet::pallet] - #[pallet::storage_version(STORAGE_VERSION)] - pub struct Pallet(_); + #[pezpallet::pezpallet] + #[pezpallet::storage_version(STORAGE_VERSION)] + pub struct Pezpallet(_); - #[pallet::config] + #[pezpallet::config] pub trait Config: pezframe_system::Config + Sized { type WeightInfo: WeightInfo; #[allow(deprecated)] @@ -236,7 +236,7 @@ pub mod pallet { /// The Preimage provider. type Preimages: QueryPreimage + StorePreimage; - /// Currency type for this pallet. + /// Currency type for this pezpallet. type Currency: ReservableCurrency + LockableCurrency>; @@ -245,59 +245,59 @@ pub mod pallet { /// It should generally be a little more than the unstake period to ensure that /// voting stakers have an opportunity to remove themselves from the system in the case /// where they are on the losing side of a vote. - #[pallet::constant] + #[pezpallet::constant] type EnactmentPeriod: Get>; /// How often (in blocks) new public referenda are launched. - #[pallet::constant] + #[pezpallet::constant] type LaunchPeriod: Get>; /// How often (in blocks) to check for new votes. - #[pallet::constant] + #[pezpallet::constant] type VotingPeriod: Get>; /// The minimum period of vote locking. /// /// It should be no shorter than enactment period to ensure that in the case of an approval, /// those successful voters are locked into the consequences that their votes entail. - #[pallet::constant] + #[pezpallet::constant] type VoteLockingPeriod: Get>; /// The minimum amount to be used as a deposit for a public referendum proposal. - #[pallet::constant] + #[pezpallet::constant] type MinimumDeposit: Get>; /// Indicator for whether an emergency origin is even allowed to happen. Some chains may /// want to set this permanently to `false`, others may want to condition it on things such /// as an upgrade having happened recently. - #[pallet::constant] + #[pezpallet::constant] type InstantAllowed: Get; /// Minimum voting period allowed for a fast-track referendum. - #[pallet::constant] + #[pezpallet::constant] type FastTrackVotingPeriod: Get>; /// Period in blocks where an external proposal may not be re-submitted after being vetoed. - #[pallet::constant] + #[pezpallet::constant] type CooloffPeriod: Get>; /// The maximum number of votes for an account. /// /// Also used to compute weight, an overly big value can /// lead to extrinsic with very big weight: see `delegate` for instance. - #[pallet::constant] + #[pezpallet::constant] type MaxVotes: Get; /// The maximum number of public proposals that can exist at any time. - #[pallet::constant] + #[pezpallet::constant] type MaxProposals: Get; /// The maximum number of deposits a public proposal may have at any time. - #[pallet::constant] + #[pezpallet::constant] type MaxDeposits: Get; /// The maximum number of items which can be blacklisted. - #[pallet::constant] + #[pezpallet::constant] type MaxBlacklisted: Get; /// Origin from which the next tabled referendum may be forced. This is a normal @@ -347,11 +347,11 @@ pub mod pallet { } /// The number of (public) proposals that have been made so far. - #[pallet::storage] + #[pezpallet::storage] pub type PublicPropCount = StorageValue<_, PropIndex, ValueQuery>; /// The public proposals. Unsorted. The second item is the proposal. - #[pallet::storage] + #[pezpallet::storage] pub type PublicProps = StorageValue< _, BoundedVec<(PropIndex, BoundedCallOf, T::AccountId), T::MaxProposals>, @@ -361,7 +361,7 @@ pub mod pallet { /// Those who have locked a deposit. /// /// TWOX-NOTE: Safe, as increasing integer keys are safe. - #[pallet::storage] + #[pezpallet::storage] pub type DepositOf = StorageMap< _, Twox64Concat, @@ -370,18 +370,18 @@ pub mod pallet { >; /// The next free referendum index, aka the number of referenda started so far. - #[pallet::storage] + #[pezpallet::storage] pub type ReferendumCount = StorageValue<_, ReferendumIndex, ValueQuery>; /// The lowest referendum index representing an unbaked referendum. Equal to /// `ReferendumCount` if there isn't a unbaked referendum. - #[pallet::storage] + #[pezpallet::storage] pub type LowestUnbaked = StorageValue<_, ReferendumIndex, ValueQuery>; /// Information concerning any given referendum. /// /// TWOX-NOTE: SAFE as indexes are not under an attacker’s control. - #[pallet::storage] + #[pezpallet::storage] pub type ReferendumInfoOf = StorageMap< _, Twox64Concat, @@ -393,7 +393,7 @@ pub mod pallet { /// have recorded. The second item is the total amount of delegations, that will be added. /// /// TWOX-NOTE: SAFE as `AccountId`s are crypto hashes anyway. - #[pallet::storage] + #[pezpallet::storage] pub type VotingOf = StorageMap< _, Twox64Concat, @@ -404,19 +404,19 @@ pub mod pallet { /// True if the last referendum tabled was submitted externally. False if it was a public /// proposal. - #[pallet::storage] + #[pezpallet::storage] pub type LastTabledWasExternal = StorageValue<_, bool, ValueQuery>; /// The referendum to be tabled whenever it would be valid to table an external proposal. /// This happens when a referendum needs to be tabled and one of two conditions are met: /// - `LastTabledWasExternal` is `false`; or /// - `PublicProps` is empty. - #[pallet::storage] + #[pezpallet::storage] pub type NextExternal = StorageValue<_, (BoundedCallOf, VoteThreshold)>; /// A record of who vetoed what. Maps proposal hash to a possible existent block number /// (until when it may not be resubmitted) and who vetoed it. - #[pallet::storage] + #[pezpallet::storage] pub type Blacklist = StorageMap< _, Identity, @@ -425,7 +425,7 @@ pub mod pallet { >; /// Record of all proposals that have been subject to emergency cancellation. - #[pallet::storage] + #[pezpallet::storage] pub type Cancellations = StorageMap<_, Identity, T::Hash, bool, ValueQuery>; /// General information concerning any proposal or referendum. @@ -434,17 +434,17 @@ pub mod pallet { /// /// Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove) /// large preimages. - #[pallet::storage] + #[pezpallet::storage] pub type MetadataOf = StorageMap<_, Blake2_128Concat, MetadataOwner, T::Hash>; - #[pallet::genesis_config] + #[pezpallet::genesis_config] #[derive(pezframe_support::DefaultNoBound)] pub struct GenesisConfig { #[serde(skip)] _config: core::marker::PhantomData, } - #[pallet::genesis_build] + #[pezpallet::genesis_build] impl BuildGenesisConfig for GenesisConfig { fn build(&self) { PublicPropCount::::put(0 as PropIndex); @@ -453,8 +453,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 { /// A motion has been proposed by a public account. Proposed { proposal_index: PropIndex, deposit: BalanceOf }, @@ -509,7 +509,7 @@ pub mod pallet { }, } - #[pallet::error] + #[pezpallet::error] pub enum Error { /// Value too low ValueLow, @@ -562,16 +562,16 @@ pub mod pallet { PreimageNotExist, } - #[pallet::hooks] - impl Hooks> for Pallet { + #[pezpallet::hooks] + impl Hooks> for Pezpallet { /// Weight: see `begin_block` fn on_initialize(n: BlockNumberFor) -> Weight { Self::begin_block(n) } } - #[pallet::call] - impl Pallet { + #[pezpallet::call] + impl Pezpallet { /// Propose a sensitive action to be taken. /// /// The dispatch origin of this call must be _Signed_ and the sender must @@ -581,12 +581,12 @@ pub mod pallet { /// - `value`: The amount of deposit (must be at least `MinimumDeposit`). /// /// Emits `Proposed`. - #[pallet::call_index(0)] - #[pallet::weight(T::WeightInfo::propose())] + #[pezpallet::call_index(0)] + #[pezpallet::weight(T::WeightInfo::propose())] pub fn propose( origin: OriginFor, proposal: BoundedCallOf, - #[pallet::compact] value: BalanceOf, + #[pezpallet::compact] value: BalanceOf, ) -> DispatchResult { let who = T::SubmitOrigin::ensure_origin(origin)?; ensure!(value >= T::MinimumDeposit::get(), Error::::ValueLow); @@ -599,7 +599,7 @@ pub mod pallet { if let Some((until, _)) = Blacklist::::get(proposal_hash) { ensure!( - pezframe_system::Pallet::::block_number() >= until, + pezframe_system::Pezpallet::::block_number() >= until, Error::::ProposalBlacklisted, ); } @@ -624,11 +624,11 @@ pub mod pallet { /// must have funds to cover the deposit, equal to the original deposit. /// /// - `proposal`: The index of the proposal to second. - #[pallet::call_index(1)] - #[pallet::weight(T::WeightInfo::second())] + #[pezpallet::call_index(1)] + #[pezpallet::weight(T::WeightInfo::second())] pub fn second( origin: OriginFor, - #[pallet::compact] proposal: PropIndex, + #[pezpallet::compact] proposal: PropIndex, ) -> DispatchResult { let who = ensure_signed(origin)?; @@ -650,11 +650,11 @@ pub mod pallet { /// /// - `ref_index`: The index of the referendum to vote for. /// - `vote`: The vote configuration. - #[pallet::call_index(2)] - #[pallet::weight(T::WeightInfo::vote_new().max(T::WeightInfo::vote_existing()))] + #[pezpallet::call_index(2)] + #[pezpallet::weight(T::WeightInfo::vote_new().max(T::WeightInfo::vote_existing()))] pub fn vote( origin: OriginFor, - #[pallet::compact] ref_index: ReferendumIndex, + #[pezpallet::compact] ref_index: ReferendumIndex, vote: AccountVote>, ) -> DispatchResult { let who = ensure_signed(origin)?; @@ -669,8 +669,8 @@ pub mod pallet { /// -`ref_index`: The index of the referendum to cancel. /// /// Weight: `O(1)`. - #[pallet::call_index(3)] - #[pallet::weight((T::WeightInfo::emergency_cancel(), DispatchClass::Operational))] + #[pezpallet::call_index(3)] + #[pezpallet::weight((T::WeightInfo::emergency_cancel(), DispatchClass::Operational))] pub fn emergency_cancel( origin: OriginFor, ref_index: ReferendumIndex, @@ -692,8 +692,8 @@ pub mod pallet { /// The dispatch origin of this call must be `ExternalOrigin`. /// /// - `proposal_hash`: The preimage hash of the proposal. - #[pallet::call_index(4)] - #[pallet::weight(T::WeightInfo::external_propose())] + #[pezpallet::call_index(4)] + #[pezpallet::weight(T::WeightInfo::external_propose())] pub fn external_propose( origin: OriginFor, proposal: BoundedCallOf, @@ -702,7 +702,7 @@ pub mod pallet { ensure!(!NextExternal::::exists(), Error::::DuplicateProposal); if let Some((until, _)) = Blacklist::::get(proposal.hash()) { ensure!( - pezframe_system::Pallet::::block_number() >= until, + pezframe_system::Pezpallet::::block_number() >= until, Error::::ProposalBlacklisted, ); } @@ -721,8 +721,8 @@ pub mod pallet { /// pre-scheduled `external_propose` call. /// /// Weight: `O(1)` - #[pallet::call_index(5)] - #[pallet::weight(T::WeightInfo::external_propose_majority())] + #[pezpallet::call_index(5)] + #[pezpallet::weight(T::WeightInfo::external_propose_majority())] pub fn external_propose_majority( origin: OriginFor, proposal: BoundedCallOf, @@ -743,8 +743,8 @@ pub mod pallet { /// pre-scheduled `external_propose` call. /// /// Weight: `O(1)` - #[pallet::call_index(6)] - #[pallet::weight(T::WeightInfo::external_propose_default())] + #[pezpallet::call_index(6)] + #[pezpallet::weight(T::WeightInfo::external_propose_default())] pub fn external_propose_default( origin: OriginFor, proposal: BoundedCallOf, @@ -770,8 +770,8 @@ pub mod pallet { /// Emits `Started`. /// /// Weight: `O(1)` - #[pallet::call_index(7)] - #[pallet::weight(T::WeightInfo::fast_track())] + #[pezpallet::call_index(7)] + #[pezpallet::weight(T::WeightInfo::fast_track())] pub fn fast_track( origin: OriginFor, proposal_hash: T::Hash, @@ -802,7 +802,7 @@ pub mod pallet { ensure!(proposal_hash == ext_proposal.hash(), Error::::InvalidHash); NextExternal::::kill(); - let now = pezframe_system::Pallet::::block_number(); + let now = pezframe_system::Pezpallet::::block_number(); let ref_index = Self::inject_referendum( now.saturating_add(voting_period), ext_proposal, @@ -822,8 +822,8 @@ pub mod pallet { /// Emits `Vetoed`. /// /// Weight: `O(V + log(V))` where V is number of `existing vetoers` - #[pallet::call_index(8)] - #[pallet::weight(T::WeightInfo::veto_external())] + #[pezpallet::call_index(8)] + #[pezpallet::weight(T::WeightInfo::veto_external())] pub fn veto_external(origin: OriginFor, proposal_hash: T::Hash) -> DispatchResult { let who = T::VetoOrigin::ensure_origin(origin)?; @@ -842,7 +842,7 @@ pub mod pallet { .map_err(|_| Error::::TooMany)?; let until = - pezframe_system::Pallet::::block_number().saturating_add(T::CooloffPeriod::get()); + pezframe_system::Pezpallet::::block_number().saturating_add(T::CooloffPeriod::get()); Blacklist::::insert(&proposal_hash, (until, existing_vetoers)); Self::deposit_event(Event::::Vetoed { who, proposal_hash, until }); @@ -858,11 +858,11 @@ pub mod pallet { /// - `ref_index`: The index of the referendum to cancel. /// /// # Weight: `O(1)`. - #[pallet::call_index(9)] - #[pallet::weight(T::WeightInfo::cancel_referendum())] + #[pezpallet::call_index(9)] + #[pezpallet::weight(T::WeightInfo::cancel_referendum())] pub fn cancel_referendum( origin: OriginFor, - #[pallet::compact] ref_index: ReferendumIndex, + #[pezpallet::compact] ref_index: ReferendumIndex, ) -> DispatchResult { ensure_root(origin)?; Self::internal_cancel_referendum(ref_index); @@ -891,8 +891,8 @@ pub mod pallet { /// voted on. Weight is charged as if maximum votes. // NOTE: weight must cover an incorrect voting of origin with max votes, this is ensure // because a valid delegation cover decoding a direct voting with max votes. - #[pallet::call_index(10)] - #[pallet::weight(T::WeightInfo::delegate(T::MaxVotes::get()))] + #[pezpallet::call_index(10)] + #[pezpallet::weight(T::WeightInfo::delegate(T::MaxVotes::get()))] pub fn delegate( origin: OriginFor, to: AccountIdLookupOf, @@ -920,8 +920,8 @@ pub mod pallet { /// voted on. Weight is charged as if maximum votes. // NOTE: weight must cover an incorrect voting of origin with max votes, this is ensure // because a valid delegation cover decoding a direct voting with max votes. - #[pallet::call_index(11)] - #[pallet::weight(T::WeightInfo::undelegate(T::MaxVotes::get()))] + #[pezpallet::call_index(11)] + #[pezpallet::weight(T::WeightInfo::undelegate(T::MaxVotes::get()))] pub fn undelegate(origin: OriginFor) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; let votes = Self::try_undelegate(who)?; @@ -933,8 +933,8 @@ pub mod pallet { /// The dispatch origin of this call must be _Root_. /// /// Weight: `O(1)`. - #[pallet::call_index(12)] - #[pallet::weight(T::WeightInfo::clear_public_proposals())] + #[pezpallet::call_index(12)] + #[pezpallet::weight(T::WeightInfo::clear_public_proposals())] pub fn clear_public_proposals(origin: OriginFor) -> DispatchResult { ensure_root(origin)?; PublicProps::::kill(); @@ -948,8 +948,8 @@ pub mod pallet { /// - `target`: The account to remove the lock on. /// /// Weight: `O(R)` with R number of vote of target. - #[pallet::call_index(13)] - #[pallet::weight(T::WeightInfo::unlock_set(T::MaxVotes::get()).max(T::WeightInfo::unlock_remove(T::MaxVotes::get())))] + #[pezpallet::call_index(13)] + #[pezpallet::weight(T::WeightInfo::unlock_set(T::MaxVotes::get()).max(T::WeightInfo::unlock_remove(T::MaxVotes::get())))] pub fn unlock(origin: OriginFor, target: AccountIdLookupOf) -> DispatchResult { ensure_signed(origin)?; let target = T::Lookup::lookup(target)?; @@ -984,8 +984,8 @@ pub mod pallet { /// /// Weight: `O(R + log R)` where R is the number of referenda that `target` has voted on. /// Weight is calculated for the maximum number of vote. - #[pallet::call_index(14)] - #[pallet::weight(T::WeightInfo::remove_vote(T::MaxVotes::get()))] + #[pezpallet::call_index(14)] + #[pezpallet::weight(T::WeightInfo::remove_vote(T::MaxVotes::get()))] pub fn remove_vote(origin: OriginFor, index: ReferendumIndex) -> DispatchResult { let who = ensure_signed(origin)?; Self::try_remove_vote(&who, index, UnvoteScope::Any) @@ -1006,8 +1006,8 @@ pub mod pallet { /// /// Weight: `O(R + log R)` where R is the number of referenda that `target` has voted on. /// Weight is calculated for the maximum number of vote. - #[pallet::call_index(15)] - #[pallet::weight(T::WeightInfo::remove_other_vote(T::MaxVotes::get()))] + #[pezpallet::call_index(15)] + #[pezpallet::weight(T::WeightInfo::remove_other_vote(T::MaxVotes::get()))] pub fn remove_other_vote( origin: OriginFor, target: AccountIdLookupOf, @@ -1035,8 +1035,8 @@ pub mod pallet { /// /// Weight: `O(p)` (though as this is an high-privilege dispatch, we assume it has a /// reasonable value). - #[pallet::call_index(16)] - #[pallet::weight((T::WeightInfo::blacklist(), DispatchClass::Operational))] + #[pezpallet::call_index(16)] + #[pezpallet::weight((T::WeightInfo::blacklist(), DispatchClass::Operational))] pub fn blacklist( origin: OriginFor, proposal_hash: T::Hash, @@ -1088,11 +1088,11 @@ pub mod pallet { /// - `prop_index`: The index of the proposal to cancel. /// /// Weight: `O(p)` where `p = PublicProps::::decode_len()` - #[pallet::call_index(17)] - #[pallet::weight(T::WeightInfo::cancel_proposal())] + #[pezpallet::call_index(17)] + #[pezpallet::weight(T::WeightInfo::cancel_proposal())] pub fn cancel_proposal( origin: OriginFor, - #[pallet::compact] prop_index: PropIndex, + #[pezpallet::compact] prop_index: PropIndex, ) -> DispatchResult { T::CancelProposalOrigin::ensure_origin(origin)?; @@ -1122,8 +1122,8 @@ pub mod pallet { /// - `Root` to set a metadata for an ongoing referendum. /// - `owner`: an identifier of a metadata owner. /// - `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata. - #[pallet::call_index(18)] - #[pallet::weight( + #[pezpallet::call_index(18)] + #[pezpallet::weight( match (owner, maybe_hash) { (MetadataOwner::External, Some(_)) => T::WeightInfo::set_external_metadata(), (MetadataOwner::External, None) => T::WeightInfo::clear_external_metadata(), @@ -1189,7 +1189,7 @@ pub trait EncodeInto: Encode { } impl EncodeInto for T {} -impl Pallet { +impl Pezpallet { // exposed immutables. /// Get the amount locked in support of `proposal`; `None` if proposal isn't a valid proposal @@ -1232,8 +1232,8 @@ impl Pallet { threshold: VoteThreshold, delay: BlockNumberFor, ) -> ReferendumIndex { - Pallet::::inject_referendum( - pezframe_system::Pallet::::block_number().saturating_add(T::VotingPeriod::get()), + Pezpallet::::inject_referendum( + pezframe_system::Pezpallet::::block_number().saturating_add(T::VotingPeriod::get()), proposal, threshold, delay, @@ -1348,7 +1348,7 @@ impl Pallet { let unlock_at = end.saturating_add( T::VoteLockingPeriod::get().saturating_mul(lock_periods.into()), ); - let now = pezframe_system::Pallet::::block_number(); + let now = pezframe_system::Pezpallet::::block_number(); if now < unlock_at { ensure!( matches!(scope, UnvoteScope::Any), @@ -1441,7 +1441,7 @@ impl Pallet { } => { // remove any delegation votes to our current target. Self::reduce_upstream_delegation(&target, conviction.votes(balance)); - let now = pezframe_system::Pallet::::block_number(); + let now = pezframe_system::Pezpallet::::block_number(); let lock_periods = conviction.lock_periods().into(); let unlock_block = now .saturating_add(T::VoteLockingPeriod::get().saturating_mul(lock_periods)); @@ -1481,7 +1481,7 @@ impl Pallet { // remove any delegation votes to our current target. let votes = Self::reduce_upstream_delegation(&target, conviction.votes(balance)); - let now = pezframe_system::Pallet::::block_number(); + let now = pezframe_system::Pezpallet::::block_number(); let lock_periods = conviction.lock_periods().into(); let unlock_block = now .saturating_add(T::VoteLockingPeriod::get().saturating_mul(lock_periods)); @@ -1501,7 +1501,7 @@ impl Pallet { /// a security hole) but may be reduced from what they are currently. fn update_lock(who: &T::AccountId) { let lock_needed = VotingOf::::mutate(who, |voting| { - voting.rejig(pezframe_system::Pallet::::block_number()); + voting.rejig(pezframe_system::Pezpallet::::block_number()); voting.locked_balance() }); if lock_needed.is_zero() { diff --git a/bizinikiwi/pezframe/democracy/src/migrations/mod.rs b/bizinikiwi/pezframe/democracy/src/migrations/mod.rs index 5cf9466f..866a7d52 100644 --- a/bizinikiwi/pezframe/democracy/src/migrations/mod.rs +++ b/bizinikiwi/pezframe/democracy/src/migrations/mod.rs @@ -13,10 +13,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! All migrations of this pallet. +//! All migrations of this pezpallet. -/// Migration to unlock and unreserve all pallet funds. +/// Migration to unlock and unreserve all pezpallet funds. pub mod unlock_and_unreserve_all_funds; -/// V1 storage migrations for the preimage pallet. +/// V1 storage migrations for the preimage pezpallet. pub mod v1; diff --git a/bizinikiwi/pezframe/democracy/src/migrations/unlock_and_unreserve_all_funds.rs b/bizinikiwi/pezframe/democracy/src/migrations/unlock_and_unreserve_all_funds.rs index 693e7892..5f712630 100644 --- a/bizinikiwi/pezframe/democracy/src/migrations/unlock_and_unreserve_all_funds.rs +++ b/bizinikiwi/pezframe/democracy/src/migrations/unlock_and_unreserve_all_funds.rs @@ -16,7 +16,7 @@ // limitations under the License. //! A migration that unreserves all deposit and unlocks all stake held in the context of this -//! pallet. +//! pezpallet. use crate::{PropIndex, Voting, DEMOCRACY_ID}; use alloc::{collections::btree_map::BTreeMap, vec::Vec}; @@ -42,9 +42,9 @@ pub trait UnlockConfig: 'static { type AccountId: Parameter + Ord; /// The currency type used in the runtime. /// - /// Should match the currency type previously used for the pallet, if applicable. + /// Should match the currency type previously used for the pezpallet, if applicable. type Currency: LockableCurrency + ReservableCurrency; - /// The name of the pallet as previously configured in + /// The name of the pezpallet as previously configured in /// [`construct_runtime!`](pezframe_support::construct_runtime). type PalletName: Get<&'static str>; /// The maximum number of votes as configured previously in the runtime. @@ -80,18 +80,18 @@ type VotingOf = StorageMap< >; /// A migration that unreserves all deposit and unlocks all stake held in the context of this -/// pallet. +/// pezpallet. /// -/// Useful to prevent funds from being locked up when the pallet is being deprecated. +/// Useful to prevent funds from being locked up when the pezpallet is being deprecated. /// -/// The pallet should be made inoperable before this migration is run. +/// The pezpallet should be made inoperable before this migration is run. /// /// (See also [`RemovePallet`][pezframe_support::migrations::RemovePallet]) pub struct UnlockAndUnreserveAllFunds(core::marker::PhantomData); impl UnlockAndUnreserveAllFunds { - /// Calculates and returns the total amounts reserved by each account by this pallet, and all - /// accounts with locks in the context of this pallet. + /// Calculates and returns the total amounts reserved by each account by this pezpallet, and all + /// accounts with locks in the context of this pezpallet. /// /// There is no need to return the amount locked, because the entire lock is removed (always /// should be zero post-migration). We need to return the amounts reserved to check that the @@ -102,9 +102,9 @@ impl UnlockAndUnreserveAllFunds { /// This function returns a tuple of two `BTreeMap` collections and the weight of the reads: /// /// * `BTreeMap>`: Map of account IDs to their respective total - /// reserved balance by this pallet + /// reserved balance by this pezpallet /// * `BTreeMap>`: Map of account IDs to their respective total - /// locked balance by this pallet + /// locked balance by this pezpallet /// * `pezframe_support::weights::Weight`: the weight consumed by this call. fn get_account_deposits_and_locks() -> ( BTreeMap>, @@ -160,20 +160,20 @@ where /// checks the integrity of deposited and reserved balances. /// /// Steps: - /// 1. Gets the deposited balances for each account stored in this pallet. + /// 1. Gets the deposited balances for each account stored in this pezpallet. /// 2. Collects actual pre-migration reserved balances for each account. /// 3. Checks the integrity of the deposited balances. /// 4. Prints summary statistics about the state to be migrated. /// 5. Encodes and returns pre-migration data to be used in post_upgrade. /// - /// Fails with a `TryRuntimeError` if somehow the amount reserved by this pallet is greater than + /// Fails with a `TryRuntimeError` if somehow the amount reserved by this pezpallet is greater than /// the actual total reserved amount for any accounts. #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, pezsp_runtime::TryRuntimeError> { use alloc::collections::btree_set::BTreeSet; use codec::Encode; - // Get staked and deposited balances as reported by this pallet. + // Get staked and deposited balances as reported by this pezpallet. let (account_deposits, account_locks, _) = Self::get_account_deposits_and_locks(); let all_accounts = account_deposits @@ -187,7 +187,7 @@ where .collect(); // Total deposited for each account *should* be less than or equal to the total reserved, - // however this does not hold for all cases due to bugs in the reserve logic of this pallet. + // however this does not hold for all cases due to bugs in the reserve logic of this pezpallet. let bugged_deposits = all_accounts .iter() .filter(|account| { @@ -220,11 +220,11 @@ where /// Executes the migration. /// /// Steps: - /// 1. Retrieves the deposit and accounts with locks for the pallet. + /// 1. Retrieves the deposit and accounts with locks for the pezpallet. /// 2. Unreserves the deposited funds for each account. /// 3. Unlocks the staked funds for each account. fn on_runtime_upgrade() -> pezframe_support::weights::Weight { - // Get staked and deposited balances as reported by this pallet. + // Get staked and deposited balances as reported by this pezpallet. let (account_deposits, account_stakes, initial_reads) = Self::get_account_deposits_and_locks(); @@ -252,7 +252,7 @@ where /// Performs post-upgrade sanity checks: /// - /// 1. No locks remain for this pallet in Balances. + /// 1. No locks remain for this pezpallet in Balances. /// 2. The reserved balance for each account has been reduced by the expected amount. #[cfg(feature = "try-runtime")] fn post_upgrade( @@ -264,7 +264,7 @@ where BTreeMap::>::decode(&mut &account_reserved_before_bytes[..]) .map_err(|_| "Failed to decode account_reserved_before_bytes")?; - // Get staked and deposited balances as reported by this pallet. + // Get staked and deposited balances as reported by this pezpallet. let (account_deposits, _, _) = Self::get_account_deposits_and_locks(); // Check that the reserved balance is reduced by the expected deposited amount. diff --git a/bizinikiwi/pezframe/democracy/src/migrations/v1.rs b/bizinikiwi/pezframe/democracy/src/migrations/v1.rs index e198cf2f..e6ad970b 100644 --- a/bizinikiwi/pezframe/democracy/src/migrations/v1.rs +++ b/bizinikiwi/pezframe/democracy/src/migrations/v1.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Storage migrations for the preimage pallet. +//! Storage migrations for the preimage pezpallet. use crate::*; use pezframe_support::{pezpallet_prelude::*, storage_alias, traits::OnRuntimeUpgrade, BoundedVec}; @@ -25,25 +25,25 @@ use pezsp_core::H256; /// The log target. const TARGET: &'static str = "runtime::democracy::migration::v1"; -/// The original data layout of the democracy pallet without a specific version number. +/// The original data layout of the democracy pezpallet without a specific version number. mod v0 { use super::*; #[storage_alias] pub type PublicProps = StorageValue< - Pallet, + Pezpallet, Vec<(PropIndex, ::Hash, ::AccountId)>, ValueQuery, >; #[storage_alias] pub type NextExternal = - StorageValue, (::Hash, VoteThreshold)>; + StorageValue, (::Hash, VoteThreshold)>; #[cfg(feature = "try-runtime")] #[storage_alias] pub type ReferendumInfoOf = StorageMap< - Pallet, + Pezpallet, pezframe_support::Twox64Concat, ReferendumIndex, ReferendumInfo, ::Hash, BalanceOf>, @@ -59,7 +59,7 @@ pub mod v1 { impl> OnRuntimeUpgrade for Migration { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, pezsp_runtime::TryRuntimeError> { - ensure!(StorageVersion::get::>() == 0, "can only upgrade from version 0"); + ensure!(StorageVersion::get::>() == 0, "can only upgrade from version 0"); let props_count = v0::PublicProps::::get().len(); log::info!(target: TARGET, "{} public proposals will be migrated.", props_count,); @@ -74,7 +74,7 @@ pub mod v1 { #[allow(deprecated)] fn on_runtime_upgrade() -> Weight { let mut weight = T::DbWeight::get().reads(1); - if StorageVersion::get::>() != 0 { + if StorageVersion::get::>() != 0 { log::warn!( target: TARGET, "skipping on_runtime_upgrade: executed on wrong storage version.\ @@ -124,14 +124,14 @@ pub mod v1 { NextExternal::::put((Bounded::from_legacy_hash(hash), threshold)); } - StorageVersion::new(1).put::>(); + StorageVersion::new(1).put::>(); weight.saturating_add(T::DbWeight::get().reads_writes(1, 3)) } #[cfg(feature = "try-runtime")] fn post_upgrade(state: Vec) -> Result<(), pezsp_runtime::TryRuntimeError> { - ensure!(StorageVersion::get::>() == 1, "must upgrade"); + ensure!(StorageVersion::get::>() == 1, "must upgrade"); let (old_props_count, old_ref_count): (u32, u32) = Decode::decode(&mut &state[..]).expect("pre_upgrade provides a valid state; qed"); @@ -165,7 +165,7 @@ mod test { #[test] fn migration_works() { new_test_ext().execute_with(|| { - assert_eq!(StorageVersion::get::>(), 0); + assert_eq!(StorageVersion::get::>(), 0); // Insert some values into the v0 storage: // Case 1: Ongoing referendum diff --git a/bizinikiwi/pezframe/democracy/src/tests.rs b/bizinikiwi/pezframe/democracy/src/tests.rs index 059ad3d9..9431013e 100644 --- a/bizinikiwi/pezframe/democracy/src/tests.rs +++ b/bizinikiwi/pezframe/democracy/src/tests.rs @@ -106,7 +106,7 @@ impl pezpallet_scheduler::Config for Test { type WeightInfo = (); type OriginPrivilegeCmp = EqualPrivilegeOnly; type Preimages = (); - type BlockNumberProvider = pezframe_system::Pallet; + type BlockNumberProvider = pezframe_system::Pezpallet; } #[derive_impl(pezpallet_balances::config_preludes::TestDefaultConfig)] @@ -136,7 +136,7 @@ impl SortedMembers for OneToFive { impl Config for Test { type RuntimeEvent = RuntimeEvent; - type Currency = pezpallet_balances::Pallet; + type Currency = pezpallet_balances::Pezpallet; type EnactmentPeriod = ConstU64<2>; type LaunchPeriod = ConstU64<2>; type VotingPeriod = ConstU64<2>; diff --git a/bizinikiwi/pezframe/democracy/src/weights.rs b/bizinikiwi/pezframe/democracy/src/weights.rs index 96c6b4d7..4ee366c9 100644 --- a/bizinikiwi/pezframe/democracy/src/weights.rs +++ b/bizinikiwi/pezframe/democracy/src/weights.rs @@ -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_democracy +// --pezpallet=pezpallet_democracy // --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2 // --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/democracy/src/weights.rs // --wasm-execution=compiled diff --git a/bizinikiwi/pezframe/derivatives/Cargo.toml b/bizinikiwi/pezframe/derivatives/Cargo.toml index f8e7a462..2eb58d28 100644 --- a/bizinikiwi/pezframe/derivatives/Cargo.toml +++ b/bizinikiwi/pezframe/derivatives/Cargo.toml @@ -6,7 +6,7 @@ edition.workspace = true license = "Apache-2.0" homepage.workspace = true repository.workspace = true -description = "FRAME derivatives pallet" +description = "FRAME derivatives pezpallet" readme = "README.md" documentation = "https://docs.rs/pezpallet-derivatives" diff --git a/bizinikiwi/pezframe/derivatives/README.md b/bizinikiwi/pezframe/derivatives/README.md index caa07e27..7be0d0fe 100644 --- a/bizinikiwi/pezframe/derivatives/README.md +++ b/bizinikiwi/pezframe/derivatives/README.md @@ -15,10 +15,10 @@ The motivation differs depending on the scenario in question. ### The first scenario -The `pezpallet-derivatives` can be helpful when another pallet, which hosts the derivative assets, +The `pezpallet-derivatives` can be helpful when another pezpallet, which hosts the derivative assets, doesn't provide a good enough way to create new assets in the context of them being derivatives. -For instance, the asset hosting pallet might have an asset class (NFT collection or fungible currency) creation extrinsic, +For instance, the asset hosting pezpallet might have an asset class (NFT collection or fungible currency) creation extrinsic, but among its parameters, there could be things like some admin account, currency decimals, various permissions, etc. When creating a regular (i.e., non-derivative) asset class via such an extrinsic, @@ -31,7 +31,7 @@ or we could provide an alternative API where the sensitive parameters are omitte The first approach dominates in the ecosystem at the moment since: 1. It is simple - 2. There was no pallet to make such an alternative API without rewriting individual + 2. There was no pezpallet to make such an alternative API without rewriting individual asset-hosting pallets 3. Only fungible derivatives were ever made (with rare exceptions like an NFT derivative collection on Karura). @@ -54,7 +54,7 @@ So, providing an API for unprivileged derivative registration is a preferable ch Moreover, the future data communication via XCM can benefit both fungible and non-fungible derivative collections registration. - 1. The `create_derivative` extrinsic of this pallet can be configured to initiate the + 1. The `create_derivative` extrinsic of this pezpallet can be configured to initiate the registration process by sending the `ReportMetadata` instruction to the reserve chain. It can be configured such that this can be done by anyone. @@ -72,13 +72,13 @@ This situation can arise in the following cases: `CollectionId` (the derivative ID type) to XCM `AssetId` (the original ID type) because `pezpallet-nfts` requires `CollectionId` to be incrementable. * It is desired to have a continuous ID space for all objects, both derivative and local. - For instance, one might want to reuse the existing pallet combinations (like `pezpallet-nfts` - instance + `pezpallet-nfts-fractionalization` instance) without adding new pallet instances between + For instance, one might want to reuse the existing pezpallet combinations (like `pezpallet-nfts` + instance + `pezpallet-nfts-fractionalization` instance) without adding new pezpallet instances between the one hosting NFTs and many special logic pallets. In this case, the original ID type would be `(AssetId, AssetInstance)`, and the derivative ID type can be anything. ## Usage examples -The `src/mock/mod.rs` contains a mock runtime declaration that contains several instances of the pallet +The `src/mock/mod.rs` contains a mock runtime declaration that contains several instances of the pezpallet to test the scenarios mentioned above. This test configuration can be viewed as a usage example alongside the tests in the `src/tests.rs`. diff --git a/bizinikiwi/pezframe/derivatives/src/benchmarking.rs b/bizinikiwi/pezframe/derivatives/src/benchmarking.rs index 80540f34..58ac9997 100644 --- a/bizinikiwi/pezframe/derivatives/src/benchmarking.rs +++ b/bizinikiwi/pezframe/derivatives/src/benchmarking.rs @@ -15,10 +15,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -use super::{Pallet as Derivatives, *}; +use super::{Pezpallet as Derivatives, *}; use pezframe_benchmarking::v2::*; -pub struct Pallet, I: 'static = ()>(Derivatives); +pub struct Pezpallet, I: 'static = ()>(Derivatives); pub trait Config: super::Config { fn max_original() -> OriginalOf; diff --git a/bizinikiwi/pezframe/derivatives/src/lib.rs b/bizinikiwi/pezframe/derivatives/src/lib.rs index c3bf4148..0abe0d78 100644 --- a/bizinikiwi/pezframe/derivatives/src/lib.rs +++ b/bizinikiwi/pezframe/derivatives/src/lib.rs @@ -29,10 +29,10 @@ //! //! #### The first scenario //! -//! The `pezpallet-derivatives` can be helpful when another pallet, which hosts the derivative assets, +//! The `pezpallet-derivatives` can be helpful when another pezpallet, which hosts the derivative assets, //! doesn't provide a good enough way to create new assets in the context of them being derivatives. //! -//! For instance, the asset hosting pallet might have an asset class (NFT collection or fungible +//! For instance, the asset hosting pezpallet might have an asset class (NFT collection or fungible //! currency) creation extrinsic, but among its parameters, there could be things like some admin //! account, currency decimals, various permissions, etc. When creating a regular (i.e., //! non-derivative) asset class via such an extrinsic, these parameters allow one to conveniently @@ -45,7 +45,7 @@ //! //! The first approach dominates in the ecosystem at the moment since: //! 1. It is simple -//! 2. There was no pallet to make such an alternative API without rewriting individual +//! 2. There was no pezpallet to make such an alternative API without rewriting individual //! asset-hosting pallets //! 3. Only fungible derivatives were ever made (with rare exceptions like an NFT derivative //! collection on Karura). @@ -70,7 +70,7 @@ //! //! Moreover, the future data communication via XCM can benefit both fungible and non-fungible //! derivative collections registration. -//! 1. The `create_derivative` extrinsic of this pallet can be configured to initiate the +//! 1. The `create_derivative` extrinsic of this pezpallet can be configured to initiate the //! registration process //! by sending the `ReportMetadata` instruction to the reserve chain. It can be configured such that //! this can be done by anyone. @@ -89,8 +89,8 @@ //! `CollectionId` (the derivative ID type) to XCM `AssetId` (the original ID type) //! because `pezpallet-nfts` requires `CollectionId` to be incrementable. //! * It is desired to have a continuous ID space for all objects, both derivative and local. -//! For instance, one might want to reuse the existing pallet combinations (like `pezpallet-nfts` -//! instance + `pezpallet-nfts-fractionalization` instance) without adding new pallet instances between +//! For instance, one might want to reuse the existing pezpallet combinations (like `pezpallet-nfts` +//! instance + `pezpallet-nfts-fractionalization` instance) without adding new pezpallet instances between //! the one hosting NFTs and many special logic pallets. In this case, the original ID type would be //! `(AssetId, AssetInstance)`, and the derivative ID type can be anything. @@ -108,7 +108,7 @@ use pezframe_support::{ use pezframe_system::pezpallet_prelude::*; use pezsp_runtime::DispatchResult; -pub use pallet::*; +pub use pezpallet::*; pub mod misc; @@ -123,7 +123,7 @@ mod mock; #[cfg(test)] mod tests; -/// The log target of this pallet. +/// The log target of this pezpallet. pub const LOG_TARGET: &'static str = "runtime::xcm::derivatives"; /// A helper type representing the intention to store @@ -134,14 +134,14 @@ type OriginalOf = >::Original; type DerivativeOf = >::Derivative; type DerivativeExtraOf = >::DerivativeExtra; -#[pezframe_support::pallet] -pub mod pallet { +#[pezframe_support::pezpallet] +pub mod pezpallet { use super::*; - #[pallet::pallet] - pub struct Pallet(PhantomData<(T, I)>); + #[pezpallet::pezpallet] + pub struct Pezpallet(PhantomData<(T, I)>); - #[pallet::config] + #[pezpallet::config] pub trait Config: pezframe_system::Config { type WeightInfo: WeightInfo; @@ -180,23 +180,23 @@ pub mod pallet { type DestroyOp: AssetDefinition + Destroy; } - #[pallet::storage] - #[pallet::getter(fn original_to_derivative)] + #[pezpallet::storage] + #[pezpallet::getter(fn original_to_derivative)] pub type OriginalToDerivative, I: 'static = ()> = StorageMap<_, Blake2_128Concat, OriginalOf, DerivativeOf, OptionQuery>; - #[pallet::storage] - #[pallet::getter(fn derivative_to_original)] + #[pezpallet::storage] + #[pezpallet::getter(fn derivative_to_original)] pub type DerivativeToOriginal, I: 'static = ()> = StorageMap<_, Blake2_128Concat, DerivativeOf, OriginalOf, OptionQuery>; - #[pallet::storage] - #[pallet::getter(fn derivative_extra)] + #[pezpallet::storage] + #[pezpallet::getter(fn derivative_extra)] pub type DerivativeExtra, I: 'static = ()> = StorageMap<_, Blake2_128Concat, DerivativeOf, DerivativeExtraOf, OptionQuery>; - #[pallet::event] - #[pallet::generate_deposit(pub(crate) fn deposit_event)] + #[pezpallet::event] + #[pezpallet::generate_deposit(pub(crate) fn deposit_event)] pub enum Event, I: 'static = ()> { /// A derivative is created. DerivativeCreated { original: OriginalOf }, @@ -208,7 +208,7 @@ pub mod pallet { DerivativeDestroyed { original: OriginalOf }, } - #[pallet::error] + #[pezpallet::error] pub enum Error { /// A derivative already exists. DerivativeAlreadyExists, @@ -229,9 +229,9 @@ pub mod pallet { InvalidAsset, } - #[pallet::call(weight(T::WeightInfo))] - impl, I: 'static> Pallet { - #[pallet::call_index(0)] + #[pezpallet::call(weight(T::WeightInfo))] + impl, I: 'static> Pezpallet { + #[pezpallet::call_index(0)] pub fn create_derivative( origin: OriginFor, original: OriginalOf, @@ -250,7 +250,7 @@ pub mod pallet { Ok(()) } - #[pallet::call_index(1)] + #[pezpallet::call_index(1)] pub fn destroy_derivative( origin: OriginFor, original: OriginalOf, @@ -269,7 +269,7 @@ pub mod pallet { } impl, I: 'static> DerivativesRegistry, DerivativeOf> - for Pallet + for Pezpallet { fn try_register_derivative( original: &OriginalOf, @@ -310,7 +310,7 @@ impl, I: 'static> DerivativesRegistry, DerivativeO } impl, I: 'static> IterDerivativesRegistry, DerivativeOf> - for Pallet + for Pezpallet { fn iter_originals() -> impl Iterator> { >::iter_keys() @@ -326,7 +326,7 @@ impl, I: 'static> IterDerivativesRegistry, Derivat } impl, I: 'static> DerivativesExtra, DerivativeExtraOf> - for Pallet + for Pezpallet { fn get_derivative_extra(derivative: &DerivativeOf) -> Option> { >::get(derivative) @@ -409,8 +409,8 @@ where } /// Gets the `InvalidAsset` error from the given `pezpallet-derivatives` instance. -pub struct InvalidAssetError(PhantomData); -impl, I: 'static> TypedGet for InvalidAssetError> { +pub struct InvalidAssetError(PhantomData); +impl, I: 'static> TypedGet for InvalidAssetError> { type Type = Error; fn get() -> Self::Type { diff --git a/bizinikiwi/pezframe/derivatives/src/misc.rs b/bizinikiwi/pezframe/derivatives/src/misc.rs index c24d5dc6..cd2d37f5 100644 --- a/bizinikiwi/pezframe/derivatives/src/misc.rs +++ b/bizinikiwi/pezframe/derivatives/src/misc.rs @@ -233,7 +233,7 @@ impl, DerivativeId /// NonFungible(Index())`. So, this chain is the reserve location for all /// instances matching the above identification. /// -/// However, if some of the instances within Pallet #111 could be derivatives as well, +/// However, if some of the instances within Pezpallet #111 could be derivatives as well, /// we need to ensure that this chain won't act as the reserve location for these instances. /// If we allow this, this chain could send a derivative as if it were the original NFT on this /// chain. The other chain can't know that this instance isn't the original. diff --git a/bizinikiwi/pezframe/derivatives/src/mock/mod.rs b/bizinikiwi/pezframe/derivatives/src/mock/mod.rs index 94c5ee5c..25a7e43e 100644 --- a/bizinikiwi/pezframe/derivatives/src/mock/mod.rs +++ b/bizinikiwi/pezframe/derivatives/src/mock/mod.rs @@ -17,33 +17,33 @@ //! Test environment for `pezpallet-derivatives`. //! -//! It contains a simple NFT-like `unique_items` pallet that emulate both NFT collections and their -//! tokens (depending on the pallet instance). This test pallet is instatiated three times in the +//! It contains a simple NFT-like `unique_items` pezpallet that emulate both NFT collections and their +//! tokens (depending on the pezpallet instance). This test pezpallet is instatiated three times in the //! test environment to cover the usage scenarios of `pezpallet-derivatives` described in it's crate //! doc comment. //! //! * The first instance, called `PredefinedIdCollections`, emulates NFT collections that are //! created with a predefined ID. //! The ID is set to XCM `AssetId`, so a derivative collection can be created directly using the -//! foreign collection's ID. This pallet instance illustrates and tests the `pezpallet-derivatives` +//! foreign collection's ID. This pezpallet instance illustrates and tests the `pezpallet-derivatives` //! usage scenario #1 (i.e., when no suitable way of directly creating a derivative collection is -//! provided by the hosting pallet). The configuration of this instance can be found in the +//! provided by the hosting pezpallet). The configuration of this instance can be found in the //! [predefined_id_collections] module. The corresponding `pezpallet-derivatives` instance is called //! `PredefinedIdDerivativeCollections`. //! //! * The second instance, called `AutoIdCollections`, emulates NFT collections that are created //! with an automatically assigned ID (e.g., an incremental one). //! The ID is set to `u64`, so a mapping between the foreign collection's ID and the derivative -//! collection ID is needed. This pallet instance illustrates and tests the `pezpallet-derivatives` +//! collection ID is needed. This pezpallet instance illustrates and tests the `pezpallet-derivatives` //! usage scenario #2 combined with scenario #1 (since we also test manual collection creation and //! destruction). The configuration of this instance can be found in the [auto_id_collections] //! module. The corresponding `pezpallet-derivatives` instance is called `AutoIdDerivativeCollections`. //! //! * The third instance, called `PredefinedIdNfts`, emulates non-fungible tokens within collections -//! from the pallet's second instance. +//! from the pezpallet's second instance. //! The full NFT ID is a tuple consisting of the collection ID and a token ID, both of which are of //! the `u64` type. Since a foreign NFT is identified by `(AssetId, AssetInstance)`, we need the -//! mapping between it and the derivative NFT ID. This pallet instance illustrates and tests the +//! mapping between it and the derivative NFT ID. This pezpallet instance illustrates and tests the //! `pezpallet-derivatives` usage scenario #2 without scenario #1 (the manual creation and destruction //! of derivative NFTs is forbidden). The configuration of this instance can be found in the //! [auto_id_nfts] module. The corresponding `pezpallet-derivatives` instance is called @@ -84,32 +84,32 @@ type AccountId = u64; type Block = pezframe_system::mocking::MockBlock; type Balance = u64; -#[pezframe_support::pallet] +#[pezframe_support::pezpallet] pub mod unique_items { use pezframe_support::pezpallet_prelude::*; - #[pallet::config] + #[pezpallet::config] pub trait Config: pezframe_system::Config { type ItemId: Member + Parameter + MaxEncodedLen + TypeInfo; } - #[pallet::pallet] - pub struct Pallet(_); + #[pezpallet::pezpallet] + pub struct Pezpallet(_); - #[pallet::error] + #[pezpallet::error] pub enum Error { AlreadyExists, NoPermission, UnknownItem, } - #[pallet::event] + #[pezpallet::event] pub enum Event, I: 'static = ()> {} - #[pallet::storage] + #[pezpallet::storage] pub type CurrentItemId, I: 'static = ()> = StorageValue<_, T::ItemId, OptionQuery>; - #[pallet::storage] + #[pezpallet::storage] pub type ItemOwner, I: 'static = ()> = StorageMap<_, Blake2_128Concat, T::ItemId, T::AccountId, OptionQuery>; } @@ -234,7 +234,7 @@ pub type CreateDerivativeOwnedBySovAcc >; /// The `pezpallet-derivatives` instance corresponding to the `PredefinedIdCollections` instance of the -/// `unique_items` mock pallet. +/// `unique_items` mock pezpallet. pub type PredefinedIdDerivativeCollectionsInstance = pezpallet_derivatives::Instance1; impl pezpallet_derivatives::Config for Test { type WeightInfo = pezpallet_derivatives::TestWeightInfo; @@ -246,7 +246,7 @@ impl pezpallet_derivatives::Config fo type CreateOrigin = EnsureSigned; - // `NoStoredMapping` tells the pallet not to store the mapping between the `Original` and the + // `NoStoredMapping` tells the pezpallet not to store the mapping between the `Original` and the // `Derivative` type CreateOp = pezpallet_derivatives::NoStoredMapping< CreateDerivativeOwnedBySovAcc< @@ -261,7 +261,7 @@ impl pezpallet_derivatives::Config fo } /// The `pezpallet-derivatives` instance corresponding to the `AutoIdCollections` instance of the -/// `unique_items` mock pallet. +/// `unique_items` mock pezpallet. pub type AutoIdDerivativeCollectionsInstance = pezpallet_derivatives::Instance2; impl pezpallet_derivatives::Config for Test { type WeightInfo = pezpallet_derivatives::TestWeightInfo; @@ -274,7 +274,7 @@ impl pezpallet_derivatives::Config for Test type CreateOrigin = EnsureSigned; - // `StoreMapping` tells the pallet to store the mapping between the `Original` and the + // `StoreMapping` tells the pezpallet to store the mapping between the `Original` and the // `Derivative` type CreateOp = pezpallet_derivatives::StoreMapping< CreateDerivativeOwnedBySovAcc< @@ -300,7 +300,7 @@ impl pezpallet_derivatives::Config for Test } /// The `pezpallet-derivatives` instance corresponding to the `PredefinedIdNfts` instance of the -/// `unique_items` mock pallet. +/// `unique_items` mock pezpallet. pub type DerivativeNftsInstance = pezpallet_derivatives::Instance3; impl pezpallet_derivatives::Config for Test { type WeightInfo = pezpallet_derivatives::TestWeightInfo; @@ -319,7 +319,7 @@ impl pezpallet_derivatives::Config for Test { type DestroyOp = DisabledOps; } -/// Matches NFTs within the `PredefinedIdNfts` pallet. +/// Matches NFTs within the `PredefinedIdNfts` pezpallet. /// These NFTs are considered "local" since they are minted on this chain. pub type LocalNftsMatcher = MatchInClassInstances< MatchedConvertedConcreteId< diff --git a/bizinikiwi/pezframe/dummy-dim/README.md b/bizinikiwi/pezframe/dummy-dim/README.md index 98982eb9..dd70fef9 100644 --- a/bizinikiwi/pezframe/dummy-dim/README.md +++ b/bizinikiwi/pezframe/dummy-dim/README.md @@ -1,4 +1,4 @@ -# Dummy DIM Pallet +# Dummy DIM Pezpallet Allows control of a `PeopleTrait` interface through a privileged origin by simulating a DIM. diff --git a/bizinikiwi/pezframe/dummy-dim/src/benchmarking.rs b/bizinikiwi/pezframe/dummy-dim/src/benchmarking.rs index 83d8b1a1..32b6a7d0 100644 --- a/bizinikiwi/pezframe/dummy-dim/src/benchmarking.rs +++ b/bizinikiwi/pezframe/dummy-dim/src/benchmarking.rs @@ -15,14 +15,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Dummy DIM pallet benchmarking. +//! Dummy DIM pezpallet benchmarking. extern crate alloc; use alloc::vec::Vec; use super::*; -use crate::Pallet as DummyDim; +use crate::Pezpallet as DummyDim; use pezframe_benchmarking::v2::{benchmarks, *}; use pezframe_support::{assert_ok, traits::Get}; @@ -32,7 +32,7 @@ type SecretOf = <::People as AddOnlyPeopleTrait>::Secret; type MemberOf = <::People as AddOnlyPeopleTrait>::Member; fn assert_last_event(generic_event: ::RuntimeEvent) { - pezframe_system::Pallet::::assert_last_event(generic_event.into()); + pezframe_system::Pezpallet::::assert_last_event(generic_event.into()); } fn new_member_from(id: PersonalId) -> (MemberOf, SecretOf) { @@ -165,5 +165,5 @@ mod benches { // Implements a test for each benchmark. Execute with: // `cargo test -p pezpallet-dummy-dim --features runtime-benchmarks`. - impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test); + impl_benchmark_test_suite!(Pezpallet, crate::mock::new_test_ext(), crate::mock::Test); } diff --git a/bizinikiwi/pezframe/dummy-dim/src/lib.rs b/bizinikiwi/pezframe/dummy-dim/src/lib.rs index 5bf2891b..1eb83621 100644 --- a/bizinikiwi/pezframe/dummy-dim/src/lib.rs +++ b/bizinikiwi/pezframe/dummy-dim/src/lib.rs @@ -33,31 +33,31 @@ mod tests; mod benchmarking; pub mod weights; -pub use pallet::*; +pub use pezpallet::*; pub use weights::WeightInfo; type MemberOf = <::People as AddOnlyPeopleTrait>::Member; -#[pezframe_support::pallet] -pub mod pallet { +#[pezframe_support::pezpallet] +pub mod pezpallet { use super::*; use pezframe_support::{pezpallet_prelude::*, Twox64Concat}; use pezframe_system::pezpallet_prelude::*; - #[pallet::pallet] - pub struct Pallet(_); + #[pezpallet::pezpallet] + pub struct Pezpallet(_); - /// The configuration of the pallet dummy DIM. - #[pallet::config] + /// The configuration of the pezpallet dummy DIM. + #[pezpallet::config] pub trait Config: pezframe_system::Config { - /// Weight information for extrinsics in this pallet. + /// Weight information for extrinsics in this pezpallet. type WeightInfo: WeightInfo; /// The runtime event type. #[allow(deprecated)] type RuntimeEvent: From> + IsType<::RuntimeEvent>; - /// The origin which may command personhood updates through this pallet. Root can always do + /// The origin which may command personhood updates through this pezpallet. Root can always do /// this. type UpdateOrigin: EnsureOrigin; @@ -88,16 +88,16 @@ pub mod pallet { } /// The personal IDs that are reserved by unproven people. - #[pallet::storage] + #[pezpallet::storage] pub type ReservedIds = StorageMap<_, Blake2_128Concat, PersonalId, (), OptionQuery>; /// The people we track along with their records. - #[pallet::storage] + #[pezpallet::storage] pub type People = StorageMap<_, Twox64Concat, PersonalId, Record>, OptionQuery>; - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] + #[pezpallet::event] + #[pezpallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { /// A number of IDs was reserved. IdsReserved { count: u32 }, @@ -111,13 +111,13 @@ pub mod pallet { PeopleSuspended { count: u32 }, /// Someone's personhood was resumed. PersonhoodResumed { id: PersonalId }, - /// The pallet enabled suspensions. + /// The pezpallet enabled suspensions. SuspensionsStarted, - /// The pallet disabled suspensions. + /// The pezpallet disabled suspensions. SuspensionsEnded, } - #[pallet::error] + #[pezpallet::error] pub enum Error { /// The personal ID does not belong to a recognized person. NotPerson, @@ -129,11 +129,11 @@ pub mod pallet { TooManyPeople, } - #[pallet::call(weight = ::WeightInfo)] - impl Pallet { + #[pezpallet::call(weight = ::WeightInfo)] + impl Pezpallet { /// Reserve a number of personal IDs. - #[pallet::weight(T::WeightInfo::reserve_ids(T::MaxPersonBatchSize::get()))] - #[pallet::call_index(0)] + #[pezpallet::weight(T::WeightInfo::reserve_ids(T::MaxPersonBatchSize::get()))] + #[pezpallet::call_index(0)] pub fn reserve_ids(origin: OriginFor, count: u32) -> DispatchResultWithPostInfo { T::UpdateOrigin::ensure_origin_or_root(origin)?; ensure!(count <= T::MaxPersonBatchSize::get(), Error::::TooManyPeople); @@ -146,7 +146,7 @@ pub mod pallet { } /// Renew a personal ID. The ID must not be in use. - #[pallet::call_index(1)] + #[pezpallet::call_index(1)] pub fn renew_id_reservation( origin: OriginFor, id: PersonalId, @@ -160,7 +160,7 @@ pub mod pallet { } /// Cancel a personal ID reservation. - #[pallet::call_index(2)] + #[pezpallet::call_index(2)] pub fn cancel_id_reservation( origin: OriginFor, id: PersonalId, @@ -174,8 +174,8 @@ pub mod pallet { } /// Grant personhood for a list of candidates that have reserved personal IDs. - #[pallet::weight(T::WeightInfo::recognize_personhood(T::MaxPersonBatchSize::get()))] - #[pallet::call_index(3)] + #[pezpallet::weight(T::WeightInfo::recognize_personhood(T::MaxPersonBatchSize::get()))] + #[pezpallet::call_index(3)] pub fn recognize_personhood( origin: OriginFor, ids_and_keys: BoundedVec<(PersonalId, MemberOf), T::MaxPersonBatchSize>, @@ -194,8 +194,8 @@ pub mod pallet { /// Suspend the personhood of a list of recognized people. The people must not currently be /// suspended. - #[pallet::weight(T::WeightInfo::suspend_personhood(T::MaxPersonBatchSize::get()))] - #[pallet::call_index(4)] + #[pezpallet::weight(T::WeightInfo::suspend_personhood(T::MaxPersonBatchSize::get()))] + #[pezpallet::call_index(4)] pub fn suspend_personhood( origin: OriginFor, ids: BoundedVec, @@ -214,7 +214,7 @@ pub mod pallet { } /// Resume someone's personhood. The person must currently be suspended. - #[pallet::call_index(5)] + #[pezpallet::call_index(5)] pub fn resume_personhood( origin: OriginFor, id: PersonalId, @@ -232,7 +232,7 @@ pub mod pallet { /// Start a mutation session in the underlying `People` interface. This call does not check /// whether a mutation session is already ongoing and can start new sessions. - #[pallet::call_index(6)] + #[pezpallet::call_index(6)] pub fn start_mutation_session(origin: OriginFor) -> DispatchResultWithPostInfo { T::UpdateOrigin::ensure_origin_or_root(origin)?; T::People::start_people_set_mutation_session()?; @@ -241,10 +241,10 @@ pub mod pallet { } /// End a mutation session in the underlying `People` interface. This call can end multiple - /// mutation sessions, even ones not started by this pallet. + /// mutation sessions, even ones not started by this pezpallet. /// /// This call will fail if no mutation session is ongoing. - #[pallet::call_index(7)] + #[pezpallet::call_index(7)] pub fn end_mutation_session(origin: OriginFor) -> DispatchResultWithPostInfo { T::UpdateOrigin::ensure_origin_or_root(origin)?; T::People::end_people_set_mutation_session()?; diff --git a/bizinikiwi/pezframe/dummy-dim/src/mock.rs b/bizinikiwi/pezframe/dummy-dim/src/mock.rs index db3b7914..aec6e114 100644 --- a/bizinikiwi/pezframe/dummy-dim/src/mock.rs +++ b/bizinikiwi/pezframe/dummy-dim/src/mock.rs @@ -25,7 +25,7 @@ use pezsp_runtime::{ type Block = pezframe_system::mocking::MockBlock; -// Configure a mock runtime to test the pallet. +// Configure a mock runtime to test the pezpallet. pezframe_support::construct_runtime!( pub enum Test { diff --git a/bizinikiwi/pezframe/dummy-dim/src/weights.rs b/bizinikiwi/pezframe/dummy-dim/src/weights.rs index fb8caf39..77fb2c0c 100644 --- a/bizinikiwi/pezframe/dummy-dim/src/weights.rs +++ b/bizinikiwi/pezframe/dummy-dim/src/weights.rs @@ -24,8 +24,8 @@ // Executed Command: // /Users/gav/Core/bizinikiwi/target/release/bizinikiwi // benchmark -// pallet -// --pallet +// pezpallet +// --pezpallet // pezpallet-dummy-dim // --extrinsic=* // --chain=dev diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/benchmarking.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/benchmarking.rs index 18ea4859..8b5da942 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/benchmarking.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/benchmarking.rs @@ -17,7 +17,7 @@ use crate::{ verifier::{self, Verifier}, - Config, CurrentPhase, Pallet, Phase, Snapshot, + Config, CurrentPhase, Pezpallet, Phase, Snapshot, }; use pezframe_benchmarking::v2::*; use pezframe_election_provider_support::{ElectionDataProvider, ElectionProvider}; @@ -28,7 +28,7 @@ benchmark with enough genesis stakers in staking (DataProvider) to fill a page o as per VoterSnapshotPerBlock and TargetSnapshotPerBlock. Generate at least \ 2 * VoterSnapshotPerBlock) nominators and TargetSnapshotPerBlock validators"; -// TODO: remove unwraps from all benchmarks of this pallet -- it makes debugging via wasm harder +// TODO: remove unwraps from all benchmarks of this pezpallet -- it makes debugging via wasm harder #[benchmarks(where T: crate::signed::Config + crate::unsigned::Config + crate::verifier::Config)] mod benchmarks { @@ -40,7 +40,7 @@ mod benchmarks { #[block] { - Pallet::::roll_next(true, false); + Pezpallet::::roll_next(true, false); } assert_eq!(CurrentPhase::::get(), Phase::Off); @@ -53,13 +53,13 @@ mod benchmarks { #[cfg(test)] crate::mock::ElectionStart::set(pezsp_runtime::traits::Bounded::max_value()); - crate::Pallet::::start().unwrap(); + crate::Pezpallet::::start().unwrap(); assert_eq!(CurrentPhase::::get(), Phase::Snapshot(T::Pages::get())); #[block] { - Pallet::::roll_next(true, false); + Pezpallet::::roll_next(true, false); } // we have collected the target snapshot only @@ -81,10 +81,10 @@ mod benchmarks { #[cfg(test)] crate::mock::ElectionStart::set(pezsp_runtime::traits::Bounded::max_value()); - crate::Pallet::::start().unwrap(); + crate::Pezpallet::::start().unwrap(); // roll to the first block of the snapshot. - Pallet::::roll_until_matches(|| { + Pezpallet::::roll_until_matches(|| { CurrentPhase::::get() == Phase::Snapshot(T::Pages::get() - 1) }); @@ -99,7 +99,7 @@ mod benchmarks { // take one more snapshot page. #[block] { - Pallet::::roll_next(true, false); + Pezpallet::::roll_next(true, false); } // we have now collected the first page of voters. @@ -118,9 +118,9 @@ mod benchmarks { fn on_initialize_into_signed() -> Result<(), BenchmarkError> { #[cfg(test)] crate::mock::ElectionStart::set(pezsp_runtime::traits::Bounded::max_value()); - crate::Pallet::::start().unwrap(); + crate::Pezpallet::::start().unwrap(); - Pallet::::roll_until_before_matches(|| { + Pezpallet::::roll_until_before_matches(|| { matches!(CurrentPhase::::get(), Phase::Signed(_)) }); @@ -128,7 +128,7 @@ mod benchmarks { #[block] { - Pallet::::roll_next(true, false); + Pezpallet::::roll_next(true, false); } assert!(CurrentPhase::::get().is_signed()); @@ -140,9 +140,9 @@ mod benchmarks { fn on_initialize_into_signed_validation() -> Result<(), BenchmarkError> { #[cfg(test)] crate::mock::ElectionStart::set(pezsp_runtime::traits::Bounded::max_value()); - crate::Pallet::::start().unwrap(); + crate::Pezpallet::::start().unwrap(); - Pallet::::roll_until_before_matches(|| { + Pezpallet::::roll_until_before_matches(|| { matches!(CurrentPhase::::get(), Phase::SignedValidation(_)) }); @@ -150,7 +150,7 @@ mod benchmarks { #[block] { - Pallet::::roll_next(true, false); + Pezpallet::::roll_next(true, false); } Ok(()) @@ -160,16 +160,16 @@ mod benchmarks { fn on_initialize_into_unsigned() -> Result<(), BenchmarkError> { #[cfg(test)] crate::mock::ElectionStart::set(pezsp_runtime::traits::Bounded::max_value()); - crate::Pallet::::start().unwrap(); + crate::Pezpallet::::start().unwrap(); - Pallet::::roll_until_before_matches(|| { + Pezpallet::::roll_until_before_matches(|| { matches!(CurrentPhase::::get(), Phase::Unsigned(_)) }); assert!(matches!(CurrentPhase::::get(), Phase::SignedValidation(_))); #[block] { - Pallet::::roll_next(true, false); + Pezpallet::::roll_next(true, false); } assert!(matches!(CurrentPhase::::get(), Phase::Unsigned(_))); @@ -180,14 +180,14 @@ mod benchmarks { fn export_non_terminal() -> Result<(), BenchmarkError> { #[cfg(test)] crate::mock::ElectionStart::set(pezsp_runtime::traits::Bounded::max_value()); - crate::Pallet::::start().unwrap(); + crate::Pezpallet::::start().unwrap(); // submit a full solution. - crate::Pallet::::roll_to_signed_and_submit_full_solution()?; + crate::Pezpallet::::roll_to_signed_and_submit_full_solution()?; // fully verify it in the signed validation phase. assert!(T::Verifier::queued_score().is_none()); - crate::Pallet::::roll_until_matches(|| { + crate::Pezpallet::::roll_until_matches(|| { matches!(CurrentPhase::::get(), Phase::Unsigned(_)) }); @@ -196,7 +196,7 @@ mod benchmarks { assert_eq!(verifier::QueuedSolution::::valid_iter().count() as u32, T::Pages::get()); // Roll to Done phase to start export - crate::Pallet::::roll_until_matches(|| CurrentPhase::::get().is_done()); + crate::Pezpallet::::roll_until_matches(|| CurrentPhase::::get().is_done()); #[block] { @@ -215,14 +215,14 @@ mod benchmarks { fn export_terminal() -> Result<(), BenchmarkError> { #[cfg(test)] crate::mock::ElectionStart::set(pezsp_runtime::traits::Bounded::max_value()); - crate::Pallet::::start().unwrap(); + crate::Pezpallet::::start().unwrap(); // submit a full solution. - crate::Pallet::::roll_to_signed_and_submit_full_solution()?; + crate::Pezpallet::::roll_to_signed_and_submit_full_solution()?; // fully verify it in the signed validation phase. ensure!(T::Verifier::queued_score().is_none(), "nothing should be queued"); - crate::Pallet::::roll_until_matches(|| { + crate::Pezpallet::::roll_until_matches(|| { matches!(CurrentPhase::::get(), Phase::Unsigned(_)) }); @@ -234,7 +234,7 @@ mod benchmarks { ); // Roll to Done phase - crate::Pallet::::roll_until_matches(|| CurrentPhase::::get().is_done()); + crate::Pezpallet::::roll_until_matches(|| CurrentPhase::::get().is_done()); // Start export and fetch all pages except the last one (1..=T::Pages::get() - 1).rev().for_each(T::DataProvider::fetch_page); @@ -257,10 +257,10 @@ mod benchmarks { // heaviest case is emergency set. #[cfg(test)] crate::mock::ElectionStart::set(pezsp_runtime::traits::Bounded::max_value()); - crate::Pallet::::start().unwrap(); + crate::Pezpallet::::start().unwrap(); // roll to signed so the snapshot exists - Pallet::::roll_until_before_matches(|| { + Pezpallet::::roll_until_before_matches(|| { matches!(CurrentPhase::::get(), Phase::Signed(_)) }); @@ -271,7 +271,7 @@ mod benchmarks { #[block] { // fallback might decide to fail, that's okay.. - let maybe_err = Pallet::::manage(origin, crate::ManagerOperation::EmergencyFallback); + let maybe_err = Pezpallet::::manage(origin, crate::ManagerOperation::EmergencyFallback); //.. but it cannot be bad origin. assert!(maybe_err.is_ok() || maybe_err.unwrap_err() != DispatchError::BadOrigin.into()); } @@ -284,10 +284,10 @@ mod benchmarks { // heaviest case is emergency set. #[cfg(test)] crate::mock::ElectionStart::set(pezsp_runtime::traits::Bounded::max_value()); - crate::Pallet::::start().unwrap(); + crate::Pezpallet::::start().unwrap(); // mine a single page solution. - let solution = crate::Pallet::::roll_to_signed_and_mine_solution(1); + let solution = crate::Pezpallet::::roll_to_signed_and_mine_solution(1); // verify to get the support. let (voter_pages, all_targets, desired_targets) = @@ -316,7 +316,7 @@ mod benchmarks { .map_err(|_| -> BenchmarkError { "cannot create admin origin".into() })?; #[block] { - assert_ok!(Pallet::::admin( + assert_ok!(Pezpallet::::admin( origin, crate::AdminOperation::EmergencySetSolution( pezsp_std::boxed::Box::new(single_support), @@ -332,7 +332,7 @@ mod benchmarks { } impl_benchmark_test_suite!( - Pallet, + Pezpallet, crate::mock::ExtBuilder::full().build_unchecked(), crate::mock::Runtime ); diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/helpers.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/helpers.rs index cd416360..8a924799 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/helpers.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/helpers.rs @@ -26,18 +26,18 @@ use pezframe_support::{traits::Get, BoundedVec}; use pezsp_runtime::SaturatedConversion; use pezsp_std::{collections::btree_map::BTreeMap, convert::TryInto, prelude::*}; -/// Emit a log specific to this pallet, setting the target to [`crate::LOG_PREFIX`] +/// Emit a log specific to this pezpallet, setting the target to [`crate::LOG_PREFIX`] #[macro_export] macro_rules! log { ($level:tt, $pattern:expr $(, $values:expr)* $(,)?) => { log::$level!( target: $crate::LOG_PREFIX, - concat!("[#{:?}] 🗳🗳🗳 ", $pattern), >::block_number() $(, $values)* + concat!("[#{:?}] 🗳🗳🗳 ", $pattern), >::block_number() $(, $values)* ) }; } -/// Emit a log within a submodule of the pallet +/// Emit a log within a submodule of the pezpallet #[macro_export] macro_rules! sublog { ($level:tt, $sub_pallet:tt, $pattern:expr $(, $values:expr)* $(,)?) => { @@ -46,7 +46,7 @@ macro_rules! sublog { #[cfg(feature = "std")] log::$level!( target: format!("{}::{}", $crate::LOG_PREFIX, $sub_pallet).as_ref(), - concat!("[#{:?}] 🗳🗳🗳 ", $pattern), >::block_number() $(, $values )* + concat!("[#{:?}] 🗳🗳🗳 ", $pattern), >::block_number() $(, $values )* ) }; } diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/lib.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/lib.rs index 634b0c77..a7d79d63 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/lib.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/lib.rs @@ -15,9 +15,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! # Multi-phase, multi-block, election provider pallet. +//! # Multi-phase, multi-block, election provider pezpallet. //! -//! > This pallet is sometimes abbreviated as `EPMB`, and `pezpallet_election_provider_multi_phase` as +//! > This pezpallet is sometimes abbreviated as `EPMB`, and `pezpallet_election_provider_multi_phase` as //! > `EPM`. //! //! ## Overall idea @@ -28,40 +28,40 @@ //! Nonetheless, it has a limited capacity in terms of number of voters it can process in a **single //! block**. //! -//! This pallet takes `EPM` system, keeps most of its ideas and core premises, and extends it to -//! support paginated, multi-block operations. The final goal of this pallet is to scale linearly +//! This pezpallet takes `EPM` system, keeps most of its ideas and core premises, and extends it to +//! support paginated, multi-block operations. The final goal of this pezpallet is to scale linearly //! with the number of blocks allocated to the elections. Moreover, the amount of work that it does //! in one block should be bounded and measurable, making it suitable for a teyrchain. In principle, //! with large enough blocks (in a dedicated teyrchain), the number of voters included in the NPoS //! system can grow significantly (yet, obviously not indefinitely). //! -//! Note that this pallet does not consider how the recipient is processing the results. To ensure -//! scalability, the recipient of this pallet's data (i.e. `pezpallet-staking`) must also be capable of +//! Note that this pezpallet does not consider how the recipient is processing the results. To ensure +//! scalability, the recipient of this pezpallet's data (i.e. `pezpallet-staking`) must also be capable of //! pagination and multi-block processing. //! //! ## Companion pallets //! -//! This pallet will only function in a sensible way if it is peered with its companion pallets. +//! This pezpallet will only function in a sensible way if it is peered with its companion pallets. //! -//! - The [`verifier`] pallet provides a standard implementation of the [`verifier::Verifier`]. This -//! pallet is mandatory. +//! - The [`verifier`] pezpallet provides a standard implementation of the [`verifier::Verifier`]. This +//! pezpallet is mandatory. //! - The [`unsigned`] module provides the implementation of unsigned submission by validators. If -//! this pallet is included, then [`Config::UnsignedPhase`] will determine its duration. +//! this pezpallet is included, then [`Config::UnsignedPhase`] will determine its duration. //! - The [`signed`] module provides the implementation of the signed submission by any account. If -//! this pallet is included, the combined [`Config::SignedPhase`] and +//! this pezpallet is included, the combined [`Config::SignedPhase`] and //! [`Config::SignedValidationPhase`] will determine its duration //! //! These pallets are in fact hierarchical. This particular one is the top level one. It contains //! the shared information that all child pallets use. All child pallets depend on the top level -//! pallet ONLY, but not the other way around. For those cases, traits are used. +//! pezpallet ONLY, but not the other way around. For those cases, traits are used. //! //! As in, notice that [`crate::verifier::Config`] relies on [`crate::Config`], but for the //! reverse, we rely on [`crate::verifier::Verifier`] trait, which is indeed part of //! [`crate::Config`]. This is merely an implementation opinion. //! -//! ### Pallet Ordering: +//! ### Pezpallet Ordering: //! -//! TODO: @kiaenigma: this needs clarification and a enforcement. Signed pallet should come first. +//! TODO: @kiaenigma: this needs clarification and a enforcement. Signed pezpallet should come first. //! Fixing this should yield removing `verifier_done` from the phase transition. //! //! The ordering of these pallets in a runtime should be: @@ -76,14 +76,14 @@ //! //! ## Pagination //! -//! Most of the external APIs of this pallet are paginated. All pagination follow a pattern where if +//! Most of the external APIs of this pezpallet are paginated. All pagination follow a pattern where if //! `N` pages exist, the first paginated call is `function(N-1)` and the last one is `function(0)`. //! For example, with 3 pages, the `elect` of [`ElectionProvider`] is expected to be called as //! `elect(2) -> elect(1) -> elect(0)`. In essence, calling a paginated function with index 0 is //! always a signal of termination, meaning that no further calls will follow. //! //! The snapshot creation for voters (Nominators in staking), submission of signed pages, validation -//! of signed solutions and exporting of pages are all paginated. Note that this pallet is yet to +//! of signed solutions and exporting of pages are all paginated. Note that this pezpallet is yet to //! support paginated target (Validators in staking) snapshotting. //! //! ### Terminology Note: `msp` and `lsp` @@ -94,13 +94,13 @@ //! //! ## Phases //! -//! The operations in this pallet are divided intor rounds, a `u32` number stored in [`Round`]. -//! This value helps this pallet organize itself, and leaves the door open for lazy deletion of any +//! The operations in this pezpallet are divided intor rounds, a `u32` number stored in [`Round`]. +//! This value helps this pezpallet organize itself, and leaves the door open for lazy deletion of any //! stale data. A round, under the happy path, starts by receiving the call to //! [`ElectionProvider::start`], and is terminated by receiving a call to //! [`ElectionProvider::elect`] with value 0. //! -//! The timeline of pallet is overall as follows: +//! The timeline of pezpallet is overall as follows: //! //! ```ignore //! < Off > @@ -121,10 +121,10 @@ //! * Duration of `Signed`, `SignedValidation` and `Unsigned` are determined by //! [`Config::SignedPhase`], [`Config::SignedValidationPhase`] and [`Config::UnsignedPhase`] //! respectively. -//! * [`Config::Pages`] calls to elect are expected, but all in all the pallet will close a round +//! * [`Config::Pages`] calls to elect are expected, but all in all the pezpallet will close a round //! once `elect(0)` is called. //! -//! > Given this, it is rather important for the user of this pallet to ensure it always terminates +//! > Given this, it is rather important for the user of this pezpallet to ensure it always terminates //! > election via `elect` before requesting a new one. //! //! ## Feasible Solution (correct solution) @@ -149,7 +149,7 @@ //! //! 1. Do nothing: [`Continue`] //! 2. Force us into the emergency phase: [`crate::InitiateEmergencyPhase`]. This initiates -//! [`Phase::Emergency`], which will halt almost all operations of this pallet, and it can only +//! [`Phase::Emergency`], which will halt almost all operations of this pezpallet, and it can only //! be recovered by [`AdminOperation`], dispatched via [`Call::manage`]. //! 3. compute an onchain from the give page of snapshot. //! @@ -163,7 +163,7 @@ //! we don't have another choice as we cannot request another smaller snapshot from the data //! provider mid-election without more bookkeeping on the staking side. //! -//! If onchain solution is to be seriously considered, an improvement to this pallet should +//! If onchain solution is to be seriously considered, an improvement to this pezpallet should //! re-request a smaller set of voters from `T::DataProvider` in a stateless manner. //! //! ### Signed Phase @@ -182,15 +182,15 @@ // - Naming convention is: `${singular}_page` for singular, e.g. `voter_page` for `Vec`. // `paged_${plural}` for plural, e.g. `paged_voters` for `Vec>`. // -// - Since this crate has multiple `Pallet` and `Configs`, in each sub-pallet, we only reference the -// local `Pallet` without a prefix and allow it to be imported via `use`. Avoid `super::Pallet` -// except for the case of a modules that want to reference their local `Pallet` . The -// `crate::Pallet` is always reserved for the parent pallet. Other sibling pallets must be -// referenced with full path, e.g. `crate::Verifier::Pallet`. Do NOT write something like `use -// unsigned::Pallet as UnsignedPallet`. +// - Since this crate has multiple `Pezpallet` and `Configs`, in each sub-pezpallet, we only reference the +// local `Pezpallet` without a prefix and allow it to be imported via `use`. Avoid `super::Pezpallet` +// except for the case of a modules that want to reference their local `Pezpallet` . The +// `crate::Pezpallet` is always reserved for the parent pezpallet. Other sibling pallets must be +// referenced with full path, e.g. `crate::Verifier::Pezpallet`. Do NOT write something like `use +// unsigned::Pezpallet as UnsignedPallet`. // // - Respecting private storage items with wrapper We move all implementations out of the `mod -// pallet` as much as possible to ensure we NEVER access the internal storage items directly. All +// pezpallet` as much as possible to ensure we NEVER access the internal storage items directly. All // operations should happen with the wrapper types. #![cfg_attr(not(feature = "std"), no_std)] @@ -239,22 +239,22 @@ macro_rules! clear_round_based_map { }}; } -/// The signed pallet +/// The signed pezpallet pub mod signed; -/// Common types of the pallet +/// Common types of the pezpallet pub mod types; -/// The unsigned pallet +/// The unsigned pezpallet pub mod unsigned; -/// The verifier pallet +/// The verifier pezpallet pub mod verifier; /// The weight module pub mod weights; -pub use pallet::*; +pub use pezpallet::*; pub use types::*; pub use weights::traits::pezpallet_election_provider_multi_block::WeightInfo; -/// A fallback implementation that transitions the pallet to the emergency phase. +/// A fallback implementation that transitions the pezpallet to the emergency phase. pub struct InitiateEmergencyPhase(pezsp_std::marker::PhantomData); impl ElectionProvider for InitiateEmergencyPhase { type AccountId = T::AccountId; @@ -267,7 +267,7 @@ impl ElectionProvider for InitiateEmergencyPhase { type MaxBackersPerWinnerFinal = ::MaxBackersPerWinnerFinal; fn elect(_page: PageIndex) -> Result, Self::Error> { - Pallet::::phase_transition(Phase::Emergency); + Pezpallet::::phase_transition(Phase::Emergency); Err("Emergency phase started.") } @@ -382,7 +382,7 @@ impl IfSolutionQueuedElse { let queued_score = ::queued_score().is_some(); #[cfg(debug_assertions)] { - let any_pages_queued = (Pallet::::lsp()..=Pallet::::msp()).any(|p| { + let any_pages_queued = (Pezpallet::::lsp()..=Pezpallet::::msp()).any(|p| { ::get_queued_solution_page(p).is_some() }); assert_eq!( @@ -407,9 +407,9 @@ impl>, NotQueued: Get>> Get> } } -/// Internal errors of the pallet. This is used in the implementation of [`ElectionProvider`]. +/// Internal errors of the pezpallet. This is used in the implementation of [`ElectionProvider`]. /// -/// Note that this is different from [`pallet::Error`]. +/// Note that this is different from [`pezpallet::Error`]. #[derive( pezframe_support::DebugNoBound, pezframe_support::PartialEqNoBound, pezframe_support::EqNoBound, )] @@ -446,7 +446,7 @@ impl From for ElectionError { } } -/// Different operations that only the [`Config::AdminOrigin`] can perform on the pallet. +/// Different operations that only the [`Config::AdminOrigin`] can perform on the pezpallet. #[derive( Encode, Decode, @@ -464,7 +464,7 @@ pub enum AdminOperation { /// Set the given (single page) emergency solution. /// /// Can only be called in emergency phase. - EmergencySetSolution(Box>>, ElectionScore), + EmergencySetSolution(Box>>, ElectionScore), /// Set the minimum untrusted score. This is directly communicated to the verifier component to /// be taken into account. /// @@ -474,7 +474,7 @@ pub enum AdminOperation { } /// Different operations that the [`Config::ManagerOrigin`] (or [`Config::AdminOrigin`]) can perform -/// on the pallet. +/// on the pezpallet. #[derive( Encode, Decode, @@ -516,7 +516,7 @@ impl OnRoundRotation for () { /// pallets, once the round is over. /// /// This is intended to be phased out once we move to fully lazy deletion system to spare more PoV. -/// In that case, simply use `()` on [`pallet::Config::OnRoundRotation`]. +/// In that case, simply use `()` on [`pezpallet::Config::OnRoundRotation`]. pub struct CleanRound(core::marker::PhantomData); impl OnRoundRotation for CleanRound { fn on_round_rotation(_ending: u32) { @@ -524,38 +524,38 @@ impl OnRoundRotation for CleanRound { T::Verifier::kill(); // Kill the snapshot. - pallet::Snapshot::::kill(); + pezpallet::Snapshot::::kill(); - // Nothing to do in the signed pallet -- it is already in lazy-deletion mode. + // Nothing to do in the signed pezpallet -- it is already in lazy-deletion mode. } } -#[pezframe_support::pallet] -pub mod pallet { +#[pezframe_support::pezpallet] +pub mod pezpallet { use super::*; - #[pallet::config] + #[pezpallet::config] pub trait Config: pezframe_system::Config { /// Duration of the unsigned phase. - #[pallet::constant] + #[pezpallet::constant] type UnsignedPhase: Get>; /// Duration of the signed phase. - #[pallet::constant] + #[pezpallet::constant] type SignedPhase: Get>; /// Duration of the singed validation phase. /// /// The duration of this should not be less than `T::Pages`, and there is no point in it /// being more than `SignedPhase::MaxSubmission::get() * T::Pages`. TODO: integrity test for /// it. - #[pallet::constant] + #[pezpallet::constant] type SignedValidationPhase: Get>; /// The number of snapshot voters to fetch per block. - #[pallet::constant] + #[pezpallet::constant] type VoterSnapshotPerBlock: Get; /// The number of snapshot targets to fetch per block. - #[pallet::constant] + #[pezpallet::constant] type TargetSnapshotPerBlock: Get; /// The number of pages. @@ -564,7 +564,7 @@ pub mod pallet { /// /// The solutions may contain at MOST this many pages, but less pages are acceptable as /// well. - #[pallet::constant] + #[pezpallet::constant] type Pages: Get; /// Something that will provide the election data. @@ -596,15 +596,15 @@ pub mod pallet { MaxWinnersPerPage = ::MaxWinnersPerPage, >; - /// The verifier pallet's interface. + /// The verifier pezpallet's interface. type Verifier: verifier::Verifier< Solution = SolutionOf, AccountId = Self::AccountId, > + verifier::AsynchronousVerifier; - /// The origin that can perform administration operations on this pallet. + /// The origin that can perform administration operations on this pezpallet. /// - /// This is the highest privilege origin of this pallet, and should be configured + /// This is the highest privilege origin of this pezpallet, and should be configured /// restrictively. type AdminOrigin: EnsureOrigin; @@ -618,7 +618,7 @@ pub mod pallet { /// Common implementation is [`ProceedRegardlessOf`] or [`RevertToSignedIfNotQueuedOf`]. type AreWeDone: Get>; - /// The weight of the pallet. + /// The weight of the pezpallet. type WeightInfo: WeightInfo; /// Single type that implement [`super::OnRoundRotation`] to do something when the round @@ -626,15 +626,15 @@ pub mod pallet { type OnRoundRotation: super::OnRoundRotation; } - #[pallet::call] - impl Pallet { - /// Manage this pallet. + #[pezpallet::call] + impl Pezpallet { + /// Manage this pezpallet. /// /// The origin of this call must be [`Config::ManagerOrigin`]. /// /// See [`ManagerOperation`] for various operations that are possible. - #[pallet::weight(T::WeightInfo::manage_fallback().max(T::WeightInfo::export_terminal()))] - #[pallet::call_index(0)] + #[pezpallet::weight(T::WeightInfo::manage_fallback().max(T::WeightInfo::export_terminal()))] + #[pezpallet::call_index(0)] pub fn manage(origin: OriginFor, op: ManagerOperation) -> DispatchResultWithPostInfo { T::ManagerOrigin::ensure_origin(origin.clone()).map(|_| ()).or_else(|_| { // try admin origin as well as admin is a superset. @@ -682,8 +682,8 @@ pub mod pallet { } } - #[pallet::call_index(1)] - #[pallet::weight(T::WeightInfo::admin_set())] + #[pezpallet::call_index(1)] + #[pezpallet::weight(T::WeightInfo::admin_set())] pub fn admin(origin: OriginFor, op: AdminOperation) -> DispatchResultWithPostInfo { T::AdminOrigin::ensure_origin(origin)?; match op { @@ -706,8 +706,8 @@ pub mod pallet { } } - #[pallet::hooks] - impl Hooks> for Pallet { + #[pezpallet::hooks] + impl Hooks> for Pezpallet { fn on_initialize(_now: BlockNumberFor) -> Weight { let current_phase = CurrentPhase::::get(); let weight1 = match current_phase { @@ -790,7 +790,7 @@ pub mod pallet { // We only accept data provider who's maximum votes per voter matches our // `T::Solution`'s `LIMIT`. // - // NOTE that this pallet does not really need to enforce this in runtime. The + // NOTE that this pezpallet does not really need to enforce this in runtime. The // solution cannot represent any voters more than `LIMIT` anyhow. assert_eq!( ::MaxVotesPerVoter::get(), @@ -821,8 +821,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 { /// A phase transition happened. Only checks major changes in the variants, not minor inner /// values. @@ -838,8 +838,8 @@ pub mod pallet { UnexpectedVoterSnapshotFailed, } - /// Error of the pallet that can be returned in response to dispatches. - #[pallet::error] + /// Error of the pezpallet that can be returned in response to dispatches. + #[pezpallet::error] pub enum Error { /// Triggering the `Fallback` failed. Fallback, @@ -871,16 +871,16 @@ pub mod pallet { /// Internal counter for the number of rounds. /// /// This is useful for de-duplication of transactions submitted to the pool, and general - /// diagnostics of the pallet. + /// diagnostics of the pezpallet. /// /// This is merely incremented once per every time that an upstream `elect` is called. - #[pallet::storage] - #[pallet::getter(fn round)] + #[pezpallet::storage] + #[pezpallet::getter(fn round)] pub type Round = StorageValue<_, u32, ValueQuery>; /// Current phase. - #[pallet::storage] - #[pallet::getter(fn current_phase)] + #[pezpallet::storage] + #[pezpallet::getter(fn current_phase)] pub type CurrentPhase = StorageValue<_, Phase, ValueQuery>; /// Wrapper struct for working with snapshots. @@ -928,10 +928,10 @@ pub mod pallet { pub(crate) fn set_targets(targets: BoundedVec) { let hash = Self::write_storage_with_pre_allocate( - &PagedTargetSnapshot::::hashed_key_for(Self::round(), Pallet::::msp()), + &PagedTargetSnapshot::::hashed_key_for(Self::round(), Pezpallet::::msp()), targets, ); - PagedTargetSnapshotHash::::insert(Self::round(), Pallet::::msp(), hash); + PagedTargetSnapshotHash::::insert(Self::round(), Pezpallet::::msp(), hash); } pub(crate) fn set_voters(page: PageIndex, voters: VoterPageOf) { @@ -964,7 +964,7 @@ pub mod pallet { pub(crate) fn targets() -> Option> { // NOTE: targets always have one index, which is 0, aka lsp. - PagedTargetSnapshot::::get(Self::round(), Pallet::::msp()) + PagedTargetSnapshot::::get(Self::round(), Pezpallet::::msp()) } /// Get a fingerprint of the snapshot, from all the hashes that are stored for each page of @@ -976,7 +976,7 @@ pub mod pallet { pub fn fingerprint() -> T::Hash { let mut hashed_target_and_voters = Self::targets_hash().unwrap_or_default().as_ref().to_vec(); - let hashed_voters = (Pallet::::msp()..=Pallet::::lsp()) + let hashed_voters = (Pezpallet::::msp()..=Pezpallet::::lsp()) .map(|i| PagedVoterSnapshotHash::::get(Self::round(), i).unwrap_or_default()) .flat_map(|hash| >::as_ref(&hash).to_owned()) .collect::>(); @@ -1001,11 +1001,11 @@ pub mod pallet { } pub(crate) fn targets_hash() -> Option { - PagedTargetSnapshotHash::::get(Self::round(), Pallet::::msp()) + PagedTargetSnapshotHash::::get(Self::round(), Pezpallet::::msp()) } fn round() -> u32 { - Pallet::::round() + Pezpallet::::round() } } @@ -1034,7 +1034,7 @@ pub mod pallet { up_to_page = up_to_page.min(T::Pages::get()); // ensure that voter pages that should exist, indeed to exist.. let mut sum_existing_voters: usize = 0; - for p in (crate::Pallet::::lsp()..=crate::Pallet::::msp()) + for p in (crate::Pezpallet::::lsp()..=crate::Pezpallet::::msp()) .rev() .take(up_to_page as usize) { @@ -1052,7 +1052,7 @@ pub mod pallet { } // ..and those that should not exist, indeed DON'T. - for p in (crate::Pallet::::lsp()..=crate::Pallet::::msp()) + for p in (crate::Pezpallet::::lsp()..=crate::Pezpallet::::msp()) .take((T::Pages::get() - up_to_page) as usize) { ensure!( @@ -1083,7 +1083,7 @@ pub mod pallet { ); // ensure that voter pages that should exist, indeed to exist.. - for p in crate::Pallet::::lsp()..=crate::Pallet::::msp() { + for p in crate::Pezpallet::::lsp()..=crate::Pezpallet::::msp() { ensure!( Self::voters_hash(p).is_some() && Self::voters_decode_len(p).unwrap_or_default() as u32 == @@ -1100,7 +1100,7 @@ pub mod pallet { } pub(crate) fn targets_decode_len() -> Option { - PagedTargetSnapshot::::decode_len(Self::round(), Pallet::::msp()) + PagedTargetSnapshot::::decode_len(Self::round(), Pezpallet::::msp()) } pub(crate) fn voters_hash(page: PageIndex) -> Option { @@ -1110,7 +1110,7 @@ pub mod pallet { pub(crate) fn sanity_check() -> Result<(), &'static str> { // check the snapshot existence based on the phase. This checks all of the needed // conditions except for the metadata values. - let phase = Pallet::::current_phase(); + let phase = Pezpallet::::current_phase(); let _ = match phase { // no page should exist in this phase. Phase::Off => Self::ensure_snapshot(false, T::Pages::get()), @@ -1151,7 +1151,7 @@ pub mod pallet { pub(crate) fn voters_iter_flattened() -> impl Iterator> { let key_range = - (crate::Pallet::::lsp()..=crate::Pallet::::msp()).collect::>(); + (crate::Pezpallet::::lsp()..=crate::Pezpallet::::msp()).collect::>(); key_range .into_iter() .flat_map(|k| PagedVoterSnapshot::::get(Self::round(), k).unwrap_or_default()) @@ -1166,20 +1166,20 @@ pub mod pallet { } pub(crate) fn remove_target_page() { - PagedTargetSnapshot::::remove(Self::round(), Pallet::::msp()); + PagedTargetSnapshot::::remove(Self::round(), Pezpallet::::msp()); } pub(crate) fn remove_target(at: usize) { PagedTargetSnapshot::::mutate( Self::round(), - crate::Pallet::::msp(), + crate::Pezpallet::::msp(), |maybe_targets| { if let Some(targets) = maybe_targets { targets.remove(at); // and update the hash. PagedTargetSnapshotHash::::insert( Self::round(), - crate::Pallet::::msp(), + crate::Pezpallet::::msp(), T::Hashing::hash(&targets.encode()), ) } else { @@ -1191,10 +1191,10 @@ pub mod pallet { } /// Desired number of targets to elect for this round. - #[pallet::storage] + #[pezpallet::storage] pub type DesiredTargets = StorageMap<_, Twox64Concat, u32, u32>; /// Paginated voter snapshot. At most [`T::Pages`] keys will exist. - #[pallet::storage] + #[pezpallet::storage] pub type PagedVoterSnapshot = StorageDoubleMap< _, Twox64Concat, @@ -1206,13 +1206,13 @@ pub mod pallet { /// Same as [`PagedVoterSnapshot`], but it will store the hash of the snapshot. /// /// The hash is generated using [`pezframe_system::Config::Hashing`]. - #[pallet::storage] + #[pezpallet::storage] pub type PagedVoterSnapshotHash = StorageDoubleMap<_, Twox64Concat, u32, Twox64Concat, PageIndex, T::Hash>; /// Paginated target snapshot. /// /// For the time being, since we assume one pages of targets, at most ONE key will exist. - #[pallet::storage] + #[pezpallet::storage] pub type PagedTargetSnapshot = StorageDoubleMap< _, Twox64Concat, @@ -1224,15 +1224,15 @@ pub mod pallet { /// Same as [`PagedTargetSnapshot`], but it will store the hash of the snapshot. /// /// The hash is generated using [`pezframe_system::Config::Hashing`]. - #[pallet::storage] + #[pezpallet::storage] pub type PagedTargetSnapshotHash = StorageDoubleMap<_, Twox64Concat, u32, Twox64Concat, PageIndex, T::Hash>; - #[pallet::pallet] - pub struct Pallet(PhantomData); + #[pezpallet::pezpallet] + pub struct Pezpallet(PhantomData); } -impl Pallet { +impl Pezpallet { /// Returns the most significant page of the snapshot. /// /// Based on the contract of `ElectionDataProvider`, this is the first page that is filled. @@ -1440,7 +1440,7 @@ impl Pallet { #[allow(unused)] #[cfg(any(feature = "runtime-benchmarks", test))] // helper code for testing and benchmarking -impl Pallet +impl Pezpallet where T: Config + crate::signed::Config + crate::unsigned::Config + crate::verifier::Config, BlockNumberFor: From, @@ -1461,7 +1461,7 @@ where loop { let should_break = pezframe_support::storage::with_transaction( || -> TransactionOutcome> { - Pallet::::roll_next(true, false); + Pezpallet::::roll_next(true, false); if criteria() { TransactionOutcome::Rollback(Ok(true)) } else { @@ -1500,12 +1500,12 @@ where use types::Pagify; // register alice - let alice = crate::Pallet::::funded_account("alice", 0); - signed::Pallet::::register(RawOrigin::Signed(alice.clone()).into(), score)?; + let alice = crate::Pezpallet::::funded_account("alice", 0); + signed::Pezpallet::::register(RawOrigin::Signed(alice.clone()).into(), score)?; // submit pages for (index, page) in solution_pages.pagify(T::Pages::get()) { - signed::Pallet::::submit_page( + signed::Pezpallet::::submit_page( RawOrigin::Signed(alice.clone()).into(), index, Some(Box::new(page.clone())), @@ -1557,27 +1557,27 @@ where /// Roll all pallets forward, for the given number of blocks. pub(crate) fn roll_to(n: BlockNumberFor, with_signed: bool, try_state: bool) { - let now = pezframe_system::Pallet::::block_number(); + let now = pezframe_system::Pezpallet::::block_number(); assert!(n > now, "cannot roll to current or past block"); let one: BlockNumberFor = 1u32.into(); let mut i = now + one; while i <= n { - pezframe_system::Pallet::::set_block_number(i); + pezframe_system::Pezpallet::::set_block_number(i); - Pallet::::on_initialize(i); - verifier::Pallet::::on_initialize(i); - unsigned::Pallet::::on_initialize(i); + Pezpallet::::on_initialize(i); + verifier::Pezpallet::::on_initialize(i); + unsigned::Pezpallet::::on_initialize(i); if with_signed { - signed::Pallet::::on_initialize(i); + signed::Pezpallet::::on_initialize(i); } // invariants must hold at the end of each block. if try_state { - Pallet::::do_try_state(i).unwrap(); - verifier::Pallet::::do_try_state(i).unwrap(); - unsigned::Pallet::::do_try_state(i).unwrap(); - signed::Pallet::::do_try_state(i).unwrap(); + Pezpallet::::do_try_state(i).unwrap(); + verifier::Pezpallet::::do_try_state(i).unwrap(); + unsigned::Pezpallet::::do_try_state(i).unwrap(); + signed::Pezpallet::::do_try_state(i).unwrap(); } i += one; @@ -1587,14 +1587,14 @@ where /// Roll to next block. pub(crate) fn roll_next(with_signed: bool, try_state: bool) { Self::roll_to( - pezframe_system::Pallet::::block_number() + 1u32.into(), + pezframe_system::Pezpallet::::block_number() + 1u32.into(), with_signed, try_state, ); } } -impl ElectionProvider for Pallet { +impl ElectionProvider for Pezpallet { type AccountId = T::AccountId; type BlockNumber = BlockNumberFor; type Error = ElectionError; @@ -1630,7 +1630,7 @@ impl ElectionProvider for Pallet { .map_err(|err| { // if any pages returns an error, we go into the emergency phase and don't do // anything else anymore. This will prevent any new submissions to signed and - // unsigned pallet, and thus the verifier will also be almost stuck, except for the + // unsigned pezpallet, and thus the verifier will also be almost stuck, except for the // submission of emergency solutions. log!(debug, "fallback also ({:?}) failed for page {:?}", err, remaining); err @@ -2468,8 +2468,8 @@ mod election_provider { assert_eq!(Round::::get(), 1); // and the snapshot is cleared, assert_storage_noop!(Snapshot::::kill()); - // signed pallet is clean. - // NOTE: in the future, if and when we add lazy cleanup to the signed pallet, this + // signed pezpallet is clean. + // NOTE: in the future, if and when we add lazy cleanup to the signed pezpallet, this // assertion might break. assert_ok!(signed::Submissions::::ensure_killed(0)); }); @@ -2518,7 +2518,7 @@ mod election_provider { assert_full_snapshot(); // there are 3 pages (indexes 2..=0), but we short circuit by just calling 0. - let _solution = crate::Pallet::::elect(0).unwrap(); + let _solution = crate::Pezpallet::::elect(0).unwrap(); // round is incremented. assert_eq!(MultiBlock::round(), round + 1); @@ -2530,7 +2530,7 @@ mod election_provider { assert_eq!(Round::::get(), 1); // the snapshot is cleared, assert_none_snapshot(); - // and signed pallet is clean. + // and signed pezpallet is clean. assert_ok!(signed::Submissions::::ensure_killed(round)); }); } @@ -2580,7 +2580,7 @@ mod election_provider { let solutions = (1..=MultiBlock::msp()) .rev() // 2, 1 .map(|page| { - crate::Pallet::::elect(page as PageIndex).unwrap(); + crate::Pezpallet::::elect(page as PageIndex).unwrap(); assert!(MultiBlock::current_phase().is_export()); }) .collect::>(); @@ -2675,7 +2675,7 @@ mod election_provider { assert_eq!(MultiBlock::current_phase(), Phase::Off); // the snapshot is cleared, assert_storage_noop!(Snapshot::::kill()); - // and signed pallet is clean. + // and signed pezpallet is clean. assert_ok!(signed::Submissions::::ensure_killed(round)); }); } @@ -2904,7 +2904,7 @@ mod manage_ops { // This scenario have multiple outcomes: // 1. rotate in off => almost a noop // 2. rotate mid signed, validation, unsigned, done, but NOT export => clear all data, move to - // next round and be off. Note: all of the data in this pallet is indexed by the round index, + // next round and be off. Note: all of the data in this pezpallet is indexed by the round index, // so moving to the next round will implicitly make the old data unavaioable, even if not // cleared out. This secnario needs further testing. // 3. rotate mid export: same as above, except staking will be out of sync and will also need @@ -2923,7 +2923,7 @@ mod manage_ops { // we have snapshot data now for this round. assert_full_snapshot(); - // there is some data in the verifier pallet + // there is some data in the verifier pezpallet assert!(verifier::QueuedSolution::::queued_score().is_some()); // phase is assert_eq!(MultiBlock::current_phase(), Phase::SignedValidation(2)); diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/mock/mod.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/mock/mod.rs index 6340cdca..f64041a6 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/mock/mod.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/mock/mod.rs @@ -505,7 +505,7 @@ fn all_pallets_sanity_checks() { /// Fully verify a solution. /// -/// This will progress the blocks until the verifier pallet is done verifying it. +/// This will progress the blocks until the verifier pezpallet is done verifying it. /// /// The solution must have already been loaded via `load_and_start_verification`. /// @@ -608,7 +608,7 @@ pub fn ensure_targets(pages: PageIndex, count: usize) { assert_eq!(crate::Snapshot::::targets().unwrap().len(), count); } -/// get the events of the multi-block pallet. +/// get the events of the multi-block pezpallet. pub fn multi_block_events() -> Vec> { System::events() .into_iter() @@ -629,7 +629,7 @@ pub fn multi_block_events_since_last_call() -> Vec> { events.into_iter().skip(already_seen as usize).collect() } -/// get the events of the verifier pallet. +/// get the events of the verifier pezpallet. pub fn verifier_events() -> Vec> { System::events() .into_iter() @@ -640,7 +640,7 @@ pub fn verifier_events() -> Vec> { .collect::>() } -/// get the events of the verifier pallet since last call. +/// get the events of the verifier pezpallet since last call. pub fn verifier_events_since_last_call() -> Vec> { let events = verifier_events(); let already_seen = VerifierEvents::get(); @@ -650,7 +650,7 @@ pub fn verifier_events_since_last_call() -> Vec> /// proceed block number to `n`. pub fn roll_to(n: BlockNumber) { - crate::Pallet::::roll_to( + crate::Pezpallet::::roll_to( n, matches!(SignedPhaseSwitch::get(), SignedSwitch::Real), true, diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/mock/signed.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/mock/signed.rs index ebf9ad91..b0eb4f05 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/mock/signed.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/mock/signed.rs @@ -135,7 +135,7 @@ pub fn signed_events_since_last_call() -> Vec> { events.into_iter().skip(already_seen as usize).collect() } -/// get the events of the verifier pallet. +/// get the events of the verifier pezpallet. pub fn signed_events() -> Vec> { System::events() .into_iter() @@ -144,7 +144,7 @@ pub fn signed_events() -> Vec> { .collect::>() } -/// Load a signed solution into its pallet. +/// Load a signed solution into its pezpallet. pub fn load_signed_for_verification(who: AccountId, paged: PagedRawSolution) { let initial_balance = Balances::free_balance(&who); assert_eq!(balances(who), (initial_balance, 0)); diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/mock/staking.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/mock/staking.rs index bbb58ebc..23b03a09 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/mock/staking.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/mock/staking.rs @@ -115,7 +115,7 @@ impl ElectionDataProvider for MockStaking { } fn next_election_prediction(_: u64) -> u64 { - unreachable!("not used in this pallet") + unreachable!("not used in this pezpallet") } #[cfg(feature = "runtime-benchmarks")] diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/signed/benchmarking.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/signed/benchmarking.rs index 2f033f06..83290b15 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/signed/benchmarking.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/signed/benchmarking.rs @@ -16,7 +16,7 @@ // limitations under the License. use crate::{ - signed::{Config, Pallet, Submissions}, + signed::{Config, Pezpallet, Submissions}, types::PagedRawSolution, unsigned::miner::OffchainWorkerMiner, CurrentPhase, Phase, Round, @@ -37,13 +37,13 @@ mod benchmarks { fn register_not_full() -> Result<(), BenchmarkError> { CurrentPhase::::put(Phase::Signed(T::SignedPhase::get() - One::one())); let round = Round::::get(); - let alice = crate::Pallet::::funded_account("alice", 0); + let alice = crate::Pezpallet::::funded_account("alice", 0); let score = ElectionScore::default(); assert_eq!(Submissions::::sorted_submitters(round).len(), 0); #[block] { - Pallet::::register(RawOrigin::Signed(alice).into(), score)?; + Pezpallet::::register(RawOrigin::Signed(alice).into(), score)?; } assert_eq!(Submissions::::sorted_submitters(round).len(), 1); @@ -56,20 +56,20 @@ mod benchmarks { let round = Round::::get(); for i in 0..T::MaxSubmissions::get() { - let submitter = crate::Pallet::::funded_account("submitter", i); + let submitter = crate::Pezpallet::::funded_account("submitter", i); let score = ElectionScore { minimal_stake: i.into(), ..Default::default() }; - Pallet::::register(RawOrigin::Signed(submitter.clone()).into(), score)?; + Pezpallet::::register(RawOrigin::Signed(submitter.clone()).into(), score)?; // The first one, which will be ejected, has also submitted all pages if i == 0 { for p in 0..T::Pages::get() { let page = Some(Default::default()); - Pallet::::submit_page(RawOrigin::Signed(submitter.clone()).into(), p, page)?; + Pezpallet::::submit_page(RawOrigin::Signed(submitter.clone()).into(), p, page)?; } } } - let who = crate::Pallet::::funded_account("who", 0); + let who = crate::Pezpallet::::funded_account("who", 0); let score = ElectionScore { minimal_stake: T::MaxSubmissions::get().into(), ..Default::default() }; @@ -80,7 +80,7 @@ mod benchmarks { #[block] { - Pallet::::register(RawOrigin::Signed(who).into(), score)?; + Pezpallet::::register(RawOrigin::Signed(who).into(), score)?; } assert_eq!( @@ -94,9 +94,9 @@ mod benchmarks { fn submit_page() -> Result<(), BenchmarkError> { #[cfg(test)] crate::mock::ElectionStart::set(pezsp_runtime::traits::Bounded::max_value()); - crate::Pallet::::start().unwrap(); + crate::Pezpallet::::start().unwrap(); - crate::Pallet::::roll_until_matches(|| { + crate::Pezpallet::::roll_until_matches(|| { matches!(CurrentPhase::::get(), Phase::Signed(_)) }); @@ -106,12 +106,12 @@ mod benchmarks { let page = Some(Box::new(solution_pages[0].clone())); // register alice - let alice = crate::Pallet::::funded_account("alice", 0); - Pallet::::register(RawOrigin::Signed(alice.clone()).into(), score)?; + let alice = crate::Pezpallet::::funded_account("alice", 0); + Pezpallet::::register(RawOrigin::Signed(alice.clone()).into(), score)?; #[block] { - Pallet::::submit_page(RawOrigin::Signed(alice).into(), 0, page)?; + Pezpallet::::submit_page(RawOrigin::Signed(alice).into(), 0, page)?; } Ok(()) @@ -121,9 +121,9 @@ mod benchmarks { fn unset_page() -> Result<(), BenchmarkError> { #[cfg(test)] crate::mock::ElectionStart::set(pezsp_runtime::traits::Bounded::max_value()); - crate::Pallet::::start().unwrap(); + crate::Pezpallet::::start().unwrap(); - crate::Pallet::::roll_until_matches(|| { + crate::Pezpallet::::roll_until_matches(|| { matches!(CurrentPhase::::get(), Phase::Signed(_)) }); @@ -133,15 +133,15 @@ mod benchmarks { let page = Some(Box::new(solution_pages[0].clone())); // register alice - let alice = crate::Pallet::::funded_account("alice", 0); - Pallet::::register(RawOrigin::Signed(alice.clone()).into(), score)?; + let alice = crate::Pezpallet::::funded_account("alice", 0); + Pezpallet::::register(RawOrigin::Signed(alice.clone()).into(), score)?; // submit page - Pallet::::submit_page(RawOrigin::Signed(alice.clone()).into(), 0, page)?; + Pezpallet::::submit_page(RawOrigin::Signed(alice.clone()).into(), 0, page)?; #[block] { - Pallet::::submit_page(RawOrigin::Signed(alice).into(), 0, None)?; + Pezpallet::::submit_page(RawOrigin::Signed(alice).into(), 0, None)?; } Ok(()) @@ -150,21 +150,21 @@ mod benchmarks { #[benchmark(pov_mode = Measured)] fn bail() -> Result<(), BenchmarkError> { CurrentPhase::::put(Phase::Signed(T::SignedPhase::get() - One::one())); - let alice = crate::Pallet::::funded_account("alice", 0); + let alice = crate::Pezpallet::::funded_account("alice", 0); // register alice let score = ElectionScore::default(); - Pallet::::register(RawOrigin::Signed(alice.clone()).into(), score)?; + Pezpallet::::register(RawOrigin::Signed(alice.clone()).into(), score)?; // submit all pages for p in 0..T::Pages::get() { let page = Some(Default::default()); - Pallet::::submit_page(RawOrigin::Signed(alice.clone()).into(), p, page)?; + Pezpallet::::submit_page(RawOrigin::Signed(alice.clone()).into(), p, page)?; } #[block] { - Pallet::::bail(RawOrigin::Signed(alice).into())?; + Pezpallet::::bail(RawOrigin::Signed(alice).into())?; } Ok(()) @@ -174,32 +174,32 @@ mod benchmarks { fn clear_old_round_data(p: Linear<1, { T::Pages::get() }>) -> Result<(), BenchmarkError> { // set signed phase and alice ready to submit CurrentPhase::::put(Phase::Signed(T::SignedPhase::get() - One::one())); - let alice = crate::Pallet::::funded_account("alice", 0); + let alice = crate::Pezpallet::::funded_account("alice", 0); // register alice let score = ElectionScore::default(); - Pallet::::register(RawOrigin::Signed(alice.clone()).into(), score)?; + Pezpallet::::register(RawOrigin::Signed(alice.clone()).into(), score)?; // submit a solution with p pages. for pp in 0..p { let page = Some(Default::default()); - Pallet::::submit_page(RawOrigin::Signed(alice.clone()).into(), pp, page)?; + Pezpallet::::submit_page(RawOrigin::Signed(alice.clone()).into(), pp, page)?; } // force rotate to the next round. let prev_round = Round::::get(); - crate::Pallet::::rotate_round(); + crate::Pezpallet::::rotate_round(); #[block] { - Pallet::::clear_old_round_data(RawOrigin::Signed(alice).into(), prev_round, p)?; + Pezpallet::::clear_old_round_data(RawOrigin::Signed(alice).into(), prev_round, p)?; } Ok(()) } impl_benchmark_test_suite!( - Pallet, + Pezpallet, crate::mock::ExtBuilder::signed().build_unchecked(), crate::mock::Runtime ); diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/signed/mod.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/signed/mod.rs index d9b7c8fc..0bc99c65 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/signed/mod.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/signed/mod.rs @@ -79,8 +79,8 @@ use pezsp_std::prelude::*; /// Explore all weights pub use crate::weights::traits::pezpallet_election_provider_multi_block_signed::*; -/// Exports of this pallet -pub use pallet::*; +/// Exports of this pezpallet +pub use pezpallet::*; #[cfg(feature = "runtime-benchmarks")] mod benchmarking; @@ -111,7 +111,7 @@ pub struct SubmissionMetadata { pages: BoundedVec, } -impl SolutionDataProvider for Pallet { +impl SolutionDataProvider for Pezpallet { type Solution = SolutionOf; // `get_page` should only be called when a leader exists. @@ -221,12 +221,12 @@ impl + Saturating, G: Get> CalculatePageDeposit @@ -239,7 +239,7 @@ pub mod pallet { /// Extra deposit per-page. type DepositPerPage: CalculatePageDeposit>; - /// The fixed deposit charged upon [`Pallet::register`] from [`Invulnerables`]. + /// The fixed deposit charged upon [`Pezpallet::register`] from [`Invulnerables`]. type InvulnerableDeposit: Get>; /// Base reward that is given to the winner. @@ -250,7 +250,7 @@ pub mod pallet { type MaxSubmissions: Get; /// The ratio of the deposit to return in case a signed account submits a solution via - /// [`Pallet::register`], but later calls [`Pallet::bail`]. + /// [`Pezpallet::register`], but later calls [`Pezpallet::bail`]. /// /// This should be large enough to cover for the deletion cost of possible all pages. To be /// safe, you can put it to 100% to begin with to fully dis-incentivize bailing. @@ -266,12 +266,12 @@ pub mod pallet { /// submitter for the winner. type EstimateCallFee: EstimateCallFee, BalanceOf>; - /// Provided weights of this pallet. + /// Provided weights of this pezpallet. type WeightInfo: WeightInfo; } /// The hold reason of this palelt. - #[pallet::composite_enum] + #[pezpallet::composite_enum] pub enum HoldReason { /// Because of submitting a signed solution. #[codec(index = 0)] @@ -287,7 +287,7 @@ pub mod pallet { /// * If _ejected_ by better solution from [`SortedScores`], they will get their full deposit /// back. /// * They always get their tx-fee back even if they are _discarded_. - #[pallet::storage] + #[pezpallet::storage] pub type Invulnerables = StorageValue<_, BoundedVec>, ValueQuery>; @@ -327,7 +327,7 @@ pub mod pallet { /// purely independent. pub(crate) struct Submissions(pezsp_std::marker::PhantomData); - #[pallet::storage] + #[pezpallet::storage] pub type SortedScores = StorageMap< _, Twox64Concat, @@ -337,7 +337,7 @@ pub mod pallet { >; /// Triple map from (round, account, page) to a solution page. - #[pallet::storage] + #[pezpallet::storage] type SubmissionStorage = StorageNMap< _, ( @@ -353,7 +353,7 @@ pub mod pallet { /// /// invariant: for any Key1 of type `AccountId` in [`Submissions`], this storage map also has a /// value. - #[pallet::storage] + #[pezpallet::storage] type SubmissionMetadataStorage = StorageDoubleMap<_, Twox64Concat, u32, Twox64Concat, T::AccountId, SubmissionMetadata>; @@ -472,7 +472,7 @@ pub mod pallet { if sorted_scores.is_full() { let remove_idx = sorted_scores .iter() - .position(|(x, _)| !Pallet::::is_invulnerable(x)) + .position(|(x, _)| !Pezpallet::::is_invulnerable(x)) .ok_or(Error::::QueueFull)?; if insert_idx > remove_idx { // we have a better solution @@ -496,14 +496,14 @@ pub mod pallet { debug_assert!(_r.unique <= T::Pages::get()); if let Some(metadata) = maybe_metadata { - Pallet::::settle_deposit( + Pezpallet::::settle_deposit( &discarded, metadata.deposit, T::EjectGraceRatio::get(), ); } - Pallet::::deposit_event(Event::::Ejected(round, discarded)); + Pezpallet::::deposit_event(Event::::Ejected(round, discarded)); true } else { // we don't have a better solution @@ -542,10 +542,10 @@ pub mod pallet { /// Get the deposit of a registration with the given number of pages. fn deposit_for(who: &T::AccountId, pages: usize) -> BalanceOf { - if Pallet::::is_invulnerable(who) { + if Pezpallet::::is_invulnerable(who) { T::InvulnerableDeposit::get() } else { - let round = Pallet::::current_round(); + let round = Pezpallet::::current_round(); let queue_size = Self::submitters_count(round); let base = T::DepositBase::calculate_base_deposit(queue_size); let pages = T::DepositPerPage::calculate_page_deposit(queue_size, pages); @@ -740,11 +740,11 @@ pub mod pallet { } } - #[pallet::pallet] - pub struct Pallet(PhantomData); + #[pezpallet::pezpallet] + pub struct Pezpallet(PhantomData); - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] + #[pezpallet::event] + #[pezpallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { /// Upcoming submission has been registered for the given account, with the given score. Registered(u32, T::AccountId, ElectionScore), @@ -762,7 +762,7 @@ pub mod pallet { Bailed(u32, T::AccountId), } - #[pallet::error] + #[pezpallet::error] pub enum Error { /// The phase is not signed. PhaseNotSigned, @@ -784,17 +784,17 @@ pub mod pallet { TooManyInvulnerables, } - #[pallet::call] - impl Pallet { + #[pezpallet::call] + impl Pezpallet { /// Register oneself for an upcoming signed election. - #[pallet::weight(SignedWeightsOf::::register_eject())] - #[pallet::call_index(0)] + #[pezpallet::weight(SignedWeightsOf::::register_eject())] + #[pezpallet::call_index(0)] pub fn register( origin: OriginFor, claimed_score: ElectionScore, ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; - ensure!(crate::Pallet::::current_phase().is_signed(), Error::::PhaseNotSigned); + ensure!(crate::Pezpallet::::current_phase().is_signed(), Error::::PhaseNotSigned); // note: we could already check if this is a duplicate here, but prefer keeping the code // simple for now. @@ -825,21 +825,21 @@ pub mod pallet { /// Submit a single page of a solution. /// - /// Must always come after [`Pallet::register`]. + /// Must always come after [`Pezpallet::register`]. /// /// `maybe_solution` can be set to `None` to erase the page. /// /// Collects deposits from the signed origin based on [`Config::DepositBase`] and /// [`Config::DepositPerPage`]. - #[pallet::weight(SignedWeightsOf::::submit_page())] - #[pallet::call_index(1)] + #[pezpallet::weight(SignedWeightsOf::::submit_page())] + #[pezpallet::call_index(1)] pub fn submit_page( origin: OriginFor, page: PageIndex, maybe_solution: Option>>, ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; - ensure!(crate::Pallet::::current_phase().is_signed(), Error::::PhaseNotSigned); + ensure!(crate::Pezpallet::::current_phase().is_signed(), Error::::PhaseNotSigned); let is_set = maybe_solution.is_some(); let round = Self::current_round(); @@ -859,11 +859,11 @@ pub mod pallet { /// A portion of the deposit may be returned, based on the [`Config::EjectGraceRatio`]. /// /// This will fully remove the solution from storage. - #[pallet::weight(SignedWeightsOf::::bail())] - #[pallet::call_index(2)] + #[pezpallet::weight(SignedWeightsOf::::bail())] + #[pezpallet::call_index(2)] pub fn bail(origin: OriginFor) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; - ensure!(crate::Pallet::::current_phase().is_signed(), Error::::PhaseNotSigned); + ensure!(crate::Pezpallet::::current_phase().is_signed(), Error::::PhaseNotSigned); let round = Self::current_round(); let metadata = Submissions::::take_submission_with_data(round, &who) .ok_or(Error::::NoSubmission)?; @@ -881,8 +881,8 @@ pub mod pallet { /// /// This can only be called for submissions that end up being discarded, as in they are not /// processed and they end up lingering in the queue. - #[pallet::call_index(3)] - #[pallet::weight(SignedWeightsOf::::clear_old_round_data(*witness_pages))] + #[pezpallet::call_index(3)] + #[pezpallet::weight(SignedWeightsOf::::clear_old_round_data(*witness_pages))] pub fn clear_old_round_data( origin: OriginFor, round: u32, @@ -925,8 +925,8 @@ pub mod pallet { /// Set the invulnerable list. /// /// Dispatch origin must the the same as [`crate::Config::AdminOrigin`]. - #[pallet::call_index(4)] - #[pallet::weight(T::DbWeight::get().writes(1))] + #[pezpallet::call_index(4)] + #[pezpallet::weight(T::DbWeight::get().writes(1))] pub fn set_invulnerables(origin: OriginFor, inv: Vec) -> DispatchResult { ::AdminOrigin::ensure_origin(origin)?; let bounded: BoundedVec<_, ConstU32<16>> = @@ -936,8 +936,8 @@ pub mod pallet { } } - #[pallet::view_functions] - impl Pallet { + #[pezpallet::view_functions] + impl Pezpallet { /// Get the deposit amount that will be held for a solution of `pages`. /// /// This allows an offchain application to know what [`Config::DepositPerPage`] and @@ -948,14 +948,14 @@ pub mod pallet { } } - #[pallet::hooks] - impl Hooks> for Pallet { + #[pezpallet::hooks] + impl Hooks> for Pezpallet { fn on_initialize(_: BlockNumberFor) -> Weight { // this code is only called when at the boundary of phase transition, which is already - // captured by the parent pallet. No need for weight. + // captured by the parent pezpallet. No need for weight. let weight_taken_into_account: Weight = Default::default(); - if crate::Pallet::::current_phase().is_signed_validation_opened_now() { + if crate::Pezpallet::::current_phase().is_signed_validation_opened_now() { let maybe_leader = Submissions::::leader(Self::current_round()); sublog!( debug, @@ -982,14 +982,14 @@ pub mod pallet { } } -impl Pallet { +impl Pezpallet { #[cfg(any(feature = "try-runtime", test, feature = "runtime-benchmarks"))] pub(crate) fn do_try_state(_n: BlockNumberFor) -> Result<(), pezsp_runtime::TryRuntimeError> { Submissions::::sanity_check_round(Self::current_round()) } fn current_round() -> u32 { - crate::Pallet::::round() + crate::Pezpallet::::round() } fn is_invulnerable(who: &T::AccountId) -> bool { @@ -1040,7 +1040,7 @@ impl Pallet { // Try to start verification again if we still have submissions if let crate::types::Phase::SignedValidation(remaining_blocks) = - crate::Pallet::::current_phase() + crate::Pezpallet::::current_phase() { // Only start verification if there are sufficient blocks remaining // Note: SignedValidation(N) means N+1 blocks remaining in the phase diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/signed/tests.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/signed/tests.rs index abd73c81..8a8cad83 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/signed/tests.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/signed/tests.rs @@ -63,7 +63,7 @@ mod calls { #[test] fn cannot_register_if_not_signed() { ExtBuilder::signed().build_and_execute(|| { - assert!(!crate::Pallet::::current_phase().is_signed()); + assert!(!crate::Pezpallet::::current_phase().is_signed()); assert_noop!( SignedPallet::register(RuntimeOrigin::signed(99), Default::default()), Error::::PhaseNotSigned @@ -655,7 +655,7 @@ mod e2e { // 99 now has their deposit returned. assert_eq!(balances(99), (100, 0)); - // signed pallet should be in 100% clean state. + // signed pezpallet should be in 100% clean state. assert_ok!(Submissions::::ensure_killed(0)); }) } @@ -675,7 +675,7 @@ mod e2e { assert_eq!(Submissions::::submitters_count(current_round), 1); roll_to_signed_validation_open(); - roll_next(); // one block so signed pallet will send start signal. + roll_next(); // one block so signed pezpallet will send start signal. roll_to_full_verification(); // Check that rejection events were properly generated @@ -696,13 +696,13 @@ mod e2e { ); // Verify no-restart conditions are met - assert!(crate::Pallet::::current_phase().is_signed_validation()); + assert!(crate::Pezpallet::::current_phase().is_signed_validation()); assert!(!Submissions::::has_leader(current_round)); assert_eq!(Submissions::::submitters_count(current_round), 0); assert_eq!(VerifierPallet::status(), crate::verifier::Status::Nothing); // Verifier should remain idle for the rest of the signed validation phase - while crate::Pallet::::current_phase().is_signed_validation() { + while crate::Pezpallet::::current_phase().is_signed_validation() { roll_next(); assert_eq!(VerifierPallet::status(), crate::verifier::Status::Nothing); } @@ -817,7 +817,7 @@ mod e2e { roll_to_signed_validation_open(); assert_eq!(MultiBlock::current_phase(), Phase::SignedValidation(3)); assert!(matches!(VerifierPallet::status(), crate::verifier::Status::Nothing)); - roll_next(); // one block so signed-pallet will send the start signal + roll_next(); // one block so signed-pezpallet will send the start signal assert_eq!(MultiBlock::current_phase(), Phase::SignedValidation(2)); assert!(matches!(VerifierPallet::status(), crate::verifier::Status::Ongoing(2))); @@ -959,11 +959,11 @@ mod e2e { ); // we have 1 block left in signed verification, but we cannot do anything here. - assert_eq!(crate::Pallet::::current_phase(), Phase::SignedValidation(0)); + assert_eq!(crate::Pezpallet::::current_phase(), Phase::SignedValidation(0)); // we go back to signed next roll_next(); - assert_eq!(crate::Pallet::::current_phase(), Phase::Signed(4)); + assert_eq!(crate::Pezpallet::::current_phase(), Phase::Signed(4)); // no one submits again, and we go to verification again roll_to_signed_validation_open(); @@ -995,15 +995,15 @@ mod e2e { vec![crate::signed::Event::Rewarded(0, 999, 7)] ); - // verifier is `Nothing`, and will remain so as signed-pallet will not start it + // verifier is `Nothing`, and will remain so as signed-pezpallet will not start it // again. - assert_eq!(crate::Pallet::::current_phase(), Phase::SignedValidation(0)); + assert_eq!(crate::Pezpallet::::current_phase(), Phase::SignedValidation(0)); assert_eq!(VerifierPallet::status(), crate::verifier::Status::Nothing); // next block we go to done roll_next(); - assert_eq!(crate::Pallet::::current_phase(), Phase::Done); + assert_eq!(crate::Pezpallet::::current_phase(), Phase::Done); assert_eq!(VerifierPallet::status(), crate::verifier::Status::Nothing); }) } @@ -1042,7 +1042,7 @@ mod e2e { assert_eq!(Submissions::::submitters_count(current_round), 2); roll_to_signed_validation_open(); - roll_next(); // one block so signed-pallet will send the start signal + roll_next(); // one block so signed-pezpallet will send the start signal assert!(matches!(MultiBlock::current_phase(), Phase::SignedValidation(_))); assert!(matches!(VerifierPallet::status(), crate::verifier::Status::Ongoing(_))); @@ -1099,7 +1099,7 @@ mod e2e { assert_eq!(VerifierPallet::status(), crate::verifier::Status::Nothing); roll_to_signed_validation_open(); - roll_next(); // one block so signed-pallet will send the start signal + roll_next(); // one block so signed-pezpallet will send the start signal // Now in the next validation phase, the good solution starts verification assert!(matches!(VerifierPallet::status(), crate::verifier::Status::Ongoing(_))); @@ -1111,7 +1111,7 @@ mod e2e { roll_next(); // Process page 0 // Good solution should be fully verified and accepted - assert_eq!(crate::Pallet::::current_phase(), Phase::SignedValidation(0)); + assert_eq!(crate::Pezpallet::::current_phase(), Phase::SignedValidation(0)); assert_eq!(VerifierPallet::status(), crate::verifier::Status::Nothing); assert_eq!(Submissions::::submitters_count(current_round), 0); }); @@ -1158,7 +1158,7 @@ mod e2e { // Move to verification phase roll_to_signed_validation_open(); - roll_next(); // one block so signed-pallet will send the start signal + roll_next(); // one block so signed-pezpallet will send the start signal assert!(matches!(VerifierPallet::status(), crate::verifier::Status::Ongoing(_))); // Process first invalid solution (91) @@ -1228,7 +1228,7 @@ mod e2e { ] ); - assert_eq!(crate::Pallet::::current_phase(), Phase::SignedValidation(0)); + assert_eq!(crate::Pezpallet::::current_phase(), Phase::SignedValidation(0)); assert_eq!(VerifierPallet::status(), crate::verifier::Status::Nothing); // Check that all expected events were emitted in the correct order @@ -1249,7 +1249,7 @@ mod e2e { // finally done roll_next(); - assert_eq!(crate::Pallet::::current_phase(), Phase::Done); + assert_eq!(crate::Pezpallet::::current_phase(), Phase::Done); // verifier has done nothing assert_eq!(VerifierPallet::status(), crate::verifier::Status::Nothing); assert!( @@ -1605,7 +1605,7 @@ mod invulnerables { assert_ok!(SignedPallet::register(RuntimeOrigin::signed(99), invalid_score)); roll_to_signed_validation_open(); - roll_next(); // one block so signed pallet will send start signal. + roll_next(); // one block so signed pezpallet will send start signal. roll_to_full_verification(); // Check that rejection events were properly generated @@ -1678,7 +1678,7 @@ mod defensive_tests { // Delete the score storage let full_key = - crate::signed::pallet::SortedScores::::hashed_key_for(current_round); + crate::signed::pezpallet::SortedScores::::hashed_key_for(current_round); unhashed::kill(&full_key); // Complete verification - this should trigger score unavailable detection diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/types.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/types.rs index d55cd67c..77a1fd7b 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/types.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/types.rs @@ -15,11 +15,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Common types and traits of the EPMB pallet group. +//! Common types and traits of the EPMB pezpallet group. //! //! ## [`SolutionOf`] //! -//! This type is among the most cryptic used in the EPMB pallet. The origins of this type go back to +//! This type is among the most cryptic used in the EPMB pezpallet. The origins of this type go back to //! the fact that sending a solution, with hundreds or thousands of account-ids in it would be too //! large for a chain to handle. This was particularly the case in a single page solution, as //! developed in `election-provider-multi-phase`. To combat this, a "compact" custom type is @@ -32,7 +32,7 @@ //! //! ## [`Phase`] //! -//! This is the most important type of this pallet, demonstrating the state-machine used +//! This is the most important type of this pezpallet, demonstrating the state-machine used //! to manage the election process and its various phases. use crate::{unsigned::miner::MinerConfig, verifier}; @@ -227,7 +227,7 @@ impl Get for MaxFlattenedVoters { /// This is bounded by [`MaxFlattenedVoters`]. pub type AllVoterPagesFlattenedOf = BoundedVec, MaxFlattenedVoters>; -/// Current phase of the pallet. +/// Current phase of the pezpallet. #[derive( PartialEqNoBound, EqNoBound, @@ -271,7 +271,7 @@ pub enum Phase { /// The inner value should be read as "`remaining` number of pages are left to be fetched". /// Thus, if inner value is `0` if the snapshot is complete and we are ready to move on. /// - /// This value should be interpreted after `on_initialize` of this pallet has already been + /// This value should be interpreted after `on_initialize` of this pezpallet has already been /// called. Snapshot(PageIndex), /// Snapshot is done, and we are waiting for `Export` to kick in. @@ -280,7 +280,7 @@ pub enum Phase { /// /// Once this is active, no more signed or solutions will be accepted. Export(PageIndex), - /// The emergency phase. This is could be enabled by one of the fallbacks, and locks the pallet + /// The emergency phase. This is could be enabled by one of the fallbacks, and locks the pezpallet /// such that only governance can change the state. Emergency, } diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/unsigned/benchmarking.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/unsigned/benchmarking.rs index ce35a1af..8bda758d 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/unsigned/benchmarking.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/unsigned/benchmarking.rs @@ -16,7 +16,7 @@ // limitations under the License. use crate::{ - unsigned::{miner::OffchainWorkerMiner, Call, Config, Pallet}, + unsigned::{miner::OffchainWorkerMiner, Call, Config, Pezpallet}, verifier::Verifier, CurrentPhase, Phase, }; @@ -34,9 +34,9 @@ mod benchmarks { fn validate_unsigned() -> Result<(), BenchmarkError> { #[cfg(test)] crate::mock::ElectionStart::set(pezsp_runtime::traits::Bounded::max_value()); - crate::Pallet::::start().unwrap(); + crate::Pezpallet::::start().unwrap(); - crate::Pallet::::roll_until_matches(|| { + crate::Pezpallet::::roll_until_matches(|| { matches!(CurrentPhase::::get(), Phase::Unsigned(_)) }); let call: Call = OffchainWorkerMiner::::mine_solution(T::MinerPages::get(), false) @@ -45,7 +45,7 @@ mod benchmarks { #[block] { - assert_ok!(Pallet::::validate_unsigned(TransactionSource::Local, &call)); + assert_ok!(Pezpallet::::validate_unsigned(TransactionSource::Local, &call)); } Ok(()) @@ -55,10 +55,10 @@ mod benchmarks { fn submit_unsigned() -> Result<(), BenchmarkError> { #[cfg(test)] crate::mock::ElectionStart::set(pezsp_runtime::traits::Bounded::max_value()); - crate::Pallet::::start().unwrap(); + crate::Pezpallet::::start().unwrap(); // roll to unsigned phase open - crate::Pallet::::roll_until_matches(|| { + crate::Pezpallet::::roll_until_matches(|| { matches!(CurrentPhase::::get(), Phase::Unsigned(_)) }); // TODO: we need to better ensure that this is actually worst case @@ -69,7 +69,7 @@ mod benchmarks { assert!(T::Verifier::queued_score().is_none()); #[block] { - assert_ok!(Pallet::::submit_unsigned(RawOrigin::None.into(), Box::new(solution))); + assert_ok!(Pezpallet::::submit_unsigned(RawOrigin::None.into(), Box::new(solution))); } // something is queued @@ -81,10 +81,10 @@ mod benchmarks { fn mine_solution(p: Linear<1, { T::Pages::get() }>) -> Result<(), BenchmarkError> { #[cfg(test)] crate::mock::ElectionStart::set(pezsp_runtime::traits::Bounded::max_value()); - crate::Pallet::::start().unwrap(); + crate::Pezpallet::::start().unwrap(); // roll to unsigned phase open - crate::Pallet::::roll_until_matches(|| { + crate::Pezpallet::::roll_until_matches(|| { matches!(CurrentPhase::::get(), Phase::Unsigned(_)) }); @@ -97,7 +97,7 @@ mod benchmarks { } impl_benchmark_test_suite!( - Pallet, + Pezpallet, crate::mock::ExtBuilder::full().build_unchecked(), crate::mock::Runtime ); diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/unsigned/miner.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/unsigned/miner.rs index 7986581a..3ace55e3 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/unsigned/miner.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/unsigned/miner.rs @@ -15,17 +15,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! The miner code for the EPMB pallet. +//! The miner code for the EPMB pezpallet. //! //! It is broadly consisted of two main types: //! //! * [`crate::unsigned::miner::BaseMiner`], which is more generic, needs parameterization via //! [`crate::unsigned::miner::MinerConfig`], and can be used by an external implementation. //! * [`crate::unsigned::miner::OffchainWorkerMiner`], which is more opinionated, and is used by -//! this pallet via the `offchain_worker` hook to also mine solutions during the +//! this pezpallet via the `offchain_worker` hook to also mine solutions during the //! `Phase::Unsigned`. -use super::{Call, Config, Pallet}; +use super::{Call, Config, Pezpallet}; use crate::{ helpers, types::{PadSolutionPages, *}, @@ -75,7 +75,7 @@ pub enum MinerError { Solver(MinerSolverErrorOf), /// Snapshot data was unavailable unexpectedly. SnapshotUnAvailable(SnapshotType), - /// The base, common errors from the pallet. + /// The base, common errors from the pezpallet. Common(CommonError), /// The solution generated from the miner is not feasible. Feasibility(verifier::FeasibilityError), @@ -112,7 +112,7 @@ impl From for MinerError { pub enum OffchainMinerError { /// An error in the base miner. BaseMiner(MinerError), - /// The base, common errors from the pallet. + /// The base, common errors from the pezpallet. Common(CommonError), /// Something went wrong fetching the lock. Lock(&'static str), @@ -143,7 +143,7 @@ impl From for OffchainMinerError { /// Configurations for the miner. /// /// This is extracted from the main crate's config so that an offchain miner can readily use the -/// [`BaseMiner`] without needing to deal with the rest of the pallet's configuration. +/// [`BaseMiner`] without needing to deal with the rest of the pezpallet's configuration. pub trait MinerConfig { /// The account id type. type AccountId: Ord + Clone + codec::Codec + core::fmt::Debug; @@ -165,7 +165,7 @@ pub trait MinerConfig { /// /// This value is not set in stone, and it is up to an individual miner to configure. A good /// value is something like 75% of the total block length, which can be fetched from the system - /// pallet. + /// pezpallet. type MaxLength: Get; /// Maximum number of votes per voter. /// @@ -208,7 +208,7 @@ pub trait MinerConfig { } /// A base miner that is only capable of mining a new solution and checking it against the state of -/// this pallet for feasibility, and trimming its length/weight. +/// this pezpallet for feasibility, and trimming its length/weight. pub struct BaseMiner(pezsp_std::marker::PhantomData); /// Parameterized `BoundedSupports` for the miner. @@ -690,7 +690,7 @@ impl OffchainWorkerMiner { .ok_or(MinerError::SnapshotUnAvailable(SnapshotType::Targets))?; // This is the range of voters that we are interested in. - let voter_pages_range = crate::Pallet::::msp_range_for(pages as usize); + let voter_pages_range = crate::Pezpallet::::msp_range_for(pages as usize); sublog!( debug, @@ -727,7 +727,7 @@ impl OffchainWorkerMiner { return Err(OffchainMinerError::::ZeroPages); } let (voter_pages, all_targets, desired_targets) = Self::fetch_snapshot(pages)?; - let round = crate::Pallet::::round(); + let round = crate::Pezpallet::::round(); BaseMiner::::mine_solution(MineInput { desired_targets, all_targets, @@ -782,7 +782,7 @@ impl OffchainWorkerMiner { do_feasibility: bool, ) -> Result<(), OffchainMinerError> { // NOTE: we prefer cheap checks first, so first run unsigned checks. - Pallet::::unsigned_specific_checks(paged_solution)?; + Pezpallet::::unsigned_specific_checks(paged_solution)?; Self::base_check_solution(paged_solution, maybe_snapshot_fingerprint, do_feasibility) } @@ -817,7 +817,7 @@ impl OffchainWorkerMiner { maybe_snapshot_fingerprint: Option, do_feasibility: bool, ) -> Result<(), OffchainMinerError> { - let _ = crate::Pallet::::snapshot_independent_checks( + let _ = crate::Pezpallet::::snapshot_independent_checks( paged_solution, maybe_snapshot_fingerprint, )?; diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/unsigned/mod.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/unsigned/mod.rs index 81d54012..d48601e2 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/unsigned/mod.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/unsigned/mod.rs @@ -17,10 +17,10 @@ //! ## The unsigned phase, and its miner. //! -//! This pallet deals with unsigned submissions. These are backup, "possibly" multi-page submissions +//! This pezpallet deals with unsigned submissions. These are backup, "possibly" multi-page submissions //! from validators. //! -//! This pallet has two miners, described in [`unsigned::miner`]. +//! This pezpallet has two miners, described in [`unsigned::miner`]. //! //! As it stands, a validator can, during the unsigned phase, submit up to //! [`unsigned::Config::MinerPages`] pages. While this can be more than 1, it can likely not be a @@ -71,16 +71,16 @@ /// Export weights pub use crate::weights::traits::pezpallet_election_provider_multi_block_unsigned::*; -/// Exports of this pallet -pub use pallet::*; +/// Exports of this pezpallet +pub use pezpallet::*; #[cfg(feature = "runtime-benchmarks")] mod benchmarking; /// The miner. pub mod miner; -#[pezframe_support::pallet] -mod pallet { +#[pezframe_support::pezpallet] +mod pezpallet { use super::WeightInfo; use crate::{ types::*, @@ -102,8 +102,8 @@ mod pallet { pub(crate) type UnsignedWeightsOf = ::WeightInfo; - #[pallet::config] - #[pallet::disable_pezframe_system_supertrait_check] + #[pezpallet::config] + #[pezpallet::disable_pezframe_system_supertrait_check] pub trait Config: crate::Config + CreateBare> { /// The repeat threshold of the offchain worker. /// @@ -127,15 +127,15 @@ mod pallet { /// The number of pages that the offchain miner will try and submit. type MinerPages: Get; - /// Runtime weight information of this pallet. + /// Runtime weight information of this pezpallet. type WeightInfo: WeightInfo; } - #[pallet::pallet] - pub struct Pallet(PhantomData); + #[pezpallet::pezpallet] + pub struct Pezpallet(PhantomData); - #[pallet::call] - impl Pallet { + #[pezpallet::call] + impl Pezpallet { /// Submit an unsigned solution. /// /// This works very much like an inherent, as only the validators are permitted to submit @@ -146,13 +146,13 @@ mod pallet { /// verified on the fly. /// /// The `paged_solution` may contain at most [`Config::MinerPages`] pages. They are - /// interpreted as msp -> lsp, as per [`crate::Pallet::msp_range_for`]. + /// interpreted as msp -> lsp, as per [`crate::Pezpallet::msp_range_for`]. /// /// For example, if `Pages = 4`, and `MinerPages = 2`, our full snapshot range would be [0, /// 1, 2, 3], with 3 being msp. But, in this case, then the `paged_raw_solution.pages` is /// expected to correspond to `[snapshot(2), snapshot(3)]`. - #[pallet::weight((UnsignedWeightsOf::::submit_unsigned(), DispatchClass::Operational))] - #[pallet::call_index(0)] + #[pezpallet::weight((UnsignedWeightsOf::::submit_unsigned(), DispatchClass::Operational))] + #[pezpallet::call_index(0)] pub fn submit_unsigned( origin: OriginFor, paged_solution: Box>, @@ -168,7 +168,7 @@ mod pallet { let claimed_score = paged_solution.score; // we select the most significant pages, based on `T::MinerPages`. - let page_indices = crate::Pallet::::msp_range_for(T::MinerPages::get() as usize); + let page_indices = crate::Pezpallet::::msp_range_for(T::MinerPages::get() as usize); ::verify_synchronous_multi( paged_solution.solution_pages, page_indices, @@ -180,8 +180,8 @@ mod pallet { } } - #[pallet::validate_unsigned] - impl ValidateUnsigned for Pallet { + #[pezpallet::validate_unsigned] + impl ValidateUnsigned for Pezpallet { type Call = Call; fn validate_unsigned(source: TransactionSource, call: &Self::Call) -> TransactionValidity { if let Call::submit_unsigned { paged_solution, .. } = call { @@ -232,8 +232,8 @@ mod pallet { } } - #[pallet::hooks] - impl Hooks> for Pallet { + #[pezpallet::hooks] + impl Hooks> for Pezpallet { fn integrity_test() { assert!( UnsignedWeightsOf::::submit_unsigned().all_lte(T::BlockWeights::get().max_block), @@ -258,7 +258,7 @@ mod pallet { // This should only come useful in an **abrupt** termination of execution, otherwise the // guard will be dropped upon successful execution. let mut lock = - StorageLock::>>::with_block_deadline( + StorageLock::>>::with_block_deadline( miner::OffchainWorkerMiner::::OFFCHAIN_LOCK, T::UnsignedPhase::get().saturated_into(), ); @@ -279,12 +279,12 @@ mod pallet { } } - impl Pallet { + impl Pezpallet { /// Internal logic of the offchain worker, to be executed only when the offchain lock is /// acquired with success. fn do_synchronized_offchain_worker(now: BlockNumberFor) { use miner::OffchainWorkerMiner; - let current_phase = crate::Pallet::::current_phase(); + let current_phase = crate::Pezpallet::::current_phase(); sublog!( trace, "unsigned", @@ -334,18 +334,18 @@ mod pallet { paged_solution: &PagedRawSolution, ) -> Result<(), CommonError> { Self::unsigned_specific_checks(paged_solution) - .and(crate::Pallet::::snapshot_independent_checks(paged_solution, None)) + .and(crate::Pezpallet::::snapshot_independent_checks(paged_solution, None)) .map_err(Into::into) } - /// The checks that are specific to the (this) unsigned pallet. + /// The checks that are specific to the (this) unsigned pezpallet. /// /// ensure solution has the correct phase, and it has only 1 page. pub fn unsigned_specific_checks( paged_solution: &PagedRawSolution, ) -> Result<(), CommonError> { ensure!( - crate::Pallet::::current_phase().is_unsigned(), + crate::Pezpallet::::current_phase().is_unsigned(), CommonError::EarlySubmission ); ensure!( diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/benchmarking.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/benchmarking.rs index 37e53aca..d5d68836 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/benchmarking.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/benchmarking.rs @@ -16,7 +16,7 @@ // limitations under the License. use crate::{ - verifier::{Config, Event, FeasibilityError, Pallet, Status, StatusStorage}, + verifier::{Config, Event, FeasibilityError, Pezpallet, Status, StatusStorage}, CurrentPhase, Phase, }; use pezframe_benchmarking::v2::*; @@ -35,33 +35,33 @@ mod benchmarks { where ::RuntimeEvent: TryInto>, { - pezframe_system::Pallet::::read_events_for_pallet::>() + pezframe_system::Pezpallet::::read_events_for_pallet::>() } #[benchmark(pov_mode = Measured)] fn on_initialize_valid_non_terminal() -> Result<(), BenchmarkError> { #[cfg(test)] crate::mock::ElectionStart::set(pezsp_runtime::traits::Bounded::max_value()); - crate::Pallet::::start().unwrap(); + crate::Pezpallet::::start().unwrap(); - // roll to signed validation, with a solution stored in the signed pallet - crate::Pallet::::roll_to_signed_and_submit_full_solution()?; + // roll to signed validation, with a solution stored in the signed pezpallet + crate::Pezpallet::::roll_to_signed_and_submit_full_solution()?; // roll to verification - crate::Pallet::::roll_until_matches(|| { + crate::Pezpallet::::roll_until_matches(|| { matches!(CurrentPhase::::get(), Phase::SignedValidation(_)) }); // send start signal - crate::Pallet::::roll_next(true, false); + crate::Pezpallet::::roll_next(true, false); // start signal must have been sent by now - assert_eq!(StatusStorage::::get(), Status::Ongoing(crate::Pallet::::msp())); + assert_eq!(StatusStorage::::get(), Status::Ongoing(crate::Pezpallet::::msp())); #[block] { - crate::Pallet::::roll_next(true, false); + crate::Pezpallet::::roll_next(true, false); } - assert_eq!(StatusStorage::::get(), Status::Ongoing(crate::Pallet::::msp() - 1)); + assert_eq!(StatusStorage::::get(), Status::Ongoing(crate::Pezpallet::::msp() - 1)); Ok(()) } @@ -70,26 +70,26 @@ mod benchmarks { fn on_initialize_valid_terminal() -> Result<(), BenchmarkError> { #[cfg(test)] crate::mock::ElectionStart::set(pezsp_runtime::traits::Bounded::max_value()); - crate::Pallet::::start().unwrap(); + crate::Pezpallet::::start().unwrap(); - // roll to signed validation, with a solution stored in the signed pallet + // roll to signed validation, with a solution stored in the signed pezpallet assert!( T::SignedValidationPhase::get() >= T::Pages::get().into(), "Signed validation phase must be larger than the number of pages" ); - crate::Pallet::::roll_to_signed_and_submit_full_solution()?; + crate::Pezpallet::::roll_to_signed_and_submit_full_solution()?; // roll to before the last page of verification - crate::Pallet::::roll_until_matches(|| { + crate::Pezpallet::::roll_until_matches(|| { matches!(CurrentPhase::::get(), Phase::SignedValidation(_)) }); // send start signal - crate::Pallet::::roll_next(true, false); + crate::Pezpallet::::roll_next(true, false); // start signal must have been sent by now - assert_eq!(StatusStorage::::get(), Status::Ongoing(crate::Pallet::::msp())); + assert_eq!(StatusStorage::::get(), Status::Ongoing(crate::Pezpallet::::msp())); for _ in 0..(T::Pages::get() - 1) { - crate::Pallet::::roll_next(true, false); + crate::Pezpallet::::roll_next(true, false); } // we must have verified all pages by now, minus the last one. @@ -101,7 +101,7 @@ mod benchmarks { // verify the last page. #[block] { - crate::Pallet::::roll_next(true, false); + crate::Pezpallet::::roll_next(true, false); } // we are done @@ -124,34 +124,34 @@ mod benchmarks { #[cfg(test)] crate::mock::ElectionStart::set(pezsp_runtime::traits::Bounded::max_value()); - crate::Pallet::::start().unwrap(); + crate::Pezpallet::::start().unwrap(); - // roll to signed validation, with a solution stored in the signed pallet + // roll to signed validation, with a solution stored in the signed pezpallet // but this solution is corrupt - let mut paged_solution = crate::Pallet::::roll_to_signed_and_mine_full_solution(); + let mut paged_solution = crate::Pezpallet::::roll_to_signed_and_mine_full_solution(); paged_solution.score.minimal_stake -= 1; - crate::Pallet::::submit_full_solution(paged_solution)?; + crate::Pezpallet::::submit_full_solution(paged_solution)?; // roll to verification - crate::Pallet::::roll_until_matches(|| { + crate::Pezpallet::::roll_until_matches(|| { matches!(CurrentPhase::::get(), Phase::SignedValidation(_)) }); // send start signal - crate::Pallet::::roll_next(true, false); + crate::Pezpallet::::roll_next(true, false); - assert_eq!(StatusStorage::::get(), Status::Ongoing(crate::Pallet::::msp())); + assert_eq!(StatusStorage::::get(), Status::Ongoing(crate::Pezpallet::::msp())); // verify all pages, except for the last one. for i in 0..T::Pages::get() - 1 { - crate::Pallet::::roll_next(true, false); + crate::Pezpallet::::roll_next(true, false); assert_eq!( StatusStorage::::get(), - Status::Ongoing(crate::Pallet::::msp() - 1 - i) + Status::Ongoing(crate::Pezpallet::::msp() - 1 - i) ); } // next page to be verified is the last one - assert_eq!(StatusStorage::::get(), Status::Ongoing(crate::Pallet::::lsp())); + assert_eq!(StatusStorage::::get(), Status::Ongoing(crate::Pezpallet::::lsp())); assert!(matches!( &events_for::()[..], [Event::Verified(_, _), .., Event::Verified(1, _)] @@ -159,7 +159,7 @@ mod benchmarks { #[block] { - crate::Pallet::::roll_next(true, false); + crate::Pezpallet::::roll_next(true, false); } // we are now reset. @@ -186,12 +186,12 @@ mod benchmarks { #[cfg(test)] crate::mock::ElectionStart::set(pezsp_runtime::traits::Bounded::max_value()); - crate::Pallet::::start().unwrap(); + crate::Pezpallet::::start().unwrap(); - // roll to signed validation, with a solution stored in the signed pallet, but this solution + // roll to signed validation, with a solution stored in the signed pezpallet, but this solution // is corrupt in its msp. - let mut paged_solution = crate::Pallet::::roll_to_signed_and_mine_full_solution(); - let page_to_corrupt = crate::Pallet::::msp() - v; + let mut paged_solution = crate::Pezpallet::::roll_to_signed_and_mine_full_solution(); + let page_to_corrupt = crate::Pezpallet::::msp() - v; crate::log!( info, "pages of solution: {:?}, to corrupt {}, v {}", @@ -200,30 +200,30 @@ mod benchmarks { v ); paged_solution.solution_pages[page_to_corrupt as usize].corrupt(); - crate::Pallet::::submit_full_solution(paged_solution)?; + crate::Pezpallet::::submit_full_solution(paged_solution)?; // roll to verification - crate::Pallet::::roll_until_matches(|| { + crate::Pezpallet::::roll_until_matches(|| { matches!(CurrentPhase::::get(), Phase::SignedValidation(_)) }); // send start signal - crate::Pallet::::roll_next(true, false); + crate::Pezpallet::::roll_next(true, false); // we should be ready to go - assert_eq!(StatusStorage::::get(), Status::Ongoing(crate::Pallet::::msp())); + assert_eq!(StatusStorage::::get(), Status::Ongoing(crate::Pezpallet::::msp())); // validate the the parameterized number of valid pages. for _ in 0..v { - crate::Pallet::::roll_next(true, false); + crate::Pezpallet::::roll_next(true, false); } // we are still ready to continue - assert_eq!(StatusStorage::::get(), Status::Ongoing(crate::Pallet::::msp() - v)); + assert_eq!(StatusStorage::::get(), Status::Ongoing(crate::Pezpallet::::msp() - v)); // verify one page, which will be invalid. #[block] { - crate::Pallet::::roll_next(true, false); + crate::Pezpallet::::roll_next(true, false); } // we are now reset, because this page was invalid. @@ -238,7 +238,7 @@ mod benchmarks { } impl_benchmark_test_suite!( - Pallet, + Pezpallet, crate::mock::ExtBuilder::full().build_unchecked(), crate::mock::Runtime ); diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/impls.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/impls.rs index 7071cd26..cd33e8be 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/impls.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/impls.rs @@ -15,8 +15,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! The implementation of the verifier pallet, and an implementation of [`crate::Verifier`] and -//! [`crate::AsynchronousVerifier`] for [`Pallet`]. +//! The implementation of the verifier pezpallet, and an implementation of [`crate::Verifier`] and +//! [`crate::AsynchronousVerifier`] for [`Pezpallet`]. use super::*; use crate::{ @@ -36,7 +36,7 @@ use pezframe_support::{ traits::{defensive_prelude::*, Get}, }; use pezframe_system::pezpallet_prelude::*; -use pallet::*; +use pezpallet::*; use pezsp_npos_elections::{evaluate_support, ElectionScore}; use pezsp_std::{collections::btree_map::BTreeMap, prelude::*}; @@ -48,7 +48,7 @@ pub(crate) type SupportsOfVerifier = pezframe_election_provider_support::Boun pub(crate) type VerifierWeightsOf = ::WeightInfo; -/// The status of this pallet. +/// The status of this pezpallet. #[derive( Encode, Decode, scale_info::TypeInfo, Clone, Copy, MaxEncodedLen, Debug, PartialEq, Eq, )] @@ -107,28 +107,28 @@ impl pezsp_npos_elections::Backings for PartialBackings { } } -#[pezframe_support::pallet] -pub(crate) mod pallet { +#[pezframe_support::pezpallet] +pub(crate) mod pezpallet { use super::*; - #[pallet::config] - #[pallet::disable_pezframe_system_supertrait_check] + #[pezpallet::config] + #[pezpallet::disable_pezframe_system_supertrait_check] pub trait Config: crate::Config { /// Maximum number of backers, per winner, among all pages of an election. /// /// This can only be checked at the very final step of verification. /// /// NOTE: at the moment, we don't check this, and it is in place for future compatibility. - #[pallet::constant] + #[pezpallet::constant] type MaxBackersPerWinnerFinal: Get; /// Maximum number of backers, per winner, per page. - #[pallet::constant] + #[pezpallet::constant] type MaxBackersPerWinner: Get; /// Maximum number of supports (aka. winners/validators/targets) that can be represented in /// a page of results. - #[pallet::constant] + #[pezpallet::constant] type MaxWinnersPerPage: Get; /// Something that can provide the solution data to the verifier. @@ -138,12 +138,12 @@ pub(crate) mod pallet { Solution = SolutionOf, >; - /// The weight information of this pallet. + /// The weight information of this pezpallet. type WeightInfo: super::WeightInfo; } - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] + #[pezpallet::event] + #[pezpallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { /// A verification failed at the given page. /// @@ -168,7 +168,7 @@ pub(crate) mod pallet { /// - `QueuedSolutionBackings` /// /// As the name suggests, `QueuedValidVariant` points to the correct variant between - /// `QueuedSolutionX` and `QueuedSolutionY`. In the context of this pallet, by VALID and + /// `QueuedSolutionX` and `QueuedSolutionY`. In the context of this pezpallet, by VALID and /// INVALID variant we mean either of these two storage items, based on the value of /// `QueuedValidVariant`. /// @@ -191,7 +191,7 @@ pub(crate) mod pallet { /// - The number of existing keys in `QueuedSolutionBackings` must always match that of the /// INVALID variant. /// - /// Moreover, the following conditions must be met when this pallet is in [`Status::Nothing`], + /// Moreover, the following conditions must be met when this pezpallet is in [`Status::Nothing`], /// meaning that no ongoing asynchronous verification is ongoing. /// /// - No keys should exist in the INVALID variant. @@ -202,7 +202,7 @@ pub(crate) mod pallet { /// > the number of keys in the VALID variant. In fact, an empty solution with score of [0, 0, /// > 0] can also be correct. /// - /// No additional conditions must be met when the pallet is in [`Status::Ongoing`]. The number + /// No additional conditions must be met when the pezpallet is in [`Status::Ongoing`]. The number /// of pages in pub struct QueuedSolution(pezsp_std::marker::PhantomData); impl QueuedSolution { @@ -219,7 +219,7 @@ pub(crate) mod pallet { } fn round() -> u32 { - crate::Pallet::::round() + crate::Pezpallet::::round() } /// Finalize a correct solution. @@ -275,14 +275,14 @@ pub(crate) mod pallet { /// known to be valid. At this stage, we write to the invalid variant. Once all pages are /// verified, a call to [`finalize_correct`] will seal the correct pages and flip the /// invalid/valid variants. - pub(crate) fn set_invalid_page(page: PageIndex, supports: SupportsOfVerifier>) { + pub(crate) fn set_invalid_page(page: PageIndex, supports: SupportsOfVerifier>) { use pezframe_support::traits::TryCollect; Self::mutate_checked(|| { let backings: BoundedVec<_, _> = supports .iter() .map(|(x, s)| (x.clone(), PartialBackings { total: s.total, backers: s.voters.len() as u32 } )) .try_collect() - .expect("`SupportsOfVerifier` is bounded by as Verifier>::MaxWinnersPerPage, which is assured to be the same as `T::MaxWinnersPerPage` in an integrity test"); + .expect("`SupportsOfVerifier` is bounded by as Verifier>::MaxWinnersPerPage, which is assured to be the same as `T::MaxWinnersPerPage` in an integrity test"); QueuedSolutionBackings::::insert(Self::round(), page, backings); match Self::invalid() { @@ -300,7 +300,7 @@ pub(crate) mod pallet { /// solution. pub(crate) fn force_set_single_page_valid( page: PageIndex, - supports: SupportsOfVerifier>, + supports: SupportsOfVerifier>, score: ElectionScore, ) { Self::mutate_checked(|| { @@ -322,7 +322,7 @@ pub(crate) mod pallet { pub(crate) fn force_set_multi_page_valid( pages: Vec, - supports: Vec>>, + supports: Vec>>, score: ElectionScore, ) { debug_assert_eq!(pages.len(), supports.len()); @@ -405,7 +405,7 @@ pub(crate) mod pallet { /// Get a page of the current queued (aka valid) solution. pub(crate) fn get_queued_solution_page( page: PageIndex, - ) -> Option>> { + ) -> Option>> { match Self::valid() { ValidSolution::X => QueuedSolutionX::::get(Self::round(), page), ValidSolution::Y => QueuedSolutionY::::get(Self::round(), page), @@ -425,7 +425,7 @@ pub(crate) mod pallet { #[cfg(any(test, feature = "runtime-benchmarks", feature = "try-runtime", debug_assertions))] impl QueuedSolution { pub(crate) fn valid_iter( - ) -> impl Iterator>)> { + ) -> impl Iterator>)> { match Self::valid() { ValidSolution::X => QueuedSolutionX::::iter_prefix(Self::round()), ValidSolution::Y => QueuedSolutionY::::iter_prefix(Self::round()), @@ -433,14 +433,14 @@ pub(crate) mod pallet { } pub(crate) fn invalid_iter( - ) -> impl Iterator>)> { + ) -> impl Iterator>)> { match Self::invalid() { ValidSolution::X => QueuedSolutionX::::iter_prefix(Self::round()), ValidSolution::Y => QueuedSolutionY::::iter_prefix(Self::round()), } } - pub(crate) fn get_valid_page(page: PageIndex) -> Option>> { + pub(crate) fn get_valid_page(page: PageIndex) -> Option>> { match Self::valid() { ValidSolution::X => QueuedSolutionX::::get(Self::round(), page), ValidSolution::Y => QueuedSolutionY::::get(Self::round(), page), @@ -464,7 +464,7 @@ pub(crate) mod pallet { pub(crate) fn sanity_check() -> Result<(), pezsp_runtime::DispatchError> { // score is correct and better than min-score. ensure!( - Pallet::::minimum_score() + Pezpallet::::minimum_score() .zip(Self::queued_score()) .map_or(true, |(min_score, score)| score.strict_better(min_score)), "queued solution has weak score (min-score)" @@ -509,30 +509,30 @@ pub(crate) mod pallet { /// Writing theses supports on top of a *good* queued supports is wrong, since we might bail. /// Writing them to a bugger and copying at the ned is slightly better, but expensive. This flag /// system is best of both worlds. - #[pallet::storage] + #[pezpallet::storage] type QueuedSolutionX = StorageDoubleMap< _, Twox64Concat, u32, Twox64Concat, PageIndex, - SupportsOfVerifier>, + SupportsOfVerifier>, >; /// The `Y` variant of the current queued solution. Might be the valid one or not. - #[pallet::storage] + #[pezpallet::storage] type QueuedSolutionY = StorageDoubleMap< _, Twox64Concat, u32, Twox64Concat, PageIndex, - SupportsOfVerifier>, + SupportsOfVerifier>, >; /// Pointer to the variant of [`QueuedSolutionX`] or [`QueuedSolutionY`] that is currently /// valid. - #[pallet::storage] + #[pezpallet::storage] type QueuedValidVariant = StorageMap<_, Twox64Concat, u32, ValidSolution, ValueQuery>; @@ -544,7 +544,7 @@ pub(crate) mod pallet { /// This can only ever live for the invalid variant of the solution. Once it is valid, we don't /// need this information anymore; the score is already computed once in /// [`QueuedSolutionScore`], and the backing counts are checked. - #[pallet::storage] + #[pezpallet::storage] type QueuedSolutionBackings = StorageDoubleMap< _, Twox64Concat, @@ -557,25 +557,25 @@ pub(crate) mod pallet { /// The score of the valid variant of [`QueuedSolution`]. /// /// This only ever lives for the `valid` variant. - #[pallet::storage] + #[pezpallet::storage] type QueuedSolutionScore = StorageMap<_, Twox64Concat, u32, ElectionScore>; // -- ^^ private storage items, managed by `QueuedSolution`. /// The minimum score that each solution must attain in order to be considered feasible. - #[pallet::storage] - #[pallet::getter(fn minimum_score)] + #[pezpallet::storage] + #[pezpallet::getter(fn minimum_score)] pub(crate) type MinimumScore = StorageValue<_, ElectionScore>; /// Storage item for [`Status`]. - #[pallet::storage] - #[pallet::getter(fn status_storage)] + #[pezpallet::storage] + #[pezpallet::getter(fn status_storage)] pub(crate) type StatusStorage = StorageValue<_, Status, ValueQuery>; - #[pallet::pallet] - pub struct Pallet(PhantomData); + #[pezpallet::pezpallet] + pub struct Pezpallet(PhantomData); - #[pallet::genesis_config] + #[pezpallet::genesis_config] #[derive(pezframe_support::DefaultNoBound)] pub struct GenesisConfig { /// Initial value for [`MinimumScore`] @@ -583,18 +583,18 @@ pub(crate) mod pallet { _marker: PhantomData, } - #[pallet::genesis_build] + #[pezpallet::genesis_build] impl BuildGenesisConfig for GenesisConfig { fn build(&self) { MinimumScore::::put(self.minimum_score); } } - #[pallet::call] - impl Pallet {} + #[pezpallet::call] + impl Pezpallet {} - #[pallet::hooks] - impl Hooks> for Pallet { + #[pezpallet::hooks] + impl Hooks> for Pezpallet { fn integrity_test() { // ensure that we have funneled some of our type parameters EXACTLY as-is to the // verifier trait interface we implement. @@ -617,7 +617,7 @@ pub(crate) mod pallet { } } -impl Pallet { +impl Pezpallet { fn do_on_initialize() -> Weight { if let Status::Ongoing(current_page) = Self::status_storage() { let page_solution = @@ -638,7 +638,7 @@ impl Pallet { Self::deposit_event(Event::::Verified(current_page, supports.len() as u32)); QueuedSolution::::set_invalid_page(current_page, supports); - if current_page > crate::Pallet::::lsp() { + if current_page > crate::Pezpallet::::lsp() { // not last page, just tick forward. StatusStorage::::put(Status::Ongoing(current_page.saturating_sub(1))); VerifierWeightsOf::::on_initialize_valid_non_terminal() @@ -927,7 +927,7 @@ pub fn feasibility_check_page_inner_with_snapshot( Ok(bounded_supports) } -impl Verifier for Pallet { +impl Verifier for Pezpallet { type AccountId = T::AccountId; type Solution = SolutionOf; type MaxBackersPerWinner = T::MaxBackersPerWinner; @@ -985,11 +985,11 @@ impl Verifier for Pallet { } } -impl AsynchronousVerifier for Pallet { +impl AsynchronousVerifier for Pezpallet { type SolutionDataProvider = T::SolutionDataProvider; fn status() -> Status { - Pallet::::status_storage() + Pezpallet::::status_storage() } fn start() -> Result<(), &'static str> { @@ -999,7 +999,7 @@ impl AsynchronousVerifier for Pallet { if Self::ensure_score_quality(claimed_score).is_err() { // don't do anything, report back that this solution was garbage. Self::deposit_event(Event::::VerificationFailed( - crate::Pallet::::msp(), + crate::Pezpallet::::msp(), FeasibilityError::ScoreTooLow, )); T::SolutionDataProvider::report_result(VerificationResult::Rejected); @@ -1007,7 +1007,7 @@ impl AsynchronousVerifier for Pallet { Ok(()) } else { // This solution is good enough to win, we start verifying it in the next block. - StatusStorage::::put(Status::Ongoing(crate::Pallet::::msp())); + StatusStorage::::put(Status::Ongoing(crate::Pezpallet::::msp())); Ok(()) } } else { diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/mod.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/mod.rs index b023183f..2b39c949 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/mod.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/verifier/mod.rs @@ -15,18 +15,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! # The Verifier Pallet +//! # The Verifier Pezpallet //! -//! This pallet has no end-user functionality, and is only used internally by other pallets in the +//! This pezpallet has no end-user functionality, and is only used internally by other pallets in the //! EPMB machinery to verify solutions. //! //! ### *Feasibility* Check //! -//! Before explaining the pallet itself, it should be explained what a *verification* even means. +//! Before explaining the pezpallet itself, it should be explained what a *verification* even means. //! Verification of a solution page ([`crate::unsigned::miner::MinerConfig::Solution`]) includes the //! process of checking all of its edges against a snapshot to be correct. For instance, all voters //! that are presented in a solution page must have actually voted for the winner that they are -//! backing, based on the snapshot kept in the parent pallet. +//! backing, based on the snapshot kept in the parent pezpallet. //! //! Such checks are bound to each page of the solution, and happen per-page. After checking all of //! the edges in each page, a handful of other checks are performed. These checks cannot happen @@ -48,11 +48,11 @@ //! //! ## Modes of Verification //! -//! The verifier pallet provide two modes of functionality: +//! The verifier pezpallet provide two modes of functionality: //! //! 1. Single or multi-page, synchronous verification. This is useful in the context of single-page, //! emergency, or unsigned solutions that need to be verified on the fly. This is similar to how -//! the old school `multi-phase` pallet works. See [`Verifier::verify_synchronous`] and +//! the old school `multi-phase` pezpallet works. See [`Verifier::verify_synchronous`] and //! [`Verifier::verify_synchronous_multi`]. //! 2. Multi-page, asynchronous verification. This is useful in the context of multi-page, signed //! solutions. See [`verifier::AsynchronousVerifier`] and [`verifier::SolutionDataProvider`]. @@ -78,7 +78,7 @@ pub use crate::weights::traits::pezpallet_election_provider_multi_block_verifier use pezframe_election_provider_support::PageIndex; use impls::SupportsOfVerifier; -pub use impls::{feasibility_check_page_inner_with_snapshot, pallet::*, Status}; +pub use impls::{feasibility_check_page_inner_with_snapshot, pezpallet::*, Status}; use pezsp_core::Get; use pezsp_npos_elections::ElectionScore; use pezsp_std::{fmt::Debug, prelude::*}; @@ -99,7 +99,7 @@ pub enum FeasibilityError { WrongWinnerCount, /// The snapshot is not available. /// - /// Kinda defensive: The pallet should technically never attempt to do a feasibility check + /// Kinda defensive: The pezpallet should technically never attempt to do a feasibility check /// when no snapshot is present. SnapshotUnavailable, /// A vote is invalid. @@ -144,7 +144,7 @@ pub trait Verifier { /// Maximum number of winners that can be represented in each page. /// /// A reasonable value for this should be the maximum number of winners that the election user - /// (e.g. the staking pallet) could ever desire. + /// (e.g. the staking pezpallet) could ever desire. type MaxWinnersPerPage: Get; /// Maximum number of backers, per winner, among all pages of an election. @@ -227,7 +227,7 @@ pub enum VerificationResult { /// Something that can provide candidate solutions to the verifier. /// -/// In reality, this can be implemented by the [`crate::signed::Pallet`], where signed solutions are +/// In reality, this can be implemented by the [`crate::signed::Pezpallet`], where signed solutions are /// queued and sorted based on claimed score, and they are put forth one by one, from best to worse. pub trait SolutionDataProvider { /// The opaque solution type. @@ -280,7 +280,7 @@ pub trait AsynchronousVerifier: Verifier { /// derived from a full solution) are valid and the solution is verified. The solution is /// queued and is ready for further export. /// 2. The solution checks verification at one of the steps. Nothing is stored inside the - /// verifier pallet and all intermediary data is removed. + /// verifier pezpallet and all intermediary data is removed. /// /// In both cases, the [`SolutionDataProvider`] is informed via /// [`SolutionDataProvider::report_result`]. It is sensible for the data provide to call `start` diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/weights/mod.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/weights/mod.rs index 7d0956aa..69f069fb 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/weights/mod.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/weights/mod.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! WeightInfo for the election provider multi-block pallet group. +//! WeightInfo for the election provider multi-block pezpallet group. mod pezpallet_election_provider_multi_block_hez_size; mod pezpallet_election_provider_multi_block_signed_hez_size; diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_hez_size.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_hez_size.rs index 09185e72..1d6ca957 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_hez_size.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_hez_size.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for `pezpallet_election_provider_multi_block` //! -//! This is a special template for `election-provider-multi-block` pallet. This is required because +//! This is a special template for `election-provider-multi-block` pezpallet. This is required because // ! we don't want to generate the `trait WeightInfo`. //! //! THIS FILE WAS AUTO-GENERATED USING THE BIZINIKIWI BENCHMARK CLI VERSION 32.0.0 @@ -31,8 +31,8 @@ // ../../../../../target/release/frame-omni-bencher // v1 // benchmark -// pallet -// --pallet +// pezpallet +// --pezpallet // pezpallet_election_provider_multi_block // --extrinsic // * diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_ksm_size.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_ksm_size.rs index 6b0ba437..540afbf6 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_ksm_size.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_ksm_size.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for `pezpallet_election_provider_multi_block` //! -//! This is a special template for `election-provider-multi-block` pallet. This is required because +//! This is a special template for `election-provider-multi-block` pezpallet. This is required because // ! we don't want to generate the `trait WeightInfo`. //! //! THIS FILE WAS AUTO-GENERATED USING THE BIZINIKIWI BENCHMARK CLI VERSION 32.0.0 @@ -31,8 +31,8 @@ // ../../../../../target/release/frame-omni-bencher // v1 // benchmark -// pallet -// --pallet +// pezpallet +// --pezpallet // pezpallet_election_provider_multi_block // --extrinsic // * diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_signed_hez_size.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_signed_hez_size.rs index a8541cd9..1ccd9e3d 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_signed_hez_size.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_signed_hez_size.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for `pezpallet_election_provider_multi_block_signed` //! -//! This is a special template for `election-provider-multi-block` pallet. This is required because +//! This is a special template for `election-provider-multi-block` pezpallet. This is required because // ! we don't want to generate the `trait WeightInfo`. //! //! THIS FILE WAS AUTO-GENERATED USING THE BIZINIKIWI BENCHMARK CLI VERSION 32.0.0 @@ -31,8 +31,8 @@ // ../../../../../target/release/frame-omni-bencher // v1 // benchmark -// pallet -// --pallet +// pezpallet +// --pezpallet // pezpallet_election_provider_multi_block_signed // --extrinsic // * diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_signed_ksm_size.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_signed_ksm_size.rs index 37ba11c2..7365520c 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_signed_ksm_size.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_signed_ksm_size.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for `pezpallet_election_provider_multi_block_signed` //! -//! This is a special template for `election-provider-multi-block` pallet. This is required because +//! This is a special template for `election-provider-multi-block` pezpallet. This is required because // ! we don't want to generate the `trait WeightInfo`. //! //! THIS FILE WAS AUTO-GENERATED USING THE BIZINIKIWI BENCHMARK CLI VERSION 32.0.0 @@ -31,8 +31,8 @@ // ../../../../../target/release/frame-omni-bencher // v1 // benchmark -// pallet -// --pallet +// pezpallet +// --pezpallet // pezpallet_election_provider_multi_block_signed // --extrinsic // * diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_unsigned_hez_size.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_unsigned_hez_size.rs index 5e0a977b..152529cf 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_unsigned_hez_size.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_unsigned_hez_size.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for `pezpallet_election_provider_multi_block_unsigned` //! -//! This is a special template for `election-provider-multi-block` pallet. This is required because +//! This is a special template for `election-provider-multi-block` pezpallet. This is required because // ! we don't want to generate the `trait WeightInfo`. //! //! THIS FILE WAS AUTO-GENERATED USING THE BIZINIKIWI BENCHMARK CLI VERSION 32.0.0 @@ -31,8 +31,8 @@ // ../../../../../target/release/frame-omni-bencher // v1 // benchmark -// pallet -// --pallet +// pezpallet +// --pezpallet // pezpallet_election_provider_multi_block_unsigned // --extrinsic // * diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_unsigned_ksm_size.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_unsigned_ksm_size.rs index 219e9d6b..da4bcdc3 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_unsigned_ksm_size.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_unsigned_ksm_size.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for `pezpallet_election_provider_multi_block_unsigned` //! -//! This is a special template for `election-provider-multi-block` pallet. This is required because +//! This is a special template for `election-provider-multi-block` pezpallet. This is required because // ! we don't want to generate the `trait WeightInfo`. //! //! THIS FILE WAS AUTO-GENERATED USING THE BIZINIKIWI BENCHMARK CLI VERSION 32.0.0 @@ -31,8 +31,8 @@ // ../../../../../target/release/frame-omni-bencher // v1 // benchmark -// pallet -// --pallet +// pezpallet +// --pezpallet // pezpallet_election_provider_multi_block_unsigned // --extrinsic // * diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_verifier_hez_size.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_verifier_hez_size.rs index d51eb12d..ead56045 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_verifier_hez_size.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_verifier_hez_size.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for `pezpallet_election_provider_multi_block_verifier` //! -//! This is a special template for `election-provider-multi-block` pallet. This is required because +//! This is a special template for `election-provider-multi-block` pezpallet. This is required because // ! we don't want to generate the `trait WeightInfo`. //! //! THIS FILE WAS AUTO-GENERATED USING THE BIZINIKIWI BENCHMARK CLI VERSION 32.0.0 @@ -31,8 +31,8 @@ // ../../../../../target/release/frame-omni-bencher // v1 // benchmark -// pallet -// --pallet +// pezpallet +// --pezpallet // pezpallet_election_provider_multi_block_verifier // --extrinsic // * diff --git a/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_verifier_ksm_size.rs b/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_verifier_ksm_size.rs index d4d03e70..26151df1 100644 --- a/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_verifier_ksm_size.rs +++ b/bizinikiwi/pezframe/election-provider-multi-block/src/weights/pezpallet_election_provider_multi_block_verifier_ksm_size.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for `pezpallet_election_provider_multi_block_verifier` //! -//! This is a special template for `election-provider-multi-block` pallet. This is required because +//! This is a special template for `election-provider-multi-block` pezpallet. This is required because // ! we don't want to generate the `trait WeightInfo`. //! //! THIS FILE WAS AUTO-GENERATED USING THE BIZINIKIWI BENCHMARK CLI VERSION 32.0.0 @@ -31,8 +31,8 @@ // ../../../../../target/release/frame-omni-bencher // v1 // benchmark -// pallet -// --pallet +// pezpallet +// --pezpallet // pezpallet_election_provider_multi_block_verifier // --extrinsic // * diff --git a/bizinikiwi/pezframe/election-provider-multi-phase/src/benchmarking.rs b/bizinikiwi/pezframe/election-provider-multi-phase/src/benchmarking.rs index e5a39e2c..3f230f03 100644 --- a/bizinikiwi/pezframe/election-provider-multi-phase/src/benchmarking.rs +++ b/bizinikiwi/pezframe/election-provider-multi-phase/src/benchmarking.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Two phase election pallet benchmarking. +//! Two phase election pezpallet benchmarking. use core::cmp::Reverse; use pezframe_benchmarking::{v2::*, BenchmarkError}; @@ -201,7 +201,7 @@ mod benchmarks { #[block] { - Pallet::::on_initialize(1_u32.into()); + Pezpallet::::on_initialize(1_u32.into()); } assert!(CurrentPhase::::get().is_off()); @@ -214,7 +214,7 @@ mod benchmarks { #[block] { - Pallet::::phase_transition(Phase::Signed); + Pezpallet::::phase_transition(Phase::Signed); } assert!(Snapshot::::get().is_none()); @@ -228,8 +228,8 @@ mod benchmarks { #[block] { - let now = pezframe_system::Pallet::::block_number(); - Pallet::::phase_transition(Phase::Unsigned((true, now))); + let now = pezframe_system::Pezpallet::::block_number(); + Pezpallet::::phase_transition(Phase::Unsigned((true, now))); } assert!(Snapshot::::get().is_none()); @@ -252,7 +252,7 @@ mod benchmarks { #[block] { - Pallet::::finalize_signed_phase_accept_solution(ready, &receiver, deposit, call_fee); + Pezpallet::::finalize_signed_phase_accept_solution(ready, &receiver, deposit, call_fee); } assert_eq!(T::Currency::free_balance(&receiver), initial_balance + reward + call_fee); @@ -272,7 +272,7 @@ mod benchmarks { #[block] { - Pallet::::finalize_signed_phase_reject_solution(&receiver, deposit) + Pezpallet::::finalize_signed_phase_reject_solution(&receiver, deposit) } assert_eq!(T::Currency::free_balance(&receiver), T::Currency::minimum_balance()); @@ -298,7 +298,7 @@ mod benchmarks { #[block] { - Pallet::::create_snapshot_internal(targets, voters, desired_targets) + Pezpallet::::create_snapshot_internal(targets, voters, desired_targets) } assert!(Snapshot::::get().is_some()); @@ -308,7 +308,7 @@ mod benchmarks { Ok(()) } - // A call to `::elect` where we only return the queued solution. + // A call to `::elect` where we only return the queued solution. #[benchmark] fn elect_queued( // Number of assignments, i.e. `solution.len()`. @@ -330,7 +330,7 @@ mod benchmarks { let witness = SolutionOrSnapshotSize { voters: v, targets: t }; let raw_solution = solution_with_size::(witness, a, d)?; - let ready_solution = Pallet::::feasibility_check(raw_solution, ElectionCompute::Signed) + let ready_solution = Pezpallet::::feasibility_check(raw_solution, ElectionCompute::Signed) .map_err(<&str>::from)?; CurrentPhase::::put(Phase::Signed); // Assume a queued solution is stored, regardless of where it comes from. @@ -345,7 +345,7 @@ mod benchmarks { #[block] { - result = as ElectionProvider>::elect(Zero::zero()); + result = as ElectionProvider>::elect(Zero::zero()); } assert!(result.is_ok()); @@ -364,8 +364,8 @@ mod benchmarks { #[benchmark] fn submit() -> Result<(), BenchmarkError> { // The queue is full and the solution is only better than the worse. - Pallet::::create_snapshot().map_err(<&str>::from)?; - Pallet::::phase_transition(Phase::Signed); + Pezpallet::::create_snapshot().map_err(<&str>::from)?; + Pezpallet::::phase_transition(Phase::Signed); Round::::put(1); let mut signed_submissions = SignedSubmissions::::get(); @@ -397,7 +397,7 @@ mod benchmarks { let caller = pezframe_benchmarking::whitelisted_caller(); let deposit = - Pallet::::deposit_for(&solution, SnapshotMetadata::::get().unwrap_or_default()); + Pezpallet::::deposit_for(&solution, SnapshotMetadata::::get().unwrap_or_default()); T::Currency::make_free_balance_be( &caller, T::Currency::minimum_balance() * 1000u32.into() + deposit, @@ -406,7 +406,7 @@ mod benchmarks { #[extrinsic_call] _(RawOrigin::Signed(caller), Box::new(solution)); - assert!(Pallet::::signed_submissions().len() as u32 == T::SignedMaxSubmissions::get()); + assert!(Pezpallet::::signed_submissions().len() as u32 == T::SignedMaxSubmissions::get()); Ok(()) } @@ -472,7 +472,7 @@ mod benchmarks { #[block] { - result = Pallet::::feasibility_check(raw_solution, ElectionCompute::Unsigned); + result = Pezpallet::::feasibility_check(raw_solution, ElectionCompute::Unsigned); } assert!(result.is_ok()); @@ -500,14 +500,14 @@ mod benchmarks { let t = T::BenchmarkingConfig::MAXIMUM_TARGETS; set_up_data_provider::(v, t); - let now = pezframe_system::Pallet::::block_number(); + let now = pezframe_system::Pezpallet::::block_number(); CurrentPhase::::put(Phase::Unsigned((true, now))); - Pallet::::create_snapshot().unwrap(); + Pezpallet::::create_snapshot().unwrap(); #[block] { // we can't really verify this as it won't write anything to state, check logs. - Pallet::::offchain_worker(now) + Pezpallet::::offchain_worker(now) } } @@ -529,7 +529,7 @@ mod benchmarks { #[block] { - Pallet::::create_snapshot().map_err(|_| "could not create snapshot")?; + Pezpallet::::create_snapshot().map_err(|_| "could not create snapshot")?; } assert!(Snapshot::::get().is_some()); @@ -627,7 +627,7 @@ mod benchmarks { } impl_benchmark_test_suite! { - Pallet, + Pezpallet, mock::ExtBuilder::default().build_offchainify(10).0, mock::Runtime, } diff --git a/bizinikiwi/pezframe/election-provider-multi-phase/src/helpers.rs b/bizinikiwi/pezframe/election-provider-multi-phase/src/helpers.rs index ac4a3b9d..37ff7c56 100644 --- a/bizinikiwi/pezframe/election-provider-multi-phase/src/helpers.rs +++ b/bizinikiwi/pezframe/election-provider-multi-phase/src/helpers.rs @@ -28,7 +28,7 @@ macro_rules! log { ($level:tt, $pattern:expr $(, $values:expr)* $(,)?) => { log::$level!( target: $crate::LOG_TARGET, - concat!("[#{:?}] 🗳 ", $pattern), pezframe_system::Pallet::::block_number() $(, $values)* + concat!("[#{:?}] 🗳 ", $pattern), pezframe_system::Pezpallet::::block_number() $(, $values)* ) }; } diff --git a/bizinikiwi/pezframe/election-provider-multi-phase/src/lib.rs b/bizinikiwi/pezframe/election-provider-multi-phase/src/lib.rs index 5c6ad4f2..f21040a3 100644 --- a/bizinikiwi/pezframe/election-provider-multi-phase/src/lib.rs +++ b/bizinikiwi/pezframe/election-provider-multi-phase/src/lib.rs @@ -15,14 +15,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! # Multi phase, offchain election provider pallet. +//! # Multi phase, offchain election provider pezpallet. //! //! Currently, this election-provider has two distinct phases (see [`Phase`]), **signed** and //! **unsigned**. //! //! ## Phases //! -//! The timeline of pallet is as follows. At each block, +//! The timeline of pezpallet is as follows. At each block, //! [`pezframe_election_provider_support::ElectionDataProvider::next_election_prediction`] is used to //! estimate the time remaining to the next call to //! [`pezframe_election_provider_support::ElectionProvider::elect`]. Based on this, a phase is chosen. @@ -35,15 +35,15 @@ //! Phase::Off + Phase::Signed + Phase::Unsigned + //! ``` //! -//! Note that the unsigned phase starts [`pallet::Config::UnsignedPhase`] blocks before the +//! Note that the unsigned phase starts [`pezpallet::Config::UnsignedPhase`] blocks before the //! `next_election_prediction`, but only ends when a call to [`ElectionProvider::elect`] happens. If //! no `elect` happens, the signed phase is extended. //! -//! > Given this, it is rather important for the user of this pallet to ensure it always terminates +//! > Given this, it is rather important for the user of this pezpallet to ensure it always terminates //! election via `elect` before requesting a new one. //! //! Each of the phases can be disabled by essentially setting their length to zero. If both phases -//! have length zero, then the pallet essentially runs only the fallback strategy, denoted by +//! have length zero, then the pezpallet essentially runs only the fallback strategy, denoted by //! [`Config::Fallback`]. //! //! ### Signed Phase @@ -51,7 +51,7 @@ //! In the signed phase, solutions (of type [`RawSolution`]) are submitted and queued on chain. A //! deposit is reserved, based on the size of the solution, for the cost of keeping this solution //! on-chain for a number of blocks, and the potential weight of the solution upon being checked. A -//! maximum of `pallet::Config::SignedMaxSubmissions` solutions are stored. The queue is always +//! maximum of `pezpallet::Config::SignedMaxSubmissions` solutions are stored. The queue is always //! sorted based on score (worse to best). //! //! Upon arrival of a new solution: @@ -67,7 +67,7 @@ //! origin can not bail out in any way, if their solution is queued. //! //! Upon the end of the signed phase, the solutions are examined from best to worse (i.e. `pop()`ed -//! until drained). Each solution undergoes an expensive `Pallet::feasibility_check`, which ensures +//! until drained). Each solution undergoes an expensive `Pezpallet::feasibility_check`, which ensures //! the score claimed by this score was correct, and it is valid based on the election data (i.e. //! votes and targets). At each step, if the current best solution passes the feasibility check, //! it is considered to be the best one. The sender of the origin is rewarded, and the rest of the @@ -111,9 +111,9 @@ //! ### Fallback //! //! If we reach the end of both phases (i.e. call to [`ElectionProvider::elect`] happens) and no -//! good solution is queued, then the fallback strategy [`pallet::Config::Fallback`] is used to +//! good solution is queued, then the fallback strategy [`pezpallet::Config::Fallback`] is used to //! determine what needs to be done. The on-chain election is slow, and contains no balancing or -//! reduction post-processing. If [`pallet::Config::Fallback`] fails, the next phase +//! reduction post-processing. If [`pezpallet::Config::Fallback`] fails, the next phase //! [`Phase::Emergency`] is enabled, which is a more *fail-safe* approach. //! //! ### Emergency Phase @@ -124,15 +124,15 @@ //! provided //! 2. Any other unforeseen internal error //! -//! A call to `T::ElectionProvider::elect` is made, and `Ok(_)` cannot be returned, then the pallet +//! A call to `T::ElectionProvider::elect` is made, and `Ok(_)` cannot be returned, then the pezpallet //! proceeds to the [`Phase::Emergency`]. During this phase, any solution can be submitted from -//! [`Config::ForceOrigin`], without any checking, via [`Pallet::set_emergency_election_result`] +//! [`Config::ForceOrigin`], without any checking, via [`Pezpallet::set_emergency_election_result`] //! transaction. Hence, `[`Config::ForceOrigin`]` should only be set to a trusted origin, such as //! the council or root. Once submitted, the forced solution is kept in [`QueuedSolution`] until the //! next call to `T::ElectionProvider::elect`, where it is returned and [`Phase`] goes back to //! `Off`. //! -//! This implies that the user of this pallet (i.e. a staking pallet) should re-try calling +//! This implies that the user of this pezpallet (i.e. a staking pezpallet) should re-try calling //! `T::ElectionProvider::elect` in case of error, until `OK(_)` is returned. //! //! To generate an emergency solution, one must only provide one argument: [`Supports`]. This is @@ -140,7 +140,7 @@ //! supports can be generated by any means. In the simplest case, it could be manual. For example, //! in the case of massive network failure or misbehavior, [`Config::ForceOrigin`] might decide to //! select only a small number of emergency winners (which would greatly restrict the next validator -//! set, if this pallet is used with `pezpallet-staking`). If the failure is for other technical +//! set, if this pezpallet is used with `pezpallet-staking`). If the failure is for other technical //! reasons, then a simple and safe way to generate supports is using the staking-miner binary //! provided in the Pezkuwi repository. This binary has a subcommand named `emergency-solution` //! which is capable of connecting to a live network, and generating appropriate `supports` using a @@ -172,13 +172,13 @@ //! //! ## Error types //! -//! This pallet provides a verbose error system to ease future debugging and debugging. The overall +//! This pezpallet provides a verbose error system to ease future debugging and debugging. The overall //! hierarchy of errors is as follows: //! -//! 1. [`pallet::Error`]: These are the errors that can be returned in the dispatchables of the -//! pallet, either signed or unsigned. Since decomposition with nested enums is not possible +//! 1. [`pezpallet::Error`]: These are the errors that can be returned in the dispatchables of the +//! pezpallet, either signed or unsigned. Since decomposition with nested enums is not possible //! here, they are prefixed with the logical sub-system to which they belong. -//! 2. [`ElectionError`]: These are the errors that can be generated while the pallet is doing +//! 2. [`ElectionError`]: These are the errors that can be generated while the pezpallet is doing //! something in automatic scenarios, such as `offchain_worker` or `on_initialize`. These errors //! are helpful for logging and are thus nested as: //! - [`ElectionError::Miner`]: wraps a [`unsigned::MinerError`]. @@ -192,10 +192,10 @@ //! ## Multi-page election support //! //! The [`pezframe_election_provider_support::ElectionDataProvider`] and -//! [`pezframe_election_provider_support::ElectionProvider`] traits used by this pallet can support a +//! [`pezframe_election_provider_support::ElectionProvider`] traits used by this pezpallet can support a //! multi-page election. //! -//! However, this pallet only supports single-page election and data +//! However, this pezpallet only supports single-page election and data //! provider and all the relevant trait implementation and configurations reflect that assumption. //! //! If external callers request the election of a page index higher than 0, the election will fail @@ -206,7 +206,7 @@ //! **Emergency-phase recovery script**: This script should be taken out of staking-miner in //! pezkuwi and ideally live in `bizinikiwi/utils/pezframe/elections`. //! -//! **Challenge Phase**. We plan on adding a third phase to the pallet, called the challenge phase. +//! **Challenge Phase**. We plan on adding a third phase to the pezpallet, called the challenge phase. //! This is a phase in which no further solutions are processed, and the current best solution might //! be challenged by anyone (signed or unsigned). The main plan here is to enforce the solution to //! be PJR. Checking PJR on-chain is quite expensive, yet proving that a solution is **not** PJR is @@ -284,7 +284,7 @@ mod remote_mining; #[macro_use] pub mod helpers; -/// This pallet only supports a single page election flow. +/// This pezpallet only supports a single page election flow. pub(crate) const SINGLE_PAGE: u32 = 0; const LOG_TARGET: &str = "runtime::election-provider"; @@ -310,7 +310,7 @@ pub type SolutionTargetIndexOf = as NposSolution>::TargetIndex /// The accuracy of the election, when submitted from offchain. Derived from [`SolutionOf`]. pub type SolutionAccuracyOf = ::MinerConfig> as NposSolution>::Accuracy; -/// A ready solution parameterized with this pallet's miner config. +/// A ready solution parameterized with this pezpallet's miner config. pub type ReadySolutionOf = ReadySolution< ::AccountId, ::MaxWinners, @@ -319,7 +319,7 @@ pub type ReadySolutionOf = ReadySolution< /// The fallback election type. pub type FallbackErrorOf = <::Fallback as ElectionProvider>::Error; -/// Configuration for the benchmarks of the pallet. +/// Configuration for the benchmarks of the pezpallet. pub trait BenchmarkingConfig { /// Range of voters. const VOTERS: [u32; 2]; @@ -337,7 +337,7 @@ pub trait BenchmarkingConfig { const MAXIMUM_TARGETS: u32; } -/// Current phase of the pallet. +/// Current phase of the pezpallet. #[derive(PartialEq, Eq, Clone, Copy, Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo)] pub enum Phase { /// Nothing, the election is not happening. @@ -425,7 +425,7 @@ impl Default for ElectionCompute { /// This is what will get submitted to the chain. /// /// Such a solution should never become effective in anyway before being checked by the -/// `Pallet::feasibility_check`. +/// `Pezpallet::feasibility_check`. #[derive( PartialEq, Eq, @@ -515,9 +515,9 @@ pub struct SolutionOrSnapshotSize { pub targets: u32, } -/// Internal errors of the pallet. +/// Internal errors of the pezpallet. /// -/// Note that this is different from [`pallet::Error`]. +/// Note that this is different from [`pezpallet::Error`]. #[derive(pezframe_support::DebugNoBound)] #[cfg_attr(feature = "runtime-benchmarks", derive(strum::IntoStaticStr))] pub enum ElectionError { @@ -530,7 +530,7 @@ pub enum ElectionError { /// An error nested in the fallback. Fallback(FallbackErrorOf), /// An error occurred when requesting an election result. The caller expects a multi-paged - /// election, which this pallet does not support. + /// election, which this pezpallet does not support. MultiPageNotSupported, /// No solution has been queued. NothingQueued, @@ -576,7 +576,7 @@ pub enum FeasibilityError { WrongWinnerCount, /// The snapshot is not available. /// - /// Kinda defensive: The pallet should technically never attempt to do a feasibility check when + /// Kinda defensive: The pezpallet should technically never attempt to do a feasibility check when /// no snapshot is present. SnapshotUnavailable, /// Internal error from the election crate. @@ -605,16 +605,16 @@ impl From for FeasibilityError { } } -pub use pallet::*; -#[pezframe_support::pallet] -pub mod pallet { +pub use pezpallet::*; +#[pezframe_support::pezpallet] +pub mod pezpallet { use super::*; use pezframe_election_provider_support::{InstantElectionProvider, NposSolver}; use pezframe_support::{pezpallet_prelude::*, traits::EstimateCallFee}; use pezframe_system::pezpallet_prelude::*; use pezsp_runtime::traits::Convert; - #[pallet::config] + #[pezpallet::config] pub trait Config: pezframe_system::Config + CreateBare> { #[allow(deprecated)] type RuntimeEvent: From> @@ -634,18 +634,18 @@ pub mod pallet { /// The minimum amount of improvement to the solution score that defines a solution as /// "better" in the Signed phase. - #[pallet::constant] + #[pezpallet::constant] type BetterSignedThreshold: Get; /// The repeat threshold of the offchain worker. /// /// For example, if it is 5, that means that at least 5 blocks will elapse between attempts /// to submit the worker's solution. - #[pallet::constant] + #[pezpallet::constant] type OffchainRepeat: Get>; /// The priority of the unsigned transaction submitted in the unsigned-phase - #[pallet::constant] + #[pezpallet::constant] type MinerTxPriority: Get; /// Configurations of the embedded miner. @@ -666,43 +666,43 @@ pub mod pallet { /// update this value during an election, you _must_ ensure that /// `SignedSubmissionIndices.len()` is less than or equal to the new value. Otherwise, /// attempts to submit new solutions may cause a runtime panic. - #[pallet::constant] + #[pezpallet::constant] type SignedMaxSubmissions: Get; /// Maximum weight of a signed solution. /// /// If [`Config::MinerConfig`] is being implemented to submit signed solutions (outside of - /// this pallet), then [`MinerConfig::solution_weight`] is used to compare against + /// this pezpallet), then [`MinerConfig::solution_weight`] is used to compare against /// this value. - #[pallet::constant] + #[pezpallet::constant] type SignedMaxWeight: Get; /// The maximum amount of unchecked solutions to refund the call fee for. - #[pallet::constant] + #[pezpallet::constant] type SignedMaxRefunds: Get; /// Base reward for a signed solution - #[pallet::constant] + #[pezpallet::constant] type SignedRewardBase: Get>; /// Per-byte deposit for a signed solution. - #[pallet::constant] + #[pezpallet::constant] type SignedDepositByte: Get>; /// Per-weight deposit for a signed solution. - #[pallet::constant] + #[pezpallet::constant] type SignedDepositWeight: Get>; /// Maximum number of winners that an election supports. /// /// Note: This must always be greater or equal to `T::DataProvider::desired_targets()`. - #[pallet::constant] + #[pezpallet::constant] type MaxWinners: Get; /// Maximum number of voters that can support a winner in an election solution. /// /// This is needed to ensure election computation is bounded. - #[pallet::constant] + #[pezpallet::constant] type MaxBackersPerWinner: Get; /// Something that calculates the signed deposit base based on the signed submissions queue @@ -748,43 +748,43 @@ pub mod pallet { /// OCW election solution miner algorithm implementation. type Solver: NposSolver; - /// Origin that can control this pallet. Note that any action taken by this origin (such) + /// Origin that can control this pezpallet. Note that any action taken by this origin (such) /// as providing an emergency solution is not checked. Thus, it must be a trusted origin. type ForceOrigin: EnsureOrigin; /// The configuration of benchmarking. type BenchmarkingConfig: BenchmarkingConfig; - /// The weight of the pallet. + /// The weight of the pezpallet. type WeightInfo: WeightInfo; } // Expose miner configs over the metadata such that they can be re-implemented. - #[pallet::extra_constants] - impl Pallet { - #[pallet::constant_name(MinerMaxLength)] + #[pezpallet::extra_constants] + impl Pezpallet { + #[pezpallet::constant_name(MinerMaxLength)] fn max_length() -> u32 { ::MaxLength::get() } - #[pallet::constant_name(MinerMaxWeight)] + #[pezpallet::constant_name(MinerMaxWeight)] fn max_weight() -> Weight { ::MaxWeight::get() } - #[pallet::constant_name(MinerMaxVotesPerVoter)] + #[pezpallet::constant_name(MinerMaxVotesPerVoter)] fn max_votes_per_voter() -> u32 { ::MaxVotesPerVoter::get() } - #[pallet::constant_name(MinerMaxWinners)] + #[pezpallet::constant_name(MinerMaxWinners)] fn max_winners() -> u32 { ::MaxWinners::get() } } - #[pallet::hooks] - impl Hooks> for Pallet { + #[pezpallet::hooks] + impl Hooks> for Pezpallet { fn on_initialize(now: BlockNumberFor) -> Weight { let next_election = T::DataProvider::next_election_prediction(now).max(now); @@ -870,7 +870,7 @@ pub mod pallet { // This should only come useful in an **abrupt** termination of execution, otherwise the // guard will be dropped upon successful execution. let mut lock = - StorageLock::>>::with_block_deadline( + StorageLock::>>::with_block_deadline( unsigned::OFFCHAIN_LOCK, T::UnsignedPhase::get().saturated_into(), ); @@ -911,7 +911,7 @@ pub mod pallet { // We only accept data provider who's maximum votes per voter matches our // `T::Solution`'s `LIMIT`. // - // NOTE that this pallet does not really need to enforce this in runtime. The + // NOTE that this pezpallet does not really need to enforce this in runtime. The // solution cannot represent any voters more than `LIMIT` anyhow. assert_eq!( ::MaxVotesPerVoter::get(), @@ -920,7 +920,7 @@ pub mod pallet { // While it won't cause any failures, setting `SignedMaxRefunds` gt // `SignedMaxSubmissions` is a red flag that the developer does not understand how to - // configure this pallet. + // configure this pezpallet. assert!(T::SignedMaxSubmissions::get() >= T::SignedMaxRefunds::get()); } @@ -930,8 +930,8 @@ pub mod pallet { } } - #[pallet::call] - impl Pallet { + #[pezpallet::call] + impl Pezpallet { /// Submit a solution for the unsigned phase. /// /// The dispatch origin fo this call must be __none__. @@ -946,8 +946,8 @@ pub mod pallet { /// putting their authoring reward at risk. /// /// No deposit or reward is associated with this submission. - #[pallet::call_index(0)] - #[pallet::weight(( + #[pezpallet::call_index(0)] + #[pezpallet::weight(( T::WeightInfo::submit_unsigned( witness.voters, witness.targets, @@ -997,8 +997,8 @@ pub mod pallet { /// Dispatch origin must be aligned with `T::ForceOrigin`. /// /// This check can be turned off by setting the value to `None`. - #[pallet::call_index(1)] - #[pallet::weight(T::DbWeight::get().writes(1))] + #[pezpallet::call_index(1)] + #[pezpallet::weight(T::DbWeight::get().writes(1))] pub fn set_minimum_untrusted_score( origin: OriginFor, maybe_next_score: Option, @@ -1008,7 +1008,7 @@ pub mod pallet { Ok(()) } - /// Set a solution in the queue, to be handed out to the client of this pallet in the next + /// Set a solution in the queue, to be handed out to the client of this pezpallet in the next /// call to `ElectionProvider::elect`. /// /// This can only be set by `T::ForceOrigin`, and only when the phase is `Emergency`. @@ -1016,8 +1016,8 @@ pub mod pallet { /// The solution is not checked for any feasibility and is assumed to be trustworthy, as any /// feasibility check itself can in principle cause the election process to fail (due to /// memory/weight constrains). - #[pallet::call_index(2)] - #[pallet::weight(T::DbWeight::get().reads_writes(1, 1))] + #[pezpallet::call_index(2)] + #[pezpallet::weight(T::DbWeight::get().reads_writes(1, 1))] pub fn set_emergency_election_result( origin: OriginFor, supports: Supports, @@ -1056,8 +1056,8 @@ pub mod pallet { /// /// A deposit is reserved and recorded for the solution. Based on the outcome, the solution /// might be rewarded, slashed, or get all or a part of the deposit back. - #[pallet::call_index(3)] - #[pallet::weight(T::WeightInfo::submit())] + #[pezpallet::call_index(3)] + #[pezpallet::weight(T::WeightInfo::submit())] pub fn submit( origin: OriginFor, raw_solution: Box>>, @@ -1128,8 +1128,8 @@ pub mod pallet { /// /// This can only be called when [`Phase::Emergency`] is enabled, as an alternative to /// calling [`Call::set_emergency_election_result`]. - #[pallet::call_index(4)] - #[pallet::weight(T::DbWeight::get().reads_writes(1, 1))] + #[pezpallet::call_index(4)] + #[pezpallet::weight(T::DbWeight::get().reads_writes(1, 1))] pub fn governance_fallback(origin: OriginFor) -> DispatchResult { T::ForceOrigin::ensure_origin(origin)?; ensure!(CurrentPhase::::get().is_emergency(), Error::::CallNotAllowed); @@ -1162,8 +1162,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 { /// A solution was stored with the given compute. /// @@ -1195,8 +1195,8 @@ pub mod pallet { }, } - /// Error of the pallet that can be returned in response to dispatches. - #[pallet::error] + /// Error of the pezpallet that can be returned in response to dispatches. + #[pezpallet::error] pub enum Error { /// Submission was too early. PreDispatchEarlySubmission, @@ -1230,8 +1230,8 @@ pub mod pallet { PreDispatchDifferentRound, } - #[pallet::validate_unsigned] - impl ValidateUnsigned for Pallet { + #[pezpallet::validate_unsigned] + impl ValidateUnsigned for Pezpallet { type Call = Call; fn validate_unsigned(source: TransactionSource, call: &Self::Call) -> TransactionValidity { if let Call::submit_unsigned { raw_solution, .. } = call { @@ -1277,7 +1277,7 @@ pub mod pallet { } } - #[pallet::type_value] + #[pezpallet::type_value] pub fn DefaultForRound() -> u32 { 1 } @@ -1285,41 +1285,41 @@ pub mod pallet { /// Internal counter for the number of rounds. /// /// This is useful for de-duplication of transactions submitted to the pool, and general - /// diagnostics of the pallet. + /// diagnostics of the pezpallet. /// /// This is merely incremented once per every time that an upstream `elect` is called. - #[pallet::storage] + #[pezpallet::storage] pub type Round = StorageValue<_, u32, ValueQuery, DefaultForRound>; /// Current phase. - #[pallet::storage] + #[pezpallet::storage] pub type CurrentPhase = StorageValue<_, Phase>, ValueQuery>; /// Current best solution, signed or unsigned, queued to be returned upon `elect`. /// /// Always sorted by score. - #[pallet::storage] + #[pezpallet::storage] pub type QueuedSolution = StorageValue<_, ReadySolutionOf>; /// Snapshot data of the round. /// /// This is created at the beginning of the signed phase and cleared upon calling `elect`. /// Note: This storage type must only be mutated through [`SnapshotWrapper`]. - #[pallet::storage] + #[pezpallet::storage] pub type Snapshot = StorageValue<_, RoundSnapshot>>; /// Desired number of targets to elect for this round. /// /// Only exists when [`Snapshot`] is present. /// Note: This storage type must only be mutated through [`SnapshotWrapper`]. - #[pallet::storage] + #[pezpallet::storage] pub type DesiredTargets = StorageValue<_, u32>; /// The metadata of the [`RoundSnapshot`] /// /// Only exists when [`Snapshot`] is present. /// Note: This storage type must only be mutated through [`SnapshotWrapper`]. - #[pallet::storage] + #[pezpallet::storage] pub type SnapshotMetadata = StorageValue<_, SolutionOrSnapshotSize>; // The following storage items collectively comprise `SignedSubmissions`, and should never be @@ -1335,7 +1335,7 @@ pub mod pallet { /// We can't just use `SignedSubmissionIndices.len()`, because that's a bounded set; past its /// capacity, it will simply saturate. We can't just iterate over `SignedSubmissionsMap`, /// because iteration is slow. Instead, we store the value here. - #[pallet::storage] + #[pezpallet::storage] pub type SignedSubmissionNextIndex = StorageValue<_, u32, ValueQuery>; /// A sorted, bounded vector of `(score, block_number, index)`, where each `index` points to a @@ -1344,7 +1344,7 @@ pub mod pallet { /// We never need to process more than a single signed submission at a time. Signed submissions /// can be quite large, so we're willing to pay the cost of multiple database accesses to access /// them one at a time instead of reading and decoding all of them at once. - #[pallet::storage] + #[pezpallet::storage] pub type SignedSubmissionIndices = StorageValue<_, SubmissionIndicesOf, ValueQuery>; @@ -1355,7 +1355,7 @@ pub mod pallet { /// /// Twox note: the key of the map is an auto-incrementing index which users cannot inspect or /// affect; we shouldn't need a cryptographically secure hasher. - #[pallet::storage] + #[pezpallet::storage] pub type SignedSubmissionsMap = StorageMap<_, Twox64Concat, u32, SignedSubmissionOf, OptionQuery>; @@ -1365,7 +1365,7 @@ pub mod pallet { /// feasible. /// /// Can be set via `set_minimum_untrusted_score`. - #[pallet::storage] + #[pezpallet::storage] pub type MinimumUntrustedScore = StorageValue<_, ElectionScore>; /// The in-code storage version. @@ -1373,10 +1373,10 @@ pub mod pallet { /// v1: https://github.com/pezkuwichain/kurdistan-sdk/issues/38/ const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); - #[pallet::pallet] - #[pallet::without_storage_info] - #[pallet::storage_version(STORAGE_VERSION)] - pub struct Pallet(_); + #[pezpallet::pezpallet] + #[pezpallet::without_storage_info] + #[pezpallet::storage_version(STORAGE_VERSION)] + pub struct Pezpallet(_); } /// This wrapper is created for handling the synchronization of [`Snapshot`], [`SnapshotMetadata`] @@ -1412,11 +1412,11 @@ impl SnapshotWrapper { } } -impl Pallet { +impl Pezpallet { /// Internal counter for the number of rounds. /// /// This is useful for de-duplication of transactions submitted to the pool, and general - /// diagnostics of the pallet. + /// diagnostics of the pezpallet. /// /// This is merely incremented once per every time that an upstream `elect` is called. pub fn round() -> u32 { @@ -1505,7 +1505,7 @@ impl Pallet { CurrentPhase::::put(to); } - /// Parts of [`create_snapshot`] that happen inside of this pallet. + /// Parts of [`create_snapshot`] that happen inside of this pezpallet. /// /// Extracted for easier weight calculation. fn create_snapshot_internal( @@ -1534,11 +1534,11 @@ impl Pallet { SnapshotWrapper::::set(metadata, desired_targets, &buffer); } - /// Parts of [`create_snapshot`] that happen outside of this pallet. + /// Parts of [`create_snapshot`] that happen outside of this pezpallet. /// /// Extracted for easier weight calculation. /// - /// Note: this pallet only supports one page of voter and target snapshots. + /// Note: this pezpallet only supports one page of voter and target snapshots. fn create_snapshot_external( ) -> Result<(Vec, Vec>, u32), ElectionError> { let election_bounds = T::ElectionBounds::get(); @@ -1562,7 +1562,7 @@ impl Pallet { }) .map_err(ElectionError::DataProvider)?; - let mut desired_targets = as ElectionProvider>::desired_targets_checked() + let mut desired_targets = as ElectionProvider>::desired_targets_checked() .map_err(|e| ElectionError::DataProvider(e))?; // If `desired_targets` > `targets.len()`, cap `desired_targets` to that level and emit a @@ -1590,7 +1590,7 @@ impl Pallet { /// Returns `Ok(())` if operation is okay. /// /// This is a *self-weighing* function, it will register its own extra weight as - /// [`DispatchClass::Mandatory`] with the system pallet. + /// [`DispatchClass::Mandatory`] with the system pezpallet. pub fn create_snapshot() -> Result<(), ElectionError> { // this is self-weighing itself.. let (targets, voters, desired_targets) = Self::create_snapshot_external()?; @@ -1603,11 +1603,11 @@ impl Pallet { Ok(()) } - /// Register some amount of weight directly with the system pallet. + /// Register some amount of weight directly with the system pezpallet. /// /// This is always mandatory weight. fn register_weight(weight: Weight) { - pezframe_system::Pallet::::register_extra_weight_unchecked( + pezframe_system::Pezpallet::::register_extra_weight_unchecked( weight, DispatchClass::Mandatory, ); @@ -1714,7 +1714,7 @@ impl Pallet { } #[cfg(feature = "try-runtime")] -impl Pallet { +impl Pezpallet { fn do_try_state() -> Result<(), TryRuntimeError> { Self::try_state_snapshot()?; Self::try_state_signed_submissions_map()?; @@ -1795,7 +1795,7 @@ impl Pallet { } } -impl ElectionProvider for Pallet { +impl ElectionProvider for Pezpallet { type AccountId = T::AccountId; type BlockNumber = BlockNumberFor; type Error = ElectionError; @@ -1806,7 +1806,7 @@ impl ElectionProvider for Pallet { type DataProvider = T::DataProvider; fn elect(page: PageIndex) -> Result, Self::Error> { - // Note: this pallet **MUST** only by used in the single-page mode. + // Note: this pezpallet **MUST** only by used in the single-page mode. ensure!(page == SINGLE_PAGE, ElectionError::::MultiPageNotSupported); let res = match Self::do_elect() { @@ -1836,7 +1836,7 @@ impl ElectionProvider for Pallet { fn start() -> Result<(), Self::Error> { log!( warn, - "we received signal, but this pallet works in the basis of legacy pull based election" + "we received signal, but this pezpallet works in the basis of legacy pull based election" ); Ok(()) } diff --git a/bizinikiwi/pezframe/election-provider-multi-phase/src/migrations.rs b/bizinikiwi/pezframe/election-provider-multi-phase/src/migrations.rs index a7d991e4..279c44ae 100644 --- a/bizinikiwi/pezframe/election-provider-multi-phase/src/migrations.rs +++ b/bizinikiwi/pezframe/election-provider-multi-phase/src/migrations.rs @@ -27,8 +27,8 @@ pub mod v1 { pub struct MigrateToV1(core::marker::PhantomData); impl OnRuntimeUpgrade for MigrateToV1 { fn on_runtime_upgrade() -> Weight { - let current = Pallet::::in_code_storage_version(); - let onchain = Pallet::::on_chain_storage_version(); + let current = Pezpallet::::in_code_storage_version(); + let onchain = Pezpallet::::on_chain_storage_version(); log!( info, @@ -41,7 +41,7 @@ pub mod v1 { if SignedSubmissionIndices::::exists() { // This needs to be tested at a both a block height where this value exists, and // when it doesn't. - let now = pezframe_system::Pallet::::block_number(); + let now = pezframe_system::Pezpallet::::block_number(); let map = unhashed::get::>( &SignedSubmissionIndices::::hashed_key(), ) @@ -67,7 +67,7 @@ pub mod v1 { log!(info, "SignedSubmissionIndices did NOT exist."); } - current.put::>(); + current.put::>(); T::DbWeight::get().reads_writes(2, 1) } else { log!(info, "Migration did not execute. This probably should be removed"); diff --git a/bizinikiwi/pezframe/election-provider-multi-phase/src/mock.rs b/bizinikiwi/pezframe/election-provider-multi-phase/src/mock.rs index 8fde2c67..d65778eb 100644 --- a/bizinikiwi/pezframe/election-provider-multi-phase/src/mock.rs +++ b/bizinikiwi/pezframe/election-provider-multi-phase/src/mock.rs @@ -77,7 +77,7 @@ pezframe_election_provider_support::generate_solution_type!( >(16) ); -/// All events of this pallet. +/// All events of this pezpallet. pub(crate) fn multi_phase_events() -> Vec> { System::read_events_for_pallet::>() } diff --git a/bizinikiwi/pezframe/election-provider-multi-phase/src/signed.rs b/bizinikiwi/pezframe/election-provider-multi-phase/src/signed.rs index f4ae7de3..7aa1cba9 100644 --- a/bizinikiwi/pezframe/election-provider-multi-phase/src/signed.rs +++ b/bizinikiwi/pezframe/election-provider-multi-phase/src/signed.rs @@ -20,7 +20,7 @@ use core::marker::PhantomData; use crate::{ - unsigned::MinerConfig, Config, ElectionCompute, Pallet, QueuedSolution, RawSolution, + unsigned::MinerConfig, Config, ElectionCompute, Pezpallet, QueuedSolution, RawSolution, ReadySolutionOf, SignedSubmissionIndices, SignedSubmissionNextIndex, SignedSubmissionsMap, SnapshotMetadata, SolutionOf, SolutionOrSnapshotSize, Weight, WeightInfo, }; @@ -301,7 +301,7 @@ impl SignedSubmissions { pub fn insert(&mut self, submission: SignedSubmissionOf) -> InsertResult { // verify the expectation that we never reuse an index debug_assert!(!self.indices.iter().map(|(_, _, x)| x).any(|&idx| idx == self.next_idx)); - let block_number = pezframe_system::Pallet::::block_number(); + let block_number = pezframe_system::Pezpallet::::block_number(); let maybe_weakest = match self.indices.try_push(( submission.raw_solution.score, @@ -376,7 +376,7 @@ where } } -impl Pallet { +impl Pezpallet { /// `Self` accessor for `SignedSubmission`. pub fn signed_submissions() -> SignedSubmissions { SignedSubmissions::::get() diff --git a/bizinikiwi/pezframe/election-provider-multi-phase/src/unsigned.rs b/bizinikiwi/pezframe/election-provider-multi-phase/src/unsigned.rs index fcd2bdd3..5576d6d6 100644 --- a/bizinikiwi/pezframe/election-provider-multi-phase/src/unsigned.rs +++ b/bizinikiwi/pezframe/election-provider-multi-phase/src/unsigned.rs @@ -19,7 +19,7 @@ use crate::{ helpers, Call, Config, CurrentPhase, DesiredTargets, ElectionCompute, Error, FeasibilityError, - Pallet, QueuedSolution, RawSolution, ReadySolution, ReadySolutionOf, Round, RoundSnapshot, + Pezpallet, QueuedSolution, RawSolution, ReadySolution, ReadySolutionOf, Round, RoundSnapshot, Snapshot, SolutionAccuracyOf, SolutionOf, SolutionOrSnapshotSize, Weight, }; use alloc::{boxed::Box, vec::Vec}; @@ -71,7 +71,7 @@ pub type Assignment = /// particular runtime `T`. pub type IndexAssignmentOf = pezframe_election_provider_support::IndexAssignmentOf>; -/// Error type of the pallet's [`crate::Config::Solver`]. +/// Error type of the pezpallet's [`crate::Config::Solver`]. pub type SolverErrorOf = <::Solver as NposSolver>::Error; /// Error type for operations related to the OCW npos solution miner. #[derive(pezframe_support::DebugNoBound, pezframe_support::PartialEqNoBound)] @@ -192,7 +192,7 @@ fn ocw_solution_exists() -> bool { matches!(StorageValueRef::persistent(OFFCHAIN_CACHED_CALL).get::>(), Ok(Some(_))) } -impl>> Pallet { +impl>> Pezpallet { /// Mine a new npos solution. /// /// The Npos Solver type, `S`, must have the same AccountId and Error type as the @@ -322,9 +322,9 @@ impl>> Pallet { /// Mine a new npos solution, with all the relevant checks to make sure that it will be accepted /// to the chain. /// - /// If you want an unchecked solution, use [`Pallet::mine_solution`]. + /// If you want an unchecked solution, use [`Pezpallet::mine_solution`]. /// If you want a checked solution and submit it at the same time, use - /// [`Pallet::mine_check_save_submit`]. + /// [`Pezpallet::mine_check_save_submit`]. pub fn mine_and_check() -> Result< (RawSolution>, SolutionOrSnapshotSize, TrimmingStatus), MinerError, @@ -413,7 +413,7 @@ impl>> Pallet { } } -/// Configurations for a miner that comes with this pallet. +/// Configurations for a miner that comes with this pezpallet. pub trait MinerConfig { /// The account id type. type AccountId: Ord + Clone + codec::Codec + core::fmt::Debug; @@ -440,7 +440,7 @@ pub trait MinerConfig { /// The weight is computed using `solution_weight`. type MaxWeight: Get; /// The maximum number of winners that can be elected in the single page supported by this - /// pallet. + /// pezpallet. type MaxWinners: Get; /// The maximum number of backers per winner in the last solution. type MaxBackersPerWinner: Get; @@ -453,7 +453,7 @@ pub trait MinerConfig { /// A base miner, suitable to be used for both signed and unsigned submissions. pub struct Miner(core::marker::PhantomData); impl Miner { - /// Same as [`Pallet::mine_solution`], but the input snapshot data must be given. + /// Same as [`Pezpallet::mine_solution`], but the input snapshot data must be given. pub fn mine_solution_with_snapshot( voters: Vec<(T::AccountId, VoteWeight, BoundedVec)>, targets: Vec, diff --git a/bizinikiwi/pezframe/election-provider-multi-phase/src/weights.rs b/bizinikiwi/pezframe/election-provider-multi-phase/src/weights.rs index dfa88329..a6645883 100644 --- a/bizinikiwi/pezframe/election-provider-multi-phase/src/weights.rs +++ b/bizinikiwi/pezframe/election-provider-multi-phase/src/weights.rs @@ -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_election_provider_multi_phase +// --pezpallet=pezpallet_election_provider_multi_phase // --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2 // --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/election-provider-multi-phase/src/weights.rs // --wasm-execution=compiled diff --git a/bizinikiwi/pezframe/election-provider-multi-phase/test-staking-e2e/Cargo.toml b/bizinikiwi/pezframe/election-provider-multi-phase/test-staking-e2e/Cargo.toml index 062f53dc..2a4e3e3c 100644 --- a/bizinikiwi/pezframe/election-provider-multi-phase/test-staking-e2e/Cargo.toml +++ b/bizinikiwi/pezframe/election-provider-multi-phase/test-staking-e2e/Cargo.toml @@ -6,7 +6,7 @@ edition.workspace = true license = "Apache-2.0" homepage.workspace = true repository.workspace = true -description = "FRAME election provider multi phase pallet tests with staking pallet, bags-list and session pallets" +description = "FRAME election provider multi phase pezpallet tests with staking pezpallet, bags-list and session pallets" publish = false documentation = "https://docs.rs/pezpallet-election-provider-e2e-test" diff --git a/bizinikiwi/pezframe/election-provider-multi-phase/test-staking-e2e/src/lib.rs b/bizinikiwi/pezframe/election-provider-multi-phase/test-staking-e2e/src/lib.rs index 5dcb1a07..430aea50 100644 --- a/bizinikiwi/pezframe/election-provider-multi-phase/test-staking-e2e/src/lib.rs +++ b/bizinikiwi/pezframe/election-provider-multi-phase/test-staking-e2e/src/lib.rs @@ -295,7 +295,7 @@ fn ledger_consistency_active_balance_below_ed() { /// Automatic withdrawal of unlocking funds in staking propagates to the nomination pools and its /// state correctly. /// -/// The staking pallet may withdraw unlocking funds from a pool's bonded account without a pool +/// The staking pezpallet may withdraw unlocking funds from a pool's bonded account without a pool /// member or operator calling explicitly `Call::withdraw*`. This test verifies that the member's /// are eventually paid and the `TotalValueLocked` is kept in sync in those cases. fn automatic_unbonding_pools() { diff --git a/bizinikiwi/pezframe/election-provider-support/benchmarking/src/inner.rs b/bizinikiwi/pezframe/election-provider-support/benchmarking/src/inner.rs index 7a6d9f99..db9a3dc9 100644 --- a/bizinikiwi/pezframe/election-provider-support/benchmarking/src/inner.rs +++ b/bizinikiwi/pezframe/election-provider-support/benchmarking/src/inner.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Election provider support pallet benchmarking. +//! Election provider support pezpallet benchmarking. //! This is separated into its own crate to avoid bloating the size of the runtime. use alloc::vec::Vec; @@ -31,7 +31,7 @@ const SEED: u32 = 999; pub trait Config: pezframe_system::Config {} -pub struct Pallet(pezframe_system::Pallet); +pub struct Pezpallet(pezframe_system::Pezpallet); fn set_up_voters_targets( voters_len: u32, diff --git a/bizinikiwi/pezframe/election-provider-support/benchmarking/src/lib.rs b/bizinikiwi/pezframe/election-provider-support/benchmarking/src/lib.rs index 4afa166e..898be184 100644 --- a/bizinikiwi/pezframe/election-provider-support/benchmarking/src/lib.rs +++ b/bizinikiwi/pezframe/election-provider-support/benchmarking/src/lib.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Election provider support pallet benchmarking. +//! Election provider support pezpallet benchmarking. #![cfg_attr(not(feature = "std"), no_std)] diff --git a/bizinikiwi/pezframe/election-provider-support/benchmarking/src/weights.rs b/bizinikiwi/pezframe/election-provider-support/benchmarking/src/weights.rs index 10221851..a3e2d9d0 100644 --- a/bizinikiwi/pezframe/election-provider-support/benchmarking/src/weights.rs +++ b/bizinikiwi/pezframe/election-provider-support/benchmarking/src/weights.rs @@ -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_election_provider_support_benchmarking +// --pezpallet=pezpallet_election_provider_support_benchmarking // --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2 // --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/election-provider-support/benchmarking/src/weights.rs // --wasm-execution=compiled diff --git a/bizinikiwi/pezframe/election-provider-support/src/lib.rs b/bizinikiwi/pezframe/election-provider-support/src/lib.rs index 9d572d0f..d80e59ff 100644 --- a/bizinikiwi/pezframe/election-provider-support/src/lib.rs +++ b/bizinikiwi/pezframe/election-provider-support/src/lib.rs @@ -42,8 +42,8 @@ //! ElectionProvider //! ``` //! -//! > It could also be possible that a third party pallet (C), provides the data of election to an -//! > election provider (B), which then passes the election result to another pallet (A). +//! > It could also be possible that a third party pezpallet (C), provides the data of election to an +//! > election provider (B), which then passes the election result to another pezpallet (A). //! //! ## Election Types //! @@ -101,13 +101,13 @@ //! type ElectionProvider: ElectionProvider< //! AccountId = AccountId, //! BlockNumber = BlockNumber, -//! DataProvider = Pallet, +//! DataProvider = Pezpallet, //! >; //! } //! -//! pub struct Pallet(std::marker::PhantomData); +//! pub struct Pezpallet(std::marker::PhantomData); //! -//! impl ElectionDataProvider for Pallet { +//! impl ElectionDataProvider for Pezpallet { //! type AccountId = AccountId; //! type BlockNumber = BlockNumber; //! type MaxVotesPerVoter = ConstU32<100>; @@ -181,7 +181,7 @@ //! //! struct Runtime; //! impl generic_election_provider::Config for Runtime { -//! type DataProvider = data_provider_mod::Pallet; +//! type DataProvider = data_provider_mod::Pezpallet; //! type MaxWinnersPerPage = MaxWinnersPerPage; //! type MaxBackersPerWinner = MaxBackersPerWinner; //! type Pages = Pages; @@ -333,7 +333,7 @@ pub trait ElectionDataProvider { /// targets that could become elected, thus "electable". /// /// This should be implemented as a self-weighing function. The implementor should register its - /// appropriate weight at the end of execution with the system pallet directly. + /// appropriate weight at the end of execution with the system pezpallet directly. fn electable_targets( bounds: DataProviderBounds, page: PageIndex, @@ -354,7 +354,7 @@ pub trait ElectionDataProvider { /// Note that if a notion of self-vote exists, it should be represented here. /// /// This should be implemented as a self-weighing function. The implementor should register its - /// appropriate weight at the end of execution with the system pallet directly. + /// appropriate weight at the end of execution with the system pezpallet directly. fn electing_voters( bounds: DataProviderBounds, page: PageIndex, @@ -372,7 +372,7 @@ pub trait ElectionDataProvider { /// The number of targets to elect. /// /// This should be implemented as a self-weighing function. The implementor should register its - /// appropriate weight at the end of execution with the system pallet directly. + /// appropriate weight at the end of execution with the system pezpallet directly. /// /// A sensible implementation should use the minimum between this value and /// [`Self::targets().len()`], since desiring a winner set larger than candidates is not @@ -634,7 +634,7 @@ pub trait SortedListProvider { /// /// If this is implemented by a bags-list instance, it will be the smallest and largest bags. /// - /// This is useful to help another pallet that consumes this trait generate an even distribution + /// This is useful to help another pezpallet that consumes this trait generate an even distribution /// of nodes for testing/genesis. fn range() -> (Self::Score, Self::Score) { (Self::Score::min_value(), Self::Score::max_value()) diff --git a/bizinikiwi/pezframe/election-provider-support/src/onchain.rs b/bizinikiwi/pezframe/election-provider-support/src/onchain.rs index 3a6c0453..9bea7307 100644 --- a/bizinikiwi/pezframe/election-provider-support/src/onchain.rs +++ b/bizinikiwi/pezframe/election-provider-support/src/onchain.rs @@ -95,7 +95,7 @@ pub trait Config { BlockNumber = pezframe_system::pezpallet_prelude::BlockNumberFor, >; - /// Weight information for extrinsics in this pallet. + /// Weight information for extrinsics in this pezpallet. type WeightInfo: WeightInfo; /// Elections bounds, to use when calling into [`Config::DataProvider`]. It might be overwritten @@ -136,7 +136,7 @@ impl OnChainExecution { targets_len, ::MaxVotesPerVoter::get(), ); - pezframe_system::Pallet::::register_extra_weight_unchecked( + pezframe_system::Pezpallet::::register_extra_weight_unchecked( weight, DispatchClass::Mandatory, ); diff --git a/bizinikiwi/pezframe/election-provider-support/src/weights.rs b/bizinikiwi/pezframe/election-provider-support/src/weights.rs index fbb48aa5..95714f40 100644 --- a/bizinikiwi/pezframe/election-provider-support/src/weights.rs +++ b/bizinikiwi/pezframe/election-provider-support/src/weights.rs @@ -24,11 +24,11 @@ // Executed Command: // target/release/bizinikiwi // benchmark -// pallet +// pezpallet // --chain=dev // --steps=1 // --repeat=1 -// --pallet=pezpallet_election_provider_support_benchmarking +// --pezpallet=pezpallet_election_provider_support_benchmarking // --extrinsic=* // --execution=wasm // --wasm-execution=compiled diff --git a/bizinikiwi/pezframe/elections-phragmen/Cargo.toml b/bizinikiwi/pezframe/elections-phragmen/Cargo.toml index 6cf2cfb9..f07f062f 100644 --- a/bizinikiwi/pezframe/elections-phragmen/Cargo.toml +++ b/bizinikiwi/pezframe/elections-phragmen/Cargo.toml @@ -6,7 +6,7 @@ edition.workspace = true license = "Apache-2.0" homepage.workspace = true repository.workspace = true -description = "FRAME pallet based on seq-Phragmén election method." +description = "FRAME pezpallet based on seq-Phragmén election method." readme = "README.md" documentation = "https://docs.rs/pezpallet-elections-phragmen" diff --git a/bizinikiwi/pezframe/elections-phragmen/src/benchmarking.rs b/bizinikiwi/pezframe/elections-phragmen/src/benchmarking.rs index d91eac66..43890492 100644 --- a/bizinikiwi/pezframe/elections-phragmen/src/benchmarking.rs +++ b/bizinikiwi/pezframe/elections-phragmen/src/benchmarking.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! Elections-Phragmen pallet benchmarking. +//! Elections-Phragmen pezpallet benchmarking. #![cfg(feature = "runtime-benchmarks")] @@ -51,7 +51,7 @@ fn as_lookup(account: T::AccountId) -> AccountIdLookupOf { // Get a reasonable amount of stake based on the execution trait's configuration. fn default_stake(num_votes: u32) -> BalanceOf { let min = T::Currency::minimum_balance(); - Pallet::::deposit_of(num_votes as usize).max(min) + Pezpallet::::deposit_of(num_votes as usize).max(min) } // Get the current number of candidates. @@ -67,7 +67,7 @@ fn submit_candidates( (0..c) .map(|i| { let account = endowed_account::(prefix, i); - Pallet::::submit_candidacy( + Pezpallet::::submit_candidacy( RawOrigin::Signed(account.clone()).into(), candidate_count::(), ) @@ -96,7 +96,7 @@ fn submit_voter( votes: Vec, stake: BalanceOf, ) -> DispatchResultWithPostInfo { - Pallet::::vote(RawOrigin::Signed(caller).into(), votes, stake) + Pezpallet::::vote(RawOrigin::Signed(caller).into(), votes, stake) } // Create `num_voter` voters who randomly vote for at most `votes` of `all_candidates` if @@ -122,7 +122,7 @@ fn distribute_voters( fn fill_seats_up_to(m: u32) -> Result, &'static str> { submit_candidates_with_self_vote::(m, "fill_seats_up_to")?; assert_eq!(Candidates::::get().len() as u32, m, "wrong number of candidates."); - Pallet::::do_phragmen(); + Pezpallet::::do_phragmen(); assert_eq!(Candidates::::get().len(), 0, "some candidates remaining."); assert_eq!( Members::::get().len() + RunnersUp::::get().len(), @@ -325,7 +325,7 @@ mod benchmarks { let members_and_runners_up = fill_seats_up_to::(m)?; let bailing = members_and_runners_up[0].clone(); - assert!(Pallet::::is_member(&bailing)); + assert!(Pezpallet::::is_member(&bailing)); whitelist!(bailing); @@ -351,7 +351,7 @@ mod benchmarks { let members_and_runners_up = fill_seats_up_to::(m)?; let bailing = members_and_runners_up[T::DesiredMembers::get() as usize + 1].clone(); - assert!(Pallet::::is_runner_up(&bailing)); + assert!(Pezpallet::::is_runner_up(&bailing)); whitelist!(bailing); @@ -389,7 +389,7 @@ mod benchmarks { clean::(); fill_seats_up_to::(m)?; - let removing = as_lookup::(Pallet::::members_ids()[0].clone()); + let removing = as_lookup::(Pezpallet::::members_ids()[0].clone()); #[extrinsic_call] remove_member(RawOrigin::Root, removing, true, false); @@ -421,7 +421,7 @@ mod benchmarks { Candidates::::kill(); // Now everyone is defunct. - assert!(Voting::::iter().all(|(_, v)| Pallet::::is_defunct_voter(&v.votes))); + assert!(Voting::::iter().all(|(_, v)| Pezpallet::::is_defunct_voter(&v.votes))); assert_eq!(Voting::::iter().count() as u32, v); #[extrinsic_call] @@ -461,7 +461,7 @@ mod benchmarks { #[block] { - Pallet::::on_initialize(T::TermDuration::get()); + Pezpallet::::on_initialize(T::TermDuration::get()); } assert_eq!(Members::::get().len() as u32, T::DesiredMembers::get().min(c)); @@ -478,7 +478,7 @@ mod benchmarks { } impl_benchmark_test_suite! { - Pallet, + Pezpallet, tests::ExtBuilder::default().desired_members(13).desired_runners_up(7), tests::Test, exec_name = build_and_execute, diff --git a/bizinikiwi/pezframe/elections-phragmen/src/lib.rs b/bizinikiwi/pezframe/elections-phragmen/src/lib.rs index e2eade1e..d4fc4034 100644 --- a/bizinikiwi/pezframe/elections-phragmen/src/lib.rs +++ b/bizinikiwi/pezframe/elections-phragmen/src/lib.rs @@ -181,12 +181,12 @@ pub struct SeatHolder { pub deposit: Balance, } -pub use pallet::*; +pub use pezpallet::*; type AccountIdLookupOf = <::Lookup as StaticLookup>::Source; -#[pezframe_support::pallet] -pub mod pallet { +#[pezframe_support::pezpallet] +pub mod pezpallet { use super::*; use pezframe_support::pezpallet_prelude::*; use pezframe_system::pezpallet_prelude::*; @@ -194,18 +194,18 @@ pub mod pallet { /// The in-code storage version. const STORAGE_VERSION: StorageVersion = StorageVersion::new(4); - #[pallet::pallet] - #[pallet::storage_version(STORAGE_VERSION)] - #[pallet::without_storage_info] - pub struct Pallet(_); + #[pezpallet::pezpallet] + #[pezpallet::storage_version(STORAGE_VERSION)] + #[pezpallet::without_storage_info] + pub struct Pezpallet(_); - #[pallet::config] + #[pezpallet::config] pub trait Config: pezframe_system::Config { #[allow(deprecated)] type RuntimeEvent: From> + IsType<::RuntimeEvent>; - /// Identifier for the elections-phragmen pallet's lock - #[pallet::constant] + /// Identifier for the elections-phragmen pezpallet's lock + #[pezpallet::constant] type PalletId: Get; /// The currency that people are electing with. @@ -223,18 +223,18 @@ pub mod pallet { type CurrencyToVote: CurrencyToVote>; /// How much should be locked up in order to submit one's candidacy. - #[pallet::constant] + #[pezpallet::constant] type CandidacyBond: Get>; /// Base deposit associated with voting. /// - /// This should be sensibly high to economically ensure the pallet cannot be attacked by + /// This should be sensibly high to economically ensure the pezpallet cannot be attacked by /// creating a gigantic number of votes. - #[pallet::constant] + #[pezpallet::constant] type VotingBondBase: Get>; /// The amount of bond that need to be locked for each vote (32 bytes). - #[pallet::constant] + #[pezpallet::constant] type VotingBondFactor: Get>; /// Handler for the unbalanced reduction when a candidate has lost (and is not a runner-up) @@ -244,17 +244,17 @@ pub mod pallet { type KickedMember: OnUnbalanced>; /// Number of members to elect. - #[pallet::constant] + #[pezpallet::constant] type DesiredMembers: Get; /// Number of runners_up to keep. - #[pallet::constant] + #[pezpallet::constant] type DesiredRunnersUp: Get; /// How long each seat is kept. This defines the next block number at which an election /// round will happen. If set to zero, no elections are ever triggered and the module will /// be in passive mode. - #[pallet::constant] + #[pezpallet::constant] type TermDuration: Get>; /// The maximum number of candidates in a phragmen election. @@ -263,7 +263,7 @@ pub mod pallet { /// consider how it will impact `T::WeightInfo::election_phragmen`. /// /// When this limit is reached no more candidates are accepted in the election. - #[pallet::constant] + #[pezpallet::constant] type MaxCandidates: Get; /// The maximum number of voters to allow in a phragmen election. @@ -272,22 +272,22 @@ pub mod pallet { /// consider how it will impact `T::WeightInfo::election_phragmen`. /// /// When the limit is reached the new voters are ignored. - #[pallet::constant] + #[pezpallet::constant] type MaxVoters: Get; /// Maximum numbers of votes per voter. /// /// Warning: This impacts the size of the election which is run onchain. Chose wisely, and /// consider how it will impact `T::WeightInfo::election_phragmen`. - #[pallet::constant] + #[pezpallet::constant] type MaxVotesPerVoter: Get; - /// Weight information for extrinsics in this pallet. + /// Weight information for extrinsics in this pezpallet. type WeightInfo: WeightInfo; } - #[pallet::hooks] - impl Hooks> for Pallet { + #[pezpallet::hooks] + impl Hooks> for Pezpallet { /// What to do at the end of each block. /// /// Checks if an election needs to happen or not. @@ -341,8 +341,8 @@ pub mod pallet { } } - #[pallet::call] - impl Pallet { + #[pezpallet::call] + impl Pezpallet { /// Vote for a set of candidates for the upcoming round of election. This can be called to /// set the initial votes, or update already existing votes. /// @@ -362,8 +362,8 @@ pub mod pallet { /// /// It is the responsibility of the caller to **NOT** place all of their balance into the /// lock and keep some for further operations. - #[pallet::call_index(0)] - #[pallet::weight( + #[pezpallet::call_index(0)] + #[pezpallet::weight( T::WeightInfo::vote_more(votes.len() as u32) .max(T::WeightInfo::vote_less(votes.len() as u32)) .max(T::WeightInfo::vote_equal(votes.len() as u32)) @@ -371,7 +371,7 @@ pub mod pallet { pub fn vote( origin: OriginFor, votes: Vec, - #[pallet::compact] value: BalanceOf, + #[pezpallet::compact] value: BalanceOf, ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; @@ -427,8 +427,8 @@ pub mod pallet { /// This removes the lock and returns the deposit. /// /// The dispatch origin of this call must be signed and be a voter. - #[pallet::call_index(1)] - #[pallet::weight(T::WeightInfo::remove_voter())] + #[pezpallet::call_index(1)] + #[pezpallet::weight(T::WeightInfo::remove_voter())] pub fn remove_voter(origin: OriginFor) -> DispatchResult { let who = ensure_signed(origin)?; ensure!(Self::is_voter(&who), Error::::MustBeVoter); @@ -451,11 +451,11 @@ pub mod pallet { /// The number of current candidates must be provided as witness data. /// ## Complexity /// O(C + log(C)) where C is candidate_count. - #[pallet::call_index(2)] - #[pallet::weight(T::WeightInfo::submit_candidacy(*candidate_count))] + #[pezpallet::call_index(2)] + #[pezpallet::weight(T::WeightInfo::submit_candidacy(*candidate_count))] pub fn submit_candidacy( origin: OriginFor, - #[pallet::compact] candidate_count: u32, + #[pezpallet::compact] candidate_count: u32, ) -> DispatchResult { let who = ensure_signed(origin)?; @@ -498,8 +498,8 @@ pub mod pallet { /// - Renouncing::Candidate(count): O(count + log(count)) /// - Renouncing::Member: O(1) /// - Renouncing::RunnerUp: O(1) - #[pallet::call_index(3)] - #[pallet::weight(match *renouncing { + #[pezpallet::call_index(3)] + #[pezpallet::weight(match *renouncing { Renouncing::Candidate(count) => T::WeightInfo::renounce_candidacy_candidate(count), Renouncing::Member => T::WeightInfo::renounce_candidacy_members(), Renouncing::RunnerUp => T::WeightInfo::renounce_candidacy_runners_up(), @@ -559,8 +559,8 @@ pub mod pallet { /// /// ## Complexity /// - Check details of remove_and_replace_member() and do_phragmen(). - #[pallet::call_index(4)] - #[pallet::weight(if *rerun_election { + #[pezpallet::call_index(4)] + #[pezpallet::weight(if *rerun_election { T::WeightInfo::remove_member_without_replacement() } else { T::WeightInfo::remove_member_with_replacement() @@ -594,8 +594,8 @@ pub mod pallet { /// /// ## Complexity /// - Check is_defunct_voter() details. - #[pallet::call_index(5)] - #[pallet::weight(T::WeightInfo::clean_defunct_voters(*num_voters, *num_defunct))] + #[pezpallet::call_index(5)] + #[pezpallet::weight(T::WeightInfo::clean_defunct_voters(*num_voters, *num_defunct))] pub fn clean_defunct_voters( origin: OriginFor, num_voters: u32, @@ -613,8 +613,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 { /// A new term with new_members. This indicates that enough candidates existed to run /// the election, not that enough have been elected. The inner value must be examined @@ -644,7 +644,7 @@ pub mod pallet { }, } - #[pallet::error] + #[pezpallet::error] pub enum Error { /// Cannot vote when no candidates or members exist. UnableToVote, @@ -685,7 +685,7 @@ pub mod pallet { /// The current elected members. /// /// Invariant: Always sorted based on account id. - #[pallet::storage] + #[pezpallet::storage] pub type Members = StorageValue<_, Vec>>, ValueQuery>; @@ -693,7 +693,7 @@ pub mod pallet { /// /// Invariant: Always sorted based on rank (worse to best). Upon removal of a member, the /// last (i.e. _best_) runner-up will be replaced. - #[pallet::storage] + #[pezpallet::storage] pub type RunnersUp = StorageValue<_, Vec>>, ValueQuery>; @@ -703,27 +703,27 @@ pub mod pallet { /// Second element is the deposit. /// /// Invariant: Always sorted based on account id. - #[pallet::storage] + #[pezpallet::storage] pub type Candidates = StorageValue<_, Vec<(T::AccountId, BalanceOf)>, ValueQuery>; /// The total number of vote rounds that have happened, excluding the upcoming one. - #[pallet::storage] + #[pezpallet::storage] pub type ElectionRounds = StorageValue<_, u32, ValueQuery>; /// Votes and locked stake of a particular voter. /// /// TWOX-NOTE: SAFE as `AccountId` is a crypto hash. - #[pallet::storage] + #[pezpallet::storage] pub type Voting = StorageMap<_, Twox64Concat, T::AccountId, Voter>, ValueQuery>; - #[pallet::genesis_config] + #[pezpallet::genesis_config] #[derive(pezframe_support::DefaultNoBound)] pub struct GenesisConfig { pub members: Vec<(T::AccountId, BalanceOf)>, } - #[pallet::genesis_build] + #[pezpallet::genesis_build] impl BuildGenesisConfig for GenesisConfig { fn build(&self) { assert!( @@ -782,7 +782,7 @@ pub mod pallet { } } -impl Pallet { +impl Pezpallet { /// The deposit value of `count` votes. fn deposit_of(count: usize) -> BalanceOf { T::VotingBondBase::get() @@ -1156,13 +1156,13 @@ impl Pallet { } } -impl Contains for Pallet { +impl Contains for Pezpallet { fn contains(who: &T::AccountId) -> bool { Self::is_member(who) } } -impl SortedMembers for Pallet { +impl SortedMembers for Pezpallet { fn contains(who: &T::AccountId) -> bool { Self::is_member(who) } @@ -1171,7 +1171,7 @@ impl SortedMembers for Pallet { Self::members_ids() } - // A special function to populate members in this pallet for passing Origin + // A special function to populate members in this pezpallet for passing Origin // checks in runtime benchmarking. #[cfg(feature = "runtime-benchmarks")] fn add(who: &T::AccountId) { @@ -1189,7 +1189,7 @@ impl SortedMembers for Pallet { } } -impl ContainsLengthBound for Pallet { +impl ContainsLengthBound for Pezpallet { fn min_len() -> usize { 0 } @@ -1201,7 +1201,7 @@ impl ContainsLengthBound for Pallet { } #[cfg(any(feature = "try-runtime", test))] -impl Pallet { +impl Pezpallet { fn do_try_state() -> Result<(), TryRuntimeError> { Self::try_state_members()?; Self::try_state_runners_up()?; @@ -1264,8 +1264,8 @@ impl Pallet { // - Members and candidates sets are disjoint; // - Members and runners-ups sets are disjoint. fn try_state_members_disjoint() -> Result<(), TryRuntimeError> { - match Self::intersects(&Pallet::::members_ids(), &Self::candidates_ids()) && - Self::intersects(&Pallet::::members_ids(), &Self::runners_up_ids()) + match Self::intersects(&Pezpallet::::members_ids(), &Self::candidates_ids()) && + Self::intersects(&Pezpallet::::members_ids(), &Self::runners_up_ids()) { true => Err("Members set should be disjoint from candidates and runners-up sets".into()), @@ -1322,7 +1322,7 @@ mod tests { #[derive_impl(pezpallet_balances::config_preludes::TestDefaultConfig)] impl pezpallet_balances::Config for Test { - type AccountStore = pezframe_system::Pallet; + type AccountStore = pezframe_system::Pezpallet; } pezframe_support::parameter_types! { diff --git a/bizinikiwi/pezframe/elections-phragmen/src/migrations/mod.rs b/bizinikiwi/pezframe/elections-phragmen/src/migrations/mod.rs index e3d602f6..a165e326 100644 --- a/bizinikiwi/pezframe/elections-phragmen/src/migrations/mod.rs +++ b/bizinikiwi/pezframe/elections-phragmen/src/migrations/mod.rs @@ -15,9 +15,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! All migrations of this pallet. +//! All migrations of this pezpallet. -/// Migration to unreserve all pallet funds. +/// Migration to unreserve all pezpallet funds. pub mod unlock_and_unreserve_all_funds; /// Version 3. pub mod v3; diff --git a/bizinikiwi/pezframe/elections-phragmen/src/migrations/unlock_and_unreserve_all_funds.rs b/bizinikiwi/pezframe/elections-phragmen/src/migrations/unlock_and_unreserve_all_funds.rs index 8c94f7d4..de97b6f8 100644 --- a/bizinikiwi/pezframe/elections-phragmen/src/migrations/unlock_and_unreserve_all_funds.rs +++ b/bizinikiwi/pezframe/elections-phragmen/src/migrations/unlock_and_unreserve_all_funds.rs @@ -16,7 +16,7 @@ // limitations under the License. //! A migration that unreserves all deposit and unlocks all stake held in the context of this -//! pallet. +//! pezpallet. use alloc::{collections::btree_map::BTreeMap, vec::Vec}; use core::iter::Sum; @@ -41,14 +41,14 @@ pub trait UnlockConfig: 'static { type AccountId: Parameter + Ord; /// The currency type used in the runtime. /// - /// Should match the currency type previously used for the pallet, if applicable. + /// Should match the currency type previously used for the pezpallet, if applicable. type Currency: LockableCurrency + ReservableCurrency; - /// The name of the pallet as previously configured in + /// The name of the pezpallet as previously configured in /// [`construct_runtime!`](pezframe_support::construct_runtime). type PalletName: Get<&'static str>; /// The maximum number of votes per voter as configured previously in the previous runtime. type MaxVotesPerVoter: Get; - /// Identifier for the elections-phragmen pallet's lock, as previously configured in the + /// Identifier for the elections-phragmen pezpallet's lock, as previously configured in the /// runtime. type PalletId: Get; /// The DB weight as configured in the runtime to calculate the correct weight. @@ -86,18 +86,18 @@ type Voting = StorageMap< >; /// A migration that unreserves all deposit and unlocks all stake held in the context of this -/// pallet. +/// pezpallet. /// -/// Useful to prevent funds from being locked up when the pallet is being deprecated. +/// Useful to prevent funds from being locked up when the pezpallet is being deprecated. /// -/// The pallet should be made inoperable before this migration is run. +/// The pezpallet should be made inoperable before this migration is run. /// /// (See also [`RemovePallet`][pezframe_support::migrations::RemovePallet]) pub struct UnlockAndUnreserveAllFunds(core::marker::PhantomData); impl UnlockAndUnreserveAllFunds { /// Calculates and returns the total amounts deposited and staked by each account in the context - /// of this pallet. + /// of this pezpallet. /// /// The deposited and staked amounts are returned in two separate `BTreeMap` collections. /// @@ -177,20 +177,20 @@ where /// checks the integrity of deposited and reserved balances. /// /// Steps: - /// 1. Gets the deposited and staked balances for each account stored in this pallet. + /// 1. Gets the deposited and staked balances for each account stored in this pezpallet. /// 2. Collects actual pre-migration locked and reserved balances for each account. /// 3. Checks the integrity of the deposited and reserved balances. /// 4. Prints summary statistics about the state to be migrated. /// 5. Encodes and returns pre-migration data to be used in post_upgrade. /// /// Fails with a `TryRuntimeError` if there's a discrepancy between the amount - /// reported as staked by the pallet and the amount actually locked in `Balances`. + /// reported as staked by the pezpallet and the amount actually locked in `Balances`. #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, pezsp_runtime::TryRuntimeError> { use alloc::collections::btree_set::BTreeSet; use codec::Encode; - // Get staked and deposited balances as reported by this pallet. + // Get staked and deposited balances as reported by this pezpallet. let (account_deposited_sums, account_staked_sums, _) = Self::get_account_deposited_and_staked_sums(); @@ -206,7 +206,7 @@ where .collect(); // Total deposited for each account *should* be less than or equal to the total reserved, - // however this does not hold for all cases due to bugs in the reserve logic of this pallet. + // however this does not hold for all cases due to bugs in the reserve logic of this pezpallet. let bugged_deposits = all_accounts .iter() .filter(|account| { @@ -241,11 +241,11 @@ where /// Executes the migration. /// /// Steps: - /// 1. Retrieves the deposit and stake amounts from the pallet. + /// 1. Retrieves the deposit and stake amounts from the pezpallet. /// 2. Unreserves the deposited funds for each account. /// 3. Unlocks the staked funds for each account. fn on_runtime_upgrade() -> pezframe_support::weights::Weight { - // Get staked and deposited balances as reported by this pallet. + // Get staked and deposited balances as reported by this pezpallet. let (account_deposited_sums, account_staked_sums, initial_reads) = Self::get_account_deposited_and_staked_sums(); @@ -290,7 +290,7 @@ where BTreeMap::>::decode(&mut &account_reserved_before_bytes[..]) .map_err(|_| "Failed to decode account_reserved_before_bytes")?; - // Get deposited balances as reported by this pallet. + // Get deposited balances as reported by this pezpallet. let (account_deposited_sums, _, _) = Self::get_account_deposited_and_staked_sums(); // Check that the reserved balance is reduced by the expected deposited amount. @@ -300,7 +300,7 @@ where .get(&account) .unwrap_or(&Zero::zero()) // .min here to handle bugged deposits where actual_reserved_before is less than the - // amount the pallet reports is reserved + // amount the pezpallet reports is reserved .min(&actual_reserved_before); let expected_reserved_after = actual_reserved_before.saturating_sub(expected_amount_deducted); diff --git a/bizinikiwi/pezframe/elections-phragmen/src/migrations/v3.rs b/bizinikiwi/pezframe/elections-phragmen/src/migrations/v3.rs index c94d2c97..3f0c7716 100644 --- a/bizinikiwi/pezframe/elections-phragmen/src/migrations/v3.rs +++ b/bizinikiwi/pezframe/elections-phragmen/src/migrations/v3.rs @@ -18,7 +18,7 @@ //! Migrations to version [`3.0.0`], as denoted by the changelog. use super::super::LOG_TARGET; -use crate::{Config, Pallet}; +use crate::{Config, Pezpallet}; use alloc::vec::Vec; use codec::{Decode, Encode, FullCodec}; use pezframe_support::{ @@ -51,25 +51,25 @@ pub trait V2ToV3 { #[pezframe_support::storage_alias] type Candidates = - StorageValue, Vec<(::AccountId, ::Balance)>, ValueQuery>; + StorageValue, Vec<(::AccountId, ::Balance)>, ValueQuery>; #[pezframe_support::storage_alias] type Members = StorageValue< - Pallet, + Pezpallet, Vec::AccountId, ::Balance>>, ValueQuery, >; #[pezframe_support::storage_alias] type RunnersUp = StorageValue< - Pallet, + Pezpallet, Vec::AccountId, ::Balance>>, ValueQuery, >; #[pezframe_support::storage_alias] type Voting = StorageMap< - Pallet, + Pezpallet, Twox64Concat, ::AccountId, Voter<::AccountId, ::Balance>, @@ -88,7 +88,7 @@ pub fn apply( old_voter_bond: V::Balance, old_candidacy_bond: V::Balance, ) -> Weight { - let storage_version = StorageVersion::get::>(); + let storage_version = StorageVersion::get::>(); log::info!( target: LOG_TARGET, "Running migration for elections-phragmen with storage version {:?}", @@ -101,7 +101,7 @@ pub fn apply( migrate_runners_up_to_recorded_deposit::(old_candidacy_bond); migrate_members_to_recorded_deposit::(old_candidacy_bond); - StorageVersion::new(3).put::>(); + StorageVersion::new(3).put::>(); Weight::MAX } else { diff --git a/bizinikiwi/pezframe/elections-phragmen/src/migrations/v4.rs b/bizinikiwi/pezframe/elections-phragmen/src/migrations/v4.rs index 90a20c7c..0d6a4a1f 100644 --- a/bizinikiwi/pezframe/elections-phragmen/src/migrations/v4.rs +++ b/bizinikiwi/pezframe/elections-phragmen/src/migrations/v4.rs @@ -26,7 +26,7 @@ use pezframe_support::{ /// The old prefix. pub const OLD_PREFIX: &[u8] = b"PhragmenElection"; -/// Migrate the entire storage of this pallet to a new prefix. +/// Migrate the entire storage of this pezpallet to a new prefix. /// /// This new prefix must be the same as the one set in construct_runtime. For safety, use /// `PalletInfo` to get it, as: @@ -37,11 +37,11 @@ pub fn migrate>(new_pallet_name: N) -> Weight { if new_pallet_name.as_ref().as_bytes() == OLD_PREFIX { log::info!( target: LOG_TARGET, - "New pallet name is equal to the old prefix. No migration needs to be done.", + "New pezpallet name is equal to the old prefix. No migration needs to be done.", ); return Weight::zero(); } - let storage_version = StorageVersion::get::>(); + let storage_version = StorageVersion::get::>(); log::info!( target: LOG_TARGET, "Running migration to v4 for elections-phragmen with storage version {:?}", @@ -55,7 +55,7 @@ pub fn migrate>(new_pallet_name: N) -> Weight { new_pallet_name.as_ref().as_bytes(), ); - StorageVersion::new(4).put::>(); + StorageVersion::new(4).put::>(); ::BlockWeights::get().max_block } else { @@ -93,7 +93,7 @@ pub fn pre_migration>(new: N) { pezsp_core::hexdisplay::HexDisplay::from(&pezsp_io::storage::next_key(new.as_bytes()).unwrap()) ); // ensure storage version is 3. - assert_eq!(StorageVersion::get::>(), 3); + assert_eq!(StorageVersion::get::>(), 3); } /// Some checks for after migration. This can be linked to @@ -103,5 +103,5 @@ pub fn pre_migration>(new: N) { pub fn post_migration() { log::info!("post-migration elections-phragmen"); // ensure we've been updated to v4 by the automatic write of crate version -> storage version. - assert_eq!(StorageVersion::get::>(), 4); + assert_eq!(StorageVersion::get::>(), 4); } diff --git a/bizinikiwi/pezframe/elections-phragmen/src/weights.rs b/bizinikiwi/pezframe/elections-phragmen/src/weights.rs index 902a981f..8c3ff6f6 100644 --- a/bizinikiwi/pezframe/elections-phragmen/src/weights.rs +++ b/bizinikiwi/pezframe/elections-phragmen/src/weights.rs @@ -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_elections_phragmen +// --pezpallet=pezpallet_elections_phragmen // --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2 // --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/elections-phragmen/src/weights.rs // --wasm-execution=compiled diff --git a/bizinikiwi/pezframe/examples/authorization-tx-extension/Cargo.toml b/bizinikiwi/pezframe/examples/authorization-tx-extension/Cargo.toml index 3369180c..8e7251df 100644 --- a/bizinikiwi/pezframe/examples/authorization-tx-extension/Cargo.toml +++ b/bizinikiwi/pezframe/examples/authorization-tx-extension/Cargo.toml @@ -6,7 +6,7 @@ edition.workspace = true license = "MIT-0" homepage.workspace = true repository.workspace = true -description = "FRAME example authorization transaction extension pallet" +description = "FRAME example authorization transaction extension pezpallet" publish = false documentation = "https://docs.rs/pezpallet-example-authorization-tx-extension" diff --git a/bizinikiwi/pezframe/examples/authorization-tx-extension/src/extensions.rs b/bizinikiwi/pezframe/examples/authorization-tx-extension/src/extensions.rs index 401f67a9..f5244706 100644 --- a/bizinikiwi/pezframe/examples/authorization-tx-extension/src/extensions.rs +++ b/bizinikiwi/pezframe/examples/authorization-tx-extension/src/extensions.rs @@ -126,7 +126,7 @@ where let local_origin = Origin::Coowners(first_account, second_account); // Turn it into a local `PalletsOrigin`. let local_origin = ::PalletsOrigin::from(local_origin); - // Then finally into a pallet `RuntimeOrigin`. + // Then finally into a pezpallet `RuntimeOrigin`. let local_origin = ::RuntimeOrigin::from(local_origin); // Which the `set_caller_from` function will convert into the overarching `RuntimeOrigin` // created by `construct_runtime!`. diff --git a/bizinikiwi/pezframe/examples/authorization-tx-extension/src/lib.rs b/bizinikiwi/pezframe/examples/authorization-tx-extension/src/lib.rs index b5d33c52..ad3eb234 100644 --- a/bizinikiwi/pezframe/examples/authorization-tx-extension/src/lib.rs +++ b/bizinikiwi/pezframe/examples/authorization-tx-extension/src/lib.rs @@ -21,9 +21,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -//! # Authorization Transaction Extension Example Pallet +//! # Authorization Transaction Extension Example Pezpallet //! -//! **This pallet serves as an example and is not meant to be used in production.** +//! **This pezpallet serves as an example and is not meant to be used in production.** //! //! FRAME Transaction Extension reference implementation, origin mutation, origin authorization and //! integration in a `TransactionExtension` pipeline. @@ -31,7 +31,7 @@ //! The [TransactionExtension](pezsp_runtime::traits::TransactionExtension) used in this example is //! [AuthorizeCoownership](extensions::AuthorizeCoownership). If activated, the extension will //! authorize 2 signers as coowners, with a [coowner origin](pezpallet_coownership::Origin) specific to -//! the [coownership example pallet](pezpallet_coownership), by validating a signature of the rest of +//! the [coownership example pezpallet](pezpallet_coownership), by validating a signature of the rest of //! the transaction from each party. This means any extensions after ours in the pipeline, their //! implicits and the actual call. The extension pipeline used in our example checks the genesis //! hash, transaction version and mortality of the transaction after the `AuthorizeCoownership` runs @@ -41,7 +41,7 @@ //! In this example, aside from the [AuthorizeCoownership](extensions::AuthorizeCoownership) //! extension, we use the following pallets: //! - [pezpallet_coownership] - provides a coowner origin and the functionality to authorize it. -//! - [pezpallet_assets] - a dummy asset pallet that tracks assets, identified by an +//! - [pezpallet_assets] - a dummy asset pezpallet that tracks assets, identified by an //! [AssetId](pezpallet_assets::AssetId), and their respective owners, which can be either an //! [account](pezpallet_assets::Owner::Single) or a [pair of owners](pezpallet_assets::Owner::Double). //! @@ -56,7 +56,7 @@ //! ### Example usage #![doc = docify::embed!("src/tests.rs", create_coowned_asset_works)] //! -//! This example does not focus on any pallet logic or syntax, but rather on `TransactionExtension` +//! This example does not focus on any pezpallet logic or syntax, but rather on `TransactionExtension` //! functionality. The pallets used are just skeletons to provide storage state and custom origin //! choices and requirements, as shown in the examples. Any weight and/or //! transaction fee is out of scope for this example. @@ -75,12 +75,12 @@ extern crate alloc; use pezframe_support::pezpallet_prelude::*; use pezframe_system::pezpallet_prelude::*; -#[pezframe_support::pallet(dev_mode)] +#[pezframe_support::pezpallet(dev_mode)] pub mod pezpallet_coownership { use super::*; use pezframe_support::traits::OriginTrait; - #[pallet::config] + #[pezpallet::config] pub trait Config: pezframe_system::Config { /// The aggregated origin which the dispatch will take. type RuntimeOrigin: OriginTrait @@ -91,12 +91,12 @@ pub mod pezpallet_coownership { type PalletsOrigin: From> + TryInto, Error = Self::PalletsOrigin>; } - #[pallet::pallet] - pub struct Pallet(_); + #[pezpallet::pezpallet] + pub struct Pezpallet(_); - /// Origin that this pallet can authorize. For the purposes of this example, it's just two + /// Origin that this pezpallet can authorize. For the purposes of this example, it's just two /// accounts that own something together. - #[pallet::origin] + #[pezpallet::origin] #[derive( Clone, PartialEq, @@ -113,7 +113,7 @@ pub mod pezpallet_coownership { } } -#[pezframe_support::pallet(dev_mode)] +#[pezframe_support::pezpallet(dev_mode)] pub mod pezpallet_assets { use super::*; @@ -126,7 +126,7 @@ pub mod pezpallet_assets { Double(AccountId, AccountId), } - #[pallet::config] + #[pezpallet::config] pub trait Config: pezframe_system::Config { /// Type that can authorize an account pair coowner origin. type CoownerOrigin: EnsureOrigin< @@ -136,26 +136,26 @@ pub mod pezpallet_assets { } /// Map that holds the owner information for each asset it manages. - #[pallet::storage] + #[pezpallet::storage] pub type AssetOwners = StorageMap<_, Blake2_128Concat, AssetId, Owner<::AccountId>>; - #[pallet::pallet] - pub struct Pallet(_); + #[pezpallet::pezpallet] + pub struct Pezpallet(_); - #[pallet::error] + #[pezpallet::error] pub enum Error { /// Asset already exists. AlreadyExists, } - #[pallet::call] - impl Pallet { + #[pezpallet::call] + impl Pezpallet { /// Simple call that just creates an asset with a specific `AssetId`. This call will fail if /// there is already an asset with the same `AssetId`. /// /// The origin is either a single account (traditionally signed origin) or a coowner origin. - #[pallet::call_index(0)] + #[pezpallet::call_index(0)] pub fn create_asset(origin: OriginFor, asset_id: AssetId) -> DispatchResult { let owner: Owner = match T::CoownerOrigin::try_origin(origin) { Ok((first, second)) => Owner::Double(first, second), diff --git a/bizinikiwi/pezframe/examples/authorization-tx-extension/src/mock.rs b/bizinikiwi/pezframe/examples/authorization-tx-extension/src/mock.rs index 90f3095c..f8fef716 100644 --- a/bizinikiwi/pezframe/examples/authorization-tx-extension/src/mock.rs +++ b/bizinikiwi/pezframe/examples/authorization-tx-extension/src/mock.rs @@ -65,7 +65,7 @@ mod example_runtime { pub type Signature = MultiSignature; pub type BlockNumber = u32; - // For testing the pallet, we construct a mock runtime. + // For testing the pezpallet, we construct a mock runtime. pezframe_support::construct_runtime!( pub enum Runtime { @@ -92,7 +92,7 @@ mod example_runtime { type BenchmarkHelper = (); } - /// Type that enables any pallet to ask for a coowner origin. + /// Type that enables any pezpallet to ask for a coowner origin. pub struct EnsureCoowner; impl EnsureOrigin for EnsureCoowner { type Success = (AccountId, AccountId); diff --git a/bizinikiwi/pezframe/examples/basic/Cargo.toml b/bizinikiwi/pezframe/examples/basic/Cargo.toml index 98057ee1..2fe4d1c7 100644 --- a/bizinikiwi/pezframe/examples/basic/Cargo.toml +++ b/bizinikiwi/pezframe/examples/basic/Cargo.toml @@ -6,7 +6,7 @@ edition.workspace = true license = "MIT-0" homepage.workspace = true repository.workspace = true -description = "FRAME example pallet" +description = "FRAME example pezpallet" readme = "README.md" publish = false documentation = "https://docs.rs/pezpallet-example-basic" diff --git a/bizinikiwi/pezframe/examples/basic/README.md b/bizinikiwi/pezframe/examples/basic/README.md index 0424593a..2fd9f047 100644 --- a/bizinikiwi/pezframe/examples/basic/README.md +++ b/bizinikiwi/pezframe/examples/basic/README.md @@ -1,13 +1,13 @@ -# Basic Example Pallet +# Basic Example Pezpallet -The Example: A simple example of a FRAME pallet demonstrating +The Example: A simple example of a FRAME pezpallet demonstrating concepts, APIs and structures common to most FRAME runtimes. -Run `cargo doc --package pezpallet-example-basic --open` to view this pallet's documentation. +Run `cargo doc --package pezpallet-example-basic --open` to view this pezpallet's documentation. -**This pallet serves as an example and is not meant to be used in production.** +**This pezpallet serves as an example and is not meant to be used in production.** ## Documentation Guidelines @@ -15,8 +15,8 @@ Run `cargo doc --package pezpallet-example-basic --open` to view this pallet's d