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

milestone-2 delivery of SEOR code-less smart contract platform #292

Merged
merged 6 commits into from
Nov 10, 2021

Conversation

AKACoder
Copy link
Contributor

Milestone Delivery Checklist

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

@semuelle
Copy link
Member

Thanks for the delivery, @AKACoder. We will look into it as soon as possible. In the meantime, could you remove the M1 delivery document from this PR? It was already merged with your last delivery. I'm not sure but it might be sufficient (and easiest) to just fetch upstream.

@AKACoder
Copy link
Contributor Author

Thanks for the delivery, @AKACoder. We will look into it as soon as possible. In the meantime, could you remove the M1 delivery document from this PR? It was already merged with your last delivery. I'm not sure but it might be sufficient (and easiest) to just fetch upstream.

Sorry, my bad. Fetch the upstream now, and the file of M1 delivery was removed form this pr.

@semuelle semuelle self-assigned this Oct 26, 2021
@semuelle
Copy link
Member

Hi @AKACoder. Thanks again for the delivery and sorry for the late reply. I am trying to run the tests for the wrappers, but run into issues. Can you advise?

For the web3-wrapper and solana-wrapper tests, I get

26 10 2021 17:34:56.695:INFO [karma-server]: Restarting Chrome 95.0.4638 (Linux 0.0.0) (1 of 3 attempts)
26 10 2021 17:34:57.310:INFO [Chrome 95.0.4638 (Linux 0.0.0)]: Connected on socket xLLX-1BDq4z12z-RAAAG with id 28596209
Chrome 95.0.4638 (Linux 0.0.0) ERROR
  Uncaught Error: Cannot find module './signtransactionPrivateKey'
  at test/index.js:97832:17071
  
  Error: Cannot find module './signtransactionPrivateKey'
      at webpackMissingModule (test/index.js:97832:16979)
      at Object../src/wrapper/actions/actions/actions.ts (test/index.js:97832:17081)
      at __webpack_require__ (test/index.js:20:30)
      at Object../src/wrapper/actions/index.ts (test/index.js:98012:7913)
      at __webpack_require__ (test/index.js:20:30)
      at Object../src/wrapper/wrapper.ts (test/index.js:98164:1963)
      at __webpack_require__ (test/index.js:20:30)
      at Object../test/getAccount.spec.tsx (test/index.js:98235:19)
      at __webpack_require__ (test/index.js:20:30)
      at webpackContext (test/index.js:98197:9)

For the polkadot-wrapper, I get

  sendSignedTransaction
    ✗ sendSignedTransaction
	TypeError: Cannot read properties of undefined (reading 'meta')
	    at SendSignedTransaction.<anonymous> (test/index.js:105303:11544)
	    at Generator.next (<anonymous>)
	    at fulfilled (test/index.js:105303:9710)

  SignWithWallet
    ✗ SignWithWallet
	TypeError: Cannot read properties of undefined (reading 'meta')
	    at SignWithWallet.<anonymous> (test/index.js:105363:9468)
	    at Generator.next (<anonymous>)
	    at fulfilled (test/index.js:105363:7861)

tronweb-wrapper:

  link
    ✓ Wallet installed linkFunction
    ✗ Wallet not installed linkFunction
	TypeError: Cannot set properties of undefined (setting 'enable')
	    at test/index.js:49973:32
	    at Generator.next (<anonymous>)
	    at test/index.js:49955:71
	    at new Promise (<anonymous>)
	    at ./test/link.spec.tsx.__awaiter (test/index.js:49951:12)
	    at Context.<anonymous> (test/index.js:49971:51)

Also, every time I start yarn run test, it opens a clean install of Chrome, so I have to install the polkadotjs extension and address each time.

@AKACoder
Copy link
Contributor Author

Hi @AKACoder. Thanks again for the delivery and sorry for the late reply. I am trying to run the tests for the wrappers, but run into issues. Can you advise?

For the web3-wrapper and solana-wrapper tests, I get

