Skip to content

Commit

Permalink
update version to 0.0.5+3
Browse files Browse the repository at this point in the history
  • Loading branch information
slackve committed May 24, 2020
1 parent ed87b16 commit ec3f199
Show file tree
Hide file tree
Showing 46 changed files with 313 additions and 119 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.5+3
### Updates
[UPDATE] format code.

## 0.0.5+2
### New Features
[ADD] AccountPropertiesAddressTransaction.
Expand Down
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.5+2
xpx_chain_sdk: 0.0.5+3
```

**2. Install it**
Expand Down
2 changes: 1 addition & 1 deletion lib/imp/buffer.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library xpx_chain_sdk.buffer;

export 'package:xpx_chain_sdk/imp/buffer/schema.dart';
export 'package:xpx_chain_sdk/imp/buffer/model.dart';
export 'package:xpx_chain_sdk/imp/buffer/schema.dart';
4 changes: 2 additions & 2 deletions lib/imp/buffer/model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'dart:typed_data';

import 'package:flat_buffers/flat_buffers.dart' as fb;

part 'model/account_properties_transaction_catapult.dart';
part 'model/account_properties_transaction_buffer.dart';
part 'model/aggregate_transaction_buffer.dart';
part 'model/alias_transaction_buffer.dart';
part 'model/exchange_transaction_buffer.dart';
Expand All @@ -18,5 +18,5 @@ part 'model/mosaic_supply_change_transaction_buffer.dart';
part 'model/register_namespace_transaction_buffer.dart';
part 'model/secret_lock_transaction_buffer.dart';
part 'model/secret_proof_transaction_buffer.dart';
part 'model/transfer_transaction_buffer.dart';
part 'model/transactions_buffer.dart';
part 'model/transfer_transaction_buffer.dart';
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ part of xpx_chain_sdk.buffer.model;

class PropertyModificationBuffer {
factory PropertyModificationBuffer(List<int> bytes) {
final fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes);
final fb.BufferContext rootRef = fb.BufferContext.fromBytes(bytes);
return reader.read(rootRef, 0);
}

PropertyModificationBuffer._(this._bc, this._bcOffset);

static const fb.Reader<PropertyModificationBuffer> reader =
const _PropertyModificationBufferReader();
_PropertyModificationBufferReader();

final fb.BufferContext _bc;
final int _bcOffset;
Expand All @@ -19,7 +19,7 @@ class PropertyModificationBuffer {

/// In case of address it is 25 bytes array. In case of mosaic it is 8 byte array(or 2 uint32 array).
/// In case of transaction it is 2 byte array(ushort)
List<int> get value => const fb.ListReader<int>(const fb.Uint8Reader())
List<int> get value => const fb.ListReader<int>(fb.Uint8Reader())
.vTableGet(_bc, _bcOffset, 6, null);

@override
Expand All @@ -33,7 +33,7 @@ class _PropertyModificationBufferReader

@override
PropertyModificationBuffer createObject(fb.BufferContext bc, int offset) =>
new PropertyModificationBuffer._(bc, offset);
PropertyModificationBuffer._(bc, offset);
}

class PropertyModificationBufferBuilder {
Expand Down Expand Up @@ -86,15 +86,15 @@ class PropertyModificationBufferObjectBuilder extends fb.ObjectBuilder {
/// Convenience method to serialize to byte list.
@override
Uint8List toBytes([String fileIdentifier]) {
final fb.Builder fbBuilder = new fb.Builder();
final fb.Builder fbBuilder = fb.Builder();
final int offset = finish(fbBuilder);
return fbBuilder.finish(offset, fileIdentifier);
}
}

class AccountPropertiesTransactionBuffer {
factory AccountPropertiesTransactionBuffer(List<int> bytes) {
final fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes);
final fb.BufferContext rootRef = fb.BufferContext.fromBytes(bytes);
return reader.read(rootRef, 0);
}

Expand All @@ -107,20 +107,29 @@ class AccountPropertiesTransactionBuffer {
final int _bcOffset;

int get size => const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 4, 0);
List<int> get signature => const fb.ListReader<int>(const fb.Uint8Reader())

List<int> get signature => const fb.ListReader<int>(fb.Uint8Reader())
.vTableGet(_bc, _bcOffset, 6, null);
List<int> get signer => const fb.ListReader<int>(const fb.Uint8Reader())

List<int> get signer => const fb.ListReader<int>(fb.Uint8Reader())
.vTableGet(_bc, _bcOffset, 8, null);

int get version => const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 10, 0);

int get type => const fb.Uint16Reader().vTableGet(_bc, _bcOffset, 12, 0);
List<int> get maxFee => const fb.ListReader<int>(const fb.Uint32Reader())

List<int> get maxFee => const fb.ListReader<int>(fb.Uint32Reader())
.vTableGet(_bc, _bcOffset, 14, null);
List<int> get deadline => const fb.ListReader<int>(const fb.Uint32Reader())

List<int> get deadline => const fb.ListReader<int>(fb.Uint32Reader())
.vTableGet(_bc, _bcOffset, 16, null);

int get propertyType =>
const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 18, 0);

int get modificationCount =>
const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 20, 0);

List<PropertyModificationBuffer> get modifications =>
const fb.ListReader<PropertyModificationBuffer>(
PropertyModificationBuffer.reader)
Expand All @@ -138,7 +147,7 @@ class _AccountPropertiesTransactionBufferReader
@override
AccountPropertiesTransactionBuffer createObject(
fb.BufferContext bc, int offset) =>
new AccountPropertiesTransactionBuffer._(bc, offset);
AccountPropertiesTransactionBuffer._(bc, offset);
}

class AccountPropertiesTransactionBufferBuilder {
Expand Down Expand Up @@ -284,7 +293,7 @@ class AccountPropertiesTransactionBufferObjectBuilder extends fb.ObjectBuilder {
/// Convenience method to serialize to byte list.
@override
Uint8List toBytes([String fileIdentifier]) {
final fb.Builder fbBuilder = new fb.Builder();
final fb.Builder fbBuilder = fb.Builder();
final int offset = finish(fbBuilder);
return fbBuilder.finish(offset, fileIdentifier);
}
Expand Down
8 changes: 8 additions & 0 deletions lib/imp/buffer/model/aggregate_transaction_buffer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,26 @@ class AggregateTransactionBuffer {
final int _bcOffset;

int get size => const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 4, 0);

List<int> get signature => const fb.ListReader<int>(fb.Uint8Reader())
.vTableGet(_bc, _bcOffset, 6, null);

List<int> get signer => const fb.ListReader<int>(fb.Uint8Reader())
.vTableGet(_bc, _bcOffset, 8, null);

int get version => const fb.Uint16Reader().vTableGet(_bc, _bcOffset, 10, 0);

int get type => const fb.Uint16Reader().vTableGet(_bc, _bcOffset, 12, 0);

List<int> get fee => const fb.ListReader<int>(fb.Uint32Reader())
.vTableGet(_bc, _bcOffset, 14, null);

List<int> get deadline => const fb.ListReader<int>(fb.Uint32Reader())
.vTableGet(_bc, _bcOffset, 16, null);

int get transactionsSize =>
const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 18, 0);

List<int> get transactions => const fb.ListReader<int>(fb.Uint8Reader())
.vTableGet(_bc, _bcOffset, 20, null);

Expand Down
8 changes: 8 additions & 0 deletions lib/imp/buffer/model/alias_transaction_buffer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,25 @@ class AliasTransactionBuffer {
final int _bcOffset;

int get size => const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 4, 0);

List<int> get signature => const fb.ListReader<int>(fb.Uint8Reader())
.vTableGet(_bc, _bcOffset, 6, null);

List<int> get signer => const fb.ListReader<int>(fb.Uint8Reader())
.vTableGet(_bc, _bcOffset, 8, null);

int get version => const fb.Uint16Reader().vTableGet(_bc, _bcOffset, 10, 0);

int get type => const fb.Uint16Reader().vTableGet(_bc, _bcOffset, 12, 0);

List<int> get maxFee => const fb.ListReader<int>(fb.Uint32Reader())
.vTableGet(_bc, _bcOffset, 14, null);

List<int> get deadline => const fb.ListReader<int>(fb.Uint32Reader())
.vTableGet(_bc, _bcOffset, 16, null);

int get actionType => const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 18, 0);

List<int> get namespaceId => const fb.ListReader<int>(fb.Uint32Reader())
.vTableGet(_bc, _bcOffset, 20, null);

Expand Down
Loading

0 comments on commit ec3f199

Please sign in to comment.