Skip to content

Instantly share code, notes, and snippets.

property("serialization symmetry") =
Prop.forAll(BlockchainElementsGenerator.blockHeader) { header =>
BlockHeader(header.hex) == header
}
(* If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
*
* Find the sum of all the multiples of 3 or 5 below 1000.
*)
let rec find_multiples counter accum =
let x = 3 * counter in
let y = 5 * counter in
if ((List.exists (fun a -> x == a) accum)) then
match (y < 1000) with
/** Updates all of the given ts in the database */
def updateAll(ts: Seq[T]): Future[Seq[T]] = {
val query = findAll(ts)
val actions = ts.map(t => query.update(t))
val affectedRows: Future[Seq[Int]] = database.run(DBIO.sequence(actions))
val updatedTs = findAll(ts)
affectedRows.flatMap { _ =>
database.run(updatedTs.result)
}
}
"asm": "06226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f OP_WITHDRAWPROOFVERIFY"
"scriptSig": {
"asm": "5032504800000000000000000000000000000000d0
0000002040d6c07880b9d27e0c0056d5ed631e8fd0cc69ea257d2778a306ff5cb354ef71a4d3af4c96c81b208ba4ea85c6111381d09f0562501341cb7783262a961b4f88e8adbd58ffff7f200000000002000000020ddfc236182b5d23d1f098f62c5e84c0be6d364a7b5a1cad2d536987eb54957026eaf23d94a9a417a1777338b0039e5c160a1ab175d007d46693034d634619a60105 1 01000000013101107756ee12408d3bbdfc63f077ae8ca957eea5714ae9a4023cbd566cd0ea0000000049483045022100b204a2f4d73302cdb52ecfbd85dd85ae8395bf6de1c875c1eea96140763ede8d02207a31a84b17a546dca8af08a5f5c76be0da5eb35a013e2e5bbd0383c731a705ba01feffffff0228021024010000001976a914f596590deaf7f3afa453baf305d1cd7c7ca4523988ac00e1f5050000000017a914588ead1f4ba4e8b0b6b2da36f3f727296f46ee358765000000 1 1",
"hex": "285032504800000000000000000000000000000000d76885e2754fcd108c0204eab323e071e24e9a984c970000002040d6c07880b9d27e0c0056d5ed631e8fd0cc69ea257d2778a306ff5cb354ef71a4d3af4c96c81b208ba4ea85c6111381d09f0562501341cb7783262a961b4f88e8adbd58ffff7f20000

Oracle Explorer API

List all announcements

curl  -X GET http://localhost:9000/v2/announcements

This endpoint returns a JSON array of announcement objects.

const CScript redeemScript = std::get<0>(spk_keys);
const std::vector<CKey> keys = std::get<1>(spk_keys);
//hash the spk
const CScript p2sh = GetScriptForDestination(CScriptID(redeemScript));
//return sign(std::make_tuple(p2sh,keys));
const int inputIndex = 0;
//const CScript spk = std::get<0>(spk_keys);
//const std::vector<CKey> keys = std::get<1>(spk_keys);
CBasicKeyStore store;
for (const auto k: keys) {