feat(api):better TransactionState.TransactionState->TransactionState.… #284
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm developing java sdk, when I try to generate java classes due to proto, it would generate illegal java code.
This is because tx_types.proto defines TransactionState alongwith enum TransactionState:
message TransactionState {
TransactionId id = 1;
enum TransactionState {
TRANSACTION_STATE_UNSPECIFIED = 0; // default state
TRANSACTION_STATE_REJECTED = 1; // rejected from mempool due to, e.g., invalid syntax
TRANSACTION_STATE_INSUFFICIENT_FUNDS = 2; // rejected from mempool by funds check
TRANSACTION_STATE_CONFLICTING = 3; // rejected from mempool due to conflicting counter
TRANSACTION_STATE_MEMPOOL = 4; // in mempool but not on the mesh yet
TRANSACTION_STATE_MESH = 5; // submitted to the mesh
TRANSACTION_STATE_PROCESSED = 6; // processed by STF; check Receipt for success or failure
}
TransactionState state = 2;
}
It would generate this form of java code which is illegal in Java:
A fast way to optimize this is to change the name of the enum: TransactionState.TransactionState->TransactionState.TramsactionStateEnum