-
Notifications
You must be signed in to change notification settings - Fork 13
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
JS v3: Native bigint support for select fields #72
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,76 @@ | ||
use_object_params_if_greater_than=0 | ||
indexer=true | ||
# Type override conventions: | ||
# * All Algo and asset amounts should be bigint (including fees) | ||
# * All round numbers should be bigint, including any quantities you would add | ||
# to a round number (e.g. offset or duration) | ||
# * All application and asset IDs should be bigint | ||
# * All timestamps in nanoseconds should be bigint | ||
# * If there is a quantity whose purpose is to be added to, subtracted from, or | ||
# otherwise operated on with a bigint, it should be a bigint for ease of use | ||
# * Other quantities outside of the above and which will never exceed the maximum | ||
# safe javascript integer should be number | ||
type_override_Account_amount=bigint | ||
type_override_Account_amountWithoutPendingRewards=bigint | ||
type_override_Account_pendingRewards=bigint | ||
type_override_Account_rewards=bigint | ||
type_override_Account_round=bigint | ||
type_override_Account_rewardBase=bigint | ||
type_override_AccountParticipation_voteFirstValid=bigint | ||
type_override_AccountParticipation_voteKeyDilution=bigint | ||
type_override_AccountParticipation_voteLastValid=bigint | ||
type_override_AccountResponse_currentRound=bigint | ||
type_override_AccountsResponse_currentRound=bigint | ||
type_override_Application_id=bigint | ||
type_override_ApplicationLocalState_id=bigint | ||
type_override_ApplicationLocalStatesResponse_currentRound=bigint | ||
type_override_ApplicationLogsResponse_applicationId=bigint | ||
type_override_ApplicationLogsResponse_currentRound=bigint | ||
type_override_ApplicationResponse_currentRound=bigint | ||
type_override_ApplicationsResponse_currentRound=bigint | ||
type_override_Asset_index=bigint | ||
type_override_AssetBalancesResponse_currentRound=bigint | ||
type_override_AssetHolding_assetId=bigint | ||
type_override_AssetHoldingsResponse_currentRound=bigint | ||
type_override_AssetResponse_currentRound=bigint | ||
type_override_AssetsResponse_currentRound=bigint | ||
type_override_Block_round=bigint | ||
type_override_BlockRewards_rewardsCalculationRound=bigint | ||
type_override_BlockRewards_rewardsLevel=bigint | ||
type_override_BlockRewards_rewardsRate=bigint | ||
type_override_BlockRewards_rewardsResidue=bigint | ||
type_override_BlockUpgradeState_nextProtocolSwitchOn=bigint | ||
type_override_BlockUpgradeState_nextProtocolVoteBefore=bigint | ||
type_override_BlockUpgradeVote_upgradeDelay=bigint | ||
type_override_Box_round=bigint | ||
type_override_BoxesResponse_applicationId=bigint | ||
type_override_HealthCheck_round=bigint | ||
type_override_StateProofTracking_nextRound=bigint | ||
type_override_StateProofTracking_onlineTotalWeight=bigint | ||
type_override_StateProofTracking_type=number | ||
type_override_StateSchema_numByteSlice=number | ||
type_override_StateSchema_numUint=number | ||
type_override_Transaction_fee=bigint | ||
type_override_Transaction_firstValid=bigint | ||
type_override_Transaction_lastValid=bigint | ||
type_override_Transaction_closeRewards=bigint | ||
type_override_Transaction_closingAmount=bigint | ||
type_override_Transaction_confirmedRound=bigint | ||
type_override_Transaction_createdApplicationIndex=bigint | ||
type_override_Transaction_createdAssetIndex=bigint | ||
type_override_Transaction_receiverRewards=bigint | ||
type_override_Transaction_senderRewards=bigint | ||
type_override_TransactionApplication_applicationId=bigint | ||
type_override_TransactionApplication_foreignApps=bigint | ||
type_override_TransactionApplication_foreignAssets=bigint | ||
type_override_TransactionAssetConfig_assetId=bigint | ||
type_override_TransactionAssetFreeze_assetId=bigint | ||
type_override_TransactionAssetTransfer_assetId=bigint | ||
type_override_TransactionKeyreg_voteFirstValid=bigint | ||
type_override_TransactionKeyreg_voteKeyDilution=bigint | ||
type_override_TransactionKeyreg_voteLastValid=bigint | ||
type_override_TransactionPayment_amount=bigint | ||
type_override_TransactionPayment_closeAmount=bigint | ||
type_override_TransactionResponse_currentRound=bigint | ||
type_override_TransactionStateProof_stateProofType=number | ||
type_override_TransactionsResponse_currentRound=bigint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Dumb question, why should we leave this as configurable at all? While we are putting sane defaults here, what are the cases where we should support the client overriding?
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.
First I should explain what's happening in this file. It's really just a list of key-value definitions.
In the template code, specifically here:
generator/typescript_templates/model.vm
Lines 7 to 10 in 4b0120a
we look at
propFile.type_override_X_Y
, whereX
is the generated class name andY
is the field in that class. If there's a value associated with that key from the prop file, we will use the type override that it declares.So it's less about making each field configurable, and more about configuring the list of fields and their overrides.
I chose to put the overrides in this config file for a few reasons: