Skip to content

Commit

Permalink
remove copyright from license headers
Browse files Browse the repository at this point in the history
  • Loading branch information
UtkarshBhardwaj007 committed Jan 7, 2025
1 parent 2814f87 commit 0795afc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// This file is part of 'custom-pallet'.

// Copyright (C) 2025 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: MIT-0

// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// This file is part of 'custom-pallet'.

// Copyright (C) 2025 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: MIT-0

// Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ You now have the bare minimum of package dependencies that your pallet requires
2. Prepare the scaffolding for the pallet by adding the following:

```rust
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:21:36'
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:43:43'
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:204:204'
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:20:35'
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:42:42'
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:203:203'
```

3. Verify that it compiles by running the following command:
Expand All @@ -118,7 +118,7 @@ In this step, you will configure two essential components that are critical for
Add the following `Config` trait definition to your pallet:

```rust
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:34:43'
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:33:42'
```

### Add Events
Expand All @@ -144,7 +144,7 @@ Below are the events defined for this pallet:
Define the events in the pallet as follows:
```rust
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:45:71'
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:44:70'
```
### Add Storage Items
Expand All @@ -158,7 +158,7 @@ Storage items are used to manage the pallet's state. This pallet defines two ite
Define the storage items as follows:

```rust
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:73:79'
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:72:78'
```

### Implement Custom Errors
Expand All @@ -170,7 +170,7 @@ To add custom errors, use the `#[pallet::error]` macro to define the `Error` enu
Add the following errors to the pallet:
```rust
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:81:91'
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:80:90'
```
### Implement Calls
Expand All @@ -180,10 +180,10 @@ The `#[pallet::call]` macro defines the dispatchable functions (or calls) the pa
The structure of the dispatchable calls in this pallet is as follows:

```rust
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:93:104'
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:119:130'
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:163:174'
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:202:203'
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:92:103'
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:118:129'
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:162:173'
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:201:202'
```

Below you can find the implementations of each dispatchable call in this pallet:
Expand All @@ -200,7 +200,7 @@ Below you can find the implementations of each dispatchable call in this pallet:
- Emits a `CounterValueSet` event on success
```rust
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:95:119'
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:94:118'
```
???- function "increment(origin: OriginFor<T>, amount_to_increment: u32) -> DispatchResult"
Expand All @@ -217,7 +217,7 @@ Below you can find the implementations of each dispatchable call in this pallet:
- Emits a `CounterIncremented` event on success
```rust
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:121:163'
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:120:162'
```
Expand All @@ -235,7 +235,7 @@ Below you can find the implementations of each dispatchable call in this pallet:
- Emits a `CounterDecremented` event on success
```rust
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:165:202'
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs:164:201'
```
## Verify Compilation
Expand All @@ -256,7 +256,7 @@ To review this implementation, you can find the complete pallet code below:
???+ example "Complete Pallet Code"
```rust
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs::204'
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/build-custom-pallet/src/lib.rs::203'
```
## Where to Go Next
Expand All @@ -271,4 +271,4 @@ To review this implementation, you can find the complete pallet code below:
[:octicons-arrow-right-24: Get Started](/tutorials/polkadot-sdk/parachains/zero-to-hero/pallet-unit-testing/)
</div>
</div>

0 comments on commit 0795afc

Please sign in to comment.