Skip to content

Commit b5e4896

Browse files
Merge pull request #27 from dragonchain/master
Release 4.3.0
2 parents 9c01c74 + 84606e5 commit b5e4896

32 files changed

+169
-73
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2019 Dragonchain, Inc. or its affiliates. All Rights Reserved.
1+
Copyright 2020 Dragonchain, Inc. or its affiliates. All Rights Reserved.
22

33
Apache License
44
Version 2.0, January 2004

docs/changelog.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
Changelog
22
=========
33

4+
4.3.0
5+
-----
6+
7+
Features:
8+
* Allow for deleting of smart contracts by transaction type
9+
* Add support for publishing signed interchain transactions
10+
Development:
11+
* Fix tests for python 3.8.1
12+
* Fix integration tests for redisearch update
13+
* Fix installation requirements for python 3.4 testing
14+
* Fix linting error with new bugbear version
15+
* Remove duplicate integration test and fix openfaas logs schema for newer openfaas versions
16+
* Remove codeowners
17+
418
4.2.1
519
-----
620

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def get_version():
3232
# -- Project information -----------------------------------------------------
3333

3434
project = "Dragonchain Python SDK"
35-
copyright = "2019, Dragonchain, Inc." # noqa: A001
35+
copyright = "2020, Dragonchain, Inc." # noqa: A001
3636
author = "Dragonchain, Inc."
3737

3838
# The short X.Y version

dragonchain_sdk/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2019 Dragonchain, Inc. or its affiliates. All Rights Reserved.
1+
# Copyright 2020 Dragonchain, Inc. or its affiliates. All Rights Reserved.
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at
@@ -16,7 +16,7 @@
1616
from dragonchain_sdk import dragonchain_client
1717

1818
__author__ = "Dragonchain, Inc."
19-
__version__ = "4.2.1"
19+
__version__ = "4.3.0"
2020

2121
ASYNC_SUPPORT = False
2222

dragonchain_sdk/async_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2019 Dragonchain, Inc. or its affiliates. All Rights Reserved.
1+
# Copyright 2020 Dragonchain, Inc. or its affiliates. All Rights Reserved.
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

dragonchain_sdk/configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2019 Dragonchain, Inc. or its affiliates. All Rights Reserved.
1+
# Copyright 2020 Dragonchain, Inc. or its affiliates. All Rights Reserved.
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at
@@ -193,7 +193,7 @@ def _get_credentials_as_smart_contract() -> Tuple[str, str]:
193193
auth_key = open(os.path.join(base_path, "sc-{}-secret-key".format(os.environ.get("SMART_CONTRACT_ID"))), "r").read()
194194
auth_key_id = open(os.path.join(base_path, "sc-{}-auth-key-id".format(os.environ.get("SMART_CONTRACT_ID"))), "r").read()
195195
return auth_key_id, auth_key
196-
except (OSError, IOError, FileNotFoundError):
196+
except OSError:
197197
return "", ""
198198

199199

dragonchain_sdk/credentials.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2019 Dragonchain, Inc. or its affiliates. All Rights Reserved.
1+
# Copyright 2020 Dragonchain, Inc. or its affiliates. All Rights Reserved.
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

dragonchain_sdk/dragonchain_client.py

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2019 Dragonchain, Inc. or its affiliates. All Rights Reserved.
1+
# Copyright 2020 Dragonchain, Inc. or its affiliates. All Rights Reserved.
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at
@@ -304,21 +304,30 @@ def update_smart_contract( # noqa: C901
304304

305305
return self.request.put("/v1/contract/{}".format(smart_contract_id), body)
306306

307-
def delete_smart_contract(self, smart_contract_id: str) -> "request_response":
307+
def delete_smart_contract(self, smart_contract_id: Optional[str] = None, transaction_type: Optional[str] = None) -> "request_response":
308308
"""Delete an existing contract
309309
310310
Args:
311-
smart_contract_id (str): Transaction type of the contract to delete
311+
smart_contract_id (str, optional): Contract ID of the contract to delete
312+
transaction_type (str, optional): Transaction type of the contract to delete
312313
313314
Raises:
314315
TypeError: with bad parameter types
315316
316317
Returns:
317318
The results of the delete request
318319
"""
319-
if not isinstance(smart_contract_id, str):
320-
raise TypeError('Parameter "state" must be of type str.')
321-
return self.request.delete("/v1/contract/{}".format(smart_contract_id))
320+
if smart_contract_id and transaction_type:
321+
raise TypeError('Only one of "smart_contract_id" or "transaction_type" can be specified')
322+
if smart_contract_id and not isinstance(smart_contract_id, str):
323+
raise TypeError('Parameter "smart_contract_id" must be of type str.')
324+
if transaction_type and not isinstance(transaction_type, str):
325+
raise TypeError('Parameter "transaction_type" must be of type str.')
326+
if smart_contract_id:
327+
return self.request.delete("/v1/contract/{}".format(smart_contract_id))
328+
if transaction_type:
329+
return self.request.delete("/v1/contract/txn_type/{}".format(transaction_type))
330+
raise TypeError('At least one of "smart_contract_id" or "transaction_type" must be supplied')
322331

323332
def query_transactions(
324333
self,
@@ -1178,6 +1187,30 @@ def get_default_interchain_network(self) -> "request_response":
11781187
"""
11791188
return self.request.get("/v1/interchains/default")
11801189

1190+
def publish_interchain_transaction(self, blockchain: str, name: str, signed_transaction: str) -> "request_response":
1191+
"""Publish an interchain transaction that's already been signed
1192+
1193+
Args:
1194+
blockchain (str): The blockchain type to set (i.e. 'bitcoin', 'ethereum')
1195+
name (str): The name of the that blockchain's network to use (set when creating the network)
1196+
signed_transaction (str): Signed transaction string (return from sign_<network>_transaction function)
1197+
1198+
Raises:
1199+
TypeError: with bad parameter type
1200+
1201+
Returns:
1202+
The transaction hash (or equivalent) of the published transaction
1203+
"""
1204+
if not isinstance(blockchain, str):
1205+
raise TypeError('Parameter "blockchain" must be of type str.')
1206+
if not isinstance(name, str):
1207+
raise TypeError('Parameter "name" must be of type str.')
1208+
if not isinstance(signed_transaction, str):
1209+
raise TypeError('Parameter "signed_transaction" must be of type str.')
1210+
return self.request.post(
1211+
"/v1/interchains/transaction/publish", {"version": "1", "blockchain": blockchain, "name": name, "signed_txn": signed_transaction}
1212+
)
1213+
11811214
def create_bitcoin_transaction(
11821215
self,
11831216
network: str,

dragonchain_sdk/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2019 Dragonchain, Inc. or its affiliates. All Rights Reserved.
1+
# Copyright 2020 Dragonchain, Inc. or its affiliates. All Rights Reserved.
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

0 commit comments

Comments
 (0)