Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes build & tests #478

Merged
merged 10 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
github-actions:
- changed-files:
- any-glob-to-any-file: '.github/**'

"pkg: polkadart":
- changed-files:
- any-glob-to-any-file: 'packages/polkadart/**'
Expand Down Expand Up @@ -37,3 +41,7 @@
"type: documentation":
- changed-files:
- any-glob-to-any-file: '**/*.md'

"type: dependencies":
- changed-files:
- any-glob-to-any-file: ['**/pubspec.yaml', '**/pubspec.lock', '**/pubspec_overrides.yaml']
2 changes: 2 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
with:
configuration-path: '.github/labeler.yml'
10 changes: 5 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,19 @@ jobs:

- name: Generate Files for polkadart_example
if: ${{ matrix.package == 'polkadart_example' }}
run: cd examples && dart run polkadart_cli:generate -v
run: cd examples && dart run polkadart_cli:generate -v && cd ..

- name: Check format
run: SCOPE="${{ matrix.package }}" dart run melos format
run: SCOPE="${{ matrix.package }}" dart run melos run format

- name: Analyze
run: SCOPE="${{ matrix.package }}" dart run melos analyze
run: SCOPE="${{ matrix.package }}" dart run melos run analyze

- name: Run tests
run: SCOPE="${{ matrix.package }}" dart run melos test
run: SCOPE="${{ matrix.package }}" dart run melos run test

- name: Run format coverage
run: SCOPE="${{ matrix.package }}" dart run melos coverage
run: SCOPE="${{ matrix.package }}" dart run melos run coverage

- uses: codecov/codecov-action@v4
with:
Expand Down
6 changes: 3 additions & 3 deletions examples/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ environment:
# Add regular dependencies here.
dependencies:
convert: ^3.1.1
polkadart: ^0.4.2
polkadart_cli: ^0.4.1
polkadart_keyring: ^0.4.2
polkadart: ^0.4.6
polkadart_cli: ^0.4.2
polkadart_keyring: ^0.4.3
polkadart_scale_codec: ^1.2.0
ss58: ^1.1.2
substrate_bip39: ^0.4.0
Expand Down
4 changes: 3 additions & 1 deletion examples/pubspec_overrides.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# melos_managed_dependency_overrides: polkadart,polkadart_cli,polkadart_keyring,polkadart_scale_codec,ss58,substrate_bip39,substrate_metadata
# melos_managed_dependency_overrides: polkadart,polkadart_cli,polkadart_keyring,polkadart_scale_codec,ss58,substrate_bip39,substrate_metadata,sr25519
dependency_overrides:
polkadart:
path: ../packages/polkadart
Expand All @@ -16,3 +16,5 @@ dependency_overrides:
path: ../packages/substrate_bip39
substrate_metadata:
path: ../packages/substrate_metadata
sr25519:
path: ../packages/sr25519
2 changes: 1 addition & 1 deletion packages/polkadart/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ homepage: https://github.com/leonardocustodio/polkadart/tree/main/packages/polka
repository: https://github.com/leonardocustodio/polkadart

environment:
sdk: ">=3.0.1 <4.0.0"
sdk: ">=3.3.0 <4.0.0"

dependencies:
convert: ^3.1.1 # BSD-3-Clause
Expand Down
9 changes: 8 additions & 1 deletion packages/polkadart/pubspec_overrides.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# melos_managed_dependency_overrides: secp256k1_ecdsa,sr25519,ss58
# melos_managed_dependency_overrides
dependency_overrides:
polkadart_scale_codec:
Expand All @@ -7,4 +8,10 @@ dependency_overrides:
polkadart_keyring:
path: ../polkadart_keyring
substrate_bip39:
path: ../substrate_bip39
path: ../substrate_bip39
secp256k1_ecdsa:
path: ../secp256k1_ecdsa
sr25519:
path: ../sr25519
ss58:
path: ../ss58
2 changes: 1 addition & 1 deletion packages/polkadart_cli/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ homepage: https://github.com/leonardocustodio/polkadart/tree/main/packages/polka
repository: https://github.com/leonardocustodio/polkadart

environment:
sdk: ">=3.0.1 <4.0.0"
sdk: ">=3.3.0 <4.0.0"

dependencies:
args: ^2.4.0 # BSD-3-Clause
Expand Down
12 changes: 11 additions & 1 deletion packages/polkadart_cli/pubspec_overrides.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# melos_managed_dependency_overrides: polkadart_scale_codec,substrate_metadata
# melos_managed_dependency_overrides: polkadart_scale_codec,substrate_metadata,polkadart_keyring,secp256k1_ecdsa,sr25519,ss58,substrate_bip39
dependency_overrides:
polkadart:
path: ../polkadart
polkadart_keyring:
path: ../polkadart_keyring
polkadart_scale_codec:
path: ../polkadart_scale_codec
secp256k1_ecdsa:
path: ../secp256k1_ecdsa
sr25519:
path: ../sr25519
ss58:
path: ../ss58
substrate_bip39:
path: ../substrate_bip39
substrate_metadata:
path: ../substrate_metadata
2 changes: 1 addition & 1 deletion packages/polkadart_keyring/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ homepage: https://github.com/leonardocustodio/polkadart/tree/main/packages/polka
repository: https://github.com/leonardocustodio/polkadart

