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

Commit 22e7795

Browse files
authored
Merge pull request #73 from aeternity/release/0.25.0.1b1
Release/0.25.0.1b1
2 parents bce24f0 + 6f3ee1b commit 22e7795

File tree

15 files changed

+51
-35
lines changed

15 files changed

+51
-35
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# this is used by docker-compose.yml to for the epoch image tag
2-
TAG=v0.24.0
2+
TAG=v0.25.0

CHANGELOG.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).
55

66
## [Unreleased]
77

8+
## [0.25.0.1b1]
9+
10+
### Added
11+
12+
- Support for network_id when signing transactions
13+
14+
### Removed
15+
16+
- Compatiblity with epoch nodes version < [0.25.0](https://github.com/aeternity/epoch/blob/v0.25.0/docs/release-notes/RELEASE-NOTES-0.25.0.md)
17+
- Support for .aet tld for aens
18+
19+
20+
821
## [0.24.0.2]
922

1023
### Fixed
@@ -21,7 +34,6 @@ log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).
2134

2235
- The keystore/JSON format will be deprecated in the next releases
2336

24-
2537
## [0.22.0.1]
2638

2739
### Removed
@@ -44,7 +56,6 @@ log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).
4456
- Add [exponetial backoff](https://developers.google.com/drive/api/v3/handle-errors#exponential-backoff) strategy to verify if a transaction has been included in the chain.
4557
- Add `--wait` flag to instruct the client to wait for a transaction to be included in a chain before returning
4658

47-
4859
## [0.21.0.1]
4960

5061
### Removed

aeternity/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
__version__ = '0.24.0.2'
1+
__version__ = '0.25.0.1b1'
22

33
__compatibility__ = [
4-
'0.24.0'
4+
'0.25.0'
55
]

aeternity/__main__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,8 @@ def name_register(keystore_name, domain, name_ttl, ttl, password, force, wait, j
350350
@click.argument('keystore_name', required=True)
351351
@click.argument('domain', required=True)
352352
@click.argument('address', required=True)
353-
@click.option("--name-ttl", default=100, help=f'Lifetime of the claim in blocks (default {config.DEFAULT_NAME_TTL})')
354-
@click.option("--ttl", default=100, help=f'Lifetime of the claim request in blocks (default {config.DEFAULT_TX_TTL})')
353+
@click.option("--name-ttl", default=config.DEFAULT_NAME_TTL, help=f'Lifetime of the claim in blocks (default {config.DEFAULT_NAME_TTL})')
354+
@click.option("--ttl", default=config.DEFAULT_TX_TTL, help=f'Lifetime of the claim request in blocks (default {config.DEFAULT_TX_TTL})')
355355
@account_options
356356
def name_update(keystore_name, domain, address, name_ttl, ttl, password, force, wait, json_):
357357
"""
@@ -578,7 +578,7 @@ def contract_call(keystore_name, deploy_descriptor, function, params, return_typ
578578
def inspect(obj, force, wait, json_):
579579
try:
580580
set_global_options(force, wait, json_)
581-
if obj.endswith(".aet"):
581+
if obj.endswith(".test"):
582582
name = _epoch_cli().AEName(obj)
583583
name.update_status()
584584
_print_object({

aeternity/config.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
CONTRACT_DEFAULT_GAS_PRICE = 1
2121
CONTRACT_DEFAULT_DEPOSIT = 4
2222
CONTRACT_DEFAULT_VM_VERSION = 1
23+
# network id
24+
DEFAULT_NETWORK_ID = "ae_mainnet"
2325
# TUNING
2426
MAX_RETRIES = 7 # used in exponential backoff when checking a transaction
2527
POLLING_INTERVAL = 2 # in seconds
@@ -40,7 +42,8 @@ def __init__(self,
4042
external_url='http://localhost:3013',
4143
internal_url='http://localhost:3113',
4244
websocket_url=None,
43-
force_compatibility=False):
45+
force_compatibility=False,
46+
network_id=DEFAULT_NETWORK_ID):
4447

4548
# endpoint urls
4649
self.websocket_url = websocket_url
@@ -49,6 +52,7 @@ def __init__(self,
4952
# get the version
5053
self.name_url = f'{self.api_url}/name'
5154
self.pubkey = None
55+
self.network_id = network_id
5256
# retrieve the version of the node we are connecting to
5357
try:
5458
r = requests.get(f"{self.api_url}/v2/status").json()

aeternity/epoch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def send(self, message):
137137

138138
def spend(self, keypair, recipient_pubkey, amount, payload="", fee=config.DEFAULT_FEE, tx_ttl=config.DEFAULT_TX_TTL):
139139
"""create and execute a spend transaction"""
140-
txb = transactions.TxBuilder(self.cli, keypair)
140+
txb = transactions.TxBuilder(self, keypair)
141141
# create spend_tx
142142
tx, sg, tx_hash = txb.tx_spend(recipient_pubkey, amount, payload, fee, tx_ttl)
143143
# post the transaction to the chain

aeternity/transactions.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,15 @@ class TxBuilder:
7373
TxBuilder is used to build and post transactions to the chain.
7474
"""
7575

76-
def __init__(self, epoch, account, native=True):
76+
def __init__(self, epoch, account, native=False):
7777
"""
7878
:param epoch: the epoch rest client
7979
:param account: the account that will be signing the transactions
8080
:param native: if the transactions should be built by the sdk (True) or requested to the debug api (False)
8181
"""
8282
self.epoch = epoch
8383
self.account = account
84+
self.network_id = epoch._get_active_config().network_id
8485
self.native_transactions = native
8586

8687
@staticmethod
@@ -122,11 +123,11 @@ def _get_nonce_ttl(self, relative_ttl):
122123
nonce = TxBuilder.get_next_nonce(self.epoch, self.account.get_address())
123124
return nonce, ttl
124125

125-
def encode_signed_transaction(self, signed_tx, signature):
126+
def encode_signed_transaction(self, transaction, signature):
126127
"""prepare a signed transaction message"""
127128
tag = bytes([OBJECT_TAG_SIGNED_TRANSACTION])
128129
vsn = bytes([VSN])
129-
encoded_signed_tx = hashing.encode_rlp("tx", [tag, vsn, [signature], signed_tx])
130+
encoded_signed_tx = hashing.encode_rlp("tx", [tag, vsn, [signature], transaction])
130131
encoded_signature = hashing.encode("sg", signature)
131132
return encoded_signed_tx, encoded_signature
132133

@@ -138,7 +139,7 @@ def sign_encode_transaction(self, tx):
138139
# decode the transaction if not in native mode
139140
transaction = hashing.decode(tx.tx) if hasattr(tx, "tx") else hashing.decode(tx)
140141
# sign the transaction
141-
signature = self.account.sign(transaction)
142+
signature = self.account.sign(hashing.to_bytes(self.network_id) + transaction)
142143
# encode the transaction
143144
encoded_signed_tx, encoded_signature = self.encode_signed_transaction(transaction, signature)
144145
# compute the hash

aeternity/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ def is_valid_aens_name(domain_name):
4848
# TODO: validate according to the spec!
4949
# TODO: https://github.com/aeternity/protocol/blob/master/AENS.md#name
5050

51-
if domain_name is None or not validators.domain(domain_name) or not domain_name.endswith(('.aet', '.test')):
51+
if domain_name is None or not validators.domain(domain_name) or not domain_name.endswith(('.test')):
5252
return False
5353
return True

docker/epoch_node_mean16.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
peers:
33
- aenode://pp_28uQUgsPcsy7TQwnRxhF8GMKU4ykFLKsgf4TwDwPMNaSCXwWV8@node2:3015
4-
- aenode://pp_Dxq41rJN33j26MLqryvh7AnhuZywefWKEPBiiYu2Da2vDWLBq@node3:3015
54

65
http:
76
external:
@@ -10,11 +9,11 @@ http:
109
listen_address: 0.0.0.0
1110

1211
websocket:
13-
internal:
12+
channel:
1413
listen_address: 0.0.0.0
1514

1615
keys:
17-
password: "top secret"
16+
peer_password: "top secret"
1817
dir: ./keys
1918

2019
chain:

sonar-project.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
sonar.projectKey=aeternity:aepp-sdk-python
22
sonar.projectName=Python :: Aeternity SDK
3-
sonar.projectVersion=0.24.0.1
3+
sonar.projectVersion=0.25.0.1
44

55
sonar.sources=aeternity
66
sonar.tests=tests

0 commit comments

Comments
 (0)