mirror of
https://github.com/grassrootseconomics/cic-custodial.git
synced 2024-11-10 09:16:46 +01:00
Mohammed Sohail
40cb86f522
* otx can nw be tracked at /api/track/:trackingId * moved queries to queries folder * fixed validation error check in ErrorHandler * added enum package with enum types * updated migrations: added enum tables
35 lines
610 B
Go
35 lines
610 B
Go
package store
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/grassrootseconomics/cic-custodial/pkg/enum"
|
|
)
|
|
|
|
func (s *PostgresStore) CreateDispatchStatus(ctx context.Context, dispatch DispatchStatus) error {
|
|
if _, err := s.db.Exec(
|
|
ctx,
|
|
s.queries.CreateDispatchStatus,
|
|
dispatch.OtxId,
|
|
dispatch.Status,
|
|
); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (s *PostgresStore) UpdateChainStatus(ctx context.Context, txHash string, status enum.OtxStatus, block uint64) error {
|
|
if _, err := s.db.Exec(
|
|
ctx,
|
|
s.queries.UpdateChainStatus,
|
|
txHash,
|
|
status,
|
|
block,
|
|
); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|