Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into release-horizoncl…
Browse files Browse the repository at this point in the history
…ient-v7.1.0
  • Loading branch information
tamirms committed Jun 1, 2021
2 parents c8c12a1 + 11f0c3f commit 89ffff6
Show file tree
Hide file tree
Showing 464 changed files with 12,157 additions and 38,073 deletions.
68 changes: 24 additions & 44 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ commands:
name: Download and install golang
command: |
sudo rm -rf /usr/local/go
wget https://dl.google.com/go/go1.16.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.16.linux-amd64.tar.gz
wget https://dl.google.com/go/go1.16.3.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.16.3.linux-amd64.tar.gz
# install_go_deps installs the go dependencies of the project.
install_go_deps:
Expand Down Expand Up @@ -147,7 +147,7 @@ commands:
parameters:
core-version:
type: string
default: "" # latest version by default
default: "17.0.0-568.ea5878e.xenial~buildtests"
steps:
- run:
name: Install Stellar Core <<#parameters.core-version>> (version <<parameters.core-version>>)<</parameters.core-version>>
Expand Down Expand Up @@ -218,13 +218,6 @@ commands:
name: Build release artifacts
command: go run ./support/scripts/build_release_artifacts/main.go

# send_coverage_report sends coverage report to codecov.io
send_coverage_report:
steps:
- run:
name: Send report to codecov.io
command: bash <(curl -s https://codecov.io/bash)

#-----------------------------------------------------------------------------#
# Jobs use the commands to accomplish a given task, and run through workflows #
#-----------------------------------------------------------------------------#
Expand All @@ -248,7 +241,7 @@ jobs:
test_code_1_15:
working_directory: /go/src/github.com/stellar/go
docker:
- image: golang:1.15.10
- image: golang:1.15.11
environment:
GO111MODULE: "on"
PGHOST: localhost
Expand All @@ -268,7 +261,7 @@ jobs:
test_code_1_15_postgres10:
working_directory: /go/src/github.com/stellar/go
docker:
- image: golang:1.15.10
- image: golang:1.15.11
environment:
GO111MODULE: "on"
PGHOST: localhost
Expand All @@ -284,13 +277,12 @@ jobs:
steps:
- install_go_deps
- test_packages
- send_coverage_report

# test_code_1_16 performs all package tests using Go 1.16.
test_code_1_16:
working_directory: /go/src/github.com/stellar/go
docker:
- image: golang:1.16.2
- image: golang:1.16.3
environment:
GO111MODULE: "on"
PGHOST: localhost
Expand All @@ -310,7 +302,7 @@ jobs:
test_code_1_16_postgres10:
working_directory: /go/src/github.com/stellar/go
docker:
- image: golang:1.16.2
- image: golang:1.16.3
environment:
GO111MODULE: "on"
PGHOST: localhost
Expand All @@ -326,15 +318,14 @@ jobs:
steps:
- install_go_deps
- test_packages
- send_coverage_report
# publish_artifacts builds and uploads artifacts to any tagged commit.
#
# NOTE: this commands relies on an env var called GITHUB_TOKEN which is a
# GH OAUTH token with `repo` access.
publish_artifacts:
working_directory: /go/src/github.com/stellar/go
docker:
- image: golang:1.16.2
- image: golang:1.16.3
steps:
- check_deprecations
- install_go_deps
Expand Down Expand Up @@ -383,6 +374,19 @@ jobs:
docker build -f services/horizon/docker/Dockerfile.dev -t stellar/horizon:$VERSION .
docker push stellar/horizon:$VERSION
test_verify_range_docker_image:
docker:
- image: docker:18.04-git
steps:
- checkout
- setup_remote_docker
- run:
name: Build and test Verify Range Docker image
command: |
docker build -f services/horizon/docker/verify-range/Dockerfile -t stellar/horizon-verify-range services/horizon/docker/verify-range/
# Any range should do for basic testing, this range was chosen pretty early in history so that it only takes a few mins to run
docker run -ti -e BRANCH=${CIRCLE_SHA1} -e FROM=10000063 -e TO=10000127 stellar/horizon-verify-range
publish_latest_horizon_docker_image:
docker:
- image: docker:18.04-git
Expand Down Expand Up @@ -417,10 +421,6 @@ jobs:
enable-captive-core:
type: boolean
default: false
# TODO: remove once a stellar core version with cap-35 is released
enable-cap-35-tests:
type: boolean
default: false
working_directory: ~/go/src/github.com/stellar/go
machine:
image: ubuntu-1604:202010-01
Expand All @@ -439,28 +439,12 @@ jobs:
- when:
condition: <<parameters.enable-captive-core>>
steps:
- unless:
condition: <<parameters.enable-cap-35-tests>>
steps:
# Install the default version of stellar core
- install_stellar_core
- when:
condition: <<parameters.enable-cap-35-tests>>
steps:
# Install a Stellar Core version with CAP35 support
- install_stellar_core:
core-version: 15.3.0-498.7a7f18c.xenial~SetTrustlineFlagsPR~buildtests
- install_stellar_core
- run:
name: Setting Captive Core env variables
command: echo "export HORIZON_INTEGRATION_ENABLE_CAPTIVE_CORE=true" >> $BASH_ENV
- when:
condition: <<parameters.enable-cap-35-tests>>
steps:
- run:
name: Setting CAP35 env variables
command: echo "export HORIZON_INTEGRATION_ENABLE_CAP_35=true" >> $BASH_ENV
- run:
name: Run Horizon integration tests <<#parameters.enable-captive-core>>(With captive core)<</parameters.enable-captive-core>> <<#parameters.enable-cap-35-tests>>(With CAP35)<</parameters.enable-cap-35-tests>>
name: Run Horizon integration tests <<#parameters.enable-captive-core>>(With captive core)<</parameters.enable-captive-core>>
# Currently all integration tests are in a single directory.
# Pulling the image helps with test running time
command: |
Expand Down Expand Up @@ -488,11 +472,7 @@ workflows:
- test_horizon_integration:
name: test_horizon_integration_with_captive_core
enable-captive-core: true
# ... and cap35 with captive core
- test_horizon_integration:
name: test_horizon_integration_cap35_with_captive_core
enable-captive-core: true
enable-cap-35-tests: true
- test_verify_range_docker_image
- publish_state_diff_docker_image:
filters:
branches:
Expand Down
5 changes: 5 additions & 0 deletions clients/horizonclient/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
All notable changes to this project will be documented in this
file. This project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased

* Added transaction and operation result codes to the horizonclient.Error string for easy glancing at string only errors for underlying cause.
* Fix bug in the transaction submission where requests with large transaction payloads fail with an HTTP 414 URI Too Long error ([#3643](https://github.com/stellar/go/pull/3643)).

## [v7.0.0](https://github.com/stellar/go/releases/tag/horizonclient-v7.0.0) - 2021-05-15

None
Expand Down
11 changes: 11 additions & 0 deletions clients/horizonclient/account_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package horizonclient

import (
"fmt"
"net/http"
"net/url"

"github.com/stellar/go/support/errors"
Expand Down Expand Up @@ -46,3 +47,13 @@ func (ar AccountRequest) BuildURL() (endpoint string, err error) {

return endpoint, err
}

// HTTPRequest returns the http request for the account endpoint
func (ar AccountRequest) HTTPRequest(horizonURL string) (*http.Request, error) {
endpoint, err := ar.BuildURL()
if err != nil {
return nil, err
}

return http.NewRequest("GET", horizonURL+endpoint, nil)
}
11 changes: 11 additions & 0 deletions clients/horizonclient/accounts_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package horizonclient

import (
"fmt"
"net/http"
"net/url"

"github.com/stellar/go/support/errors"
Expand Down Expand Up @@ -54,3 +55,13 @@ func (r AccountsRequest) BuildURL() (endpoint string, err error) {

return endpoint, err
}

// HTTPRequest returns the http request for the accounts endpoint
func (r AccountsRequest) HTTPRequest(horizonURL string) (*http.Request, error) {
endpoint, err := r.BuildURL()
if err != nil {
return nil, err
}

return http.NewRequest("GET", horizonURL+endpoint, nil)
}
11 changes: 11 additions & 0 deletions clients/horizonclient/asset_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package horizonclient

import (
"fmt"
"net/http"
"net/url"

"github.com/stellar/go/support/errors"
Expand All @@ -27,3 +28,13 @@ func (ar AssetRequest) BuildURL() (endpoint string, err error) {

return endpoint, err
}

// HTTPRequest returns the http request for the assets endpoint
func (ar AssetRequest) HTTPRequest(horizonURL string) (*http.Request, error) {
endpoint, err := ar.BuildURL()
if err != nil {
return nil, err
}

return http.NewRequest("GET", horizonURL+endpoint, nil)
}
11 changes: 11 additions & 0 deletions clients/horizonclient/claimable_balance_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package horizonclient

import (
"fmt"
"net/http"
"net/url"

"github.com/stellar/go/support/errors"
Expand Down Expand Up @@ -40,3 +41,13 @@ func (cbr ClaimableBalanceRequest) BuildURL() (endpoint string, err error) {

return endpoint, err
}

// HTTPRequest returns the http request for the claimable balances endpoint
func (cbr ClaimableBalanceRequest) HTTPRequest(horizonURL string) (*http.Request, error) {
endpoint, err := cbr.BuildURL()
if err != nil {
return nil, err
}

return http.NewRequest("GET", horizonURL+endpoint, nil)
}
Loading

0 comments on commit 89ffff6

Please sign in to comment.