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
package gossip_test | |
import ( | |
"context" | |
"github.com/iwasaki-kenta/gossip" | |
"github.com/perlin-network/noise" | |
"github.com/perlin-network/noise/kademlia" | |
"github.com/stretchr/testify/assert" | |
"go.uber.org/goleak" | |
"sync" |
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
package gossip_test | |
import ( | |
"context" | |
"github.com/iwasaki-kenta/gossip" | |
"github.com/perlin-network/noise" | |
"github.com/perlin-network/noise/kademlia" | |
"github.com/stretchr/testify/assert" | |
"go.uber.org/goleak" | |
"sync" |
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
package gossip_test | |
import ( | |
"context" | |
"github.com/iwasaki-kenta/gossip" | |
"github.com/perlin-network/noise" | |
"github.com/perlin-network/noise/kademlia" | |
"github.com/stretchr/testify/assert" | |
"go.uber.org/goleak" | |
"sync" |
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
export class Deferred<T> { | |
promise: Promise<T>; | |
resolve: (value?: T | PromiseLike<T>) => void; | |
reject: (reason?: any) => void; | |
constructor() { | |
this.promise = new Promise((resolve, reject) => { | |
this.resolve = resolve; | |
this.reject = reject; | |
}); |
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
import {Bucket, CuckooFilter} from "../src/cuckoo"; | |
import {hash} from "../src/crypto"; | |
import {assert} from "chai"; | |
import {SmartBuffer} from "smart-buffer"; | |
describe('CuckooFilter', () => { | |
it('sets and gets properly', () => { | |
const filter = new CuckooFilter(4, 100, 500); | |
for (let i = 0; i < 100; i++) { |
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
/usr/bin/python3 /home/kenta/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/183.5912.18/helpers/pydev/pydevd.py --multiproc --qt-support=auto --client 127.0.0.1 --port 44917 --file /home/kenta/Desktop/himitsu/main.py | |
pydev debugger: process 28305 is connecting | |
Connected to pydev debugger (build 183.5912.18) | |
Node 10 is proposing 5 transaction(s) to be finalized into Block 1. | |
Node 1 is proposing 5 transaction(s) to be finalized into Block 1. | |
Node 5 is proposing 3 transaction(s) to be finalized into Block 1. | |
Node 4 is proposing 2 transaction(s) to be finalized into Block 1. | |
Node 15 is proposing 2 transaction(s) to be finalized into Block 1. | |
Node 3 is proposing 5 transaction(s) to be finalized into Block 1. |
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
[package] | |
name = "chat" | |
version = "0.1.0" | |
authors = ["Kenta Iwasaki <[email protected]>"] | |
edition = "2018" | |
[profile.release] | |
lto = true | |
[lib] |
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
await client.pollConsensus({ | |
onRoundEnded: msg => { | |
(async () => { | |
await contract.fetchAndPopulateMemoryPages(); | |
console.log("Chat logs updated:", contract.test('get_messages', BigInt(0))); | |
})(); | |
} | |
}); |
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
await contract.call(...[ | |
{type: "uint32", value: 32}, // Pass in an unsigned little-endian 32-bit integer. | |
{type: "int64", value: JSBI.BigInt(-100000000)}, // Pass in a signed little-endian 64-bit integer. | |
{type: "string", value: "Another string"}, // Pass in a string. | |
{type: "raw", value: "hexadecimal_string_here_to_be_decoded_into_raw_bytes"}] // Pass in raw bytes hex-encoded. | |
) |
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
await contract.call( | |
wallet, | |
'send_message', | |
JSBI.BigInt(0), // amount to send | |
JSBI.BigInt(250000), // gas limit | |
JSBI.BigInt(0), // gas deposit (not explained) | |
{type: "string", value: "Your chat message here!"}, | |
); |
NewerOlder