Exemplo n.º 1
0
 @Test
 public void toStringTest() {
   InMemoryPrivateKey priv = new InMemoryPrivateKey(RANDOM_SOURCE);
   PublicKey pub = priv.getPublicKey();
   Address addr = Address.fromStandardPublicKey(pub, NetworkParameters.productionNetwork);
   System.out.println(addr.toString());
 }
Exemplo n.º 2
0
 public void setLocalTraderData(
     UUID accountId, InMemoryPrivateKey privateKey, Address address, String nickname) {
   _session = null;
   _localTraderAddress = Preconditions.checkNotNull(address);
   _localTraderAccountId = Preconditions.checkNotNull(accountId);
   _localTraderPrivateKey = Preconditions.checkNotNull(privateKey);
   _localTraderPrivateKeyString = privateKey.getBase58EncodedPrivateKey(_mbwManager.getNetwork());
   _nickname = Preconditions.checkNotNull(nickname);
   SharedPreferences.Editor editor = getEditor();
   editor.putString(Constants.LOCAL_TRADER_KEY_SETTING, _localTraderPrivateKeyString);
   editor.putString(Constants.LOCAL_TRADER_ACCOUNT_ID_SETTING, accountId.toString());
   editor.putString(Constants.LOCAL_TRADER_ADDRESS_SETTING, address.toString());
   editor.putString(Constants.LOCAL_TRADER_NICKNAME_SETTING, nickname);
   editor.commit();
 }