func (db *Database) NewPool(
	name string,
	contractAddress string,
	block uint64,
	balances, denormWeights, tokenTotalSupplies, decimals map[string]interface{},
) error {
	name = strings.ToLower(name)
	db.namedLock.Lock(name)
	defer db.namedLock.Unlock(name)
	infos := make(map[string]interface{})
	infos[strconv.FormatUint(block, 10)] = PoolInfo{
		Balances:            balances,
		DenormalizedWeights: denormWeights,
		TokenTotalSupplies:  tokenTotalSupplies,
	}
	return db.db.Create(&Pool{
		Name:            strings.ToLower(name),
		ContractAddress: contractAddress,
		LastUpdateAt:    block,
		TokenDecimals:   decimals,
		Infos:           infos,
	}).Error
}
// NewPool creates a new entry in the database for an index pool
NewPool creates a new entry in the database for an index pool
// NewPool creates a new entry in the database for an index pool
func (db *Database) NewPool(
	name string,
	contractAddress string,
	block uint64,
	balances, denormWeights, tokenTotalSupplies, decimals map[string]interface{},
) error {
	name = strings.ToLower(name)
	db.namedLock.Lock(name)
	defer db.namedLock.Unlock(name)
	infos := make(map[string]interface{})
	infos[strconv.FormatUint(block, 10)] = PoolInfo{
		Balances:            balances,
		DenormalizedWeights: denormWeights,
		TokenTotalSupplies:  tokenTotalSupplies,
	}
	return db.db.Create(&Pool{
		Name:            strings.ToLower(name),
		ContractAddress: contractAddress,
		LastUpdateAt:    block,
		TokenDecimals:   decimals,
		Infos:           infos,
	}).Error
}
func ( db * Database ) NewPool ( name string , contractAddress string , block uint64 , balances , denormWeights , tokenTotalSupplies , decimals map [ string ] interface { } , ) error { name = strings . ToLower ( name ) db . namedLock . Lock ( name ) defer db . namedLock . Unlock ( name ) infos := make ( map [ string ] interface { } ) infos [ strconv . FormatUint ( block , 10 ) ] = PoolInfo { Balances : balances , DenormalizedWeights : denormWeights , TokenTotalSupplies : tokenTotalSupplies , } return db . db . Create ( & Pool { Name : strings . ToLower ( name ) , ContractAddress : contractAddress , LastUpdateAt : block , TokenDecimals : decimals , Infos : infos , } ) . Error }
NewPool creates a new entry in the database for an index pool
NewPool creates a new entry in the database for an index pool