Giter Site home page Giter Site logo

archanova's People

Contributors

jamesyoung avatar stanislaw-glogowski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

archanova's Issues

playground stops working when clicking "auto accept sdk actions"

if you disable the "auto accept sdk actions" checkbox
and if you re-enable it later
some functions seem to not work properly

in the following screenshot
Screenshot 2019-07-23 at 21 06 30

also empty if you try to widthdraw
Screenshot 2019-07-23 at 21 07 08

I think the problem appeared when I tried disabling and re-enabling the "auto accept sdk actions"

Next State on failed hanging deployment locking account | Sokol

Description

When a deploy account transaction is submitted by the relayer with 0Gwei set as the gas price (#52 ) the next state is locked at "Deployed" preventing the sdk from attempting to submit a new transaction.

Possible solutions

  • A means of canceling transactions
  • Next state can be reset by some means

estimateAccountDeployment gives me a BadRequest

On develop branch preview

const gasPriceStrategy = sdkConstants.GasPriceStrategies.Avg
let sdkEnv = getSdkEnvironment(SdkEnvironmentNames.Kovan)
let sdk = new createSdk(sdkEnv)
/* initialise and connect to existing account */

// this line throws an error
const estimate = await sdk.estimateAccountDeployment(gasPriceStrategy)

// this is returned from the server
errors: { gasPrice: 'any.required' } }

Connected account: 0xbC4Fd6EAe7c876b5fdD0161AaF3a30e79406C04f

Device state not updating post deploy | Sokol

Description of scenario

  • Client device initialises & creates account
  • Client adds guardian as device
  • Guardian device connects to client account
  • Guardian funds & deploys account
  • Guardian adds social recovery to client account
  • Guardian set up as social recovery
  • Client connects to account
  • Client removes guardian as device

Issue

When trying to estimate & submit a transaction from the newly created account, the SDK throws a, account is in created state, error, when using getConnectedAccountDevices, the client device entry's state is "Created" where as all the other entries are deployed.

[ethjs-abi] invalid hex string

When I tried to call the estimateWithdrawAccountPayment(hash) method, I got an error:
{reason: "[ethjs-abi] invalid hex string, hex must be prefixed and alphanumeric (e.g. 0x023..)", value: null}

Steps to reproduce:

  1. sdk.createAccountPayment(null, ethToWei(0.01)) => the transaction with status Reserved will be created
  2. sdk.grabAccountPayment(hash, receiver) => for receiver I've put a address of non-smart account. The status of the tx will be Created
  3. sdk.estimateWithdrawAccountPayment(hash) => you'll get the error above

Breaks react-scripts webpack dev environment

This is a follow-up to issue #39, I've moved away from a Typescript environment with react-scripts-ts and I'm using the latest [email protected] from [email protected].

I'm still getting issues with the dev environment but this time with the following error:
TypeError: Cannot destructure property createHash of 'undefined' or 'null'.

However I've also tested it with the boilerplate create-react-app without any of my code and just installing the @archanova/sdk and it worked

But can't get it to work with my setup which has the following dependencies:

{
  "dependencies": {
    "@archanova/sdk": "^1.0.0",
    "@netgum/utils": "^0.1.3",
    "axios": "^0.19.0",
    "connected-react-router": "^6.5.2",
    "history": "^4.9.0",
    "prop-types": "^15.7.2",
    "react": "^16.8.6",
    "react-dom": "^16.8.6",
    "react-redux": "^7.1.0",
    "react-router-dom": "^5.0.1",
    "react-scripts": "3.0.1",
    "redux": "^4.0.1",
    "redux-thunk": "^2.3.0",
    "styled-components": "^4.2.1"
  }
}

Relayer returning estimates with 0 Gwei | Sokol

Description

