use of org.aion.precompiled.contracts.ATB.ErrCode in project aion by aionnetwork.
the class BridgeRingInitializationTest method testRingMultiMemberInitialization.
@Test
public void testRingMultiMemberInitialization() {
byte[][] members = new byte[][] { HashUtil.h256("member1".getBytes()), HashUtil.h256("member2".getBytes()), HashUtil.h256("member3".getBytes()), HashUtil.h256("member4".getBytes()), HashUtil.h256("member5".getBytes()) };
ErrCode code = this.controller.ringInitialize(OWNER_ADDR.toByteArray(), members);
assertThat(code).isEqualTo(ErrCode.NO_ERROR);
assertThat(this.connector.getMemberCount()).isEqualTo(5);
assertThat(this.connector.getMinThresh()).isEqualTo(3);
}
use of org.aion.precompiled.contracts.ATB.ErrCode in project aion by aionnetwork.
the class BridgeRingInitializationTest method testRingEmptyInitialization.
@Test
public void testRingEmptyInitialization() {
ErrCode code = this.controller.ringInitialize(OWNER_ADDR.toByteArray(), new byte[][] {});
assertThat(code).isEqualTo(ErrCode.NO_ERROR);
assertThat(this.connector.getMemberCount()).isEqualTo(0);
assertThat(this.connector.getMinThresh()).isEqualTo(1);
}
use of org.aion.precompiled.contracts.ATB.ErrCode in project aion by aionnetwork.
the class BridgeRingInitializationTest method testRingInitializationNotOwner.
@Test
public void testRingInitializationNotOwner() {
byte[] notOwner = HashUtil.h256("not owner".getBytes());
ErrCode code = this.controller.ringInitialize(notOwner, new byte[][] {});
assertThat(code).isEqualTo(ErrCode.NOT_OWNER);
assertThat(this.connector.getMemberCount()).isEqualTo(0);
assertThat(this.connector.getMinThresh()).isEqualTo(0);
}
use of org.aion.precompiled.contracts.ATB.ErrCode in project aion by aionnetwork.
the class BridgeRingInitializationTest method testRingSingleMemberInitialization.
@Test
public void testRingSingleMemberInitialization() {
ErrCode code = this.controller.ringInitialize(OWNER_ADDR.toByteArray(), new byte[][] { OWNER_ADDR.toByteArray() });
assertThat(code).isEqualTo(ErrCode.NO_ERROR);
assertThat(this.connector.getMemberCount()).isEqualTo(1);
assertThat(this.connector.getMinThresh()).isEqualTo(1);
}
Aggregations