Skip to content

Commit

Permalink
Updating TxStatus call to include quote data in the response
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldsg20 committed Nov 18, 2024
1 parent c39f548 commit 8a6e6cc
Show file tree
Hide file tree
Showing 3 changed files with 10 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 @@ -12,6 +12,7 @@ export class FlyoverStatusModel implements SearchableModel {
recipientAddress: string;
quoteHash: string;
quote: QuoteDbModel;
acceptedQuoteSignature: 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 @@ -66,6 +66,11 @@ export class RegisterPayload extends Model {
type: 'object',
})
quote?: QuoteDbModel;

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

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

const FlyoverStatusConnector = mongoose.model<FlyoverStatusMongoModel>('FlyoverStatuses', FlyoverStatusSchema);
Expand Down Expand Up @@ -72,6 +73,8 @@ export class FlyoverService extends MongoDbDataService<FlyoverStatusModel, Flyov
recipientAddress: flyoverTx.recipientAddress,
status,
quoteHash: flyoverTx.quoteHash,
quote: flyoverTx.quote,
acceptedQuoteSignature: flyoverTx.acceptedQuoteSignature,
};
}

Expand All @@ -88,6 +91,7 @@ export class FlyoverService extends MongoDbDataService<FlyoverStatusModel, Flyov
flyoverStatus.blockToBeFinished = currentBlock + Number(payload?.details?.blocksToCompleteTransaction ?? 0);
flyoverStatus.quoteHash = payload?.quoteHash ?? '';
flyoverStatus.quote = payload?.quote ?? {} as QuoteDbModel;
flyoverStatus.acceptedQuoteSignature = payload?.acceptedQuoteSignature ?? '';
return this.set(flyoverStatus);
}
}

0 comments on commit 8a6e6cc

Please sign in to comment.