fix: constructor
This commit is contained in:
parent
407add9aa5
commit
43535882dc
@ -7,9 +7,9 @@ contract KitabuValidators {
|
|||||||
address constant SYSTEM_ADDRESS =
|
address constant SYSTEM_ADDRESS =
|
||||||
0xffffFFFfFFffffffffffffffFfFFFfffFFFfFFfE;
|
0xffffFFFfFFffffffffffffffFfFFFfffFFFfFFfE;
|
||||||
address public admissionController =
|
address public admissionController =
|
||||||
0x77Bea3320Fa46aFF3C7c128B83F5E436596Ba73D;
|
0x9F57B4A25638F3bdfFcB1F3d2902860601a1Aa65;
|
||||||
|
|
||||||
address[] public validators;
|
address[] validators;
|
||||||
|
|
||||||
bool public finalized;
|
bool public finalized;
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ contract KitabuValidators {
|
|||||||
_;
|
_;
|
||||||
}
|
}
|
||||||
|
|
||||||
modifier pendingFinalization() {
|
modifier alreadyFinalized() {
|
||||||
require(finalized);
|
require(finalized);
|
||||||
_;
|
_;
|
||||||
}
|
}
|
||||||
@ -37,9 +37,10 @@ contract KitabuValidators {
|
|||||||
_;
|
_;
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor() {
|
constructor() public {
|
||||||
validators.push(admissionController);
|
validators.push(admissionController);
|
||||||
validatorSetIndex[admissionController] = 0;
|
validatorSetIndex[admissionController] = 0;
|
||||||
|
finalized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setNewAdmissionController(address newController)
|
function setNewAdmissionController(address newController)
|
||||||
@ -67,7 +68,7 @@ contract KitabuValidators {
|
|||||||
function addValidator(address newValidator)
|
function addValidator(address newValidator)
|
||||||
public
|
public
|
||||||
onlyAdmissionController
|
onlyAdmissionController
|
||||||
pendingFinalization
|
alreadyFinalized
|
||||||
{
|
{
|
||||||
validators.push(newValidator);
|
validators.push(newValidator);
|
||||||
validatorSetIndex[newValidator] = validators.length - 1;
|
validatorSetIndex[newValidator] = validators.length - 1;
|
||||||
@ -77,7 +78,7 @@ contract KitabuValidators {
|
|||||||
function removeValidator(address exValidator)
|
function removeValidator(address exValidator)
|
||||||
public
|
public
|
||||||
onlyAdmissionController
|
onlyAdmissionController
|
||||||
pendingFinalization
|
alreadyFinalized
|
||||||
{
|
{
|
||||||
orderedRemoval(validatorSetIndex[exValidator]);
|
orderedRemoval(validatorSetIndex[exValidator]);
|
||||||
delete validatorSetIndex[exValidator];
|
delete validatorSetIndex[exValidator];
|
||||||
|
Loading…
Reference in New Issue
Block a user