Skip to content

Commit

Permalink
Fix: logging and tezgen type
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Jan 19, 2022
1 parent 16ae320 commit 29bb9ab
Show file tree
Hide file tree
Showing 11 changed files with 89 additions and 71 deletions.
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"program": "${workspaceFolder}/cmd/watch_tower",
"args": [
"-c",
"../../configs"
"../../configs/test"
],
"envFile": "${workspaceFolder}/.env"
}, {
Expand All @@ -23,7 +23,7 @@
"program": "${workspaceFolder}/cmd/market_maker",
"args": [
"-c",
"../../configs"
"../../configs/test"
],
"envFile": "${workspaceFolder}/.env"
}
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ tower:
cd cmd/watch_tower && go run .

tower-test:
cd cmd/watch_tower && go run . -c ../../configs
cd cmd/watch_tower && go run . -c ../../configs/test

market-maker:
cd cmd/market_maker && go run . -c ../../configs
cd cmd/market_maker && go run . -c ../../configs/test

test:
go test ./...
Expand Down
1 change: 1 addition & 0 deletions cmd/market_maker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
)

func main() {
zerolog.SetGlobalLevel(zerolog.InfoLevel)
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: time.RFC3339})

var configDir string
Expand Down
1 change: 1 addition & 0 deletions cmd/watch_tower/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
)

func main() {
zerolog.SetGlobalLevel(zerolog.InfoLevel)
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: time.RFC3339})

var configDir string
Expand Down
2 changes: 1 addition & 1 deletion configs/production/market_maker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ strategies:
# - kind: volatility
# symbol: ETH_BTC

log_level: trace
log_level: info
4 changes: 2 additions & 2 deletions configs/test/chains.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
tezos:
node: https://rpc.tzkt.io/granadanet
tzkt: https://api.granadanet.tzkt.io
node: https://rpc.tzkt.io/hangzhou2net
tzkt: https://api.hangzhou2net.tzkt.io
ttl: 60
min_payoff: "0"

Expand Down
2 changes: 1 addition & 1 deletion configs/test/market_maker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ strategies:
width: 1.5
window: 60

log_level: trace
log_level: info
restore: true
11 changes: 4 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/btcsuite/btcd v0.22.0-beta // indirect
github.com/deckarep/golang-set v1.7.1 // indirect
github.com/dipdup-net/go-lib v0.1.41
github.com/dipdup-net/go-lib v0.1.52
github.com/ebellocchia/go-base58 v0.1.0
github.com/ethereum/go-ethereum v1.10.12
github.com/go-playground/validator/v10 v10.9.0
Expand All @@ -19,17 +19,14 @@ require (
github.com/mitchellh/mapstructure v1.4.2 // indirect
github.com/pkg/errors v0.9.1
github.com/rjeczalik/notify v0.9.2 // indirect
github.com/rs/zerolog v1.25.0
github.com/rs/zerolog v1.26.0
github.com/shirou/gopsutil v3.21.8+incompatible // indirect
github.com/shopspring/decimal v1.2.0
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/shopspring/decimal v1.3.1
github.com/stretchr/testify v1.7.0
github.com/tklauser/go-sysconf v0.3.9 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/valyala/fastjson v1.6.3 // indirect
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa
golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b // indirect
golang.org/x/sys v0.0.0-20211110154304-99a53858aa08 // indirect
golang.org/x/crypto v0.0.0-20211202192323-5770296d904e
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
gopkg.in/yaml.v2 v2.4.0
)
121 changes: 69 additions & 52 deletions go.sum

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions internal/chain/tezos/atomex_tez_token/contract_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
type Initiate struct {
HashedSecret tezgen.Bytes `json:"hashedSecret" validate:"string"`
Participant tezgen.Address `json:"participant" validate:"string"`
PayoffAmount tezgen.Int `json:"payoffAmount" validate:"string"`
PayoffAmount tezgen.Int `json:"payoffAmount,string" validate:"string"`
RefundTime tezgen.Timestamp `json:"refundTime" validate:"string"`
TokenAddress tezgen.Address `json:"tokenAddress" validate:"string"`
TotalAmount tezgen.Int `json:"totalAmount" validate:"string"`
TotalAmount tezgen.Int `json:"totalAmount,string" validate:"string"`
}

// Redeem
Expand All @@ -29,10 +29,10 @@ type Key0 tezgen.Bytes
type Value0 struct {
Initiator tezgen.Address `json:"initiator" validate:"string"`
Participant tezgen.Address `json:"participant" validate:"string"`
PayoffAmount tezgen.Int `json:"payoffAmount" validate:"string"`
PayoffAmount tezgen.Int `json:"payoffAmount,string" validate:"string"`
RefundTime tezgen.Timestamp `json:"refundTime" validate:"string"`
TokenAddress tezgen.Address `json:"tokenAddress" validate:"string"`
TotalAmount tezgen.Int `json:"totalAmount" validate:"string"`
TotalAmount tezgen.Int `json:"totalAmount,string" validate:"string"`
}

// BigMap0
Expand Down
2 changes: 2 additions & 0 deletions internal/chain/tools/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func NewTracker(cfg Config, opts ...TrackerOption) (*Tracker, error) {
MinPayOff: cfg.Tezos.MinPayOff,
TTL: cfg.Tezos.TTL,
OperaitonParams: cfg.Tezos.OperaitonParams,
LogLevel: zerolog.InfoLevel,
})
if err != nil {
return nil, err
Expand All @@ -51,6 +52,7 @@ func NewTracker(cfg Config, opts ...TrackerOption) (*Tracker, error) {
NodeURL: cfg.Ethereum.Node,
WssURL: cfg.Ethereum.Wss,
MinPayOff: cfg.Ethereum.MinPayOff,
LogLevel: zerolog.InfoLevel,
})
if err != nil {
return nil, err
Expand Down

0 comments on commit 29bb9ab

Please sign in to comment.