Skip to content

Instantly share code, notes, and snippets.

@ascjones
ascjones / substrate-metadata-v14-migration.md
Last active Oct 18, 2021
Migration guide for Substrate Metadata V14
View substrate-metadata-v14-migration.md

Substrate Runtime Builders

When updating to use the latest Substrate with V14 metadata, your runtime will fail to compile.

The following steps are required to make your pallets/runtime compatible. The compiler will guide you...

  • Remove any #[pallet::metadata(..)] attributes from the pallet Event definition.
  • Add scale-info dependency to pallet and runtime crates:
    • scale-info = { version = "1.0.0", default-features = false, features = ["derive"] }
    • std = [ "scale-info/std" ]
View substrate-node-runtime-metadata-v14.json
This file has been truncated, but you can view the full file.
[
1635018093,
{
"V14": {
"types": {
"types": [
{
"path": [
"sp_core",
@ascjones
ascjones / polkadot-metadata0.json
Created Jun 21, 2021
polkadot scale-info metadata
View polkadot-metadata0.json
This file has been truncated, but you can view the full file.
[
1635018093,
{
"V14": {
"types": {
"types": [
{
"path": [
"sp_core",
View flipper.wat
(module
(type (;0;) (func (param i32 i32) (result i32)))
(type (;1;) (func (param i32 i32 i32) (result i32)))
(type (;2;) (func (param i32 i32)))
(type (;3;) (func (param i32 i32 i32)))
(type (;4;) (func (param i32) (result i32)))
(type (;5;) (func (param i32)))
(type (;6;) (func (result i32)))
(type (;7;) (func (param i32) (result i64)))
(import "seal0" "seal_get_storage" (func (;0;) (type 1)))
@ascjones
ascjones / metadata-v13.json
Last active Apr 14, 2021
Substrate `node-runtime` metadata with `scale-info` type metadata, everything except errors metadata
View metadata-v13.json
This file has been truncated, but you can view the full file.
[
1635018093,
{
"V13": {
"types": {
"types": [
{
"path": [
"sp_core",
View scale-info-box1.rs
use std::any;
struct Type;
trait TypeInfo {
fn type_info() -> Type;
fn wrapped_type_id() -> Option<any::TypeId> {
None
}
View scale-info-generics.rs
use std::any;
mod meta_type {
use super::*;
use super::TypeInfo;
use std::cmp::Ordering;
#[derive(Clone, Eq, PartialEq, PartialOrd, Ord, Debug)]
pub enum MetaType {
Parameter(MetaTypeParameter),
View 699.log
2019-07-10 10:37:30.954 main-tokio-7 INFO substrate Idle (0 peers), best: #698 (0x42e4…3615), finalized #698 (0x42e4…3615), ⬇ 0 ⬆ 0
2019-07-10 10:37:31.249 jsonrpc-eventloop-0 DEBUG rpc Response: {"jsonrpc":"2.0","result":"0xc0282bc8bc7e85e87dbd080c37bbfd81ffe8b03de775ad4d062ebb0cf7642c14","id":472}.
2019-07-10 10:37:31.253 jsonrpc-eventloop-0 DEBUG rpc Response: {"jsonrpc":"2.0","result":1,"id":478}.
2019-07-10 10:37:31.254 jsonrpc-eventloop-0 DEBUG rpc Response: {"jsonrpc":"2.0","result":2,"id":479}.
2019-07-10 10:37:31.254 jsonrpc-eventloop-0 DEBUG rpc Response: {"jsonrpc":"2.0","result":3,"id":474}.
2019-07-10 10:37:31.254 jsonrpc-eventloop-0 DEBUG rpc Response: {"jsonrpc":"2.0","result":4,"id":475}.
2019-07-10 10:37:31.254 jsonrpc-eventloop-0 DEBUG rpc Response: {"jsonrpc":"2.0","result":5,"id":476}.
2019-07-10 10:37:31.254 jsonrpc-eventloop-0 DEBUG rpc Response: {"jsonrpc":"2.0","result":6,"id":477}.
2019-07-10 10:37:31.254 jsonrpc-eventloop-0 DEBUG rpc Response: {"jsonrpc":"2.0","result":7,"id
View keybase.md

Keybase proof

I hereby claim:

  • I am ascjones on github.
  • I am ascjones (https://keybase.io/ascjones) on keybase.
  • I have a public key ASBTq9RVfmKxJwI8qnHwlnEq2P7FItUz0kuPzITwwCBJBwo

To claim this, I am signing this object:

@ascjones
ascjones / FindConflictingReferences.fsx
Last active Jan 12, 2016
Script to find conflicting .NET assembly references
View FindConflictingReferences.fsx
// translated to F# Script from https://gist.github.com/brianlow/1553265
open System.IO
open System.Reflection
type Reference = {
Assembly : AssemblyName
ReferencedAssembly : AssemblyName
}