1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-19 04:50:02 +02:00

abi.go: Get rid of global state by defining an AbiManager struct.

This commit is contained in:
Henrik Hautakoski 2023-01-12 16:38:03 +01:00
parent 0ded3ee6fe
commit 45d1a468e8
3 changed files with 24 additions and 12 deletions

View file

@ -35,6 +35,8 @@ var (
eosClientCtx = context.Background()
)
var abi_mgr *AbiManager
var redisNs redis.Namespace
// Reader states
@ -216,9 +218,6 @@ func main() {
return
}
// Init Abi cache
InitAbiCache(conf.Redis.CacheID)
// Connect client and get chain info.
log.Printf("Get chain info from api at: %s", conf.Api)
eosClient = eos.New(conf.Api)
@ -228,6 +227,9 @@ func main() {
return
}
// Init Abi cache
abi_mgr = abi.NewAbiManager(eosClient, conf.Redis.CacheID)
redisNs = redis.Namespace{
Prefix: conf.Redis.Prefix,
ChainID: chainInfo.ChainID.String(),