Skip to content

Commit

Permalink
Run go fmt with go-1.19 to conform to new stds
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic committed Aug 9, 2022
1 parent 4a92cd4 commit 3f57ddc
Show file tree
Hide file tree
Showing 45 changed files with 3,396 additions and 3,652 deletions.
4 changes: 2 additions & 2 deletions exp/orderbook/pools.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func makeTrade(
// CalculatePoolPayout calculates the amount of `reserveB` disbursed from the
// pool for a `received` amount of `reserveA` . From CAP-38:
//
// y = floor[(1 - F) Yx / (X + x - Fx)]
// y = floor[(1 - F) Yx / (X + x - Fx)]
//
// It returns false if the calculation overflows.
func CalculatePoolPayout(reserveA, reserveB, received xdr.Int64, feeBips xdr.Int32, calculateRoundingSlippage bool) (xdr.Int64, xdr.Int64, bool) {
Expand Down Expand Up @@ -160,7 +160,7 @@ func CalculatePoolPayout(reserveA, reserveB, received xdr.Int64, feeBips xdr.Int
// CalculatePoolExpectation determines how much of `reserveA` you would need to
// put into a pool to get the `disbursed` amount of `reserveB`.
//
// x = ceil[Xy / ((Y - y)(1 - F))]
// x = ceil[Xy / ((Y - y)(1 - F))]
//
// It returns false if the calculation overflows.
func CalculatePoolExpectation(
Expand Down
4 changes: 2 additions & 2 deletions exp/orderbook/pools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func TestCalculatePoolPayoutRoundingSlippage(t *testing.T) {
// CalculatePoolPayout calculates the amount of `reserveB` disbursed from the
// pool for a `received` amount of `reserveA` . From CAP-38:
//
// y = floor[(1 - F) Yx / (X + x - Fx)]
// y = floor[(1 - F) Yx / (X + x - Fx)]
//
// It returns false if the calculation overflows.
func calculatePoolPayoutBig(reserveA, reserveB, received xdr.Int64, feeBips xdr.Int32) (xdr.Int64, xdr.Int64, bool) {
Expand Down Expand Up @@ -387,7 +387,7 @@ func calculatePoolPayoutBig(reserveA, reserveB, received xdr.Int64, feeBips xdr.
// calculatePoolExpectation determines how much of `reserveA` you would need to
// put into a pool to get the `disbursed` amount of `reserveB`.
//
// x = ceil[Xy / ((Y - y)(1 - F))]
// x = ceil[Xy / ((Y - y)(1 - F))]
//
// It returns false if the calculation overflows.
func calculatePoolExpectationBig(
Expand Down
18 changes: 9 additions & 9 deletions exp/orderbook/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@ func search(
// edges in `graph.edgesForSellingAsset` are traversed.
//
// The DFS maintains the following invariants:
// - no node is repeated
// - no offers are consumed from the `ignoreOffersFrom` account
// - each payment path must begin with an asset in `targetAssets`
// - also, the required source asset amount cannot exceed the balance in
// `targetAssets`
// - no node is repeated
// - no offers are consumed from the `ignoreOffersFrom` account
// - each payment path must begin with an asset in `targetAssets`
// - also, the required source asset amount cannot exceed the balance in
// `targetAssets`
type sellingGraphSearchState struct {
graph *OrderBookGraph
destinationAssetString string
Expand Down Expand Up @@ -339,10 +339,10 @@ func (state *sellingGraphSearchState) consumePool(
// edges in `graph.edgesForBuyingAsset` are traversed.
//
// The DFS maintains the following invariants:
// - no node is repeated
// - no offers are consumed from the `ignoreOffersFrom` account
// - each payment path must terminate with an asset in `targetAssets`
// - each payment path must begin with `sourceAsset`
// - no node is repeated
// - no offers are consumed from the `ignoreOffersFrom` account
// - each payment path must terminate with an asset in `targetAssets`
// - each payment path must begin with `sourceAsset`
type buyingGraphSearchState struct {
graph *OrderBookGraph
sourceAssetString string
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3f57ddc

Please sign in to comment.