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 hashlib | |
from cryptography.hazmat.backends import default_backend | |
from cryptography.hazmat.primitives.serialization import Encoding, PrivateFormat, NoEncryption, pkcs12 | |
from ecdsa import keys | |
from getpass import getpass | |
from radix_engine_toolkit import Address, PrivateKey, PublicKey, derive_virtual_account_address_from_public_key, OlympiaNetwork | |
NETWORK_ID: int = OlympiaNetwork.MAINNET.value |
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
/* A proof-of-concept for reusing a TestRunner after long-running init (e.g. deploying the initial packages) to speed up tests. */ | |
// | |
use std::sync::{Once}; | |
static mut SNAP: Option<TestRunnerSnapshot> = None; | |
static mut DATA: Option<TestData> = None; | |
static INIT: Once = Once::new(); | |
/* The data that is set during init and needs to be shared with all the tests */ | |
#[derive(Clone)] |
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
public static async fromString(manifestText: string): Promise<ManifestBuilder> { | |
const instructions = await RadixEngineToolkit.Instructions.convert( | |
{ | |
"kind": "String", | |
"value": manifestText | |
}, | |
NetworkId.Mainnet, | |
"Parsed" | |
); |
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
<@754961345123844136> If I understood correctly, then here is an example that does what you've described: | |
```rs | |
use scrypto::prelude::*; | |
#[derive(Clone, Debug, ScryptoSbor)] | |
pub enum Invocation { | |
Function { | |
package_address: PackageAddress, | |
blueprint_name: String, |
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
# Used by Docker Compose: https://docs.docker.com/compose/env-file/ | |
################################# | |
# NETWORK GATEWAY CONFIGURATION # | |
################################# | |
# The logical network name which the nodes you connect to must match with | |
# EG mainnet | stokenet | localnet |
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
-- Validators leaderboard | |
WITH validator_data AS ( | |
SELECT t.validator_id, t.name | |
FROM public.validator_data_substates t | |
WHERE name IS NOT NULL | |
AND down_state_version IS NULL | |
ORDER BY t.validator_id | |
), | |
staked_amounts AS ( | |
SELECT v.name, t.inferred_action_amount / pow(10, 18) as amount |
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 main | |
import ( | |
"bytes" | |
"crypto/ecdsa" | |
"encoding/hex" | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"log" |
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
WITH validator_data AS ( | |
SELECT t.validator_id, t.name | |
FROM public.validator_data_substates t | |
WHERE name IS NOT NULL | |
AND down_state_version IS NULL | |
ORDER BY t.validator_id | |
) | |
(SELECT k.epoch, '<- Current Epoch' as validator, Null as proposals_missed, Null as proposals_completed | |
FROM validator_proposal_records k |
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
-- Average balances per account | |
WITH balances AS ( | |
SELECT abh.balance as balance, | |
abh.account_id | |
FROM account_resource_balance_history abh | |
where abh.resource_id = 1 AND abh.to_state_version is null | |
), | |
staked_balances AS ( | |
SELECT | |
account_id, |
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 com.radixdlt.crypto.ECDSASignature; | |
import com.radixdlt.crypto.ECKeyPair; | |
import com.radixdlt.crypto.ECPublicKey; | |
import com.radixdlt.crypto.exception.PrivateKeyException; | |
import com.radixdlt.crypto.exception.PublicKeyException; | |
import com.radixdlt.identifiers.REAddr; | |
import com.radixdlt.networks.Addressing; | |
import com.radixdlt.networks.Network; | |
import com.radixdlt.utils.Bytes; | |
import lombok.extern.slf4j.Slf4j; |
NewerOlder