-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
issue: router/swap_router/core/entities/currency_amount.go의 제네릭 사용
- Loading branch information
tolelom
committed
Sep 9, 2024
1 parent
7f6730b
commit 5b7d48e
Showing
57 changed files
with
744 additions
and
261 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
package database | ||
|
||
import "context" | ||
|
||
type Database interface { | ||
GetPools() []PoolV0 | ||
GetTokens() []TokenV0 | ||
//query(sql string) T ???? | ||
//commit(string, any[][]) bool ?????? | ||
Query(ctx context.Context, sql string) (interface{}, error) // 제너릭 타입은 Go에서 다루기 복잡하므로 interface{} 사용 | ||
Commit(ctx context.Context, sql string, data [][]interface{}) (bool, error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package database | ||
|
||
type GnoswapDB struct { | ||
Database | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
module router | ||
|
||
go 1.18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
core/alpha_router_params.go → swap_router/alpha_router_params.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package core | ||
package swap_router | ||
|
||
type ChainId int | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package swap_router | ||
|
||
type BigintIsh interface { | ||
} | ||
|
||
type TradeType int | ||
|
||
const ( | ||
EXACT_INPUT = iota | ||
EXACT_OUTPUT | ||
) | ||
|
||
var MIN_PRICE_X96 = 4295128740 | ||
var MAX_PRICE_X96 = 1461446703485210103287273052203988822378723970341 | ||
|
||
const MIN_TICK = -887272 | ||
const MAX_TICK = 887272 | ||
|
||
const DEFAULT_SWAP_FEE = 0.15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package core | ||
|
||
type Rounding int | ||
|
||
const ( | ||
ROUND_DOWN Rounding = iota | ||
ROUND_HALF_UP | ||
ROUND_UP | ||
) |
Oops, something went wrong.