Skip to content

Commit

Permalink
Merge pull request #8 from proximax-storage/development
Browse files Browse the repository at this point in the history
release 0.0.3+3
  • Loading branch information
slackve authored Jun 23, 2019
2 parents 6361671 + 5e1315b commit 0361c0b
Show file tree
Hide file tree
Showing 23 changed files with 135 additions and 88 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
## 0.0.3+3

### Updates
[UPDATE] Reformat style.

[UPDATE] Update example.


### Fixed bugs
[FIXED] fixed bug in Deadline null

[FIXED] fixed bug in MosaicSupplyChangeTransaction

[FIXED] fixed bug in duration MosaicDefinition

[FIXED] fixed bug in duration namespace

[FIXED] fixed bug in _MessageDTO null

[FIXED] fixed bug in parentId null

[FIXED] fixed bug in List _MosaicNameDTO

[FIXED] fixed bug in List _MosaicInfoDTO

[FIXED] fixed bug in List _BlockInfoDTO

[FIXED] fixed bug in BlockInfoDTO

## 0.0.3+2

### Updates
Expand Down
38 changes: 19 additions & 19 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -6,60 +6,60 @@

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
'License' shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
'Licensor' shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
'Legal Entity' shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
'control' means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
'You' (or 'Your') shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
'Source' form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
'Object' form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
'Work' shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
'Derivative Works' shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
'Contribution' shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
the copyright owner. For the purposes of this definition, 'submitted'
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
designated in writing by the copyright owner as 'Not a Contribution.'

"Contributor" shall mean Licensor and any individual or Legal Entity
'Contributor' shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

Expand Down Expand Up @@ -103,7 +103,7 @@
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
(d) If the Work includes a 'NOTICE' text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
Expand Down Expand Up @@ -142,7 +142,7 @@

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
Contributor provides its Contributions) on an 'AS IS' BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
Expand Down Expand Up @@ -178,24 +178,24 @@
APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
boilerplate notice, with the fields enclosed by brackets '[]'
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
same 'printed page' as the copyright notice for easier
identification within third-party archives.

Copyright 2018 ProximaX Limited

Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the 'License');
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
distributed under the License is distributed on an 'AS IS' BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Add this to your package's pubspec.yaml file:

```dart
dependencies:
xpx_chain_sdk: 0.0.3+2
xpx_chain_sdk: 0.0.3+3
```

