Skip to content

Commit

Permalink
update multisig configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
rise1507 committed Mar 31, 2024
1 parent f588e3d commit e7b447f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
5 changes: 4 additions & 1 deletion css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ button:disabled, .btn:disabled {
margin-bottom: 30px;
}

#multisig_updateButton {
padding-left: 0;
}

#multisig_createNewOrderButton {
margin-top: 30px;
margin-bottom: 10px;
Expand All @@ -123,7 +127,6 @@ button:disabled, .btn:disabled {
}

#order_approveButton {
padding-left: 0;
margin-bottom: 10px;
}

Expand Down
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@

<div class="label">Order ID:</div>
<div id="multisig_orderId" class="value"></div>

<button id="multisig_updateButton">Change multisig configuration</button>
</div>

<button id="multisig_createNewOrderButton" class="btn-primary">Create new order</button>
Expand Down
14 changes: 13 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,11 @@ $('#newMultisig1_nextButton').addEventListener('click', () => {
});

$('#newMultisig1_backButton').addEventListener('click', () => {
showScreen('startScreen');
if (newMultisigMode === 'create') {
showScreen('startScreen');
} else {
showScreen('multisigScreen');
}
});

$('#newMultisig2_createButton').addEventListener('click', async () => {
Expand Down Expand Up @@ -1141,6 +1145,14 @@ $('#newMultisig2_backButton').addEventListener('click', () => {
showScreen('newMultisigScreen1');
});

// UPDATE

$('#multisig_updateButton').addEventListener('click', () => {
newMultisigMode = 'update';
newMultisigClear();
showScreen('newMultisigScreen1');
});

// INIT

let multisigAddress: string = localStorage.getItem('multisigAddress');
Expand Down
9 changes: 6 additions & 3 deletions src/multisig/MultisigOrderChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ export const checkMultisigOrder = async (
const multisigOrderAddress2 = await multisigInfo.multisigContract.getOrderAddress(multisigInfo.provider, parsedData.orderSeqno);
assert(multisigOrderAddress2.equals(multisigOrderAddress.address), "fake multisig-order");

assert(multisigInfo.threshold === parsedData.threshold, "multisig threshold != order treshold");
assert(equalsAddressLists(multisigInfo.signers, parsedData.signers), "multisig signers != order signers");
if (!parsedData.isExecuted) {
assert(multisigInfo.threshold === parsedData.threshold, "multisig threshold != order threshold");
assert(equalsAddressLists(multisigInfo.signers, parsedData.signers), "multisig signers != order signers");
}

// Get-methods

Expand Down Expand Up @@ -241,7 +243,7 @@ export const checkMultisigOrder = async (
} else if (actionOp === 0x1d0cfbd3) { // update_multisig_params
const newThreshold = slice.loadUint(8);
const newSigners = cellToArray(slice.loadRef());
const newProposers = cellToArray(slice.loadRef());
const newProposers = slice.loadUint(1) ? cellToArray(slice.loadRef()) : [];
endParse(slice);

assert(newSigners.length > 0, 'invalid new signers')
Expand All @@ -258,6 +260,7 @@ export const checkMultisigOrder = async (
actionString += (`<div>#${i} - ${addressString}</div>`);
}

actionString += '<div>New proposers:</div>'
if (newProposers.length > 0) {
for (let i = 0; i < newProposers.length; i++) {
const proposer = newProposers[i];
Expand Down

0 comments on commit e7b447f

Please sign in to comment.