This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM Delete eval folder with licence key and options.xml which contains a reference to it | |
for %%I in ("WebStorm", "IntelliJ", "CLion", "Rider", "GoLand", "PhpStorm", "Resharper", "PyCharm") do ( | |
for /d %%a in ("%USERPROFILE%\.%%I*") do ( | |
rd /s /q "%%a/config/eval" | |
del /q "%%a\config\options\other.xml" | |
) | |
) | |
REM Delete registry key and jetbrains folder (not sure if needet but however) | |
rmdir /s /q "%APPDATA%\JetBrains" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use crate::{mock::*, Error, Event}; | |
use frame_support::{assert_noop, assert_ok}; | |
use crate::{Config, Pallet}; | |
use sp_runtime::traits::AccountIdConversion; | |
use frame_support::traits::fungibles::Mutate; | |
use crate::mock::{new_test_ext, Test}; | |
#[cfg(test)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Look at `../interface/` to better understand this API. | |
impl<T: Config> pba_interface::DexInterface for Pallet<T> { | |
type AccountId = T::AccountId; | |
type AssetId = <T::Fungibles as fungibles::Inspect<Self::AccountId>>::AssetId; | |
type AssetBalance = <T::Fungibles as fungibles::Inspect<Self::AccountId>>::Balance; | |
fn setup_account(_who: Self::AccountId) -> DispatchResult { | |
unimplemented!() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# FRAME Assignment Instructions | |
This assignment is a project covering the material you've learned about writing Substrate runtimes with FRAME. | |
To complete this project, **select one of the following challenges**, and implement the runtime described using FRAME. | |
The [pallets included](./pallets/) may be used as a base to work in for the option you select. | |
## Main Challenges | |
These are the same challenges we have used for the previous academies. We have reviewed and graded many of these projects, and many students have be successful with these projects. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//! # FRAME-less Runtime | |
//! | |
//! Welcome to the `FRAME-less` exercise, the fourth edition. | |
//! | |
//! > This assignment is based on Joshy's experiment years ago to explore building a Substrate | |
//! > runtime using pure Rust. If you learn something new in this exercise, attribute it to his | |
//! > work. | |
//! | |
//! Parts of this assignment resembles the `mini_substrate` section of the pre-course material. It | |
//! is recommended to re-familiarize yourself with that if you have done it. Nonetheless, everything |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test ideas | |
//! - Only signed extrinsics are accepted, so you will learn signature verification. | |
//! - Basic calls for testing/learning, mainly represented in [`shared::RuntimeCall::System`]. | |
//! - Basic currency system. | |
//! - Basic staking/reserving system. | |
//! - Nonce system, to prevent replay attacks and similar issues. | |
//! - Tipping, which is there to mimic transaction fee payment. | |
//! Checks that must happen in apply phase are those that are mandatory to make sure a blockchain is | |
//! sound and safe. These include: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use super::*; | |
fn empty_wallet() -> Wallet { | |
Wallet::new(vec![].into_iter()) | |
} | |
pub fn wallet_with_alice() -> Wallet { | |
Wallet::new(vec![Address::Alice].into_iter()) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use super::*; | |
use super::test_utils::*; | |
pub fn wallet_with_alice() -> Wallet { | |
Wallet::new(vec![Address::Alice].into_iter()) | |
} | |
mod tests { | |
use super::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Share any code fast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: UNLICENSED | |
pragma solidity 0.8.18; | |
contract Level_2_Solution { | |
function solution(uint256[10] calldata unsortedArray) | |
external pure returns (uint256[10] memory) { | |
uint256[10] memory sortedArray = unsortedArray; | |
if(sortedArray[0] > sortedArray[8]) { | |
(sortedArray[0], sortedArray[8]) = (sortedArray[8], sortedArray[0]); |
NewerOlder