Skip to content

Commit

Permalink
Merge pull request #150 from sotatek-dev/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Sotatek-TanHoang authored Oct 4, 2024
2 parents 37c04ad + 16d0190 commit 79226f1
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 45 deletions.
42 changes: 0 additions & 42 deletions design/admin-update-common-config.puml

This file was deleted.

35 changes: 35 additions & 0 deletions design/admin-update-eth-bridge-config.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@startuml 1
title Admin update tip and daily quota
actor User
boundary fe as "Frontend"
control be as "Backend"
database Database
autonumber
group#LightGreen Admin changes tip, daily quota for Evm/Mina

User -> fe : Logged in with Evm/Mina wallet

note right
Both Evm and Mina admin accounts
can changes these settings.
end note
activate fe
fe --> User : show configuration screen
deactivate fe
User -> fe : enter new tip, daily quota value.
activate fe
fe -> be: call api PUT: /api/admin/update-common-config/:configId
activate be

be -> Database: persist changes
activate Database
Database --> be: update successfully
deactivate Database
be --> fe: api response 201
deactivate be
fe --> User: popup success
deactivate fe
end

@enduml

35 changes: 35 additions & 0 deletions design/admin-update-min-max.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@startuml 1
title Admin config min max amount
actor User
boundary fe as "Frontend"
participant wallet as "Metamask/ Auro Wallet"
participant network as "Mina/Eth"
autonumber
group#LightGreen Admin change min max amount to bridge Evm/Mina

User -> fe : Logged in with Evm/Mina wallet
note right
Evm admin account can change Evm brige
configuration only and so does Mina admin account.
end note
activate fe
fe --> User : show Evm configuration screen
deactivate fe
User -> fe : enter new Min, Max value to Evm/Mina bridge
activate fe
fe -> wallet: trigger wallet for user confirmation
activate wallet
wallet --> User: show estimate fee dialog
User -> wallet: confirm transaction
wallet -> network: submit transaction
activate network
network --> wallet: status success
deactivate network
wallet --> fe: send tx success status
fe --> User: shop pop up success
deactivate fe
deactivate wallet
end

@enduml

7 changes: 4 additions & 3 deletions src/modules/crawler/job-unlock.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import { IGenerateSignature, IJobUnlockPayload, IUnlockToken } from './interface

@Injectable()
export class JobUnlockProvider {
private readonly signatureJobBackOff = 5 * 1000;
private readonly sendTxJobBackOff = 60 * 1000;
constructor(
private readonly queueService: QueueService,
private readonly configService: ConfigService,
Expand Down Expand Up @@ -134,7 +136,7 @@ export class JobUnlockProvider {
},
{
attempts: 5,
backoff: 5000,
backoff: this.signatureJobBackOff,
jobId: `validate-signature-${data.eventLogId}-${i}`,
},
);
Expand All @@ -156,7 +158,7 @@ export class JobUnlockProvider {
},
{
attempts: 5,
backoff: 5000,
backoff: this.sendTxJobBackOff,
jobId: `send-tx-${data.eventLogId}`,
},
);
Expand All @@ -171,7 +173,6 @@ export class JobUnlockProvider {
await this.eventLogRepository.sumAmountBridgeOfUserInDay(address),
]);
assert(!!dailyQuota, 'daily quota undefined');
console.log(totalamount, addDecimal(dailyQuota.dailyQuota, fromDecimal));

if (totalamount && BigNumber(totalamount.totalamount).isLessThan(addDecimal(dailyQuota.dailyQuota, fromDecimal))) {
return false;
Expand Down

0 comments on commit 79226f1

Please sign in to comment.