File tree Expand file tree Collapse file tree
framework/src/test/java/org/tron Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package org .tron .common .utils ;
2+
3+ import java .util .Objects ;
4+ import org .junit .Assert ;
5+ import org .junit .Test ;
6+ import org .tron .core .capsule .AccountCapsule ;
7+ import org .tron .core .vm .repository .Type ;
8+ import org .tron .core .vm .repository .Value ;
9+ import org .tron .protos .Protocol ;
10+
11+ public class HashCodeTest {
12+
13+ @ Test
14+ public void test () {
15+ Type type = new Type ();
16+ type .setType (Type .NORMAL );
17+ Assert .assertEquals (Integer .valueOf (Type .NORMAL ).hashCode (), type .hashCode ());
18+ Protocol .Account account = Protocol .Account .newBuilder ().setBalance (100 ).build ();
19+ Value <Protocol .Account > value = Value .create (new AccountCapsule (account .toByteArray ()));
20+ Assert .assertEquals (Integer .valueOf (
21+ type .hashCode () + Objects .hashCode (account )).hashCode (), value .hashCode ());
22+ }
23+ }
Original file line number Diff line number Diff line change @@ -969,4 +969,15 @@ public void testNewFilterFinalizedBlock() {
969969 Assert .assertEquals ("invalid block range params" , e .getMessage ());
970970 }
971971 }
972+
973+ @ Test
974+ public void testWeb3ClientVersion () {
975+ try {
976+ String [] versions = tronJsonRpc .web3ClientVersion ().split ("/" );
977+ String javaVersion = versions [versions .length - 1 ];
978+ Assert .assertTrue ("Java1.8" .equals (javaVersion ) || "Java17" .equals (javaVersion ));
979+ } catch (Exception e ) {
980+ Assert .fail ();
981+ }
982+ }
972983}
You can’t perform that action at this time.
0 commit comments