-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Added new networks #157 #158
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,14 @@ public static Network testnet() { | |
Network testnet = new Network(0b0000, 1097911063); | ||
return testnet; | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks good to me. You may want to change the local variable name in prepod & preview methods to prepod/preview instead of testnet. |
||
public static Network preprod() { | ||
Network preprod = new Network(0b0000, 1); | ||
return preprod; | ||
} | ||
|
||
public static Network preview() { | ||
Network preview = new Network(0b0000, 2); | ||
return preview; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
|
||
public enum NetworkId { | ||
TESTNET, | ||
MAINNET | ||
MAINNET, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -298,7 +298,8 @@ public static TransactionBody deserialize(Map bodyMap) throws CborDeserializatio | |
int networkIdInt = networkIdUI.getValue().intValue(); | ||
if (networkIdInt == 0) { | ||
transactionBody.setNetworkId(NetworkId.TESTNET); | ||
}else if (networkIdInt == 1) { | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. This change is not required. |
||
else if (networkIdInt == 1) { | ||
transactionBody.setNetworkId(NetworkId.MAINNET); | ||
} else { | ||
throw new CborDeserializationException("Invalid networkId value : " + networkIdInt); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to change this logic. In existing code, Network object is being compared but instead we should compare NetworkId of the network and return NetworkId.MAINNET or NetworkId.TESTNET
Some thing like