Skip to content

Commit

Permalink
[FIX] - Refactoring testing section (#248)
Browse files Browse the repository at this point in the history
* fix: testing refactor

* Apply suggestions from code review

Co-authored-by: Erin Shaben <[email protected]>

* fix: references and snippets

* fix: adding cards

* Apply suggestions from code review

Co-authored-by: Dawn Kelly <[email protected]>

* Update develop/parachains/testing/mock-runtime.md

Co-authored-by: Dawn Kelly <[email protected]>

* Tutorials > Interoperability > XCM Transfers (#221)

* fix: add wip

* fix: adding last sections

* fix: wording

* fix: structure

* Apply suggestions from code review

Co-authored-by: 0xLucca <[email protected]>

* fix: adding links

* fix: images structure

* fix: paraphrasing

* fix: paraphrasing

* Update tutorials/interoperability/xcm-transfers/from-relaychain-to-parachain.md

Co-authored-by: Erin Shaben <[email protected]>

* Update tutorials/interoperability/xcm-transfers/from-relaychain-to-parachain.md

Co-authored-by: Erin Shaben <[email protected]>

* fix: table

* fix: adding papi tutorial

* fix: paraphrasing

* fix: moving code to snippet

* fix: snippet

* Update tutorials/interoperability/xcm-transfers/from-relaychain-to-parachain.md

Co-authored-by: 0xLucca <[email protected]>

* Update tutorials/interoperability/xcm-transfers/from-relaychain-to-parachain.md

Co-authored-by: 0xLucca <[email protected]>

* Update tutorials/interoperability/xcm-transfers/from-relaychain-to-parachain.md

Co-authored-by: 0xLucca <[email protected]>

* fix: feedback

* fix: snippet

* fix: link

---------

Co-authored-by: 0xLucca <[email protected]>
Co-authored-by: Erin Shaben <[email protected]>

* [FIX] - Adding references to tutorials (#230)

* fix: adding reference to tutorials on asset hub page

* Add xcm channels

* Add runtime upgrades

* Add chain spec

* Add custom parachains

* fix: adding chopsticks

* fix: zombienet

* Update develop/parachains/get-started/build-custom-parachains.md

Co-authored-by: Nicolás Hussein <[email protected]>

* fix: xcm channels references

* fix: generate chain specs references

* fix: generate chain specs 'where to go next'

* fix: build custom parachains references

* fix: runtime upgrades references

* fix: chopsticks get started references

* fix: zombienet get started references

* fix: asset hub references

* fix: add existing pallets references

* fix: add smart contract funcionality references

* fix: make custom pallet references

* fix: pallet testing references

* fix: generate chain specs references

* fix: adding comment in build custom parachains

* fix: deploy parachain to polkadot references

* fix: setup references

* fix: consensus get started references removed

* fix: architecture parachains references

---------

Co-authored-by: 0xLucca <[email protected]>
Co-authored-by: 0xLucca <[email protected]>

* Tutorials > Polkadot SDK > Parachains > Build Custom Pallet > Build the Pallet (#232)

* wip: build-pallet

* Page ready

* Improvements

* Extract code snippets

* Description and grammarly

* fix: typo

* Add suggestions

* Update tutorials/polkadot-sdk/parachains/build-custom-pallet/build-pallet.md

Co-authored-by: Nicolás Hussein <[email protected]>

* Add root origin reference

* Apply suggestions from code review

Co-authored-by: Erin Shaben <[email protected]>

* Apply fmt

* Apply suggestions from code review

Co-authored-by: Erin Shaben <[email protected]>

* Apply suggestions from code review

Co-authored-by: Nicolás Hussein <[email protected]>

* Apply fixes

---------

Co-authored-by: nhussein11 <[email protected]>
Co-authored-by: Nicolás Hussein <[email protected]>
Co-authored-by: Erin Shaben <[email protected]>

* fix: hidding polkaVM instances and adding informational banner (#251)

* Restructure Get Started section (#246)

* Remove get-started section

* Remove build and deploy pages

* Apply suggestions from code review

Co-authored-by: Erin Shaben <[email protected]>

---------

Co-authored-by: Erin Shaben <[email protected]>

* Tutorials > Polkadot SDK > Parachains > Build Custom Pallet > Pallet Unit Testing (#233)

* fix: wip

* fix: adding snippets

* fix: typo

* Apply suggestions from code review

Co-authored-by: 0xLucca <[email protected]>

* fix: updating mock runtime\

* fix: snippets comments

* fix: typo

* fix: closing expandable elements

* fix: overflow

* fix: overflow

* Update tutorials/polkadot-sdk/parachains/build-custom-pallet/pallet-unit-testing.md

Co-authored-by: Erin Shaben <[email protected]>

* fix: feedback

* fix: clean up the add tutorial branch

* Update tutorials/polkadot-sdk/parachains/build-custom-pallet/pallet-unit-testing.md

Co-authored-by: Erin Shaben <[email protected]>

---------

Co-authored-by: 0xLucca <[email protected]>
Co-authored-by: Erin Shaben <[email protected]>

* fix: feedback applied on mock runtime desc

* fix: adding further resources

* Update develop/parachains/testing/mock-runtime.md

Co-authored-by: Kian Paimani <[email protected]>

* fix: glossary runtime reference

* fix: paraphrasing according to feedback

* fix: paraphrasing

* corrects "benchmark testing" to "benchmarking" throughout the page

* Apply suggestions from code review

Co-authored-by: Dawn Kelly <[email protected]>

* Update develop/parachains/testing/benchmarking.md

Co-authored-by: Dawn Kelly <[email protected]>

* Update develop/parachains/testing/pallet-testing.md

Co-authored-by: Dawn Kelly <[email protected]>

* Update develop/parachains/testing/pallet-testing.md

Co-authored-by: Dawn Kelly <[email protected]>

* Update develop/parachains/testing/pallet-testing.md

Co-authored-by: Dawn Kelly <[email protected]>

* fix: adding reference to polkadot sdk guide

* fix: curly aphostrophes

* Update develop/parachains/testing/mock-runtime.md

Co-authored-by: Dawn Kelly <[email protected]>

* Update develop/parachains/testing/mock-runtime.md

Co-authored-by: Dawn Kelly <[email protected]>

* fix: feedback

* fix: feedback

---------

Co-authored-by: Erin Shaben <[email protected]>
Co-authored-by: Dawn Kelly <[email protected]>
Co-authored-by: 0xLucca <[email protected]>
Co-authored-by: 0xLucca <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
Co-authored-by: DAWN KELLY <[email protected]>
  • Loading branch information
7 people committed Jan 8, 2025
1 parent 500ae96 commit de18bb3
Show file tree
Hide file tree
Showing 27 changed files with 296 additions and 231 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
(AccountId32::from([1u8; 32]), 2_000_000_000_000),
];

let mut t = frame_system::GenesisConfig::<Runtime>::default()
let mut t = frame_system::GenesisConfig::<Test>::default()
.build_storage()
.unwrap();

// Adding balances configuration to the genesis config
pallet_balances::GenesisConfig::<Runtime> {
pallet_balances::GenesisConfig::<Test> {
balances: initial_balances,
}
.assimilate_storage(&mut t)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
pub mod tests {
use crate::*;
use sp_runtime::BuildStorage;

#[frame_support::runtime]
mod runtime {
#[runtime::runtime]
#[runtime::derive(
RuntimeCall,
RuntimeEvent,
RuntimeError,
RuntimeOrigin,
RuntimeFreezeReason,
RuntimeHoldReason,
RuntimeSlashReason,
RuntimeLockId,
RuntimeTask
)]
pub struct Test;

#[runtime::pallet_index(0)]
pub type System = frame_system::Pallet<Test>;

// Other pallets...
}

pub fn new_test_ext() -> sp_io::TestExternalities {
frame_system::GenesisConfig::<Test>::default()
.build_storage()
.unwrap()
.into()
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub mod integration_testing {
pub mod tests {
use crate::*;
// ...
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
pub mod tests {
use crate::*;

#[frame_support::runtime]
mod runtime {
#[runtime::runtime]
#[runtime::derive(
RuntimeCall,
RuntimeEvent,
RuntimeError,
RuntimeOrigin,
RuntimeFreezeReason,
RuntimeHoldReason,
RuntimeSlashReason,
RuntimeLockId,
RuntimeTask
)]
pub struct Test;

#[runtime::pallet_index(0)]
pub type System = frame_system::Pallet<Test>;

// Other pallets...
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Test {
...
type Index = u64;
Expand All @@ -6,4 +7,10 @@ impl frame_system::Config for Test {
type Hashing = BlakeTwo256;
type AccountId = u64;
...
}

impl pallet_template::Config for Test {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = ();
...
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#[frame_support::runtime]
mod runtime {
// The main runtime
#[runtime::runtime]
// Runtime Types to be generated
#[runtime::derive(
RuntimeCall,
RuntimeEvent,
RuntimeError,
RuntimeOrigin,
RuntimeFreezeReason,
RuntimeHoldReason,
RuntimeSlashReason,
RuntimeLockId,
RuntimeTask
)]
pub struct Test;

#[runtime::pallet_index(0)]
pub type System = frame_system::Pallet<Test>;

#[runtime::pallet_index(1)]
pub type Template = pallet_template::Pallet<Test>;
}
11 changes: 0 additions & 11 deletions .snippets/code/develop/parachains/testing/setup/genesis-config.rs

This file was deleted.

4 changes: 1 addition & 3 deletions develop/parachains/customize-parachain/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ nav:
- 'Overview (FRAME)': overview.md
- 'Add Existing Pallets': add-existing-pallets.md
- 'Add Smart Contract Functionality': add-smart-contract-functionality.md
- 'Make a Custom Pallet': make-custom-pallet.md
- 'Pallet Testing': pallet-testing.md
- 'Benchmark Testing': benchmarking.md
- 'Make a Custom Pallet': make-custom-pallet.md
119 changes: 0 additions & 119 deletions develop/parachains/customize-parachain/pallet-testing.md

This file was deleted.

5 changes: 3 additions & 2 deletions develop/parachains/testing/.pages
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
title: Testing
nav:
- index.md
- 'Setup': setup.md
- 'Runtime': runtime.md
- 'Mock Runtime': mock-runtime.md
- 'Pallet Testing': pallet-testing.md
- 'Benchmarking': benchmarking.md
Loading

0 comments on commit de18bb3

Please sign in to comment.