@@ -2967,17 +2967,17 @@ private static Permission json2Permission(JSONObject json) {
29672967 permissionBuilder .setTypeValue (type );
29682968 }
29692969 if (json .containsKey ("permission_name" )) {
2970- String permission_name = json .getString ("permission_name" );
2971- permissionBuilder .setPermissionName (permission_name );
2970+ String permissionName = json .getString ("permission_name" );
2971+ permissionBuilder .setPermissionName (permissionName );
29722972 }
29732973 if (json .containsKey ("threshold" )) {
2974- // long threshold = json.getLong("threshold");
2974+ // long threshold = json.getLong("threshold");
29752975 long threshold = Long .parseLong (json .getString ("threshold" ));
29762976 permissionBuilder .setThreshold (threshold );
29772977 }
29782978 if (json .containsKey ("parent_id" )) {
2979- int parent_id = json .getInteger ("parent_id" );
2980- permissionBuilder .setParentId (parent_id );
2979+ int parentId = json .getInteger ("parent_id" );
2980+ permissionBuilder .setParentId (parentId );
29812981 }
29822982 if (json .containsKey ("operations" )) {
29832983 byte [] operations = ByteArray .fromHexString (json .getString ("operations" ));
@@ -2991,8 +2991,6 @@ private static Permission json2Permission(JSONObject json) {
29912991 JSONObject key = keys .getJSONObject (i );
29922992 String address = key .getString ("address" );
29932993 long weight = Long .parseLong (key .getString ("weight" ));
2994- // long weight = key.getLong("weight");
2995- // keyBuilder.setAddress(ByteString.copyFrom(address.getBytes()));
29962994 keyBuilder .setAddress (ByteString .copyFrom (WalletClient .decodeFromBase58Check (address )));
29972995 keyBuilder .setWeight (weight );
29982996 keyList .add (keyBuilder .build ());
@@ -3015,28 +3013,28 @@ public static boolean accountPermissionUpdate(String permissionJson, byte[] owne
30153013 } catch (Exception ex ) {
30163014 ex .printStackTrace ();
30173015 }
3018- ECKey ecKey = temKey ;
3016+ final ECKey ecKey = temKey ;
30193017
30203018 Contract .AccountPermissionUpdateContract .Builder builder =
30213019 Contract .AccountPermissionUpdateContract .newBuilder ();
30223020
30233021 JSONObject permissions = JSONObject .parseObject (permissionJson );
3024- JSONObject owner_permission = permissions .getJSONObject ("owner_permission" );
3025- JSONObject witness_permission = permissions .getJSONObject ("witness_permission" );
3026- JSONArray active_permissions = permissions .getJSONArray ("active_permissions" );
3022+ JSONObject ownersPermission = permissions .getJSONObject ("owner_permission" );
3023+ JSONObject witnesssPermission = permissions .getJSONObject ("witness_permission" );
3024+ JSONArray activesPermissions = permissions .getJSONArray ("active_permissions" );
30273025
3028- if (owner_permission != null ) {
3029- Permission ownerPermission = json2Permission (owner_permission );
3026+ if (ownersPermission != null ) {
3027+ Permission ownerPermission = json2Permission (ownersPermission );
30303028 builder .setOwner (ownerPermission );
30313029 }
3032- if (witness_permission != null ) {
3033- Permission witnessPermission = json2Permission (witness_permission );
3030+ if (witnesssPermission != null ) {
3031+ Permission witnessPermission = json2Permission (witnesssPermission );
30343032 builder .setWitness (witnessPermission );
30353033 }
3036- if (active_permissions != null ) {
3034+ if (activesPermissions != null ) {
30373035 List <Permission > activePermissionList = new ArrayList <>();
3038- for (int j = 0 ; j < active_permissions .size (); j ++) {
3039- JSONObject permission = active_permissions .getJSONObject (j );
3036+ for (int j = 0 ; j < activesPermissions .size (); j ++) {
3037+ JSONObject permission = activesPermissions .getJSONObject (j );
30403038 activePermissionList .add (json2Permission (permission ));
30413039 }
30423040 builder .addAllActives (activePermissionList );
@@ -3495,28 +3493,28 @@ public static GrpcAPI.Return accountPermissionUpdateForResponse(String permissio
34953493 } catch (Exception ex ) {
34963494 ex .printStackTrace ();
34973495 }
3498- ECKey ecKey = temKey ;
3496+ final ECKey ecKey = temKey ;
34993497
35003498 Contract .AccountPermissionUpdateContract .Builder builder =
35013499 Contract .AccountPermissionUpdateContract .newBuilder ();
35023500
35033501 JSONObject permissions = JSONObject .parseObject (permissionJson );
3504- JSONObject owner_permission = permissions .getJSONObject ("owner_permission" );
3505- JSONObject witness_permission = permissions .getJSONObject ("witness_permission" );
3506- JSONArray active_permissions = permissions .getJSONArray ("active_permissions" );
3502+ JSONObject ownersPermission = permissions .getJSONObject ("owner_permission" );
3503+ JSONObject witnesssPermission = permissions .getJSONObject ("witness_permission" );
3504+ JSONArray activesPermissions = permissions .getJSONArray ("active_permissions" );
35073505
3508- if (owner_permission != null ) {
3509- Permission ownerPermission = json2Permission (owner_permission );
3506+ if (ownersPermission != null ) {
3507+ Permission ownerPermission = json2Permission (ownersPermission );
35103508 builder .setOwner (ownerPermission );
35113509 }
3512- if (witness_permission != null ) {
3513- Permission witnessPermission = json2Permission (witness_permission );
3510+ if (witnesssPermission != null ) {
3511+ Permission witnessPermission = json2Permission (witnesssPermission );
35143512 builder .setWitness (witnessPermission );
35153513 }
3516- if (active_permissions != null ) {
3514+ if (activesPermissions != null ) {
35173515 List <Permission > activePermissionList = new ArrayList <>();
3518- for (int j = 0 ; j < active_permissions .size (); j ++) {
3519- JSONObject permission = active_permissions .getJSONObject (j );
3516+ for (int j = 0 ; j < activesPermissions .size (); j ++) {
3517+ JSONObject permission = activesPermissions .getJSONObject (j );
35203518 activePermissionList .add (json2Permission (permission ));
35213519 }
35223520 builder .addAllActives (activePermissionList );
0 commit comments