26 10 2021 17:34:56.695:INFO [karma-server]: Restarting Chrome 95.0.4638 (Linux 0.0.0) (1 of 3 attempts)
26 10 2021 17:34:57.310:INFO [Chrome 95.0.4638 (Linux 0.0.0)]: Connected on socket xLLX-1BDq4z12z-RAAAG with id 28596209
Chrome 95.0.4638 (Linux 0.0.0) ERROR
  Uncaught Error: Cannot find module './signtransactionPrivateKey'
  at test/index.js:97832:17071
  
  Error: Cannot find module './signtransactionPrivateKey'
      at webpackMissingModule (test/index.js:97832:16979)
      at Object../src/wrapper/actions/actions/actions.ts (test/index.js:97832:17081)
      at __webpack_require__ (test/index.js:20:30)
      at Object../src/wrapper/actions/index.ts (test/index.js:98012:7913)
      at __webpack_require__ (test/index.js:20:30)
      at Object../src/wrapper/wrapper.ts (test/index.js:98164:1963)
      at __webpack_require__ (test/index.js:20:30)
      at Object../test/getAccount.spec.tsx (test/index.js:98235:19)
      at __webpack_require__ (test/index.js:20:30)
      at webpackContext (test/index.js:98197:9)

For the polkadot-wrapper, I get

  sendSignedTransaction
    ✗ sendSignedTransaction
	TypeError: Cannot read properties of undefined (reading 'meta')
	    at SendSignedTransaction.<anonymous> (test/index.js:105303:11544)
	    at Generator.next (<anonymous>)
	    at fulfilled (test/index.js:105303:9710)

  SignWithWallet
    ✗ SignWithWallet
	TypeError: Cannot read properties of undefined (reading 'meta')
	    at SignWithWallet.<anonymous> (test/index.js:105363:9468)
	    at Generator.next (<anonymous>)
	    at fulfilled (test/index.js:105363:7861)

tronweb-wrapper:

  link
    ✓ Wallet installed linkFunction
    ✗ Wallet not installed linkFunction
	TypeError: Cannot set properties of undefined (setting 'enable')
	    at test/index.js:49973:32
	    at Generator.next (<anonymous>)
	    at test/index.js:49955:71
	    at new Promise (<anonymous>)
	    at ./test/link.spec.tsx.__awaiter (test/index.js:49951:12)
	    at Context.<anonymous> (test/index.js:49971:51)

Also, every time I start yarn run test, it opens a clean install of Chrome, so I have to install the polkadotjs extension and address each time.

Hi, thank you for the review!

We improved the testing guide and the configuration of testing framework, and updated the branches related to this milestone delivery. The test part can now be run in the correct way.

Please pull & run the testing again, thank you!

@semuelle
Copy link
Member

Thanks for the update. I was able to run all Polkadot tests successfully. For the web3-wrapper, I now get

Chrome 95.0.4638 (Linux 0.0.0): Executed 36 of 36 (4 FAILED) (31.54 secs / 31.41 secs)
TOTAL: 4 FAILED, 32 SUCCESS


1) Wallet installed getBlockFunction
     getBlock
     TypeError: Cannot read properties of null (reading 'number')
    at test/index.js:98338:43
    at Generator.next (<anonymous>)
    at fulfilled (test/index.js:98318:58)

2) Wallet installed getTransactionFunction
     getTransaction
     AssertionError: expected { Object (code, data, ...) } to deeply equal { Object (code, data, ...) }
    at test/index.js:98504:46
    at Generator.next (<anonymous>)
    at fulfilled (test/index.js:98470:58)

3) Wallet installed contract-call
     loadContract
     Error: Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.
    at ABICoder../node_modules/web3-eth-abi/lib/index.js.ABICoder.decodeParametersWith (test/index.js:88809:15)
    at ABICoder../node_modules/web3-eth-abi/lib/index.js.ABICoder.decodeParameters (test/index.js:88796:17)
    at Contract../node_modules/web3-eth-contract/lib/index.js.Contract._decodeMethodReturn (test/index.js:90155:22)
    at Method.outputFormatter (test/index.js:90445:42)
    at Method../node_modules/web3-core-method/lib/index.js.Method.formatOutput (test/index.js:86757:54)
    at sendTxCallback (test/index.js:87133:33)
    at cb (test/index.js:85749:22)
    at Item../node_modules/process/browser.js.Item.run (test/index.js:69311:14)
    at drainQueue (test/index.js:69281:42)

