Skip to content

Commit

Permalink
add more multisig confirmation conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosQ96 committed Sep 23, 2023
1 parent 3f8a48d commit 38f1ecb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
7 changes: 0 additions & 7 deletions migrations/1694633909572-AddMultisigSessionEntity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,9 @@ export class AddMultisigSessionEntity1694633909572
},
],
indices: [
{
columnNames: ['safeTransactionHash', 'network'],
isUnique: true,
},
{
columnNames: ['multisigAddress'],
},
{
columnNames: ['safeTransactionHash'],
},
{
columnNames: ['network'],
},
Expand Down
6 changes: 5 additions & 1 deletion src/entities/multisigSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ export class MultisigSession extends BaseEntity {

if (this.isExpired()) this.status = MultisigStatuses.Failed;

if (safeMessageData.status === 'CONFIRMED')
if (
safeMessageData.status === 'CONFIRMED' &&
safeMessageData.confirmationsSubmitted >=
safeMessageData.confirmationsRequired
)
this.status = MultisigStatuses.Successful;

await this.save();
Expand Down
5 changes: 3 additions & 2 deletions src/routes/v1/multisigAuthenticationRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ multisigAuthenticationRouter.post(
'/multisigAuthentication',
async (req: Request, res: Response, next) => {
try {
const { safeMessageTimestamp, safeAddress, network, jwt } = req.body;
if (!safeMessageTimestamp || !safeAddress || !jwt || !network) {
const { safeAddress, network, jwt } = req.body;
const safeMessageTimestamp = req.body?.safeMessageTimestamp;
if (!safeAddress || !jwt || !network) {
res.status(422).json({ message: errorMessagesEnum.MISSING_LOGIN_DATA });
return;
}
Expand Down

0 comments on commit 38f1ecb

Please sign in to comment.