diff --git a/glide.lock b/glide.lock index 657e70066..f22157def 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: 7008afae44e3682dc2db084f221f7e2d4bf48676c162ed45125bec94cb03dab5 -updated: 2019-11-22T12:43:28.938450375+05:30 +hash: fe2cef8cdfc3bbdd1aff4bf40700c445c2e5f8dd33e3199e95717c8faedaa498 +updated: 2020-02-07T16:46:11.373155-08:00 imports: - name: cloud.google.com/go version: 83a0b8742b4d7302c26d3b71bfdcbd9224f6b951 @@ -61,6 +61,8 @@ imports: version: c8c88dbee036db4e4808d1f2ec8c2e15e11c3f80 subpackages: - query +- name: github.com/gorilla/schema + version: 61751c9687439bf8cd824ad7eec0d21db1a1b804 - name: github.com/hashicorp/hcl version: 914dc3f8dd7c463188c73fc47e9ced82a6e421ca subpackages: @@ -143,10 +145,11 @@ imports: - name: github.com/spf13/viper version: 01d7d76eb0020ae2fd1275899065ddfdd9f6a528 - name: github.com/stellar/go - version: a599ed95b928a7bdcee21cee4999efd05e43c2df + version: 7e6a2fc068c82638b19f4ce4fdfb23ad28ec6709 subpackages: - amount - build + - clients/horizon - clients/horizonclient - crc16 - hash @@ -158,8 +161,11 @@ imports: - protocols/horizon/effects - protocols/horizon/operations - strkey + - support/app + - support/clock - support/config - support/errors + - support/http/httpdecode - support/log - support/render/hal - support/render/httpjson diff --git a/glide.yaml b/glide.yaml index 0ab5a7142..2f28bc941 100644 --- a/glide.yaml +++ b/glide.yaml @@ -9,7 +9,7 @@ import: - package: github.com/spf13/pflag version: v1.0.0 - package: github.com/stellar/go - version: a599ed95b928a7bdcee21cee4999efd05e43c2df + version: release-horizonclient-v2.1.0 subpackages: - build - clients/horizonclient diff --git a/plugins/sdexExtensions.go b/plugins/sdexExtensions.go index 70fdcf08b..0e136a6de 100644 --- a/plugins/sdexExtensions.go +++ b/plugins/sdexExtensions.go @@ -71,44 +71,44 @@ func getFeeFromStats(horizonClient horizonclient.ClientInterface, capacityTrigge } // parse percentile value - acceptedFee, e := getAcceptedFee(&feeStats, percentile) + maxFee, e := getMaxFee(&feeStats, percentile) if e != nil { - return 0, fmt.Errorf("could not fetch accepted fee: %s", e) + return 0, fmt.Errorf("could not fetch max fee: %s", e) } - acceptedFeeInt64 := uint64(acceptedFee) + maxFeeInt64 := uint64(maxFee) - if acceptedFeeInt64 <= maxOpFeeStroops { - log.Printf("acceptedFeeInt64 <= maxOpFeeStroops; using acceptedFee of %d stroops at percentile=%d (maxOpFeeStroops=%d)\n", acceptedFeeInt64, percentile, maxOpFeeStroops) - return acceptedFeeInt64, nil + if maxFeeInt64 <= maxOpFeeStroops { + log.Printf("maxFeeInt64 <= maxOpFeeStroops; using maxFee of %d stroops at percentile=%d (maxOpFeeStroops=%d)\n", maxFeeInt64, percentile, maxOpFeeStroops) + return maxFeeInt64, nil } - log.Printf("acceptedFeeInt64 > maxOpFeeStroops; using maxOpFeeStroops of %d stroops (percentile=%d, acceptedFee=%d stroops)\n", maxOpFeeStroops, percentile, acceptedFeeInt64) + log.Printf("maxFeeInt64 > maxOpFeeStroops; using maxOpFeeStroops of %d stroops (percentile=%d, maxFee=%d stroops)\n", maxOpFeeStroops, percentile, maxFeeInt64) return maxOpFeeStroops, nil } -func getAcceptedFee(fs *hProtocol.FeeStats, percentile uint8) (int, error) { +func getMaxFee(fs *hProtocol.FeeStats, percentile uint8) (int64, error) { switch percentile { case 10: - return fs.P10AcceptedFee, nil + return fs.MaxFee.P10, nil case 20: - return fs.P20AcceptedFee, nil + return fs.MaxFee.P20, nil case 30: - return fs.P30AcceptedFee, nil + return fs.MaxFee.P30, nil case 40: - return fs.P40AcceptedFee, nil + return fs.MaxFee.P40, nil case 50: - return fs.P50AcceptedFee, nil + return fs.MaxFee.P50, nil case 60: - return fs.P60AcceptedFee, nil + return fs.MaxFee.P60, nil case 70: - return fs.P70AcceptedFee, nil + return fs.MaxFee.P70, nil case 80: - return fs.P80AcceptedFee, nil + return fs.MaxFee.P80, nil case 90: - return fs.P90AcceptedFee, nil + return fs.MaxFee.P90, nil case 95: - return fs.P95AcceptedFee, nil + return fs.MaxFee.P95, nil case 99: - return fs.P99AcceptedFee, nil + return fs.MaxFee.P99, nil } - return 0, fmt.Errorf("unable to get accepted fee for percentile: %d", percentile) + return 0, fmt.Errorf("unable to get max fee for percentile: %d", percentile) }