Skip to content
This repository has been archived by the owner on Jan 22, 2020. It is now read-only.

Commit

Permalink
Merge pull request #382 from stellar/prerel
Browse files Browse the repository at this point in the history
Minor prerelease fixes and changelog updates
  • Loading branch information
nullstyle committed Aug 16, 2017
2 parents b578450 + 1455597 commit 25dd1d5
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 12 deletions.
15 changes: 14 additions & 1 deletion CHANGELOG.md
Expand Up @@ -8,9 +8,21 @@ bumps. A breaking change will get clearly notified in this log.

## [Unreleased]

## [v0.11.0] - 2017-08-15

### Bug fixes

- The ingestion system can now properly imports envelopes that contain signatures that are zero-length strings.
- BREAKING CHANGE: specifying a `limit` of `0` now triggers an error instead of interpreting the value to mean "use the default limit".
- Requests that ask for more records than the maximum page size now trigger a bad request error, instead of an internal server error.
- Upstream bug fixes to xdr decoding from `github.com/stellar/go`.

### Changed

- BREAKING CHANGE: The payments endpoint now includes `account_merge` operations in the response.
- "Finished Request" log lines now include additional fields: `streaming`, `path`, `ip`, and `host`.
- Responses now include a `Content-Disposition: inline` header.


## [v0.10.1] - 2017-03-29

Expand Down Expand Up @@ -174,7 +186,8 @@ This release contains the initial implementation of the "Abridged History System
### Added
- Github releases are created from tagged travis builds automatically

[Unreleased]: https://github.com/stellar/horizon/compare/v0.10.1...master
[Unreleased]: https://github.com/stellar/horizon/compare/v0.11.0...master
[v0.11.0]: https://github.com/stellar/horizon/compare/v0.10.1...v0.11.0
[v0.10.1]: https://github.com/stellar/horizon/compare/v0.10.0...v0.10.1
[v0.10.0]: https://github.com/stellar/horizon/compare/v0.9.1...v0.10.0
[v0.9.1]: https://github.com/stellar/horizon/compare/v0.9.0...v0.9.1
Expand Down
17 changes: 13 additions & 4 deletions src/github.com/stellar/horizon/db2/sqx/main.go
Expand Up @@ -9,11 +9,20 @@ import (
sq "github.com/Masterminds/squirrel"
)

// StringArray returns a sq.Expr suitable for inclusion in an insert that represents
// the Postgres-compatible array insert.
func StringArray(str []string) interface{} {
// StringArray returns a sq.Expr suitable for inclusion in an insert that
// represents the Postgres-compatible array insert. Strings are quoted.
func StringArray(input []string) interface{} {
quoted := make([]string, len(input))

// NOTE (scott): this is naive and janked. We should be using
// https://godoc.org/github.com/lib/pq#Array instead. We should update this
// func code when our version of pq is updated.
for i, str := range input {
quoted[i] = fmt.Sprintf(`"%s"`, str)
}

return sq.Expr(
"?::character varying[]",
fmt.Sprintf("{%s}", strings.Join(str, ",")),
fmt.Sprintf("{%s}", strings.Join(quoted, ",")),
)
}
2 changes: 1 addition & 1 deletion src/github.com/stellar/horizon/db2/sqx/main_test.go
Expand Up @@ -18,5 +18,5 @@ func TestStringArray(t *testing.T) {
tt.Assert.Equal("?::character varying[]", sql)

tt.Assert.Len(args, 1)
tt.Assert.Equal("{1,2,3}", args[0])
tt.Assert.Equal(`{"1","2","3"}`, args[0])
}
5 changes: 0 additions & 5 deletions src/github.com/stellar/horizon/ingest/ingestion.go
Expand Up @@ -188,11 +188,6 @@ func (ingest *Ingestion) Start() (err error) {
func (ingest *Ingestion) transactionInsertBuilder(id int64, tx *core.Transaction, fee *core.TransactionFee) sq.InsertBuilder {
// Enquote empty signatures
signatures := tx.Base64Signatures()
for i, sig := range signatures {
if len(sig) == 0 {
signatures[i] = `""`
}
}

return ingest.transactions.Values(
id,
Expand Down
2 changes: 1 addition & 1 deletion src/github.com/stellar/horizon/ingest/ingestion_test.go
Expand Up @@ -40,7 +40,7 @@ func TestEmptySignature(t *testing.T) {
builder := ingestion.transactionInsertBuilder(1, transaction, transactionFee)
sql, args, err := builder.ToSql()
assert.Equal(t, "INSERT INTO history_transactions (id,transaction_hash,ledger_sequence,application_order,account,account_sequence,fee_paid,operation_count,tx_envelope,tx_result,tx_meta,tx_fee_meta,signatures,time_bounds,memo_type,memo,created_at,updated_at) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?::character varying[],?,?,?,?,?)", sql)
assert.Equal(t, `{8qkkeKaKfsbgInyIkzXJhqJE5/Ufxri2LdxmyKkgkT6I3sPmvrs5cPWQSzEQyhV750IW2ds97xTHqTpOfuZCAg==,""}`, args[12])
assert.Equal(t, `{"8qkkeKaKfsbgInyIkzXJhqJE5/Ufxri2LdxmyKkgkT6I3sPmvrs5cPWQSzEQyhV750IW2ds97xTHqTpOfuZCAg==",""}`, args[12])
assert.NoError(t, err)

err = ingestion.Transaction(1, transaction, transactionFee)
Expand Down

0 comments on commit 25dd1d5

Please sign in to comment.