@Test public void checkAddress(){ String mainnet = "lat1x8z5nfgjnaryutayxxkzzkrfzenpwl7k6r2a8z"; String testnet = "lax1x8z5nfgjnaryutayxxkzzkrfzenpwl7k4xcjfd"; String invalid = "xxxxx"; boolean checkAddressBoolean = presenter.checkAddress(invalid); LogUtils.i("------checkAddress result:" + checkAddressBoolean); if(checkAddressBoolean){ Mockito.verify(view).setAddressVisibility(Mockito.any()); }else{ Mockito.verify(view).showAddressError(Mockito.any()); } }
@Override public boolean checkAddress(String address) { int errMsgCode = JZWalletUtil.checkToAddressErrMsg(address); if (errMsgCode == 0) { getView().setAddressVisibility(View.GONE); } else { getView().showAddressError(string(errMsgCode)); } return errMsgCode == 0; }
AddNewAddressPresenter extends BasePresenter<AddNewAddressContract.View> implements AddNewAddressContract.Presenter { @Override public boolean checkAddress(String address) { int errMsgCode = JZWalletUtil.checkToAddressErrMsg(address); if (errMsgCode == 0) { getView().setAddressVisibility(View.GONE); } else { getView().showAddressError(string(errMsgCode)); } return errMsgCode == 0; } }
AddNewAddressPresenter extends BasePresenter<AddNewAddressContract.View> implements AddNewAddressContract.Presenter { @Override public boolean checkAddress(String address) { int errMsgCode = JZWalletUtil.checkToAddressErrMsg(address); if (errMsgCode == 0) { getView().setAddressVisibility(View.GONE); } else { getView().showAddressError(string(errMsgCode)); } return errMsgCode == 0; }  }
AddNewAddressPresenter extends BasePresenter<AddNewAddressContract.View> implements AddNewAddressContract.Presenter { @Override public boolean checkAddress(String address) { int errMsgCode = JZWalletUtil.checkToAddressErrMsg(address); if (errMsgCode == 0) { getView().setAddressVisibility(View.GONE); } else { getView().showAddressError(string(errMsgCode)); } return errMsgCode == 0; }  @Override void getIntentData(); @Override void loadAddressInfo(); @Override void addAddress(); @Override boolean checkAddressName(String name); @Override boolean checkAddress(String address); @Override void validQRCode(String text); }
AddNewAddressPresenter extends BasePresenter<AddNewAddressContract.View> implements AddNewAddressContract.Presenter { @Override public boolean checkAddress(String address) { int errMsgCode = JZWalletUtil.checkToAddressErrMsg(address); if (errMsgCode == 0) { getView().setAddressVisibility(View.GONE); } else { getView().showAddressError(string(errMsgCode)); } return errMsgCode == 0; }  @Override void getIntentData(); @Override void loadAddressInfo(); @Override void addAddress(); @Override boolean checkAddressName(String name); @Override boolean checkAddress(String address); @Override void validQRCode(String text);  }