4) Wallet installed SignWithWallet
     SignWithWallet
     Invalid parameters: must provide an Ethereum address.

The browser console shows

RPC Error: invalid sender
RPC Error: Invalid parameters: must provide an Ethereum address.
RPC Error: Invalid parameters: must provide an Ethereum address.
RPC Error: Invalid parameters: must provide an Ethereum address.

The solana-wrapper shows

ERROR in Entry module not found: Error: Can't resolve './get-selection-more.ts' in '/home/sebastian/work/w3f/code/grants/deliverables/SEOR/multi-chain-js/solana-wrapper'
ℹ 「wdm」: Failed to compile.

right after start, and the tests mostly fail with one of these error messages:

TOTAL: 14 FAILED, 13 SUCCESS

1) Wallet installed getAccountFunction
     getAccount
     TypeError: Cannot read properties of undefined (reading 'isPhantom')
    at web3InstallisPhantom (test/index.js:38426:16)

2) Wallet installed getBalanceFunction
     getBalance
     TypeError: Cannot read properties of undefined (reading 'isPhantom')
    at web3Install (test/index.js:38417:16)

There is a commit titled "improve testing of solana-wrapper" in your tronweb-wrapper and web3-wrapper branches and commits titled "improve testing of tronweb-wrapper", "improve testing of web3 wrapper" and "improve testing of solana-wrapper" in your main branch, but not in the tronweb-wrapper, web3-wrapper or solana-wrapper branches. If all tests work from the main branch, please tell me so and remove the checkouts from the documentation.

@semuelle
Copy link
Member

semuelle commented Nov 9, 2021

ping @AKACoder

@AKACoder
Copy link
Contributor Author

AKACoder commented Nov 9, 2021

Thanks for the update. I was able to run all Polkadot tests successfully. For the web3-wrapper, I now get

Chrome 95.0.4638 (Linux 0.0.0): Executed 36 of 36 (4 FAILED) (31.54 secs / 31.41 secs)
TOTAL: 4 FAILED, 32 SUCCESS


1) Wallet installed getBlockFunction
     getBlock
     TypeError: Cannot read properties of null (reading 'number')
    at test/index.js:98338:43
    at Generator.next (<anonymous>)
    at fulfilled (test/index.js:98318:58)

2) Wallet installed getTransactionFunction
     getTransaction
     AssertionError: expected { Object (code, data, ...) } to deeply equal { Object (code, data, ...) }
    at test/index.js:98504:46
    at Generator.next (<anonymous>)
    at fulfilled (test/index.js:98470:58)

3) Wallet installed contract-call
     loadContract
     Error: Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.
    at ABICoder../node_modules/web3-eth-abi/lib/index.js.ABICoder.decodeParametersWith (test/index.js:88809:15)
    at ABICoder../node_modules/web3-eth-abi/lib/index.js.ABICoder.decodeParameters (test/index.js:88796:17)
    at Contract../node_modules/web3-eth-contract/lib/index.js.Contract._decodeMethodReturn (test/index.js:90155:22)
    at Method.outputFormatter (test/index.js:90445:42)
    at Method../node_modules/web3-core-method/lib/index.js.Method.formatOutput (test/index.js:86757:54)
    at sendTxCallback (test/index.js:87133:33)
    at cb (test/index.js:85749:22)
    at Item../node_modules/process/browser.js.Item.run (test/index.js:69311:14)
    at drainQueue (test/index.js:69281:42)

4) Wallet installed SignWithWallet
     SignWithWallet
     Invalid parameters: must provide an Ethereum address.

The browser console shows

RPC Error: invalid sender
RPC Error: Invalid parameters: must provide an Ethereum address.
RPC Error: Invalid parameters: must provide an Ethereum address.
RPC Error: Invalid parameters: must provide an Ethereum address.

The solana-wrapper shows

ERROR in Entry module not found: Error: Can't resolve './get-selection-more.ts' in '/home/sebastian/work/w3f/code/grants/deliverables/SEOR/multi-chain-js/solana-wrapper'
ℹ 「wdm」: Failed to compile.

right after start, and the tests mostly fail with one of these error messages:

TOTAL: 14 FAILED, 13 SUCCESS

