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

encointer v0.8.0 #268

Merged
merged 17 commits into from
Jan 14, 2022
Merged

encointer v0.8.0 #268

merged 17 commits into from
Jan 14, 2022

Conversation

clangenb
Copy link
Member

@clangenb clangenb commented Jan 9, 2022

Tested:

  • Successful meetup including claiming of community income. Which is currently just a big button on the homepage, as the UI will be adjusted anyhow.
  • Tested registering with proof of attendance.
  • Tested community currency transfer.

Comment on lines -58 to -63
export async function subscribeParticipantIndex (msgChannel, cid, cIndex, address) {
return await api.query.encointerCeremonies.participantIndex([cid, cIndex], address, (value) => {
send(msgChannel, value);
}).then((unsub) => unsubscribe(unsub, msgChannel));
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Subscribing to this is no longer supported out of the box, as we have need to query 4 different registries for the participant index. Currently, we only fetch actively from the dart side.

return pIndex;
}

export async function getParticipantCount (cid, cIndex) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed participantCount; it was not used anywhere.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it would be nice to show, actually. "you are not alone"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to the list encointer/encointer-js#40

@@ -516,10 +535,37 @@ class _AssetsState extends State<Assets> {
);
},
),
FutureBuilder<bool>(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only display a big button on the main-page. I did not bother at all about the UX here because we are amidst heavy changes.

@clangenb clangenb force-pushed the cl/encointer-v0.8.0 branch from d3dd289 to d3f2452 Compare January 11, 2022 09:23
[JS + Dart] remove unused participantCount state and getters

[JS + Dart] remove subscribeParticipantIndex, which does no longer exist.

[Dart] fix getMeetupLocation

[JS] extract locationFromJson function

add `hasPendingIssuance` and display in assets page if we have pending issuance.

[assets] successfully claim rewards.

[types] change all fields to camelCase, as this has bin changed in polkadot-js

[types] rename fields meetupLocationIndex -> meetupIndex

[GA] use latest encointer-node artifact.

[JS] fix tests
@clangenb clangenb force-pushed the cl/encointer-v0.8.0 branch from d3f2452 to 6998958 Compare January 11, 2022 11:06

Re-generate mobx g.dart files
flutter packages pub run build_runner build --delete-conflicting-outputs

Copy link
Member Author

@clangenb clangenb Jan 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant info: this is displayed10 lines below, too.

@@ -302,50 +303,6 @@ function isTcIsRegisterAttestations (txInfo) {
return TrustedCallMap[txInfo.module][txInfo.call] === 'ceremonies_register_attestations';
}

function _extractEvents (api, result) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outsourced to @encointer

return pIndex;
}

export async function getParticipantCount (cid, cIndex) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to the list encointer/encointer-js#40

iconData: Icons.upload_sharp,
onTap: store.encointer.communityBalance != null
? () {
Navigator.pushNamed(
context,
TransferPage.route,
arguments: TransferPageParams(
redirect: AssetPage.route,
redirect: '/',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The app crashed before because we do no longer go from the asset page to transfer page, but from the home page after the UX change.

Observer(builder: (_) {
var dic = I18n.of(context).assets;

return store.settings.isConnected
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Big fat button that does show whether the community income can be issued or not. I wasn't concerned about the UX at all for now, as we are changing things heavily currently.

Comment on lines -169 to -175
Padding(
padding: const EdgeInsets.fromLTRB(8.0, 16, 8, 72),
child: Center(
child: Text('transactionByteFee: ${store.settings.transactionByteFee} $baseTokenSymbolView',
style: TextStyle(fontSize: 16, color: Colors.black54)),
),
),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the transaction-byte-fee because we show the more meaningful tx-fee-estimate on the next page anyhow.

Comment on lines +333 to +335
"token": isCommunityCurrency
? CommunityIdentifier.fromJson(i['params'][1]).toFmtString()
: rootStore.settings.networkState.tokenSymbol,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We store the txs in the 'sent tx list', which does not allow anything else than a string for the token, but in the tx callback the JS crashed before, which is why this error was not noticed.

Comment on lines -257 to -261
// user may route to transfer page from asset page
// or from home page with QRCode Scanner
if (routeArgs.redirect == AssetPage.route) {
globalAssetRefreshKey.currentState.show();
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer true, we can only go there from the home page

@clangenb clangenb requested a review from brenzi January 11, 2022 18:59
Copy link
Member

@brenzi brenzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested a local setup with the current node master
Was able to connect and register participant
In the logs I only saw:

I/flutter ( 3162): Image.network error: SocketException: OS Error: Connection refused, errno = 111, address = 10.0.2.2, port = 56466

not sure what this is about. but it doesn't seem to disturb

@clangenb
Copy link
Member Author

The error is from the IPFS community icon fetch. With the encointer-dev nework ipfs defaults to the local host. When there is no ipfs-node running this fails, and then it defaults to the current encointer icon.

@clangenb clangenb merged commit df1d4e3 into master Jan 14, 2022
@clangenb clangenb mentioned this pull request Jan 14, 2022
4 tasks
@clangenb clangenb deleted the cl/encointer-v0.8.0 branch January 22, 2022 08:04
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.

2 participants