Skip to content

Commit

Permalink
Save flyover quote hash
Browse files Browse the repository at this point in the history
  • Loading branch information
lserra-iov authored and alexjavabraz committed Oct 2, 2024
1 parent 67412bc commit 9ca9856
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/models/flyover-status.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export class FlyoverStatusModel implements SearchableModel {
blockToBeFinished: number;
senderAddress: string;
recipientAddress: string;
quoteHash: string;

getId() {
return this.txHash;
Expand Down
5 changes: 5 additions & 0 deletions src/models/register-payload.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ export class RegisterPayload extends Model {
type: 'object',
})
details?: Record<string, any>;

@property({
type: 'string',
})
quoteHash?: string;

constructor(data?: Partial<RegisterPayload>) { //NOSONAR
super(data);
Expand Down
2 changes: 2 additions & 0 deletions src/services/flyover.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const FlyoverStatusSchema = new mongoose.Schema({
blockToBeFinished: {type: Number, required: true},
senderAddress: {type: String, required: true},
recipientAddress: {type: String, required: true},
quoteHash: {type: String, required: true},
});

const FlyoverStatusConnector = mongoose.model<FlyoverStatusMongoModel>('FlyoverStatuses', FlyoverStatusSchema);
Expand Down Expand Up @@ -83,6 +84,7 @@ export class FlyoverService extends MongoDbDataService<FlyoverStatusModel, Flyov
flyoverStatus.senderAddress = payload?.details?.senderAddress ?? '';
flyoverStatus.recipientAddress = payload?.details?.recipientAddress ?? '';
flyoverStatus.blockToBeFinished = currentBlock + Number(payload?.details?.blocksToCompleteTransaction ?? 0);
flyoverStatus.quoteHash = payload?.quoteHash ?? '';
return this.set(flyoverStatus);
}
}

0 comments on commit 9ca9856

Please sign in to comment.