Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Alex Siman siman

🏠
Working from home
Block or report user

Report or block siman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View substrate-playground.ts
import { Substrate } from "../cli/substrate";
import { arrayToOneLineString, prettyClass, prettyEntity } from '../cli/printers';
import { AddClassSchemaInputType } from '../types/AddClassSchemaTypes';
const classId = 1
const entityId = 1
const schemaId = 0
// tslint:disable-next-line:max-func-body-length
async function main() {
View simple-pluralize.tsx
function pluralize(count: number | BN, singluarText: string, plularText?: string) {
count = typeof count !== 'number' ? count.toNumber() : count;
const plural = () => !plularText ? singluarText + 's' : singluarText;
const text = count === 1 ? singluarText : plural()
return <><b>{count}</b> {text}</>
}
@siman
siman / Web3-Foundation-tasks-for-blockchain-hackathon-Kyiv-Sep-2019.md
Created Sep 17, 2019
Web3 Foundation tasks for blockchain hackathon. Kyiv, Sep 21-22, 2019.
View Web3-Foundation-tasks-for-blockchain-hackathon-Kyiv-Sep-2019.md

Вознаграждение от Web3 Foundation в размере $500 получит команд(а/ы), которая предложит качественное решение на блокчейне фреймворке Substrate или же, если это решение связано с инфраструктурой Polkadot Network. В качестве примеров, могут быть проекты на такую тему:

  • Альтернативные реализации тех модулей (SRML), которые уже идут в составе Substrate. Например:
    • Упрощенный модуль для балансов "balances" без locking, vesting, etc.
    • Упрощенный модуль для голосования "voting" с квадратическим голосованием.
    • Альтернативная реализация модуля "treasury"
    • и т.д.
@siman
siman / joystream-new-class.schema.json
Last active Sep 10, 2019
Joystream class JSON schema with example
View joystream-new-class.schema.json
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "TODO: An URL of this schema. Ideally at Joystream.org. Example: https://joystream.org/new-class.schema.json",
"title": "JoystreamNewClass",
"description": "JSON schema to describe a new class for Joystream network",
"type": "object",
"additionalProperties": false,
"required": [
"name"
],
View joystream-podcast-episode-schema.json
{
"name": "PodcastEpisode",
"description": "Joystream class schema for a podcast episode",
"properties": [
{
"name": "title",
"type": "Text",
"required": true,
"maxTextLength": 100
},
View substrate-versioned-storage-property-array.rs
// Copyright 2019 Jsgenesis.
//
// This 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 Substrate. If not, see <http://www.gnu.org/licenses/>.
@siman
siman / visual-code-user-settings.json
Last active Jun 30, 2019
Visual Studio Code with Rust syntax. You need to install "dark-plus-syntax" theme before.
View visual-code-user-settings.json
{
"window.zoomLevel": 1,
"gitlens.settings.mode": "advanced",
"eslint.enable": false,
"files.autoSave": "onFocusChange",
"files.associations": {
"*.css": "scss"
},
"editor.wordWrap": "on",
"editor.renderWhitespace": "boundary",
View update-category-substrate.rs
/// Update category
fn update_category(origin, category_id: CategoryId, new_archival_status: Option<bool>, new_deletion_status: Option<bool>) -> dispatch::Result {
// Check that its a valid signature
let who = ensure_signed(origin)?;
// Not signed by forum SUDO
Self::ensure_is_forum_sudo(&who)?;
// Get path from parent to root of category tree.
View failed-to-create-a-forum-category-joystream.log
2019-06-14 10:20:30 Pre-sealed block for proposal at 314. Hash now 0xc150f6008b89ddad85a1db7f2976d53e91589cc737ade8d2057df2d8b0c5ed89, previously 0x351a1639359a4abd3a48212b123983e058a19c8a281bd25e8c2176c05436e350.
Hash: given=b09cdf4b661fb442f526f1607a8eb10427d755bbd4af0130533de12cba5af141, expected=91cdf8fb9afc1ef94623dfe0fa413b700893f320a2fb0ddbf2be04cda8808549
====================
stack backtrace:
0: substrate_panic_handler::set::{{closure}}::h41c84304a3d7b8c9 (0x10a7674a0)
1: std::panicking::rust_panic_with_hook::hfcf2d0777bc6c409 (0x10a8c6ad0)
2: std::panicking::begin_panic::hf60a109f4abac58e (0x10a469be4)
3: srml_executive::Executive<System,Block,Context,Payment,AllModules>::execute_block::h3266066fafbe65cf (0x10a43156c)
You can’t perform that action at this time.