Esempio n. 1
0
using namespace stellar::txtest;

typedef std::unique_ptr<Application> appPtr;

// add data
// change data
// remove data
// remove data that isn't there
// add too much data
TEST_CASE("manage data", "[tx][managedata]")
{
    Config const& cfg = getTestConfig();

    VirtualClock clock;
    ApplicationEditableVersion app{clock, cfg};
    auto& db = app.getDatabase();

    app.start();

    // set up world
    auto root = TestAccount::createRoot(app);

    const int64_t minBalance = app.getLedgerManager().getMinBalance(3) - 100;

    auto gateway = root.create("gw", minBalance);

    DataValue value, value2;
    value.resize(64);
    value2.resize(64);
    for (int n = 0; n < 64; n++)
    {
#include "test/test.h"
#include "util/Logging.h"
#include "util/make_unique.h"

using namespace stellar;
using namespace stellar::txtest;

typedef std::unique_ptr<Application> appPtr;

TEST_CASE("change trust", "[tx][changetrust]")
{
    Config const& cfg = getTestConfig();

    VirtualClock clock;
    ApplicationEditableVersion app{clock, cfg};
    Database& db = app.getDatabase();

    app.start();

    // set up world
    auto root = TestAccount::createRoot(app);
    auto const minBalance2 = app.getLedgerManager().getMinBalance(2);
    auto gateway = root.create("gw", minBalance2);
    Asset idrCur = makeAsset(gateway, "IDR");

    SECTION("basic tests")
    {
        // create a trustline with a limit of 0
        REQUIRE_THROWS_AS(root.changeTrust(idrCur, 0),
                          ex_CHANGE_TRUST_INVALID_LIMIT);