1) Wallet installed getAccountFunction
     getAccount
     TypeError: Cannot read properties of undefined (reading 'isPhantom')
    at web3InstallisPhantom (test/index.js:38426:16)

2) Wallet installed getBalanceFunction
     getBalance
     TypeError: Cannot read properties of undefined (reading 'isPhantom')
    at web3Install (test/index.js:38417:16)

There is a commit titled "improve testing of solana-wrapper" in your tronweb-wrapper and web3-wrapper branches and commits titled "improve testing of tronweb-wrapper", "improve testing of web3 wrapper" and "improve testing of solana-wrapper" in your main branch, but not in the tronweb-wrapper, web3-wrapper or solana-wrapper branches. If all tests work from the main branch, please tell me so and remove the checkouts from the documentation.

Sorry for the late reply, we spend more time then we think on making our testing output more clarity.
We updated all the Testing guides in READMEs and improved some of our testing print.
And we also removed the 'checkout' part in the guide due to all our released code and testing was merged to main branch.

This SDK are dependence on extension wallet such as polkadot{.js} extension to interact with blockchain's RPC interface, so you need to install the extension wallet for different blockchain's testing.

polkadot{.js} for Polkadot
MetaMask for Ethereum
Phantom for Solana
TronLink for Tron

We also added these extension wallet links in README files.

Please review again, thank you very much!

@semuelle
Copy link
Member

semuelle commented Nov 9, 2021

Thanks for the update. I will test everything in the coming days.

I just tried the example from the example folder and got this error message below. Can you check that that one is up to date as well?

❯ yarn run serve
yarn run v1.22.10
$ vue-cli-service serve
 INFO  Starting development server...
98% after emitting CopyPlugin

 ERROR  Failed to compile with 2 errors                                                                                18:17:06

These relative modules were not found:

* ./actions/index in ./node_modules/@sealsc/tronweb-wrapper/src/wrapper/wrapper.ts
* ./consts/consts in ./node_modules/@sealsc/tronweb-wrapper/src/wrapper/wrapper.ts

@AKACoder
Copy link
Contributor Author

Thanks for the update. I will test everything in the coming days.

I just tried the example from the example folder and got this error message below. Can you check that that one is up to date as well?

❯ yarn run serve
yarn run v1.22.10
$ vue-cli-service serve
 INFO  Starting development server...
98% after emitting CopyPlugin

 ERROR  Failed to compile with 2 errors                                                                                18:17:06

These relative modules were not found:

* ./actions/index in ./node_modules/@sealsc/tronweb-wrapper/src/wrapper/wrapper.ts
* ./consts/consts in ./node_modules/@sealsc/tronweb-wrapper/src/wrapper/wrapper.ts

Sorry for this problem. We forgot to publish the newest npm package and update the version in package.json file of the example.
This problem was solved in the latest commit, please pull & review again, thanks.

@semuelle
Copy link
Member

Thanks for the update, @AKACoder. Everything worked well. Your milestone is hereby accepted. Evaluation notes here.

Have you tested the libraries with other wallets? It would be handy to have a sort of compatibility table/list.

I will forward your invoice for processing.

@semuelle semuelle merged commit 0ec196d into w3f:master Nov 10, 2021
@AKACoder
Copy link
Contributor Author

Thanks for the update, @AKACoder. Everything worked well. Your milestone is hereby accepted. Evaluation notes here.

Have you tested the libraries with other wallets? It would be handy to have a sort of compatibility table/list.

I will forward your invoice for processing.

Great! Thank you for the review and such a good suggestion.
We are indeed testing other wallets. We will continue to update the documentation and add a list of compatible wallets that have passed our test.

@RouvenP
Copy link

RouvenP commented Nov 15, 2021

hi @AKACoder we transferred the payment for M2 today.

@AKACoder
Copy link
Contributor Author

hi @AKACoder we transferred the payment for M2 today.

Received, thank you!

failfmi pushed a commit to LimeChain/Grant-Milestone-Delivery that referenced this pull request Sep 26, 2022
* Github action to label based on approvals (missing)

* Revert "Github action to label based on approvals (missing)"

This reverts commit f6a6b70eb17683ab80a5493734d2bd0f3ce18ae2.

* Github action to label based on approvals

* approval labeler rewrite
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.

3 participants