Skip to content
This repository was archived by the owner on Aug 12, 2024. It is now read-only.

Commit e02b92c

Browse files
noandreashekhar-shubhendu
authored andcommitted
feat(aens): use .chain instead of .aet as TLD after Lima HF
* update node to v5.0.0-rc5 * use .chain instead of .aet as TLD after Lima HF BREAKING CHANGES: .aet is not supported after this release relates to #266
1 parent af06d36 commit e02b92c

12 files changed

+33
-33
lines changed

.env

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# this is used by docker-compose.yml to for the node image tag
2-
NODE_TAG=v5.0.0-rc.4
2+
NODE_TAG=v5.0.0-rc.5
33
COMPILER_TAG=v3.2.0

aeternity/__main__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ def contract_call_info(tx_hash, force, wait, json_):
833833
def inspect(obj, height, force, wait, json_):
834834
try:
835835
set_global_options(json_, force, wait)
836-
if obj.endswith(".test") or obj.endswith(".aet"):
836+
if obj.endswith(".test") or obj.endswith(".chain"):
837837
data = _node_cli().get_name_entry_by_name(name=obj)
838838
_print_object(data, title="name")
839839
elif obj.startswith("kh_") or obj.startswith("mh_"):

aeternity/aens.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def get_minimum_name_fee(cls, domain: str) -> int:
5353
:param domain: the domain name to get the fee for
5454
:return: the minimum fee for the domain auction
5555
"""
56-
name_len = len(domain.replace(".aet", ""))
56+
name_len = len(domain.replace(".chain", ""))
5757
if name_len >= defaults.NAME_BID_MAX_LENGTH:
5858
return defaults.NAME_BID_RANGES.get(defaults.NAME_BID_MAX_LENGTH)
5959
return defaults.NAME_BID_RANGES.get(name_len)

aeternity/hashing.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,15 @@ def namehash_encode(prefix, name):
142142

143143
def commitment_id(domain: str, salt: int = None) -> tuple:
144144
"""
145-
Compute the commitment id, the computed id will be different for .test (pre lima) and .aet domains
145+
Compute the commitment id, the computed id will be different for .test (pre lima) and .chain domains
146146
:param domain: the domain for which the commitment_id has to be generated
147147
:param salt: the salt to use, if not provided it is randomly generated
148148
"""
149149
name_salt = randint() if salt is None else salt
150-
if domain.endswith(".test"):
151-
commitment_id = hash_encode(identifiers.COMMITMENT_ID, namehash(domain) + _int(name_salt, 32))
152-
else:
150+
if domain.endswith(".chain"):
153151
commitment_id = hash_encode(identifiers.COMMITMENT_ID, domain.lower().encode('ascii') + _int(name_salt, 32))
152+
else:
153+
commitment_id = hash_encode(identifiers.COMMITMENT_ID, namehash(domain) + _int(name_salt, 32))
154154
return commitment_id, name_salt
155155

156156

@@ -236,7 +236,7 @@ def name_id(name: str):
236236
Encode a domain name
237237
:param name: the domain name to encode
238238
"""
239-
if name.endswith('.aet'):
239+
if name.endswith('.chain'):
240240
return encode(identifiers.NAME_ID, hash(name.lower().encode('ascii')))
241241
return encode(identifiers.NAME_ID, namehash(name))
242242

aeternity/signing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def from_private_key_string(cls, key_string):
134134

135135
@classmethod
136136
def from_secret_key_string(cls, key_string):
137-
"""create a keypair from a aet address and key_string key string
137+
"""create a keypair from a chain address and key_string key string
138138
:param key_string: the encoded key_string key (hex for private, prefixed base58 for public)
139139
:return: a keypair object or raise error if the public key doesn't match
140140
"""

aeternity/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def is_valid_aens_name(domain_name):
5050
Test if the provided name is valid for the aens system
5151
"""
5252
if domain_name is None or not validators.domain(domain_name.lower()) or (
53-
not domain_name.endswith(('.aet')) and not domain_name.endswith(('.test'))):
53+
not domain_name.endswith(('.chain')) and not domain_name.endswith(('.test'))):
5454
return False
5555
return True
5656

command-line-tool.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ Transactions__________________ 0
103103
The æternity naming system allows you to register a name for your account (or oracle).
104104

105105
```
106-
$ aecli account mywallet name 'newby.aet' claim
106+
$ aecli account mywallet name 'newby.chain' claim
107107
Enter the wallet password []:
108-
Name newby.aet claimed
108+
Name newby.chain claimed
109109
Transaction hash______________ th_vmucE7sFSc8QjWBAJwkh2drN3jKwtSd7KYtYzjL6Bfg1x8kyq
110110
```
111111

@@ -125,7 +125,7 @@ TTL___________________________ 86238
125125
and check out the name we registered, to ensure we have it:
126126

