FranklinPay-iOS icon indicating copy to clipboard operation
FranklinPay-iOS copied to clipboard

Feature: Pending transactions

Open BaldyAsh opened this issue 6 years ago • 24 comments

Current behavior: Now you can only get past transactions and show them

Expected behavior: Needs to get pending transactions and show them

Solution: You can use txpool, made by @currybab in his PR For Franklin use Matter Plasma Ignis API to get pending transactions.

BaldyAsh avatar Oct 25 '18 23:10 BaldyAsh

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 100.0 DAI (100.0 USD @ $1.0/DAI) attached to it.

gitcoinbot avatar Mar 18 '19 16:03 gitcoinbot

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 1 week, 2 days ago. Please review their action plans below:

1) santteegt has been approved to start work.

I´ll love to work on this as a first good issue for using a plasma impl.

Learn more on the Gitcoin Issue Details page.

gitcoinbot avatar Mar 18 '19 17:03 gitcoinbot

@santteegt hi! Great that you want to help with this. Ready to answer your questions

BaldyAsh avatar Mar 20 '19 08:03 BaldyAsh

Hi @BaldyAsh,

I've already setup the project dev environment. I was doing some tests by sending small Eth transactions on the Rinkeby testnet. Digging into the code, seems that this feature has to be implemented under the uploadTransactions() function in the TransactionHistory view controller. Now, I'm going to do some tests using the txPool instance available under wallet.web3Instance. In case I found some issues, I'll reach you :)

santteegt avatar Mar 20 '19 14:03 santteegt

@santteegt Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot avatar Mar 25 '19 16:03 gitcoinbot

Hi @BaldyAsh,

After doing some test trying to get the tx pool for sent ETH trxs on the Rinkeby testnet, I was always getting nil. Looking at the documentation seems that it does not work with Infura providers. Do I need to setup a local node to implement this, as mentioned in the reference PR?

santteegt avatar Mar 25 '19 23:03 santteegt

@santteegt Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot avatar Mar 31 '19 16:03 gitcoinbot

@santteegt you are right. Think I need to implement subscriptions in web3swift myself and then this issue can be solved

BaldyAsh avatar Mar 31 '19 18:03 BaldyAsh

Hi @BaldyAsh,

Okay, so should I wait until this feature is implemented under web3swift? I was thinking of implementing a manual tx pool by maintaining a sent tx list in global state and then verify if each of them was confirmed using the getTransactionReceipt method, but the downside is that this will be hardcoded in the wallet project.

On the other hand, in order to send transactions through the Plasma chain, how can I get some Franklin tokens?

santteegt avatar Apr 01 '19 03:04 santteegt

@santteegt think you may implement just UI and make some mocks for TXs loading. You can write mocks assuming that the pending TXs interface will be similar to the one that is in web3.js. I think this should be enough, I'll finish web3swift part and the task will be completed. For plasma - there is no need for separated pending TXs loading, and besides I have not implemented TXs in Swift yet. There is used a curve for signing TXs, that is not yet implemented in Swift. So currently I'm working on bridging some rust libs functionality with iOS.

BaldyAsh avatar Apr 01 '19 06:04 BaldyAsh

@santteegt started work in https://github.com/matter-labs/web3swift/pull/144

BaldyAsh avatar Apr 01 '19 21:04 BaldyAsh

@santteegt Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot avatar Apr 06 '19 16:04 gitcoinbot

Hi @BaldyAsh ,

I was considering using the current UI features to show pending transactions (Bob trx on screen image) under the All tab

image

I was looking to your progress in the websockets feature and seems that you almost finish it. Let me know when this feature is fully available on web3swift :)

santteegt avatar Apr 06 '19 17:04 santteegt

@santteegt hi, yes I've almost finished. There was some pod issue, hope it will not appear in new release. Or I'll integrate web3swift in Franklin as framework and it will work. Regarding pending txs - yes they should be presented in that way ;)

BaldyAsh avatar Apr 06 '19 19:04 BaldyAsh

Hi @BaldyAsh,

I just looked that you made a new release for the web3swift library. I've proceeded to update the web3swift pod version to 2.1.3 and also changed the Swift language to version 5, but I'm getting some compiling errors on the new code that implements the support for web sockets, such as Value of optional type '[String : Any]?' must be unwrapped to refer to member 'subscript' of wrapped base type '[String : Any]' at line 171 of Web3+InfuraProviders.swift:

let result = dictionary["result"] as? String {
        // setting filter id
       filterID = result
}

Not sure if I'm missing something when upgrading the pods.

santteegt avatar Apr 10 '19 03:04 santteegt

@santteegt hi, I've updated Franklin myself and haven't faced this error. Could you provide me a link to your project?

BaldyAsh avatar Apr 10 '19 09:04 BaldyAsh

@santteegt You can use updated Franklin version from this branch https://github.com/matter-labs/FranklinPay-iOS/tree/w3s2.1.3update

BaldyAsh avatar Apr 11 '19 14:04 BaldyAsh

Cool! Thanks @BaldyAsh. I'll use that branch

santteegt avatar Apr 11 '19 16:04 santteegt

Hi @BaldyAsh,

I am working in the following approach for fulfilling this feature. What do you think?

  • Store all sent transactions on the ETHTransactionModel with isPending=true.
  • When the TransactionHistory view refreshes:
  1. fetch these records
  2. compare txhashes with confirmed tx list
  3. update the record status on those that were already confirmed
  4. trxs that are still pending are appended to the view list

santteegt avatar Apr 14 '19 06:04 santteegt

@santteegt hi, think this should work, don't forget about failed txs :)

BaldyAsh avatar Apr 14 '19 18:04 BaldyAsh

Hi @BaldyAsh,

I just created a WIP PR for you to review my approach. It is working but sometimes while the pending transaction is confirmed through web3, the tx does not appear until Etherscan index that transaction a 1-2 seconds later.

santteegt avatar Apr 17 '19 05:04 santteegt

@santteegt Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • [x] reminder (3 days)
  • [ ] escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

gitcoinbot avatar Apr 21 '19 16:04 gitcoinbot

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 100.0 DAI (100.0 USD @ $1.0/DAI) has been submitted by:

  1. @santteegt

@ceresstation please take a look at the submitted work:

  • PR by @santteegt

gitcoinbot avatar Apr 21 '19 21:04 gitcoinbot

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 100.0 DAI (100.0 USD @ $1.0/DAI) attached to this issue has been approved & issued to @santteegt.

gitcoinbot avatar Apr 26 '19 22:04 gitcoinbot