Giter VIP home page Giter VIP logo

encointer-js's People

Contributors

anizeani avatar brenzi avatar clangenb avatar demyanrogozhin avatar pifragile avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

encointer-js's Issues

Add integration tests with encointer-node

Now that the tests are fixed after #15 is merged, we should also have some e2e tests here in GithubActions

Perform some basic actions in the tests:

  • transfer, query storage, some encointer-pallet calls
  • important: test custom rpc's of the encointer node.

Rpc bazaar.getBusinesses(cid) call should expect argument in base58 format

Right now, we have a mixture of base58 and hex formats for input/output arguments, I would suggests, that we keep it unified, maybe in base58?
This is the case:
Custom Rpc call: bazaar.getAllBusinesses(cid) expects hex format
Custom rpc call communities. communities.getAll()
Returns to be determined
Gesell node client: list-businesses flag expects cid in base58 format
Gesell node client: get communities: returns communities in hex format

Fix tests

As of v.3.3 the tests do not run anymore. This is like due to a change in the build-process.

Proper handling of fixed-point types

Currently we have defined our fixed point types like:

BalanceType: i128

but what is returned from the chain is:

BalanceTypeChain: {
     bits: i128
}

We need to somehow align this properly such that:

  • To the outside; the developer does not see a difference, whether he is using encointer-js or polkadot-js/api directly.

Which basically means that we need to change the encointer-js code to BalanceTypeChain as arguments and return values of its function.

We need to update the code at several places to fix that.

exports not found in v0.3.4

After upgrading the encointer-wallet I get the following build-warnings:


WARNING in ./node_modules/@polkadot/types-known/upgrades/index.js 62:25-27
"export 'BN' was not found in '@polkadot/util'
 @ ./node_modules/@polkadot/types-known/index.js
 @ ./node_modules/@polkadot/api/base/Init.js
 @ ./node_modules/@polkadot/api/base/Getters.js
 @ ./node_modules/@polkadot/api/base/index.js
 @ ./node_modules/@polkadot/api/rx/index.js
 @ ./node_modules/@polkadot/api/index.js
 @ ./src/service/settings.js
 @ ./src/index.js
 @ multi ./src/index.js

WARNING in ./node_modules/@encointer/worker-api/index.js 2:0-93
"export 'CallOptions' was not found in './interface.js'
 @ ./src/service/settings.js
 @ ./src/index.js
 @ multi ./src/index.js

WARNING in ./node_modules/@encointer/worker-api/index.js 2:0-93
"export 'IEncointerWorker' was not found in './interface.js'
 @ ./src/service/settings.js
 @ ./src/index.js
 @ multi ./src/index.js

WARNING in ./node_modules/@encointer/worker-api/index.js 2:0-93
"export 'PubKeyPinPair' was not found in './interface.js'
 @ ./src/service/settings.js
 @ ./src/index.js
 @ multi ./src/index.js

WARNING in ./node_modules/@encointer/worker-api/index.js 2:0-93
"export 'WorkerOptions' was not found in './interface.js'
 @ ./src/service/settings.js
 @ ./src/index.js
 @ multi ./src/index.js

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
  main.js (1.71 MiB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  main (1.71 MiB)
      main.js

Node-RSA seems to create output violating the standards

Our node-rsa implementation has been working some years ago, see encointer/encointer-wallet-flutter#124.

However, it seems that meanwhile there are some issues with it. I can't create encrypted blobs that can be understood by the worker, even though I am using the same code as we used back then in the encointer-wallet. There error is thrown here on the worker side.

Litentry seemed to have failed getting encryption to with the node-rsa module too, and they could finally get it to work with the node-js built-in crypto module, integritee-network/worker#987 (comment). However, this lacks browser support.

I will try to get it to work some more, before I start looking for alternatives, wip in: #89

Fix inconsistent use of CommunityIdentifier vs. ShardVault

The initial implementation of the encointer-worker implicitly assumed that the community identifier is kind of the shard of the integritee worker. In the worker api rework in #89, I have in some places abused the community identifier to be the shard vault. This dirty use should be fixed.

Fix: publish needs to be done in two steps with lerna

  • lerna version --force-publish updates the versions in the package.json file and performs a commit + push to the repository.
  • a subsequent build for the packages to be published, changes the package-info.ts files due to the new version.

Hence, to publish the package, we need two commits currently. Maybe we should do it manually again to be able to do it in only one commit?

npm package for worker-api functionality

As our flutter app and the explorer share the need to use the worker-api for Cantillon support, it would make sense to publish a npm package for this.

We have an organization registered at npmjs.com

[CI] npm release should be done with CI

Manual release procedure can go wrong, e.g., one can forget to run yarn install before running the release cycle locally.

Instead, the npm relase cycle should be triggered in the CI when a github release has been created.

[typegen] can't recreate local types due to loader error.

This has either to do with:

ERROR: Unable to load user definitions: Must use import to load ES Module: /home/clang/code/encointer-js/packages/types/src/interfaces/definitions.ts
require() of ES modules is not supported.
require() of /home/clang/code/encointer-js/packages/types/src/interfaces/definitions.ts from /home/clang/code/encointer-js/node_modules/@polkadot/typegen/cjs/fromDefs.js is an ES module file as it is a .ts file whose nearest parent package.json contains "type": "module" which defines all .ts files in that package scope as ES modules.
Instead change the requiring code to use import(), or remove "type": "module" from /home/clang/code/encointer-js/packages/types/package.json.

Edit: After some investigation I can say that this is due to #70.

Bullet-proof string to fixed-point conversion, is it needed?

In the conversion from string to fixed-point values, we parse the string to a float. In theory, this can be inconsistent.

The runtime validates the locations in the attestations exactly. So if a discrepancy occurs, the attestation is invalid. So far, this has not been observed.

The question is whether we care about an exact transform, or if we just allow for slight discrepancies when validating the fixed point number in the location.

Fix `Worker` implementation for encointer

#89 fixed the worker implementation for recent integritee-workers in general, but the encointer implementation is still not complete and is dangling in a state in between. To make the encointer-worker work, we need:

  • Make some functions needed in sending TrustedGetters and TrustedCalls more generic, such that we can create encointer types instead of integritee types depending on the contexts (currently only integritee types supported).
  • Probably update the type definitions for the encointer types

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.