**2. Install it**
Expand Down
35 changes: 20 additions & 15 deletions lib/src/api/api_account_routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,10 @@ class AccountRoutesApi {
if (response.statusCode >= 400) {
throw ApiException(response.statusCode, response.body);
} else if (response.body != null) {
final List resp = (_apiClient.deserialize(response.body, 'List<Transaction>'))
.map((item) => item)
.toList();
final List resp =
(_apiClient.deserialize(response.body, 'List<Transaction>'))
.map((item) => item)
.toList();
return resp.map(_deserializeDTO).toList();
} else {
return null;
Expand Down Expand Up @@ -332,9 +333,10 @@ class AccountRoutesApi {
if (response.statusCode >= 400) {
throw ApiException(response.statusCode, response.body);
} else if (response.body != null) {
final List resp = (_apiClient.deserialize(response.body, 'List<Transaction>'))
.map((item) => item)
.toList();
final List resp =
(_apiClient.deserialize(response.body, 'List<Transaction>'))
.map((item) => item)
.toList();
return resp.map(_deserializeDTO).toList();
} else {
return null;
Expand Down Expand Up @@ -397,9 +399,10 @@ class AccountRoutesApi {
if (response.statusCode >= 400) {
throw ApiException(response.statusCode, response.body);
} else if (response.body != null) {
final List resp = (_apiClient.deserialize(response.body, 'List<Transaction>'))
.map((item) => item)
.toList();
final List resp =
(_apiClient.deserialize(response.body, 'List<Transaction>'))
.map((item) => item)
.toList();
return resp.map(_deserializeDTO).toList();
} else {
return null;
Expand Down Expand Up @@ -462,9 +465,10 @@ class AccountRoutesApi {
if (response.statusCode >= 400) {
throw ApiException(response.statusCode, response.body);
} else if (response.body != null) {
final List resp = (_apiClient.deserialize(response.body, 'List<Transaction>'))
.map((item) => item)
.toList();
final List resp =
(_apiClient.deserialize(response.body, 'List<Transaction>'))
.map((item) => item)
.toList();
return resp.map(_deserializeDTO).toList();
} else {
return null;
Expand Down Expand Up @@ -527,9 +531,10 @@ class AccountRoutesApi {
if (response.statusCode >= 400) {
throw ApiException(response.statusCode, response.body);
} else if (response.body != null) {
final List resp = (_apiClient.deserialize(response.body, 'List<Transaction>'))
.map((item) => item)
.toList();
final List resp =
(_apiClient.deserialize(response.body, 'List<Transaction>'))
.map((item) => item)
.toList();
return resp.map(_deserializeDTO).toList();
} else {
return null;
Expand Down
12 changes: 7 additions & 5 deletions lib/src/api/api_blockchain_routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class BlockchainRoutesApi {
if (response.statusCode >= 400) {
throw ApiException(response.statusCode, response.body);
} else if (response.body != null) {
final resp = apiClient.deserialize(response.body, 'BlockInfoDTO');
final resp = apiClient.deserialize(response.body, '_BlockInfoDTO');
return BlockInfo.fromDTO(resp);
} else {
return null;
Expand Down Expand Up @@ -296,10 +296,12 @@ class BlockchainRoutesApi {
if (response.statusCode >= 400) {
throw ApiException(response.statusCode, response.body);
} else if (response.body != null) {
final List resp = apiClient
.deserialize(response.body, 'List<BlockInfoDTO>')
.map((item) => item)
.toList();
// ignore: avoid_as
final resp =
(apiClient.deserialize(response.body, 'List<_BlockInfoDTO>') as List)
// ignore: avoid_as
.map((item) => item as _BlockInfoDTO)
.toList();
return BlockInfo.listFromDTO(resp);
} else {
return null;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/api/api_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class _ApiClient {
return AnnounceTransactionInfoDTO.fromJson(value);
case 'BlockDTO':
return _BlockDTO.fromJson(value);
case 'BlockInfoDTO':
case '_BlockInfoDTO':
return _BlockInfoDTO.fromJson(value);
case 'BlockMetaDTO':
return _BlockMetaDTO.fromJson(value);
Expand Down
21 changes: 13 additions & 8 deletions lib/src/api/api_mosaic_routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,12 @@ class MosaicRoutesApi {
if (response.statusCode >= 400) {
throw ApiException(response.statusCode, response.body);
} else if (response.body != null) {
final List resp = apiClient
.deserialize(response.body, 'List<_MosaicInfoDTO>')
.map((item) => item)
.toList();
final resp =
// ignore: avoid_as
(apiClient.deserialize(response.body, 'List<_MosaicInfoDTO>') as List)
// ignore: avoid_as
.map((item) => item as _MosaicInfoDTO)
.toList();
return MosaicInfo.listFromDTO(resp);
} else {
return null;
Expand Down Expand Up @@ -142,10 +144,13 @@ class MosaicRoutesApi {
if (response.statusCode >= 400) {
throw ApiException(response.statusCode, response.body);
} else if (response.body != null) {
final List resp = apiClient
.deserialize(response.body, 'List<_MosaicNameDTO>')
.map((item) => item)
.toList();
// ignore: avoid_as
final resp =
// ignore: avoid_as
(apiClient.deserialize(response.body, 'List<_MosaicNameDTO>') as List)
// ignore: avoid_as
.map((item) => item as _MosaicNameDTO)
.toList();
return MosaicName.listFromDTO(resp);
} else {
return null;
Expand Down
6 changes: 3 additions & 3 deletions lib/src/model/account_dto.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class _AccountDTO {
};

static List<_AccountDTO> listFromJson(List<dynamic> json) => json == null
? null
? null
: json.map((value) => _AccountDTO.fromJson(value)).toList();

static Map<String, _AccountDTO> mapFromJson(
Expand All @@ -64,7 +64,7 @@ class _AccountInfoDTO {
Map<String, dynamic> toJson() => {'meta': meta, 'account': account};

static List<_AccountInfoDTO> listFromJson(List<dynamic> json) => json == null
? null
? null
: json.map((value) => _AccountInfoDTO.fromJson(value)).toList();

static Map<String, _AccountInfoDTO> mapFromJson(
Expand All @@ -82,7 +82,7 @@ class _AccountMetaDTO {
: assert(json != null, 'json must not be null');

static List<_AccountMetaDTO> listFromJson(List<dynamic> json) => json == null
? null
? null
: json.map((value) => _AccountMetaDTO.fromJson(value)).toList();

static Map<String, _AccountMetaDTO> mapFromJson(
Expand Down
5 changes: 3 additions & 2 deletions lib/src/model/alias_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class Alias {
return data;
}

static List<Alias> listFromJson(List<dynamic> json) =>
json == null ? <Alias>[] : json.map((value) => Alias.fromDTO(value)).toList();
static List<Alias> listFromJson(List<dynamic> json) => json == null
? <Alias>[]
: json.map((value) => Alias.fromDTO(value)).toList();
}
2 changes: 1 addition & 1 deletion lib/src/model/block_dto.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class _BlockMetaDTO {
num numTransactions;

static List<_BlockMetaDTO> listFromJson(List<dynamic> json) => json == null
? null
? null
: json.map((value) => _BlockMetaDTO.fromJson(value)).toList();

static Map<String, _BlockMetaDTO> mapFromJson(
Expand Down
9 changes: 4 additions & 5 deletions lib/src/model/block_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class BlockInfo {
}

static List<BlockInfo> listFromDTO(List<_BlockInfoDTO> json) => json == null
? null
? null
: json.map((value) => BlockInfo.fromDTO(value)).toList();
}

Expand Down Expand Up @@ -127,10 +127,9 @@ class BlockchainStorageInfo {
int numAccounts;

@override
String toString() =>
'{numBlocks:$numBlocks,'
' numTransactions:$numTransactions,'
' numAccounts:$numAccounts}';
String toString() => '{numBlocks:$numBlocks,'
' numTransactions:$numTransactions,'
' numAccounts:$numAccounts}';

Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
Expand Down
2 changes: 1 addition & 1 deletion lib/src/model/merkle_path_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MerklePathItem {
String toString() => 'MerklePathItem[position=$position, hash=$hash, ]';

static List<MerklePathItem> listFromJson(List<dynamic> json) => json == null
? null
? null
: json.map((value) => MerklePathItem.fromJson(value)).toList();

static Map<String, MerklePathItem> mapFromJson(
Expand Down
Loading

0 comments on commit 0361c0b

Please sign in to comment.