struct LeafSize(u32);
struct ParentSize(u32);
struct NodeSize(u32);
impl LeafSize {
// returns None when leafs in (0, 1)
fn sibling(self, leafs: LeafSize) -> Option<LeafSize>;
This file contains hidden or 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
| # file generated from go.mod using vgo2nix (https://github.com/adisbladis/vgo2nix) | |
| [ | |
| { | |
| goPackagePath = "github.com/cespare/xxhash/v2"; | |
| fetch = { | |
| type = "git"; | |
| url = "https://github.com/yihuang/test-golang-module-major-version"; | |
| rev = "4a13e4bfd5a9"; | |
| sha256 = "0i1bpw3v73jhwnpa8vv276qhy39fk6qhgyci0wng9mwr2pxfha5y"; | |
| moduleDir = ""; |
This file contains hidden or 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
| [package] | |
| name = "open-rpc-test" | |
| version = "0.1.0" | |
| authors = ["yihuang <yi.codeplayer@gmail.com>"] | |
| edition = "2018" | |
| [dependencies] | |
| schemars = "0.7" | |
| serde = "1.0" | |
| serde_json = "1.0" |
This file contains hidden or 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 std::cell::RefCell; | |
| use std::collections::HashMap; | |
| use std::net::TcpStream; | |
| use std::rc::Rc; | |
| use std::sync::atomic::{AtomicUsize, Ordering}; | |
| use std::sync::Arc; | |
| use anyhow::Result; | |
| use easy_parallel::Parallel; | |
| use futures::channel::{mpsc, oneshot}; |
-- current validator state, in memory.
create table validator (
staking_address primary key,
bonded_coins btree_indexed,
voting_power = bonded_coins / 10000_0000,
validator_address unique_indexed,
council_node_info json,
proposer_stat int, -- or vote_stat
punishment json null,1、Run the docker version of PostgreSQL 12
$ docker run --rm -p 5432:5432 -v /tmp:/data -e POSTGRES_USER=exchange -e POSTGRES_DB=exchange -e POSTGRES_PASSWORD=123456 postgres:12-alpine
2、Download the attached files to /tmp
3、Import the schema and data
$ docker exec -it $CONTAINER psql -U exchange exchange -f /data/t_order_schema.sql
$ docker exec -it $CONTAINER psql -U exchange exchange -f /data/t_order_data.sql
This file contains hidden or 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 std::fmt; | |
| trait Listener where Self: Sized + fmt::Debug { | |
| fn on_event(&self, obj: &TestObject<Self>, args: &str); | |
| } | |
| #[derive(Debug)] | |
| struct TestObject<F> where F:Listener { | |
| listener: F | |
| } |
This file contains hidden or 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
| {-# LANGUAGE GADTs, KindSignatures, DataKinds #-} | |
| module Test where | |
| data Test = | |
| Test1 { test1 :: Int } | |
| | Test2 { test2 :: Int } | |
| data TestBranch = TTest1 | TTest2 | |
| data Test' (a :: TestBranch) where | |
| Test'1 :: { test'1 :: Int } -> Test' TTest1 |