diff --git a/config/config.go b/config/config.go index 11d4540..4ecaf6d 100644 --- a/config/config.go +++ b/config/config.go @@ -3,9 +3,9 @@ package config import ( "encoding/json" "io/ioutil" -) -const NULL_BLOCK_NUMBER uint32 = 0xffffffff + shipclient "github.com/eosswedenorg-go/antelope-ship-client" +) type RedisConfig struct { Addr string `json:"addr"` @@ -37,8 +37,8 @@ type Config struct { func Parse(data []byte) (*Config, error) { cfg := Config{ - StartBlockNum: NULL_BLOCK_NUMBER, - EndBlockNum: NULL_BLOCK_NUMBER, + StartBlockNum: shipclient.NULL_BLOCK_NUMBER, + EndBlockNum: shipclient.NULL_BLOCK_NUMBER, MaxMessagesInFlight: 10, IrreversibleOnly: false, Redis: RedisConfig{ diff --git a/config/config_test.go b/config/config_test.go index 9874ea9..2df3ddb 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -4,12 +4,14 @@ import ( "testing" "github.com/stretchr/testify/require" + + shipclient "github.com/eosswedenorg-go/antelope-ship-client" ) func TestParse_Default(t *testing.T) { expected := Config{ - StartBlockNum: NULL_BLOCK_NUMBER, - EndBlockNum: NULL_BLOCK_NUMBER, + StartBlockNum: shipclient.NULL_BLOCK_NUMBER, + EndBlockNum: shipclient.NULL_BLOCK_NUMBER, MaxMessagesInFlight: 10, IrreversibleOnly: false, Redis: RedisConfig{ diff --git a/main.go b/main.go index f4ee45f..63e9086 100644 --- a/main.go +++ b/main.go @@ -205,7 +205,7 @@ func main() { return } - if conf.StartBlockNum == config.NULL_BLOCK_NUMBER { + if conf.StartBlockNum == shipclient.NULL_BLOCK_NUMBER { if conf.IrreversibleOnly { conf.StartBlockNum = uint32(chainInfo.LastIrreversibleBlockNum) } else {