@Test public void testFromTx() throws Exception { }
public static Map<Integer,List<Tx>> fromTx(String json, Wallet wallet){ Gson gson = new Gson(); UdJson udJson = gson.fromJson(json, UdJson.class); int base = 0; Map<Integer,List<Tx>> map = new HashMap<>(); List<Tx> result = new ArrayList<>(); for (History.Elem e : udJson.history.history){ Tx tx = new Tx(); tx.setPublicKey(""); tx.setUid(""); tx.setAmount(e.amount); tx.setBase(e.base); base = base>=e.base ?base : e.base; tx.setCurrency(wallet.getCurrency()); tx.setWallet(wallet); tx.setState(TxState.VALID.name()); tx.setComment(""); tx.setEnc(false); tx.setTime(e.time); tx.setBlockNumber(e.block_number); tx.setUd(true); result.add(tx); } map.put(base,result); return map; }
UdJson implements Serializable { public static Map<Integer,List<Tx>> fromTx(String json, Wallet wallet){ Gson gson = new Gson(); UdJson udJson = gson.fromJson(json, UdJson.class); int base = 0; Map<Integer,List<Tx>> map = new HashMap<>(); List<Tx> result = new ArrayList<>(); for (History.Elem e : udJson.history.history){ Tx tx = new Tx(); tx.setPublicKey(""); tx.setUid(""); tx.setAmount(e.amount); tx.setBase(e.base); base = base>=e.base ?base : e.base; tx.setCurrency(wallet.getCurrency()); tx.setWallet(wallet); tx.setState(TxState.VALID.name()); tx.setComment(""); tx.setEnc(false); tx.setTime(e.time); tx.setBlockNumber(e.block_number); tx.setUd(true); result.add(tx); } map.put(base,result); return map; } }
UdJson implements Serializable { public static Map<Integer,List<Tx>> fromTx(String json, Wallet wallet){ Gson gson = new Gson(); UdJson udJson = gson.fromJson(json, UdJson.class); int base = 0; Map<Integer,List<Tx>> map = new HashMap<>(); List<Tx> result = new ArrayList<>(); for (History.Elem e : udJson.history.history){ Tx tx = new Tx(); tx.setPublicKey(""); tx.setUid(""); tx.setAmount(e.amount); tx.setBase(e.base); base = base>=e.base ?base : e.base; tx.setCurrency(wallet.getCurrency()); tx.setWallet(wallet); tx.setState(TxState.VALID.name()); tx.setComment(""); tx.setEnc(false); tx.setTime(e.time); tx.setBlockNumber(e.block_number); tx.setUd(true); result.add(tx); } map.put(base,result); return map; }  }
UdJson implements Serializable { public static Map<Integer,List<Tx>> fromTx(String json, Wallet wallet){ Gson gson = new Gson(); UdJson udJson = gson.fromJson(json, UdJson.class); int base = 0; Map<Integer,List<Tx>> map = new HashMap<>(); List<Tx> result = new ArrayList<>(); for (History.Elem e : udJson.history.history){ Tx tx = new Tx(); tx.setPublicKey(""); tx.setUid(""); tx.setAmount(e.amount); tx.setBase(e.base); base = base>=e.base ?base : e.base; tx.setCurrency(wallet.getCurrency()); tx.setWallet(wallet); tx.setState(TxState.VALID.name()); tx.setComment(""); tx.setEnc(false); tx.setTime(e.time); tx.setBlockNumber(e.block_number); tx.setUd(true); result.add(tx); } map.put(base,result); return map; }  static Map<Integer,List<Tx>> fromTx(String json, Wallet wallet); }
UdJson implements Serializable { public static Map<Integer,List<Tx>> fromTx(String json, Wallet wallet){ Gson gson = new Gson(); UdJson udJson = gson.fromJson(json, UdJson.class); int base = 0; Map<Integer,List<Tx>> map = new HashMap<>(); List<Tx> result = new ArrayList<>(); for (History.Elem e : udJson.history.history){ Tx tx = new Tx(); tx.setPublicKey(""); tx.setUid(""); tx.setAmount(e.amount); tx.setBase(e.base); base = base>=e.base ?base : e.base; tx.setCurrency(wallet.getCurrency()); tx.setWallet(wallet); tx.setState(TxState.VALID.name()); tx.setComment(""); tx.setEnc(false); tx.setTime(e.time); tx.setBlockNumber(e.block_number); tx.setUd(true); result.add(tx); } map.put(base,result); return map; }  static Map<Integer,List<Tx>> fromTx(String json, Wallet wallet); public String currency; public String pubkey; public History history; }