Esempio n. 1
0
def test_set_operations() -> None:
    """Tests that a keypair is now hashable with the appropriate set operations."""
    keypair_primary = Keypair.generate()
    keypair_secondary = Keypair.generate()
    keypair_duplicate = keypair_secondary
    keypair_set = {keypair_primary, keypair_secondary, keypair_duplicate}
    assert keypair_primary.__hash__() != keypair_secondary.__hash__()
    assert keypair_secondary.__hash__() == keypair_duplicate.__hash__()
    assert len(keypair_set) == 2
def get_audio_token(solana_client: Client):
    if WAUDIO_MINT_PUBKEY is None:
        logger.error(
            "cache_user_balance.py | Missing Required SPL Confirguration")
        return None
    waudio_token = Token(
        conn=solana_client,
        pubkey=WAUDIO_MINT_PUBKEY,
        program_id=SPL_TOKEN_PROGRAM_ID_PUBKEY,
        payer=Keypair.generate(
        ),  # not making any txs so payer is not required
    )
    return waudio_token
Esempio n. 3
0
def test_generate_keypair() -> None:
    """Test .generate constructor works."""
    keypair = Keypair.generate()
    assert len(keypair.secret_key) == 64