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

Polkadart Milestone 2 #799

Merged
merged 1 commit into from
Mar 28, 2023
Merged

Conversation

Lohann
Copy link
Contributor

@Lohann Lohann commented Mar 14, 2023

Milestone Delivery Checklist

Link to the application pull request: w3f/Grants-Program#1053

@Lohann Lohann mentioned this pull request Mar 14, 2023
18 tasks
@keeganquigley
Copy link
Contributor

@Lohann thanks for the delivery. Someone will take a look at it soon.

@keeganquigley keeganquigley self-assigned this Mar 21, 2023
@keeganquigley
Copy link
Contributor

@Lohann I'm in the process of evaluating your delivery. A couple of initial comments:

  • There are quite a few broken links in your delivery. Can you update these please?
  • I'm not super familiar with Dart, should I just be running dart test in the root folder to run all tests for the project? Or do I need to run it in each of the test folders separately? Thanks!

@Lohann
Copy link
Contributor Author

Lohann commented Mar 22, 2023

Hey @keeganquigley for sure I'll check the links, for running the tests you can do the following:

# install git-lfs
brew install git-lfs
git lfs fetch
git lfs checkout

# Install dependencies for all packages
./scripts/run_dart_pub_get.sh

# Run tests
./scripts/run_tests.sh

If you are interested in a more hands-on approach, we published a pre-release version of all packages on pub.dev:

You can get started doing the following:
1 - Create a new project

dart create -t console polkadart-milestone-2
cd polkadart-milestone-2

2 - Add those dependencies to pubspec.yaml

...
dependencies:
  polkadart: ^0.1.0-pre.2
  ss58: ^1.1.0-pre.1

dev_dependencies:
  lints: ^2.0.0
  test: ^1.16.0
  polkadart_cli: ^0.1.0-pre.1

polkadart:
  output_dir: bin/generated
  chains:
    polkadot: wss://rpc.polkadot.io

3 - Run following command for generate the Dart types from polkadot metadata:

dart run polkadart_cli:generate -v

4 - Replace the contents of bin/polkadart_milestone_2.dart with following sample code:

import 'package:ss58/ss58.dart' show Address;
import './generated/polkadot/polkadot.dart' show Polkadot;

void main(List<String> arguments) async {
  final Polkadot polkadot = Polkadot.url(Uri.parse('wss://rpc.polkadot.io'));

  // Account from SS58 address
  final account = Address.decode('19t9Q2ay58hMDaeg6eeBhqmHsRnc2jDMV3cYYw9zbc59HLj');

  // Retrieve Account Balance
  final accountInfo = await polkadot.query.system.account(account.pubkey);
  print('Balance: ${accountInfo.data.free}');

  // Retrieve Runtime Version
  final runtimeVersion = await polkadot.rpc.state.getRuntimeVersion();
  print('Runtime Version: ${runtimeVersion.specVersion}');

  await polkadot.disconnect();
}

5 - For run the code above, just run:

dart run

@Lohann Lohann force-pushed the polkadart-milestone-2 branch from 0a6a4ea to f7400f3 Compare March 22, 2023 18:39
@Lohann Lohann force-pushed the polkadart-milestone-2 branch from f7400f3 to 8c3c190 Compare March 22, 2023 18:40
@Lohann
Copy link
Contributor Author

Lohann commented Mar 22, 2023

@keeganquigley thanks for the heads up, broken links fixed ✅

@keeganquigley
Copy link
Contributor

Thanks for the changes @Lohann! The test scripts work great. I appreciate the hands-on tutorial as well.

Running docker compose up however, gives me this error:

Attaching to polkadart-tests-1
polkadart-tests-1  | The current Dart SDK version is 2.19.5.
polkadart-tests-1  | 
polkadart-tests-1  | Because every version of flutter from sdk depends on sky_engine from sdk which requires SDK version >=3.0.0-0 <4.0.0, flutter from sdk is forbidden.
polkadart-tests-1  | So, because polkadart_example depends on flutter from sdk, version solving failed.
polkadart-tests-1  | 
polkadart-tests-1 exited with code 65

I think maybe there is a version error. Does a certain Flutter version need to be specified in the Dockerfile?

@leonardocustodio
Copy link
Contributor

Hello @keeganquigley , that's my bad. I forgot to update the Dockerfile. Can you fresh clone the repository and try again?

@keeganquigley
Copy link
Contributor

Thanks for the changes @leonardocustodio yep it works now! I'm happy to pass the milestone, and will forward your invoice internally for payment.

You can find my final eval here.

@keeganquigley keeganquigley merged commit 33f117d into w3f:master Mar 28, 2023
@semuelle
Copy link
Member

@Lohann, the postal address on your invoice doesn't match the one in the grant application. If your postal address changed, could you submit an amendment to the contract with the new address, please?

@Lohann
Copy link
Contributor Author

Lohann commented Mar 31, 2023

@semuelle thanks of the heads up, invoice updated ✅

@semuelle
Copy link
Member

semuelle commented Apr 4, 2023

@Lohann, I was referring to this address. Also, the invoice shows January as the date. Could you update again?

@Lohann
Copy link
Contributor Author

Lohann commented Apr 4, 2023

@semuelle hmm, maybe I attached the invoice from Milestone 1 by mistake, could you check again? I've sent from [email protected] the invoice title is Polkadart-Milestone-2-Invoice.pdf

@keeganquigley
Copy link
Contributor

@semuelle @Lohann sorry, this was my fault. Looks like I attached the wrong invoice when I sent the email. The one you submitted on March 31st appears to be correct, as well as the most recent one. I will send this again. My apologies!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants