Search in sources :

Example 1 with BridgeController

use of org.aion.precompiled.contracts.ATB.BridgeController in project aion by aionnetwork.

the class BridgeControllerOwnerTest method beforeEach.

@Before
public void beforeEach() {
    IExternalStateForPrecompiled worldState = ExternalStateForTests.usingDefaultRepository();
    this.connector = new BridgeStorageConnector(worldState, CONTRACT_ADDR);
    PrecompiledTransactionContext context = dummyContext();
    this.logs = context.getLogs();
    this.controller = new BridgeController(connector, this.logs, CONTRACT_ADDR, OWNER_ADDR);
}
Also used : IExternalStateForPrecompiled(org.aion.precompiled.type.IExternalStateForPrecompiled) PrecompiledTransactionContext(org.aion.precompiled.type.PrecompiledTransactionContext) BridgeStorageConnector(org.aion.precompiled.contracts.ATB.BridgeStorageConnector) BridgeController(org.aion.precompiled.contracts.ATB.BridgeController) Before(org.junit.Before)

Example 2 with BridgeController

use of org.aion.precompiled.contracts.ATB.BridgeController in project aion by aionnetwork.

the class BridgeRingInitializationTest method beforeEach.

@Before
public void beforeEach() {
    IExternalStateForPrecompiled worldState = ExternalStateForTests.usingDefaultRepository();
    this.connector = new BridgeStorageConnector(worldState, CONTRACT_ADDR);
    this.controller = new BridgeController(connector, dummyContext().getLogs(), CONTRACT_ADDR, OWNER_ADDR);
    this.controller.initialize();
}
Also used : IExternalStateForPrecompiled(org.aion.precompiled.type.IExternalStateForPrecompiled) BridgeStorageConnector(org.aion.precompiled.contracts.ATB.BridgeStorageConnector) BridgeController(org.aion.precompiled.contracts.ATB.BridgeController) Before(org.junit.Before)

Example 3 with BridgeController

use of org.aion.precompiled.contracts.ATB.BridgeController in project aion by aionnetwork.

the class BridgeControllerRingTest method beforeEach.

@Before
public void beforeEach() {
    IExternalStateForPrecompiled worldState = ExternalStateForTests.usingDefaultRepository();
    this.connector = new BridgeStorageConnector(worldState, CONTRACT_ADDR);
    this.controller = new BridgeController(connector, dummyContext().getLogs(), CONTRACT_ADDR, OWNER_ADDR);
    this.controller.initialize();
    byte[][] memberList = new byte[members.length][];
    for (int i = 0; i < members.length; i++) {
        memberList[i] = members[i].getAddress();
    }
    // setup initial ring structure
    this.controller.ringInitialize(OWNER_ADDR.toByteArray(), memberList);
}
Also used : IExternalStateForPrecompiled(org.aion.precompiled.type.IExternalStateForPrecompiled) BridgeStorageConnector(org.aion.precompiled.contracts.ATB.BridgeStorageConnector) BridgeController(org.aion.precompiled.contracts.ATB.BridgeController) Before(org.junit.Before)

Aggregations

BridgeController (org.aion.precompiled.contracts.ATB.BridgeController)3 BridgeStorageConnector (org.aion.precompiled.contracts.ATB.BridgeStorageConnector)3 IExternalStateForPrecompiled (org.aion.precompiled.type.IExternalStateForPrecompiled)3 Before (org.junit.Before)3 PrecompiledTransactionContext (org.aion.precompiled.type.PrecompiledTransactionContext)1