Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fftimestamp fix, SQL DB persistence implementation #113

Closed
wants to merge 7 commits into from
7 changes: 3 additions & 4 deletions internal/persistence/postgres/txhistory.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,17 @@ func (p *sqlPersistence) ListTransactionHistory(ctx context.Context, txID string
return p.txHistory.GetMany(ctx, filter.Condition(filter.Builder().Eq("transaction", txID)))
}

func (p *sqlPersistence) AddSubStatusAction(ctx context.Context, txID string, subStatus apitypes.TxSubStatus, action apitypes.TxAction, info *fftypes.JSONAny, errInfo *fftypes.JSONAny) error {
func (p *sqlPersistence) AddSubStatusAction(ctx context.Context, txID string, subStatus apitypes.TxSubStatus, action apitypes.TxAction, info *fftypes.JSONAny, errInfo *fftypes.JSONAny, t *fftypes.FFTime) error {
// Dispatch to TX writer
now := fftypes.Now()
op := newTransactionOperation(txID)
op.historyRecord = &apitypes.TXHistoryRecord{
ID: fftypes.NewUUID(),
TransactionID: txID,
SubStatus: subStatus,
TxHistoryActionEntry: apitypes.TxHistoryActionEntry{
OccurrenceCount: 1,
Time: now,
LastOccurrence: now,
Time: t,
LastOccurrence: t,
Chengxuan marked this conversation as resolved.
Show resolved Hide resolved
Action: action,
LastInfo: persistence.JSONOrString(info), // guard against bad JSON
LastError: persistence.JSONOrString(errInfo), // guard against bad JSON
Expand Down
Loading