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

Bazaar 199 implement search #252

Closed

Conversation

gr8Mu1
Copy link

@gr8Mu1 gr8Mu1 commented Dec 21, 2021

  • closes Re: KSM Claim problem #199
  • add search functionality and unit tests (it still has to be integrated once we have state management and actual data)

brenzi and others added 30 commits July 9, 2020 15:26
* ! build skeleton for encointer
+ placeholder for current phase

* fixing rebase. builds

* rename to org.encointer.wallet to be its own app

* more acala cleanup

* more fixing. still not connecting to endpoints

* trying to include typescript for pallet custom type definitions

* still not building js service

* revert all typescript stuff. now defining types as json

* fix. still not accepting custom types

* types include cantillon stuff now (but weight u32). fix for ApiPromise.

* update deps

* + added test in js_encointer_service that successfully connects to gesell

* ! actually load encointer main.js in encointer webview

* [js_encointer/index.js] remove currencyIds in getNetworkConst(). Type is only for acala

* store CeremonyPhase in Text field. I belive observable is not yet working

* [encointerEntry] use Observable in PhaseAwareBox

* prototype for subscription of phase

* move subscribe current phase to encointerApi. I believe it is not working yet

* fix typo

* [encointerEntry] added Register Participant dummy button

* [encointer.js/ApiEncointer.dart] add fetchCurrencyIdentifiers

* [encointerEntry] WIP: send register participant extrinsic. Currently at getting tx fees

* [encointerEntry] successfully getTxFee Estimate

* proof of concept that successfully subscribes to timestamps in a somewhat hacky way

* [encointer.js] fix all api calls. Api is not needed as argument. Timestamp subscription now works with channel name as argument

* CurrentPhase subscription works too

