Search in sources :

Example 1 with WorldDslProcessor

use of co.rsk.test.dsl.WorldDslProcessor in project rskj by rsksmart.

the class DslFilesTest method runAccounts01Resource.

@Test
public void runAccounts01Resource() throws FileNotFoundException, DslProcessorException {
    DslParser parser = DslParser.fromResource("dsl/accounts01.txt");
    World world = new World();
    WorldDslProcessor processor = new WorldDslProcessor(world);
    processor.processCommands(parser);
    Assert.assertNotNull(world.getAccountByName("acc1"));
}
Also used : WorldDslProcessor(co.rsk.test.dsl.WorldDslProcessor) DslParser(co.rsk.test.dsl.DslParser) Test(org.junit.Test)

Example 2 with WorldDslProcessor

use of co.rsk.test.dsl.WorldDslProcessor in project rskj by rsksmart.

the class DslFilesTest method runContracts05Resource.

@Test
public void runContracts05Resource() throws FileNotFoundException, DslProcessorException {
    DslParser parser = DslParser.fromResource("dsl/contracts05.txt");
    World world = new World();
    WorldDslProcessor processor = new WorldDslProcessor(world);
    processor.processCommands(parser);
}
Also used : WorldDslProcessor(co.rsk.test.dsl.WorldDslProcessor) DslParser(co.rsk.test.dsl.DslParser) Test(org.junit.Test)

Example 3 with WorldDslProcessor

use of co.rsk.test.dsl.WorldDslProcessor in project rskj by rsksmart.

the class DslFilesTest method runContracts01Resource.

@Test
public void runContracts01Resource() throws FileNotFoundException, DslProcessorException {
    DslParser parser = DslParser.fromResource("dsl/contracts01.txt");
    World world = new World();
    WorldDslProcessor processor = new WorldDslProcessor(world);
    processor.processCommands(parser);
}
Also used : WorldDslProcessor(co.rsk.test.dsl.WorldDslProcessor) DslParser(co.rsk.test.dsl.DslParser) Test(org.junit.Test)

Example 4 with WorldDslProcessor

use of co.rsk.test.dsl.WorldDslProcessor in project rskj by rsksmart.

the class DslFilesTest method runContracts04Resource.

@Test
public void runContracts04Resource() throws FileNotFoundException, DslProcessorException {
    DslParser parser = DslParser.fromResource("dsl/contracts04.txt");
    World world = new World();
    WorldDslProcessor processor = new WorldDslProcessor(world);
    processor.processCommands(parser);
}
Also used : WorldDslProcessor(co.rsk.test.dsl.WorldDslProcessor) DslParser(co.rsk.test.dsl.DslParser) Test(org.junit.Test)

Example 5 with WorldDslProcessor

use of co.rsk.test.dsl.WorldDslProcessor in project rskj by rsksmart.

the class DslFilesTest method runUncles03Resource.

@Test
public void runUncles03Resource() throws FileNotFoundException, DslProcessorException {
    DslParser parser = DslParser.fromResource("dsl/uncles03.txt");
    World world = new World();
    WorldDslProcessor processor = new WorldDslProcessor(world);
    processor.processCommands(parser);
    Assert.assertNotNull(world.getBlockByName("b01"));
    Assert.assertNotNull(world.getBlockByName("u01"));
    Assert.assertNotNull(world.getBlockByName("u02"));
    Assert.assertNotNull(world.getBlockByName("b02"));
    Assert.assertNotNull(world.getBlockByName("c02"));
    Assert.assertEquals(2, world.getBlockChain().getStatus().getBestBlock().getNumber());
}
Also used : WorldDslProcessor(co.rsk.test.dsl.WorldDslProcessor) DslParser(co.rsk.test.dsl.DslParser) Test(org.junit.Test)

Aggregations

WorldDslProcessor (co.rsk.test.dsl.WorldDslProcessor)43 Test (org.junit.Test)43 DslParser (co.rsk.test.dsl.DslParser)42 World (co.rsk.test.World)24 Block (org.ethereum.core.Block)13 Account (org.ethereum.core.Account)7 BigInteger (java.math.BigInteger)6 Transaction (org.ethereum.core.Transaction)6 DslProcessorException (co.rsk.test.dsl.DslProcessorException)2 TransactionInfo (org.ethereum.db.TransactionInfo)2 BlockChainStatus (co.rsk.core.bc.BlockChainStatus)1 DataWord (org.ethereum.vm.DataWord)1