environment:
sdk: ">=3.0.1 <4.0.0"
sdk: ">=3.3.0 <4.0.0"

dependencies:
pointycastle: ^3.6.2
Expand Down
4 changes: 3 additions & 1 deletion packages/polkadart_keyring/pubspec_overrides.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# melos_managed_dependency_overrides: polkadart_scale_codec,ss58
# melos_managed_dependency_overrides: polkadart_scale_codec,ss58,sr25519
# melos_managed_dependency_overrides
dependency_overrides:
polkadart_scale_codec:
Expand All @@ -9,3 +9,5 @@ dependency_overrides:
path: ../substrate_bip39
secp256k1_ecdsa:
path: ../secp256k1_ecdsa
sr25519:
path: ../sr25519
6 changes: 3 additions & 3 deletions packages/polkadart_scale_codec/lib/io/input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ mixin Input {
/// final input = Input.fromHex('0x010203');
/// print(input.readBytes(3)); // [1, 2, 3]
/// ```
UnmodifiableUint8ListView readBytes(int length);
Uint8List readBytes(int length);

///
/// returns true if there are bytes left to be read
Expand Down Expand Up @@ -108,12 +108,12 @@ class ByteInput with Input {
}

@override
UnmodifiableUint8ListView readBytes(int length) {
Uint8List readBytes(int length) {
if ((offset + length) > _buffer.length) {
throw Exception('Not enough bytes to read');
}
final bytes =
UnmodifiableUint8ListView(_buffer.buffer.asUint8List(offset, length));
_buffer.buffer.asUint8List(offset, length).asUnmodifiableView();
offset += length;
return bytes;
}
Expand Down
5 changes: 3 additions & 2 deletions packages/polkadart_scale_codec/lib/io/io.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
library io;

import 'dart:typed_data' show Uint8List, UnmodifiableUint8ListView;
import 'dart:typed_data' show Uint8List;

import 'package:typed_data/typed_buffers.dart';

import '../utils/utils.dart' show encodeHex, decodeHex;

part './byte_output.dart';
part './generator_output.dart';
part './hex_output.dart';
part './input.dart';
part './output.dart';
part './size_tracker.dart';
part './generator_output.dart';
2 changes: 1 addition & 1 deletion packages/polkadart_scale_codec/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ homepage: https://github.com/leonardocustodio/polkadart/tree/main/packages/polka
repository: https://github.com/leonardocustodio/polkadart

environment:
sdk: ">=3.0.1 <4.0.0"
sdk: ">=3.3.0 <4.0.0"

dependencies:
convert: ^3.0.2 # BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion packages/secp256k1_ecdsa/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ homepage: https://github.com/leonardocustodio/polkadart/tree/main/packages/secp2
repository: https://github.com/leonardocustodio/polkadart

environment:
sdk: ">=3.0.1 <4.0.0"
sdk: ">=3.3.0 <4.0.0"

dependencies:
pointycastle: ^3.7.4
Expand Down
2 changes: 1 addition & 1 deletion packages/sr25519/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ homepage: https://github.com/leonardocustodio/polkadart/tree/main/packages/sr255
repository: https://github.com/leonardocustodio/polkadart

environment:
sdk: ">=3.0.1 <4.0.0"
sdk: ">=3.3.0 <4.0.0"

dependencies:
collection: ^1.18.0
Expand Down
6 changes: 6 additions & 0 deletions packages/sr25519/pubspec_overrides.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# melos_managed_dependency_overrides: polkadart_scale_codec,substrate_bip39
dependency_overrides:
polkadart_scale_codec:
path: ../polkadart_scale_codec
substrate_bip39:
path: ../substrate_bip39
2 changes: 1 addition & 1 deletion packages/ss58/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ homepage: https://github.com/leonardocustodio/polkadart/tree/main/packages/ss58
repository: https://github.com/leonardocustodio/polkadart

environment:
sdk: ">=3.0.1 <4.0.0"
sdk: ">=3.3.0 <4.0.0"

dependencies:
equatable: ^2.0.5 # MIT
Expand Down
2 changes: 1 addition & 1 deletion packages/substrate_bip39/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ homepage: https://github.com/leonardocustodio/polkadart/tree/main/packages/subst
repository: https://github.com/leonardocustodio/polkadart

environment:
sdk: ">=3.0.1 <4.0.0"
sdk: ">=3.3.0 <4.0.0"

dependencies:
bip39_mnemonic: ^3.0.6
Expand Down
2 changes: 1 addition & 1 deletion packages/substrate_metadata/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ homepage: https://github.com/rankanizer/polkadart/tree/main/packages/substrate_m
repository: https://github.com/rankanizer/polkadart

environment:
sdk: ">=3.0.1 <4.0.0"
sdk: ">=3.3.0 <4.0.0"

dependencies:
equatable: ^2.0.5
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: polkadart_workspace

environment:
sdk: ">=3.0.1 <4.0.0"
sdk: ">=3.3.0 <4.0.0"

dev_dependencies:
coverage: ^1.6.3
coverage: ^1.8.0
melos: ^6.1.0
Loading