2 previous issues, (#56, #52) we closed despite the errors not being addressed.

The relayer will go through phases of sending back estimates that were calculated with a gas price of 0 repeatedly, I have recreated both issues in version 1.0.0 & 1.1.0 on the playground.

Can't detect other tokens

I used the getTokens and getToken method on the playground and I couldn't find the token I transferred to the active account.

accountAddress: 0x2AC21C80e9bA7f8FB21e18086D439ccdc9DE823A
tokenAddress: 0x3615757011112560521536258c1E7325Ae3b48AE

However I could top up the virtual balance using the token contract address so this issue wasn't too critical. So when I query the accountVirtualBalances, I get the following response:

Screenshot 2019-08-12 17 26 16

The token contract address gets listed on the virtual balances but it doesnt identify the name and symbol.

Account balances are not synchronously updated

When I receive a Completed AccountTransactionUpdated event, I expect to be able to access the Account's balance and receive the updated value.

Currently I have to set a 500ms timeout before accessing the balance else they do not contain the updated value(s).

Account device should be in Deployed state

This error is thrown after the account Deployment is done and before execute transaction.

The error thrown by the call to estimateAccountTransaction and we have work around currently by commenting the code that is throwing that error. Not sure why we have that error thrown. Because device is connected and account is connected.

Revert Error: Social recovery submission | Sokol

Description

After collecting a signature for a social recovery with the settings of 1 Required Friend, with 1 Friend account set up.

Submitting of social recovery returns an error of revert.

Possibly linked to the 0 Gwei gas issues (#60 #52 #56 ) as submitAccountFriendRecovery returns a hash and theres an issue with creating estimations to execute

SDK state sometimes out of sync

Think this is probably a duplicate of #64, but I'll describe in more detail here.

I have a pattern:

- client generates device
- device key sent to server
- server connects to pre-deployed acc contract
- server adds client device key as new account device
- server deploys this new device
- client should now be in a state where they are using a deployed device (after tx is mined)

What I notice, is that even when the tx is mined, the device (as seen by client) is not in the deployed state.

I also notice that after the server calls createAccountDevice, even if the client calls getConnectedAccounts, there are 0 accounts in the returned array.

I have worked around this by repeatedly calling getConnectedAccounts until I see what I expect, but this would be much simpler if there was some synchronicity.

contract method calls with gas refund

SDK should support calling contract method, broadcasting signed message and getting refund (like contract deployment).

const contract = sdk.contract.createInstance(contractAddress, abi);
const estimate = await contract.estimateCall('approve', ...args);
const data = await contract.call('approve', ...args);

Require accountAddress on options if no storageAdapter is set

If i didn't set the storageAdapter and I didn't yet deploy the account, I cannot initialize the SDK without the accountAddress.

So it would be good to update to the options on the initialize() like such:

const options = {
  device: { privateKey: "0x50bd9919ab6d896384a94f22641ba5a3fc1a29aecf157653d24bf4e1a2d5449b" },
  account: { address: "0x5272B38770B559E501c4020F131D4cc2450b3057" }
};

sdk
  .initialize(options)
  .then(() => console.log('initialized'))
  .catch(console.error);

Account Contract has enough gas but submitAccountTransaction fails on calling second time.

Account Contract has enough gas but submitAccountTransaction fails on calling second time.
Execute transaction works the first time but fails with an internal server error for the second time.

`   const accountObject = await sdkInit.estimateAccountTransaction(
  contractAddress.bettingContractAddress,
  '0',
  this.state.contractInstance.methods
    .requestWithdrawal(
      web3.utils.toWei(withdrawAmount, 'ether'),
      withdrawalAddress,
    )
    .encodeABI(),
);

console.log('Account Object =>', accountObject);

// Execute Transaction
let executeTransaction = await sdkInit.submitAccountTransaction(
  accountObject,
);`

Transactions submitted with 0Gwei gas price | Sokol

@archanova/cli: purpose unclear

Description

Purpose of CLI is unclear in context of the SDK, readme requires an update to provide purpose as well as examples of use.

Invalid recovery extension state | Sokol

Description

A deployed account had an attempt at deploying an account recovery extension. However it cant be queried, the setup account recovery function is forbidden, attempts to deploy the extension result in a null transaction hash.

To inspect

  • Open up playground
  • Initialise on Sokol using this PVT: 0xbf121c12d4be119eec1da5d3abf2bbaa6f28c1068ac0067d563dd9516191ec62
  • Connect account
  • Open Account Recovery section

Could not find a declaration file for module 'ethjs'

Failed to compile because I got the following error message:
Could not find a declaration file for module 'ethjs'

I tried to install @types/ethjs but wasn't successful

I managed to work around it by adding an empty declaration to the root directory index.d.ts
declare module "ethjs";

But then I ended getting a different error that I couldn't fix:
Cannot use namespace 'IProvider' as a type.

sdk.deployAccount is starting throw internal server error (500)

Trying to deploy SDK through sdk.deployAccount() causes internal server error with 500. It has enough ETH in the account address for deployment. We are trying launch Yolorekt pretty soon, please address this asap. Happy to get on a call if something is wrong on our end. The same of piece of code was working 2 days ago for account deployment by the yolorekt client.

npm run start:sdk:playground:5100 fails

Run:
$ npm i @archanova/cli -g
$ npm i @archanova/sdk -S
$ npm run bootstrap
$ npm run compile

$ npm run start:sdk:playground:5100

Error:

[email protected] start:sdk:playground:5100 /home/dekan/github/playground/archanova
cross-env PORT=5100 lerna run --stream --scope "@archanova/sdk-playground" start

lerna notice cli v3.13.4
lerna info filter [ '@archanova/sdk-playground' ]
lerna info Executing command in 1 package: "npm run start"
@archanova/sdk-playground: > @archanova/[email protected] start /home/dekan/github/playground/archanova/packages/sdk-playground
@archanova/sdk-playground: > react-scripts start
@archanova/sdk-playground: There might be a problem with the project dependency tree.
@archanova/sdk-playground: It is likely not a bug in Create React App, but something you need to fix locally.
@archanova/sdk-playground: The react-scripts package provided by Create React App requires a dependency:
@archanova/sdk-playground: "webpack": "4.29.6"
@archanova/sdk-playground: Don't try to install it manually: your package manager does it automatically.
@archanova/sdk-playground: However, a different version of webpack was detected higher up in the tree:
@archanova/sdk-playground: /archanova/node_modules/webpack (version: 3.12.0)
...

Workaround:
disable preflight check by addding this to sdk-playground/.env allows it to proceed
SKIP_PREFLIGHT_CHECK=true

Can't process the transaction to non smart wallet

Steps to reproduce:

  1. sdk.createAccountPayment(receiver, value) -> as a receiver set the non smart wallet account
    => transaction status will be Completed
  2. in order to process it call the sdk.estimateWithdrawAccountPayment(hash)
  3. sdk.submitAccountTransaction(estimated) => the result is 500 error without any explanation what went wrong

Make estimateAccountDeployment() method static

Is it possible to make the estimateAccountDeployment() method static? Or create a similar one. So we could get the tx fee estimate before we actually initialize the sdk and create an account?

Failed to compile - Playground - Master branch

Description

I did a fresh install of the master branch and attempted to get the SDK running on local, however it crashes throwing an error about too many params.

REACT_APP_ACTIVATE_HELP=1
REACT_APP_ACTIVATE_MAIN_SDK_ENV=1
REACT_APP_ACTIVATE_LOCAL_SDK_ENV=1
REACT_APP_ACTIVATE_XDAI_SDK_ENV=1
REACT_APP_LOCAL_SDK_ENV_PORT=8545
REACT_APP_AUTO_INITIALIZE_SDK=1
REACT_APP_AUTO_ACCEPT_SDK_ACTIONS=1
Failed to compile.
@archanova/sdk-playground: Expected 0-1 arguments, but got 2.  TS2554
@archanova/sdk-playground:      99 |       .logger
@archanova/sdk-playground:     100 |       .wrapSync('sdk.getConnectedAccountPayments', async (console) => {
@archanova/sdk-playground:   > 101 |         console.log('accountPayments', await this.sdk.getConnectedAccountPayments(pageParsed, {
@archanova/sdk-playground:         |                                                                                               ^
@archanova/sdk-playground:     102 |           state: filtersStateParsed,
@archanova/sdk-playground:     103 |         }));
@archanova/sdk-playground:     104 |       });

deposit payment not returning hash

I've ran into a hash that cannot be deposited through the sdk. I am using ropsten, but cant figure out what the problem is. I've deposited many more but this specific one does not go through: 0x0288dff5fbecc8dd82c472824c1d6763778e4aa99163ce2c4bd6b107bcd104e9

Some access to the relayer logs would be wonderful :)

Reverting when calling deployAccount

Revert error is throwing when try to use:

await this.sdk.deployAccount(sdkConstants.GasPriceStrategies.Avg);

THE CODE:

const accountBalance = await this.provider.getBalance(this.props.accountAddress);
         console.log('HERE Account Balance', accountBalance.toString()) // 20000000000000000
                const estimateResult = await this.sdk.estimateAccountDeployment(sdkConstants.GasPriceStrategies.Avg)
                console.log('HERE Estimate Result', estimateResult.totalCost.toString()) // 650000000000000

                let totalCost = ethers.utils.parseEther('0.01').add(estimateResult.totalCost.toString());
                console.log('HERE TOTAL COST', totalCost.toString()) // 10650000000000000
if (accountBalance.gte(totalCost)) {
               const hash = await this.sdk.deployAccount(sdkConstants.GasPriceStrategies.Avg);
}

THE ERROR:

Error: reverted
    at new Error (Error.js:7)
    at Function.fromAny (Error.js:32)
    at Function.throwFromAny (Error.js:38)
    at Sdk.js:46
    at shims.js:1
    at K (shims.js:1)
    at z (shims.js:1)
    at E (shims.js:1)
    at MessagePort.p (shims.js:1)

Tested both on kovan and ropsten

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.