darkwallet / python-obelisk

Pure Python Obelisk + Bitcoin client side library
GNU Affero General Public License v3.0
62 stars 50 forks source link

run testnet enviroment #6

Closed zodman closed 10 years ago

zodman commented 10 years ago

on the cli you can switch to testnet chain with a enviroment variable

caedesvvv commented 10 years ago

don't want to be nittty picky, but can't you just do:

TESTNET_ENABLED=os.environ.get("BLA", True)

that will simplify the test a lot :)

zodman commented 10 years ago

if i set BLAH=10 python main.py it will be set.

Yo are passing/injection other value to the variable TESTNET_ENABLED = 10 and not true or false.

caedesvvv commented 10 years ago

I mean you should change:

+ENABLE_TESTNET = False if not os.environ.get("ENABLE_TESTNET") else True

to:

+ENABLE_TESTNET = os.environ.get("ENABLE_TESTNET", False)

that way if defined it will take the value from environ.

set "export ENABLE_TESTNET=1"

that should work, not? do you mind the value will be set to string instead of bool? I don't think it's a problem.

the problem is when I do: "export ENABLE_TESTNET=0", then it will still be taken as true, but it's the same with your code, and we can recomment ppl to "unset ENABLE_TESNET" if they really don't wan't testnet, so... I recommend the more simple code I propose since it serves the same purpose.

zodman commented 10 years ago

ok i will replace it closet this

2014-04-04 18:16 GMT-06:00 caedesvvv notifications@github.com:

I mean you should change:

+ENABLE_TESTNET = False if not os.environ.get("ENABLE_TESTNET") else True

to:

+ENABLE_TESTNET = os.environ.get("ENABLE_TESTNET", False)

that way if defined it will take the value from environ.

set "export ENABLE_TESTNET=1"

that should work, not? do you mind the value will be set to string instead of bool? I don't think it's a problem.

the problem is when I do: "export ENABLE_TESTNET=0", then it will still be taken as true, but it's the same with your code, and we can recomment ppl to "unset ENABLE_TESNET" if they really don't wan't testnet, so... I recommend the more simple code I propose since it serves the same purpose.

— Reply to this email directly or view it on GitHubhttps://github.com/darkwallet/python-obelisk/pull/6#issuecomment-39623239 .

Andres Vargas www.zodman.com.mx

zodman commented 10 years ago

done!

caedesvvv commented 10 years ago

great thanks!