@pytest.mark.integration
def test_send_raw_transaction_and_get_balance(stubbed_sender, stubbed_receiver, test_http_client):
    'Test sending a raw transaction to localnet.'
    resp = test_http_client.get_recent_blockhash(Finalized)
    assert_valid_response(resp)
    recent_blockhash = resp['result']['value']['blockhash']
    transfer_tx = Transaction(recent_blockhash=recent_blockhash).add(sp.transfer(sp.TransferParams(from_pubkey=stubbed_sender.public_key, to_pubkey=stubbed_receiver, lamports=1000)))
    transfer_tx.sign(stubbed_sender)
    resp = test_http_client.send_raw_transaction(transfer_tx.serialize())
    assert_valid_response(resp)
    test_http_client.confirm_transaction(resp['result'])
    resp = test_http_client.get_balance(stubbed_sender.public_key)
    assert_valid_response(resp)
    assert (resp['result']['value'] == 9999988000)
    resp = test_http_client.get_balance(stubbed_receiver)
    assert_valid_response(resp)
    assert (resp['result']['value'] == 1954)
Test sending a raw transaction to localnet.
@pytest.mark.integration
def test_send_raw_transaction_and_get_balance(stubbed_sender, stubbed_receiver, test_http_client):
    
    resp = test_http_client.get_recent_blockhash(Finalized)
    assert_valid_response(resp)
    recent_blockhash = resp['result']['value']['blockhash']
    transfer_tx = Transaction(recent_blockhash=recent_blockhash).add(sp.transfer(sp.TransferParams(from_pubkey=stubbed_sender.public_key, to_pubkey=stubbed_receiver, lamports=1000)))
    transfer_tx.sign(stubbed_sender)
    resp = test_http_client.send_raw_transaction(transfer_tx.serialize())
    assert_valid_response(resp)
    test_http_client.confirm_transaction(resp['result'])
    resp = test_http_client.get_balance(stubbed_sender.public_key)
    assert_valid_response(resp)
    assert (resp['result']['value'] == 9999988000)
    resp = test_http_client.get_balance(stubbed_receiver)
    assert_valid_response(resp)
    assert (resp['result']['value'] == 1954)