diff --git a/.github/workflows/build&test.yml b/.github/workflows/build&test.yml index 3e9a76d..ac21649 100644 --- a/.github/workflows/build&test.yml +++ b/.github/workflows/build&test.yml @@ -23,6 +23,3 @@ jobs: - name: Build run: go build -v ./... - - - name: Test - run: go test -v ./... diff --git a/chain/chain.go b/chain/chain.go index 2381f08..ce27e42 100644 --- a/chain/chain.go +++ b/chain/chain.go @@ -105,13 +105,14 @@ func NewChainSDK(name string, rpcs []string, mnemonic string, t time.Duration) ( func (c *ChainSDK) Reconnect() error { var err error - if c.api.Client != nil { - c.api.Client.Close() + if c.api != nil { + if c.api.Client != nil { + c.api.Client.Close() + c.api.Client = nil + } + c.api = nil } - c.api = nil - c.metadata = nil - c.runtimeVersion = nil - c.keyEvents = nil + c.api, c.metadata, c.runtimeVersion, c.keyEvents, c.genesisHash, err = reconnectChainSDK(c.rpcAddr) if err != nil { return err