Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.

Commit 46cfd52

Browse files
authored
Merge pull request #298 from lzpap/rename_testnet
Fixes #263 Rename `testnet` to `devnet`
2 parents 363a0bf + 870fb9c commit 46cfd52

18 files changed

+37
-37
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Here's how you could send a zero-value transaction, using the library. For the g
118118

119119
```python
120120
# You don't need a seed to send zero-value transactions
121-
api = Iota('https://nodes.devnet.iota.org:443', testnet=True)
121+
api = Iota('https://nodes.devnet.iota.org:443', devnet=True)
122122

123123
# Define a message to send.
124124
# This message must include only ASCII characters.

docs/tutorials.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ Discussion
100100
We have seen this part before. Note, that now we import more objects which we
101101
will use to construct our transaction.
102102

103-
Notice ``testnet=True`` in the argument list of the API instantiation. We
104-
tell the API directly that we will use the devnet/testnet. By default, the API
105-
is configured for the mainnet.
103+
Notice ``devnet=True`` in the argument list of the API instantiation. We
104+
tell the API directly that we will use IOTA's testnet, known as the devnet.
105+
By default, the API is configured for the mainnet.
106106

107107
.. literalinclude:: ../examples/tutorials/02_send_data.py
108108
:lines: 7-8

examples/tutorials/02_send_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from pprint import pprint
33

44
# Declare an API object
5-
api = Iota('https://nodes.devnet.iota.org:443', testnet=True)
5+
api = Iota('https://nodes.devnet.iota.org:443', devnet=True)
66

77
# Prepare custom data
88
my_data = TryteString.from_unicode('Hello from the Tangle!')

examples/tutorials/03_fetch_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from iota.codecs import TrytesDecodeError
33

44
# Declare an API object
5-
api = Iota('https://nodes.devnet.iota.org:443', testnet=True)
5+
api = Iota('https://nodes.devnet.iota.org:443', devnet=True)
66

77
# Address to fetch data from
88
# Replace with your random generated address from Tutorial 2. to fetch the data

examples/tutorials/04a_gen_address.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
api = Iota(
1111
adapter='https://nodes.devnet.iota.org:443',
1212
seed=my_seed,
13-
testnet=True,
13+
devnet=True,
1414
)
1515

1616
print('Generating the first unused address...')

examples/tutorials/04b_check_balance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
my_address = Address(b'YOURADDRESSFROMTHEPREVIOUSTUTORIAL')
66

77
# Declare an API object
8-
api = Iota(adapter='https://nodes.devnet.iota.org:443', testnet=True)
8+
api = Iota(adapter='https://nodes.devnet.iota.org:443', devnet=True)
99

1010
# Script actually runs until you load up your address
1111
success = False

examples/tutorials/04c_get_acc_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
api = Iota(
1010
adapter='https://nodes.devnet.iota.org:443',
1111
seed=my_seed,
12-
testnet=True
12+
devnet=True
1313
)
1414

1515
# Script actually runs until it finds balance

examples/tutorials/05_send_tokens.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
api = Iota(
88
adapter='https://nodes.devnet.iota.org:443',
99
seed=my_seed,
10-
testnet=True,
10+
devnet=True,
1111
)
1212

1313
# Addres to receive 1i

examples/tutorials/06_store_encrypted.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
api = Iota(
1515
adapter='https://nodes.devnet.iota.org:443',
1616
seed=b'YOURSEEDFROMTHEPREVIOUSTUTORIAL',
17-
testnet=True,
17+
devnet=True,
1818
)
1919

2020
# Some confidential information

examples/tutorials/07_fetch_encrypted.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import json
1212

1313
# Declare an API object
14-
api = Iota('https://nodes.devnet.iota.org:443', testnet=True)
14+
api = Iota('https://nodes.devnet.iota.org:443', devnet=True)
1515

1616
# Prompt user for tail tx hash of the bundle
1717
tail_hash = input('Tail transaction hash of the bundle: ')

iota/api.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ class StrictIota(object):
3939
:param AdapterSpec adapter:
4040
URI string or BaseAdapter instance.
4141
42-
:param Optional[bool] testnet:
43-
Whether to use testnet settings for this instance.
44-
On the testnet, minimum weight magnitude is set to 9, on mainnet
42+
:param Optional[bool] devnet:
43+
Whether to use devnet settings for this instance.
44+
On the devnet, minimum weight magnitude is set to 9, on mainnet
4545
it is 1 by default.
4646
4747
:param Optional[bool] local_pow:
@@ -54,15 +54,15 @@ class StrictIota(object):
5454
5555
"""
5656

57-
def __init__(self, adapter, testnet=False, local_pow=False):
57+
def __init__(self, adapter, devnet=False, local_pow=False):
5858
# type: (AdapterSpec, bool, bool) -> None
5959
"""
6060
:param AdapterSpec adapter:
6161
URI string or BaseAdapter instance.
6262
63-
:param bool testnet:
64-
Whether to use testnet settings for this instance.
65-
On the testnet, minimum weight magnitude is set to 9, on mainnet
63+
:param bool devnet:
64+
Whether to use devnet settings for this instance.
65+
On the devnet, minimum weight magnitude is set to 9, on mainnet
6666
it is 1 by default.
6767
6868
:param Optional[bool] local_pow:
@@ -91,7 +91,7 @@ def __init__(self, adapter, testnet=False, local_pow=False):
9191
# via pyota-pow extension, or sends the request to a node.
9292
# But technically, the parameter belongs to the adapter.
9393
self.adapter.set_local_pow(local_pow)
94-
self.testnet = testnet
94+
self.devnet = devnet
9595

9696
def create_command(self, command):
9797
# type: (Text) -> CustomCommand
@@ -134,7 +134,7 @@ def default_min_weight_magnitude(self):
134134
Returns the default ``min_weight_magnitude`` value to use for
135135
API requests.
136136
"""
137-
return 9 if self.testnet else 14
137+
return 9 if self.devnet else 14
138138

139139
def add_neighbors(self, uris):
140140
# type: (Iterable[Text]) -> dict
@@ -197,7 +197,7 @@ def attach_to_tangle(
197197
198198
:param Optional[int] min_weight_magnitude:
199199
Minimum weight magnitude to be used for attaching trytes.
200-
14 by default on mainnet, 9 on testnet/devnet.
200+
14 by default on mainnet, 9 on devnet/devnet.
201201
202202
:return:
203203
``dict`` with the following structure::
@@ -769,9 +769,9 @@ class Iota(StrictIota):
769769
.. note::
770770
This value is never transferred to the node/network.
771771
772-
:param Optional[bool] testnet:
773-
Whether to use testnet settings for this instance.
774-
On the testnet, minimum weight magnitude is decreased, on mainnet
772+
:param Optional[bool] devnet:
773+
Whether to use devnet settings for this instance.
774+
On the devnet, minimum weight magnitude is decreased, on mainnet
775775
it is 14 by default.
776776
777777
For more info on the Mainnet and the Devnet, visit
@@ -791,7 +791,7 @@ class Iota(StrictIota):
791791
- https://github.com/iotaledger/wiki/blob/master/api-proposal.md
792792
"""
793793

794-
def __init__(self, adapter, seed=None, testnet=False, local_pow=False):
794+
def __init__(self, adapter, seed=None, devnet=False, local_pow=False):
795795
# type: (AdapterSpec, Optional[TrytesCompatible], bool, bool) -> None
796796
"""
797797
:param seed:
@@ -801,7 +801,7 @@ def __init__(self, adapter, seed=None, testnet=False, local_pow=False):
801801
.. note::
802802
This value is never transferred to the node/network.
803803
"""
804-
super(Iota, self).__init__(adapter, testnet, local_pow)
804+
super(Iota, self).__init__(adapter, devnet, local_pow)
805805

806806
self.seed = Seed(seed) if seed else Seed.random()
807807
self.helpers = Helpers(self)

iota/bin/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def parse_argv(self, argv=None):
102102
arguments['api'] = Iota(
103103
adapter=arguments.pop('uri'),
104104
seed=seed,
105-
testnet=arguments.pop('testnet'),
105+
devnet=arguments.pop('devnet'),
106106
)
107107

108108
return arguments
@@ -143,10 +143,10 @@ def create_argument_parser(self):
143143
)
144144

145145
parser.add_argument(
146-
'--testnet',
146+
'--devnet',
147147
action='store_true',
148148
default=False,
149-
help='If set, use testnet settings (e.g., for PoW).',
149+
help='If set, use devnet settings (e.g., for PoW).',
150150
)
151151

152152
return parser

iota/bin/repl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ def _start_repl(api):
8989
Starts the REPL.
9090
"""
9191
banner = (
92-
'IOTA API client for {uri} ({testnet}) '
92+
'IOTA API client for {uri} ({devnet}) '
9393
'initialized as variable `api`.\n'
9494
'Type `help(api)` for list of API commands.'.format(
95-
testnet='testnet' if api.testnet else 'mainnet',
95+
devnet='devnet' if api.devnet else 'mainnet',
9696
uri=api.adapter.get_uri(),
9797
)
9898
)

iota/commands/core/attach_to_tangle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def __init__(self):
5353
f.Required | Trytes(result_type=TransactionTrytes),
5454
),
5555

56-
# Loosely-validated; testnet nodes require a different value
56+
# Loosely-validated; devnet nodes require a different value
5757
# than mainnet.
5858
'minWeightMagnitude': f.Required | f.Type(int) | f.Min(1),
5959
})

iota/commands/extended/promote_transaction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def __init__(self):
6262
'depth': f.Required | f.Type(int) | f.Min(1),
6363
'transaction': f.Required | Trytes(TransactionHash),
6464

65-
# Loosely-validated; testnet nodes require a different value
65+
# Loosely-validated; devnet nodes require a different value
6666
# than mainnet.
6767
'minWeightMagnitude': f.Required | f.Type(int) | f.Min(1),
6868
})

iota/commands/extended/replay_bundle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def __init__(self):
5353
'depth': f.Required | f.Type(int) | f.Min(1),
5454
'transaction': f.Required | Trytes(TransactionHash),
5555

56-
# Loosely-validated; testnet nodes require a different value
56+
# Loosely-validated; devnet nodes require a different value
5757
# than mainnet.
5858
'minWeightMagnitude': f.Required | f.Type(int) | f.Min(1),
5959
})

iota/commands/extended/send_transfer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def __init__(self):
7070
'depth': f.Required | f.Type(int) | f.Min(1),
7171
'seed': f.Required | Trytes(result_type=Seed),
7272

73-
# Loosely-validated; testnet nodes require a different
73+
# Loosely-validated; devnet nodes require a different
7474
# value than mainnet.
7575
'minWeightMagnitude': f.Required | f.Type(int) | f.Min(1),
7676

iota/commands/extended/send_trytes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def __init__(self):
7474
f.Required | Trytes(TransactionTrytes),
7575
),
7676

77-
# Loosely-validated; testnet nodes require a different value
77+
# Loosely-validated; devnet nodes require a different value
7878
# than mainnet.
7979
'minWeightMagnitude': f.Required | f.Type(int) | f.Min(1),
8080

0 commit comments

Comments
 (0)