Feature/implement kyber#119
Feature/implement kyber#119snovaisg wants to merge 5 commits intoAppStoreFoundation:feature/implement-kyberfrom
Conversation
Built infrastructure to support token swap feature Token swap works (from eth to appc|eos|knc)
Cleaned Code
| public SwapDataMapper swapDataMapper; | ||
| @Inject SwapProofWriter swapBlockChainWriter; | ||
| @Inject SwapProof swapProof; | ||
| Spinner fromToken; |
There was a problem hiding this comment.
Not injected variables can be private
| // Another interface callback | ||
| } | ||
|
|
||
| public void getExpectedRate(View v) { |
There was a problem hiding this comment.
use an OnClickListener instead of xml to listener click events
| } | ||
|
|
||
| public void switchToMock1() { | ||
| Intent myIntent = new Intent(this, SwapMock1Activity.class); |
There was a problem hiding this comment.
SwapMock1Activity should be the one creating its intent
| @Override public BigInteger writeGetterSwapProof(SwapProof swapProof) { | ||
| String from = swapProof.getFromAddress(); | ||
| String to = swapProof.getToAddress(); | ||
| Function getRates = new SwapDataMapper().getDataExpectedRate(swapProof); |
There was a problem hiding this comment.
SwapDataMapper should be injected on constructor of SwapBlockchainWriter
| import javax.inject.Inject; | ||
| import org.web3j.utils.Convert; | ||
|
|
||
| public class SwapMock1Activity extends AppCompatActivity { |
There was a problem hiding this comment.
Give a better name to this activity
| String data) { | ||
|
|
||
| this.chainId = chainId; | ||
| this.gasPrice = gasSettingsRepositoryType.getGasSettings(false) |
There was a problem hiding this comment.
This can't be here, the swapProff gas price value has to be sent over its constructor
| switch (v.getId()) { | ||
| case R.id.save: { | ||
| onSave(); | ||
| //onSave(); |
There was a problem hiding this comment.
SwapActivity should create its Intent
| android:layout_marginStart="56dp" | ||
| android:layout_marginTop="32dp" | ||
| android:onClick="testApprove" | ||
| android:text="approve" |
There was a problem hiding this comment.
create a string on strings.xml file for this kind of text
| > | ||
|
|
||
| <Button | ||
| android:id="@+id/bt1" |
There was a problem hiding this comment.
give better names to this ids
| @@ -0,0 +1,105 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
| <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
There was a problem hiding this comment.
use constraints instead of margins to organize the view
Kyber use case implemented in a simple activity (SwapMock1Activity): get rates between ETHER and APPC and swap them.
Last version before changing to android mvp