1
0
Fork 0

Rename parser to chain_parser

This commit is contained in:
Gregory Eremin 2015-02-11 02:35:13 +07:00
parent b4880c254f
commit fccc4df352
1 changed files with 12 additions and 1 deletions

View File

@ -3,10 +3,21 @@ package core
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"reflect"
)
func ParseChains(b []byte) (map[string]*Chain, error) {
func ParseChains() (map[string]*Chain, error) {
f, err := os.Open(Conf().ChainsConfig)
if err != nil {
panic("Failed to open chains config: " + Conf().ChainsConfig)
}
b, err := ioutil.ReadAll(f)
if err != nil {
panic("Failed to parse chains config: " + Conf().ChainsConfig)
}
var schema map[string]interface{}
if err := json.Unmarshal(b, &schema); err != nil {
return nil, err