コード例 #1
0
def test_create_transfer_testnet():
    from lunespy.tx.transfer import transfer_token_factory
    from lunespy.wallet import wallet_factory

    sender = wallet_factory(chain=0)
    receiver = wallet_factory(chain=0)

    transfer_token_factory(
        sender_public_key=sender.public_key,
        receiver_address=receiver.address,
        amount=1000,
        chain=0
    )
コード例 #2
0
def sender():
    from lunespy.wallet import wallet_factory

    return wallet_factory(
        private_key="8YMbX5BCQdazwgdVfeUpKuoUJrmYpMyGVAGAsNaHVj1u"
    )
コード例 #3
0
        'recipient': '37xRcbn1LiT1Az4REoLhjpca93jPG1gTEwq',
        'sender': '37tQRv7x2RHd32Ss2i1EFTWSTSsqkwXcaBe',
        'timestamp': 1650250375987,
        'amount': 100000000000,
        'signature': '',
        'fee': 1000000,
        'feeAsset': '',
        'assetId': '',
        'type': 4
    }


@mark.parametrize(
    "sender, receiver, result",
    [
        [wallet_factory(chain=1), wallet_factory(chain=0), False],
        [wallet_factory(chain=0), wallet_factory(chain=1), False],
    ]
)
def test_invalid_create_transfer(sender: Wallet, receiver: Wallet, result):
    from lunespy.tx.transfer import transfer_token_factory

    assert same_chain_address(sender.address, receiver.address) == result
    with raises(ValidationError):
        transfer_token_factory(
            sender_public_key=sender.public_key,
            receiver_address=receiver.address,
            amount=1000,
            chain=sender.chain
        )
コード例 #4
0
def receiver():
    from lunespy.wallet import wallet_factory

    return wallet_factory(
        private_key="G6E2xNBWtsRG8XBDmeTQQxZNHHUa6K9dnc9KrYtKyGwM"
    )
コード例 #5
0
def account_from_private_key_testnet():
    private_key = "BnafXBSq1VDUdZ1nSjJoxhnQdBv2hk3o6dbV49TD1bzo"
    return wallet_factory(private_key=private_key, chain=0)
コード例 #6
0
def test_create_account_from_seed_testnet_with_nonces_0_1_2_3_4(
        nonce, address):
    seed = "scrub guard swim catch range upon dawn ensure segment alpha sentence spend effort bar benefit"
    assert wallet_factory(seed=seed, nonce=nonce, chain=0).address == address
コード例 #7
0
def account_from_new_seed_mainnet():
    return wallet_factory()
コード例 #8
0
def account_from_seed_testnet():
    seed = "scrub guard swim catch range upon dawn ensure segment alpha sentence spend effort bar benefit"
    return wallet_factory(seed=seed, chain=0)
コード例 #9
0
def account_from_new_seed_testnet():
    return wallet_factory(chain=0)