* Add getProofOfAttendance in js_service (#13)

* JS: Add getProofOfAttendance in js service encointer

* JS: Add tests of signure for getProofOfAttendance

* JS: Add ESLint

* JS: lint code

* JS: docs for getProofOfAttendance

* JS: fix webpack config

* JS: implement getClaimOfAttendance and attestClaimOfAttendance

* JS: remove api methods from arguments

* [encointerEntry] moved registeringPage stuff to registeringPage and include it with _getPhaseView(Phase)

* added fetchCurrentCeremonyIndex, fetchNextMeetupTime, fetchNextMeetupLocation method stubs. They return placeholder values for now

* [registeringPage] show currency identifier dropdown

* + add assigningPage draft and api.fetchParticipantIndex

* [encointerApi.dart] fix api.calls that use the public key as args

* [registeringPage.dart] reload widget after registration tx was sent. And show that user is registered

* + added attestingPage.dart

* [encointerApi] add fetchParticipantCount
moved assigningpage, RegisteringPage, AttestingPage to separate directories
Extracted registerParticipantPanel from RegisteringPage

* adjusted routes for the new encointer pages

* + added meetup page draft

* [meetupPage] fix theme

* fix rebase errors

* Extracted CeremonyOverviewPanel.dart from attestingPage.dart

* [AttestingPage] launch confirmAttendeesDialog upon meetup start

* [js_encointer_service] eslint

* [utils/format] fix formatting for strings smaller than pad

* Store more values on the dart side and change the js_encointer_service api calls to have more arguments to make less network requests in an js_encointer_service

* [fixpointUtil] fix handling of 0 and add some tests

* successfully getClaimofAttendance from js

* + add json serializables of claimOfAttendance and Location

* getClaimofAttendance now returns a hex. Pass claim of attendance json to method

* call attestClaimOfAttendance with the claimHex and fetch the passWord from the password dialog

* [claimOfAttendance] field rename to camelCase and use json fieldRename field instead.

* [attesting] + copied qrCodeClaim and from ReceivePage

* ! [fixPointUtil] fix conversion bug introduced with ab71cc2

* fix getClaimOfAttendance unittest

* successfully display qrCodeOfClaim

* [meetupPage] Build list of account cards

* apis: added fetchMeetupRegistry

* [meetupPage] add ok button to Cards

* [claimOfAttendance] add some explanations

* extracted attestationCard from meetupPage.
+ observable map of AttestationState that tracks the current meetup progress

* wrapped attest/revert button in an observable

* showQrCodeOfClaim in when clicking attest

* renamed QrCodeClaim -> QrCode

* added scanQrCode. copied and modified from accountScanPage

* [attestationCard] successfully scan qrCode of claim

* [meetup] added meetup complete button.

* [confirmAttendeesDialog] change available numbers to 3-12

* [scQrCode] pass onScan function

* extract Attestation from AttestationState file.
run flutter build_runner

* successfully sign the claim

* wip of meetup progress

* [registerParticipantPanel] use future builder

* [registerParticipantPanel] assigningPage use CeremonyOverviewPanel.dart

* [registerParticipantPanel] only build dropdown after we have fetched the currency identifiers

* [CeremonyOverviewPanel] added flutter map, but gives currently a rendering error

* complete artwork for encointer

* artwork fixes

* more artwork fixes

* yet another artwork fix

* yet another artwork fix

* + add Cantillon and local dev endpoints (dev not properly working)
+ played with look and feel. increased QR code size

* fixes.
! meetupPage now shows myself
! meetupPage now shows real meetup participants

* more debug info on screen
fix refresh
fix detecting oneself in meetup registry
drop icons, use meetupregistryindex instead

* ! save attestations as hex string, not object
! try to persist cid choice

* attestation flow with saving attestations works until tx. fee preview fails, doesn't let me send

* WIP. can't get location to decode. switched to i64 but still see hex

* ! Location as Text hex (still no xt call decoded)
+ persisting choice of cid

* card now turns green when bilateral attestation done

* UX cleanup

* + add ceremony date to register page

* + persist attestations beyond app restart

* introduce FutureBuilder to only show correct phase view

* FutureBuilder for cid selector

* FutureBuilder for register button, depending on pindex (not on cids)

* FutureBuilder for attesting. meetup start button appears only when mindex assigned

* add assignment panel to assigning and attesting views with a FutureBuilder for time and location

* add-encointer.parseAttestation (#18)

* [encointer.test.js] remove obsolete tests

* [types.js] apply eslint fix

* [encointer(-test)] add parse attestation

* fix parse attestation for use with dart side

* Bugfix register attestations (#25)

* updated *.g.dart files

* updated pubspec.lock

* Location now has fields of type BigInt

* WIP: register_attestations. Decoding claim seems to to work. Stuck at attestation.signature

* + add index.test.js for integration tests

* [index.test] reproduce register_attestation extrinsic error

* [encointer.test] fix attestClaimOfAttendance test
[encointer/customTypes] make Attestation signature field is now multisig

* wip fix attestations

* [attestation.g] signature is now Map<string, dynamic> for multisig

* incremental fix by jaco

* fix extrinsics

* ! successful registerAttestations extrinsic

* fix remaining unit-test. All js tests green

Co-authored-by: Alain Brenzikofer <[email protected]>

* Implementation for Worker API (#16)

* JS: TrustedGetter types for worker-api

* JS: Implementation for worker-api

Co-authored-by: clangenb <[email protected]>

* fix airdrop display in IOS

* fix create account bugs

* fix keyStore import

* UI adjusted

* android flutter workaround for 6.0 builds

* clean up. remove debug info. always purge attestations during registering and assigning

* rename app title to EncointerWallet

* remove debug-hardcode of phase

* renaming: use get instead of fetch (#26)

* [encointer-service] remove obsolete tests/ directory

* pubspec.lock

* [encointer_service] package.json remove type: module to be able to build with yarn

* consistent naming: use get instead of fetch

* Integrate worker api for cantillon support (#32)

* [service_encointer] added worker.test. Currently total issuance is failing

* [encointer-service/index.test] add assert statement to should get fees for register_attestation

* [encointer-service/worker] fix public getter

* [encointer-service/worker.tests] add more tests getMeetupIndexTimeAndLocation/getAttestations currently fail

* JS: Integration tests for worker-api (#27)

* [encointer-service/worker] fix decoding of worker responses. Found some bugs in either encointer-worker or js_worker_api...

* [encointer-service/worker] add unwrapOrDefault to getAttestations

* add skeleton to integrate workerApi on dart side. Everything untested

Co-authored-by: Demyan Rogozhin <[email protected]>

* can now register attestations

Co-authored-by: clangenb <[email protected]>
Co-authored-by: Demyan Rogozhin <[email protected]>
Co-authored-by: clangenb <[email protected]>
Co-authored-by: shawn <[email protected]>
* [service_encointer] added getBalances function

* wip show EncointerBalances in Asset Page

* [EncointerTypes] override toString() to print json data instead of 'instance of <type>'

* cleanup Encointerbalances

* store encointerBalancesData

* included encointer.getBalances in assets.fetchBalance. Not sure if this is a good idea

* [encointer] cast Attestation to correct map.

* [index] remove nested observable
* [js_encointer_service/account] implemented faucetTransaction

* [js_encointer_service/account] fix account.getBalances by fixing polkadot/api to 1.10.1

* [js_encointer_service/encointer] fix parseClaimOfAttendance test

* [index] functional faucet button

* be less verbose

* [index] faucet only supplies funds if balance > 0.0001
* add section on how to run the app in Android Studio with a build flavor defined

* add dev build flavor. Add idiomatic way of naming the apk depending on build flavor
* updated @polkadot/api. this fixes connecting to encointer networks.

* JS: fix some unmet peer dependency warnings
* Make Encointer Testnet Gesell the default endpoint for the first start of the app.

Note: If the app was used before, it fetches the previously connected endpoint from cache.

* Dart: Display cids as base58

* add test that checks for cid formating
* add convenience method settings.enpointIsEncointer

* assetPage: pass AssetPageParams to navigator

* enable Encointer community currency transfer

* remove redundant isEncointer from EndpointData
run flutter build_runner

* update polkadot js dependencies

* assetPage: Display available tokens correctly when Encointer community currency is chosen.

* added Parser to encointer fixPoint

* rename encointer_token_decimals -> encointerTokenDecimals

* proper formatting of encointer community currencies.

* correctly encode fractions to EncointerFixedPoint values
* implement meetup time formula. phase check fails

* meetup time should now be correct. Will perform meetup

* display lat,lon correctly and hide send attestations when there are none

* meetup time in claim is now accepted by chain.
* parse claim and attestation during meetup bilateral protocol to check data integrity

* parse whatever you get by QR. fix party A signing wrong payload
* commented out parsing of attestations/claims as they take a substantial amount of time.

* added activityIndicator that gives visual feedback when a future is loading.
clangenb and others added 29 commits May 23, 2021 14:53
* Redesigned meetup UX. Closes #113. Implemented all the app changes noted there.

Additional changes:
* Updated the `Location` type. This was on gesell `I32F32` and is now `I64F64`.
* Fix caching of `latestHeader`. This did not properly work before.
* Improved error correction quality in qr codes. This defaulted to the lowest level before. Now the level is increased by two to the second-highest level. This might resolve scanning issues in bright light for certain phones.
* `claimHex` is not used anymore. Now, it's always a `ClaimOfAttendance` instance on dart side. This is more flexible.
* shopRegistry: use `ObservableList` to resolve comment form @haerdib.
* Fix #154 and fix #156.

Tested with a successful meetup.

**Note:** First merge #133.
The bug was not due to Android API 27 per se, but the default webView installed on it.

This fix adds some JS transformations to target older browsers. Fixes #155.

Other Change: Test on more android devices in GitHub actions.

**Note: ** First merge #158.
* bump @PolkaDot to 5.9/7.4
* bump @encointer to 0.4.3
* bump @webpack to 5.5 (finally)
* remove outdated Gesell type overrides

Note: JS-tests don't compile yet.

Tested:
* account creation
* verified that latest Gesell blocks are received
* tested faucet, which just returns that the faucet has no money.
* Pin exact node/yarn version in CI
* Print some extra info when building js
* Cancel previous CI jobs upon push
* Also reactivate bazaar and make sure the current design displays the data correctly.
* This replaces #169
* Closes #178.

Reasoning about the observations in #178, I thought this is a `yarn` issue and not something with our configs. Hence, I decided to try a yarn upgrade to `yarn berry` (yarn v3).

As we were affected by build output instabilities on some machines, I opted for the [zero-install](https://yarnpkg.com/features/zero-installs) feature of yarn, trying to get the results as deterministic as possible. This implies that we check the yarn cache into the repository. It may sound like an overkill, but it does not compare to checking-in the node-modules folder in terms of size. According to yarn's guide, it is perfectly fine.

Our inconsistency problem seems to have been fixed. I could produce stable outputs on my machine as well as the CI.

I believe developers are not affected. `yarn` should point automatically to the version in `yarn/releases`.
* Put back bazaar case (fixup)

* in bazaar rename shop to business (incl. plural, lower/upper case)

Co-authored-by: Stierli Armin <[email protected]>
* Decrease error correction to `L`, which decreased code density
* Use maximum screen width for the qr-code

I have also tried base64 encoding for the string, which resulted in 20% increase in data size. If we need to improve further, we'd probably need to go for a binary encoding.
* [apiEncointer] fix: actually do `subscribeParticipantIndex`

* [apiEncointer] dartfmt

* [registerParticipant] get participant index after registering

* [encointer/store] reset state when the community is changed

* [registerParticipantPanel] show ActivityIndicator only for button

* [txConfirmPage] only `Queued` Snackbar for 12 seconds instead of 5 minutes.

* [txConfirmPage] fix execute onTxFinish immediately and even if unmounted

* minor fmt
* [Readme] add section about fmt and boilerplate code.

* fmt codebase

* [GA] add fmt check
* replaced Unregister button by "Participant is registered"
)

* add additional password dialog with the option to switch the user.
* wip

* remove plugin transform

* change package type to module

* remove test transforms - test files have correct format now.

* test files compile; but errors in the source files

* [tests] add jsom test-environments to make tests work

* [tests] skipp substratee tests

* [tests] skip cantillon tests as they are unsupported, but they compile know

* [tests] fix all tests except for createProofOfAttendance

* [README] add note on how to run the tests from the IDE.

* remove babel-jest dependency.

* make build work; successfully launch api in the app.

* remove obsolete bs58 dependency

* [encointer.test] fix last test

* [encointer.test] fix incorrect handling of cid: use cid_hex instead of cid_bs58

* [tests] extract testSetup function

* cleanup

* [GA] add js_ci

* fix gesell connection

* [tests] most gesell tests pass

* [account] fix global settings access

* [tests] gesell: updated estimated tx-fee

* [test] fix all gesell tests.

* [consts] remove obsolete pallet overrides

* [tests] run gesell e2e tests seperatly

* remove @polkadot/dev dep. It is no longer used.

* [tests] also add separate tests to run Cantillon e2e tests

* minor cleanup

* cleanup

* Revert "[consts] remove obsolete pallet overrides"

This reverts commit f7817cb
…or (#221)

* [scripts/io_init_env] list available simulator runtimes

* [GA] use correct IOS runtimes when creating the emulators

* [GA] android CI remove way to flaky android 29 emulator
* scale-enccode claim qr codes

* [JS] add unit-tests that show that basic encode/decode works

* [JS] fix decoding of scanned claim

* [scanClaimQrCode] fix handling of decoded `ClaimOfAttendance`

* [scanClaimQrCode] show a snackbar if the qr-code could not be decoded.

* remove/fix obsolete comments

* fix: revert gesell-dev address to 10.0.2.2
* Add bazaar UI

* insert optional commas to improve auto-formatting

* Remove orphaned json annotation

* Remove unused routes

* Remove old classes

* Turn pascal case into camel case file names

Co-authored-by: Armin Stierli <[email protected]>
Co-authored-by: clangenb <[email protected]>
Tested on Galaxy S10+ & emulated Nexus 6 API 28
fixes #205
fixes #208
fixes 182 (partly, thats why didn't link)

* [x] rename button to "submit attestations", not "claims"
* [x] meetup counter should be a card, not button.
* [x] After a first ceremony, the community currency balance does not show automatically (needed to change community for it to update)
* [x] upon changing community, the balance changes asynchronously, so for a while, one community may show the balance value of another. This may never happen. Rather clear the balance field entirely until we can show consistent information    

In addition:  
- communities are now cached and displayed upon startup, so the user doesn't have to wait until chain connected. If he chooses another community during connection, the metadata (token and value) will be loading until connection with chain established
- metadata is also cached, so besides the actual token value, user can see all community related data straight away
- after connection to chain established, all community related data is fetched, this wasn't before and it is crucial for the correct communityMetadata to be recieved when connected to chain
- minor text changes and code cleanup
- proper navigation if start meetup pressed but then going back (before it opened the qr scanner instead of going back)

Notes: 
There appears to be an incorrect caching problem described in #219. We solve the issue of getting wrong community data by resetting store.encointer.communities, store.encointer.communityMetadata and store.encointer.chosenCid to null when changing network. Then the user chooses can choose community in the assets page

* found possible mistake in code, storage returns string "null" and not value null, so comparison should also check for string "null", i guess?

added cached communities, now communities are displayed on startup

added fetching communitiy data after network connection

flutter format . --line-length 120

communities not found refactored to dictonary and changed name instead of currency

setting communityMetadata to null is necessary for smoth transition between communities within the same chain. in setChosenCid,  webApi.encointer.getCommunityMetadata() is called which then caches again the communityMetadata. this is ok like this

In this commit, changing network results in correct community loading, but we have a caching issue of the communityMetadata.
We now don't set communityMetadata to null in the setChosenCid method. This has the advantage, that for caching we wont set it to null, but wenn we choose another community currency in the asset page, the old community currency is shown until the new one is loaded.. needs more thinking how to solve

purging communities when changing network and therefore displaying correct communities in assets page after network change

potential solution to displaying correct communities and community tokens found

formatting

displaying no community registered if chosenCid == null

removing timer, this leaves a -00:00:01 when timer done...

formatting to 120 line length

refactoring timer to card, when timer < 60, button instead of card appears.

Placing CupertinoActivityIndicator instead of empty Container. Probably the ListTile is not the best solution, but it looks nice like this.
Open for suggestions

clear balance field completely when switching between communities until consistent data is loaded

Meetup counter is card, when over "start meetup button is shown"

changing "submit claims" to "submit attestations"

* accidentally removed improvements in index.dart from other pr during rebase, reinserted them in this commit

* cleanup

* apply changes discussed in conversation of pr

* added padding

* defined caching issue.
at the moment we kind of hack a solution. it's defined in #219

* flutter format . --line-length 120

* solving merge conflicts during rebase

* compare to communities directly in ceremony tab like in assets' index.dart , because communities are cached. Else we have two different behaviours in the different tabs

* minor comment in code for better understanding

* the hint in the dropdown menu is nice for the user experience to be asked to choose community. unfortunately it breaks our integration test - can't choose community.. shold be solved in the future, for now hint is disabled

* suggestion to fix integration test.
since we reset community metadata in setChosenCid, we can't provide the metadata from the begininning. so we could supply it after resetting it, which makes more sense. best practice would be to mock the getCommunityMetadata() to return the mock

* add comment to explain code

Co-authored-by: brenzi <[email protected]>
… for Gesell (#234)

* - cantillon networks are commented out in network selection
- passwordDialog is not opened, when isGesell true --> only shown for transactions

* flutter format . --line-length 120
* flutter format . --line-length 120

works, but if deleting an account when multiple present, next account loaded without prompt to enter password

second commit

first commit

* refactor

* refactor: removed Base at end of name and pass currentaccount instead of store

* flutter format . --line-length 120

Co-authored-by: clangenb <[email protected]>
* [scripts/build.gradle] migrate to mavenCentral

* [build.gradle] remove obsolete useProguard = true
* [scripts] add frdoid_init.sh

* [GA] test fdroid setup

* [GA] run fdroid only on beta branch push/pr

* [scripts/fdroid_init.sh] switch to node v16.13.1, and enable corepack for automatic yarn install if needed.
@gr8Mu1 gr8Mu1 closed this Dec 21, 2021
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.

Re: KSM Claim problem
7 participants