parameterize blockchain name
This commit is contained in:
parent
b63ee94973
commit
13ef7571b2
1 changed files with 7 additions and 1 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
"reflect"
|
||||
|
||||
"github.com/lbryio/lbry.go/extras/errors"
|
||||
|
@ -103,7 +104,12 @@ func fixDecodeProto(src, dest reflect.Type, data interface{}) (interface{}, erro
|
|||
val, err := getEnumVal(lbryschema.Fee_Currency_value, data)
|
||||
return lbryschema.Fee_Currency(val), err
|
||||
case reflect.TypeOf(lbryschema.Claim{}):
|
||||
claim, err := schema.DecodeClaimHex(data.(string), "lbrycrd_main")
|
||||
blockChainName := os.Getenv("BLOCKCHAIN_NAME")
|
||||
if blockChainName == "" {
|
||||
blockChainName = "lbrycrd_main"
|
||||
}
|
||||
|
||||
claim, err := schema.DecodeClaimHex(data.(string), blockChainName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue