Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
Alok committed Jun 6, 2024
1 parent 1a405dc commit e15237f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion oracle/pkg/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,15 @@ func (s *Store) AddEncryptedCommitment(
commitmentSignatureBase64,
dispatchTimestamp,
}
placeholder := make([]string, len(values))
for i := range columns {
placeholder[i] = fmt.Sprintf("$%d", i+1)
}

insertStr := fmt.Sprintf(
"INSERT INTO commitments (%s) VALUES (%s)",
strings.Join(columns, ", "),
strings.Repeat("?, ", len(values)-1)+"?",
strings.Join(placeholder, ", "),
)

_, err := s.db.ExecContext(ctx, insertStr, values...)
Expand Down

0 comments on commit e15237f

Please sign in to comment.