127127
```
128-
$ aecli inspect name newby.aet
128+
$ aecli inspect name newby.chain
129129
Status________________________ CLAIMED
130130
Pointers______________________ {'account_pubkey': 'ak_wmZUvZWrVibPM2PuSGhgWmMQXchEWgRTbwBp7tYUcPyBYHnpR'}
131131
TTL___________________________ 86329

tests/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def tempdir(scope="module"):
2828
shutil.rmtree(path)
2929

3030

31-
def random_domain(length=10, tld='aet'):
31+
def random_domain(length=10, tld='chain'):
3232
rand_str = ''.join(random.choice(string.ascii_letters) for _ in range(length))
3333
return f"{rand_str}.{tld}"
3434

tests/test_aens.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@
99
def test_name_validation_fails(chain_fixture):
1010
with raises(ValueError):
1111
chain_fixture.NODE_CLI.AEName('test.lol')
12-
chain_fixture.NODE_CLI.AEName('test.aet')
12+
chain_fixture.NODE_CLI.AEName('test.chain')
1313
chain_fixture.NODE_CLI.AEName('test.test')
1414

1515

1616
def test_name_validation_succeeds(chain_fixture):
1717
chain_fixture.NODE_CLI.AEName('test.test')
18-
chain_fixture.NODE_CLI.AEName('test.aet')
18+
chain_fixture.NODE_CLI.AEName('test.chain')
1919

2020

2121
def test_name_is_available(chain_fixture):
22-
domain = random_domain(tld='aet' if chain_fixture.NODE_CLI.get_consensus_protocol_version() >= PROTOCOL_LIMA else 'test')
22+
domain = random_domain(tld='chain' if chain_fixture.NODE_CLI.get_consensus_protocol_version() >= PROTOCOL_LIMA else 'test')
2323
name = chain_fixture.NODE_CLI.AEName(domain)
2424
assert name.is_available()
2525

2626

2727
def test_name_status_available(chain_fixture):
28-
domain = random_domain(length=13 ,tld='aet' if chain_fixture.NODE_CLI.get_consensus_protocol_version() >= PROTOCOL_LIMA else 'test')
28+
domain = random_domain(length=13 ,tld='chain' if chain_fixture.NODE_CLI.get_consensus_protocol_version() >= PROTOCOL_LIMA else 'test')
2929
name = chain_fixture.NODE_CLI.AEName(domain)
3030
assert name.status == AEName.Status.UNKNOWN
3131
name.update_status()
@@ -35,7 +35,7 @@ def test_name_status_available(chain_fixture):
3535
def test_name_claim_lifecycle(chain_fixture):
3636
try:
3737
# avoid auctions
38-
domain = random_domain(length=13 ,tld='aet' if chain_fixture.NODE_CLI.get_consensus_protocol_version() >= PROTOCOL_LIMA else 'test')
38+
domain = random_domain(length=13 ,tld='chain' if chain_fixture.NODE_CLI.get_consensus_protocol_version() >= PROTOCOL_LIMA else 'test')
3939
node_cli = chain_fixture.NODE_CLI
4040
name = node_cli.AEName(domain)
4141
assert name.status == AEName.Status.UNKNOWN
@@ -86,7 +86,7 @@ def test_name_auction(chain_fixture):
8686

8787
def test_name_status_unavailable(chain_fixture):
8888
# avoid auctions
89-
domain = random_domain(length=13 ,tld='aet' if chain_fixture.NODE_CLI.get_consensus_protocol_version() >= PROTOCOL_LIMA else 'test')
89+
domain = random_domain(length=13 ,tld='chain' if chain_fixture.NODE_CLI.get_consensus_protocol_version() >= PROTOCOL_LIMA else 'test')
9090
print(f"domain is {domain}")
9191
occupy_name = chain_fixture.NODE_CLI.AEName(domain)
9292
occupy_name.full_claim_blocking(chain_fixture.ALICE)
@@ -97,7 +97,7 @@ def test_name_status_unavailable(chain_fixture):
9797

9898
def test_name_update(chain_fixture):
9999
# avoid auctions
100-
domain = random_domain(length=13 ,tld='aet' if chain_fixture.NODE_CLI.get_consensus_protocol_version() >= PROTOCOL_LIMA else 'test')
100+
domain = random_domain(length=13 ,tld='chain' if chain_fixture.NODE_CLI.get_consensus_protocol_version() >= PROTOCOL_LIMA else 'test')
101101
print(f"domain is {domain}")
102102
name = chain_fixture.NODE_CLI.AEName(domain)
103103
print("Claim name ", domain)
@@ -122,7 +122,7 @@ def test_name_update(chain_fixture):
122122

123123
def test_spend_by_name(chain_fixture):
124124
# claim a domain
125-
domain = random_domain(tld='aet' if chain_fixture.NODE_CLI.get_consensus_protocol_version() >= PROTOCOL_LIMA else 'test')
125+
domain = random_domain(tld='chain' if chain_fixture.NODE_CLI.get_consensus_protocol_version() >= PROTOCOL_LIMA else 'test')
126126
print(f"domain is {domain}")
127127
name = chain_fixture.NODE_CLI.AEName(domain)
128128
print("Claim name ", domain)
@@ -146,7 +146,7 @@ def test_spend_by_name(chain_fixture):
146146

147147
def test_name_transfer_ownership(chain_fixture):
148148
# avoid auctions
149-
domain = random_domain(length=13 ,tld='aet' if chain_fixture.NODE_CLI.get_consensus_protocol_version() >= PROTOCOL_LIMA else 'test')
149+
domain = random_domain(length=13 ,tld='chain' if chain_fixture.NODE_CLI.get_consensus_protocol_version() >= PROTOCOL_LIMA else 'test')
150150
name = chain_fixture.NODE_CLI.AEName(domain)
151151
name.full_claim_blocking(chain_fixture.ALICE)
152152
assert name.status == AEName.Status.CLAIMED
@@ -167,7 +167,7 @@ def test_name_transfer_ownership(chain_fixture):
167167

168168
def test_name_revocation(chain_fixture):
169169
# avoid auctions
170-
domain = random_domain(length=13 ,tld='aet' if chain_fixture.NODE_CLI.get_consensus_protocol_version() >= PROTOCOL_LIMA else 'test')
170+
domain = random_domain(length=13 ,tld='chain' if chain_fixture.NODE_CLI.get_consensus_protocol_version() >= PROTOCOL_LIMA else 'test')
171171
name = chain_fixture.NODE_CLI.AEName(domain)
172172
name.full_claim_blocking(chain_fixture.ALICE)
173173
name.revoke(chain_fixture.ALICE)

tests/test_cli.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def test_cli_phases_spend(chain_fixture, tempdir):
168168
def test_cli_name_claim(chain_fixture, tempdir):
169169
account_alice_path = _account_path(tempdir, chain_fixture.ALICE)
170170
# get a domain that is not under auction scheme
171-
domain = random_domain(length=13 ,tld='aet' if chain_fixture.NODE_CLI.get_consensus_protocol_version() >= identifiers.PROTOCOL_LIMA else 'test')
171+
domain = random_domain(length=13 ,tld='chain' if chain_fixture.NODE_CLI.get_consensus_protocol_version() >= identifiers.PROTOCOL_LIMA else 'test')
172172
# let alice preclaim a name
173173
j = call_aecli('name', 'pre-claim', '--password', 'aeternity_bc', account_alice_path, domain, '--wait')
174174
# retrieve the salt and the transaction hash
@@ -202,7 +202,7 @@ def test_cli_name_auction(chain_fixture, tempdir):
202202
account_alice_path = _account_path(tempdir, chain_fixture.ALICE)
203203
account_bob_path = _account_path(tempdir, chain_fixture.ALICE)
204204
# get a domain that is under auction scheme
205-
domain = random_domain(length=9 ,tld='aet' if chain_fixture.NODE_CLI.get_consensus_protocol_version() >= identifiers.PROTOCOL_LIMA else 'test')
205+
domain = random_domain(length=9 ,tld='chain' if chain_fixture.NODE_CLI.get_consensus_protocol_version() >= identifiers.PROTOCOL_LIMA else 'test')
206206
# let alice preclaim a name
207207
j = call_aecli('name', 'pre-claim', '--password', 'aeternity_bc', account_alice_path, domain, '--wait')
208208
# retrieve the salt and the transaction hash

tests/test_hashing.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,19 @@ def test_hashing_committment_id():
127127
"commitment_id": "cm_pQu4wAuiyhe1mHqZzh3yNA4JwBPaess3MY7MnZFG9vsFjD5yE"
128128
},
129129
{
130-
"domain": "aeternity.aet",
130+
"domain": "aeternity.chain",
131131
"salt": 10692426485854419779,
132-
"commitment_id": "cm_s7xYUEpNNz4v3BenNMBP9YknxYRNqBMNTWG99Vu6v1d8kXxuH"
132+
"commitment_id": "cm_j5Aa3senWdNskwSSHh3M182ucbqrAaSE5DVjejM8fBCgR97kq"
133133
},
134134
{
135-
"domain": "whatever.aet",
135+
"domain": "whatever.chain",
136136
"salt": 4703192432112,
137-
"commitment_id": "cm_2EoRHJoWoNv4EpZLxgWKBrvgmrbSvA5BxMvDSwPDc6CUYBqanb"
137+
"commitment_id": "cm_2Hd42FoCDfYxcG3MyZkiN9wXiBKfHHzBWycEvrazPYgoEh1ien"
138138
},
139139
{
140-
"domain": "aepps.aet",
140+
"domain": "aepps.chain",
141141
"salt": 723907012945811264198,
142-
"commitment_id": "cm_2gPm7nAvTQojYnVGDPEMZd6uJbkVbZ4aX1nbFm1NCE5HW3kHE6"
142+
"commitment_id": "cm_7aMmYzWVGK2t6gqWYD9WFbwHWaLzcux6t63i2J7VHPZfcuzjs"
143143
},
144144
]
145145

tests/test_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_utils_is_valid_name():
3636
('valid.test', True),
3737
('valid.test', True),
3838
('aeternity.com', False),
39-
('aeternity.aet', True),
39+
('aeternity.chain', True),
4040
('om', False),
4141
(None, False),
4242
(".o.test", False),

0 commit comments

Comments
 (0)