-
Notifications
You must be signed in to change notification settings - Fork 15
Refactor/refactor provable types #388
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
Open
saitunc
wants to merge
73
commits into
develop
Choose a base branch
from
refactor/refactor-provable-types
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
73 commits
Select commit
Hold shift + click to select a range
d2e2160
feat: add type alias for FieldString and helper function for it
saitunc 4336578
refactor: change Field typed properties to FieldString type
saitunc be7c06e
refactor: update codebase to use string properties of Block
saitunc 86f87db
refactor: allow Field in FieldString input
saitunc c29a51d
refactor: Infer JSON type of NetworkState and use in Block interface
saitunc adc99a0
refactor: update codebase for use of NetworkStateJson type
saitunc 2483e82
refactor: remove unnecessary stringifications and type conversions
saitunc ae96af1
refactor: change use of NetworkState to NetworkStateJson in codebase
saitunc 1093afe
refactor: refactor ClientBlock and used parts in codebase
saitunc 0199877
refactor: update UntypedStateTransition with UntypedSTJson
saitunc 76e1417
refactor: add utility function for hashing NetworkStateJson values
saitunc 55d5dec
refactor: apply refactoring where NetworkStateJson is used
saitunc 78aae19
refactor: add BlockHahMerkleTreewitnessJson and refactor with it
saitunc 31db4aa
refactor: refactor BlockMapper and BlockResultMapper with new types
saitunc 7706aa3
refactor: update methodId type to string
saitunc b46e81d
refactor: add minor change to use methodId
saitunc 5934a13
refactor: rename UntypedSTJson to UntypedStateTranisitionJson
saitunc b017bb5
refactor: implement TransactionExecutionResultJson and use it for Block
saitunc d3c9336
refactor: refactor PrivateMempool to use PendingTransactionJson type
saitunc 08f95bb
refactor: add serialization utility functions for non-provable types
saitunc d8558f9
refactor: use non-provable types in storage and mempool interfaces
saitunc 564ba7a
refactor:use non-provable types in execution and tracing services
saitunc 6905b36
refactor: update Prisma interactions to use non-provable types
saitunc fb4c854
refactor: use non-provable types in object mappers
saitunc d5b6d7b
refactor: update PendingTransaction related code PendingTransactionJs…
saitunc 57ad69d
refactor(test): update with changes in codebase
saitunc a4ac392
refactor: use non-provable types in tracing and task layers
saitunc bc53d88
refactor: use non-provable types in tracing services
saitunc 57c3520
style: run lint fix
saitunc 08e7d35
Merge branch 'develop' into refactor/refactor-provable-types
saitunc 2a37bb7
style: run lint fix
saitunc f041a12
Delete planning file
saitunc 1989a19
refactor: rename NetworkState to ProvableNetworkState
saitunc 9b8bd33
refactor: remove hashNetworkState, use .hash() of ProvableNetworkState
saitunc ffdf8dd
refactor: change type of block height from string to number
saitunc ebed33e
refactor: simplify ClientBlock construction and fix type in Block
saitunc 11f7b85
refactor: update UntypedStateTranisition and UntypedOption
saitunc 4a77e29
refactor: refactor away inheritance of PendingTransaction
saitunc 231d654
refactor: make original types non-provable and remove unnecessary code
saitunc b9267b8
refactor: replace PendingTransactionJSONType with PendingTransaction
saitunc 1ee230b
refactor: move FieldString to common/utils
saitunc 170d86b
refactor: use toRuntimeTransaction for signature verification
saitunc 7dab7e5
refactor: replace TransactionExecutionResultJson with TransactionExec…
saitunc a5602a2
fix: update missing PendingTransaction replacement
saitunc 0d8db76
refactor: update toProvable in UntypedStateTransition
saitunc 20081d7
refactor: replace UntypedStateTransitionJson with UntypedStateTransition
saitunc 8a09ced
refactor: replace StateTransitionBatchJson with StateTransitionBatch
saitunc 8053677
refactor(fix): fix use of PendingTransaction attributes
saitunc f8bb8e2
refactor: remove STBatchFromJson and fix UntypedStateTransition code
saitunc 4ed3853
refactor: update RuntimeProofParameters and TaskStateRecord
saitunc a959f99
refactor(fix): fix missing changes on refactored non-provable code
saitunc 0c38966
refactor: add helper methods to UntypedOption and UntypedStateTransition
saitunc 019591f
refactor: flatten PendingTransaction like UnsignedTransaction
saitunc 9fd7a92
refactor: update code using PendingTransaction
saitunc cbecb5a
refactor: make decode to take string array as input
saitunc 44e9ea6
refactor: remove unnecessary lines and fix mappings
saitunc 4f776a7
style: run lint fix
saitunc cb059f4
fix(test): fix test code to pass
saitunc 81c0df7
refactor: use JSONTaskSerializer for RuntimeProofParameters
saitunc 92ee61b
style: run lint fix
saitunc 9ef4aea
refactor: minor line changes
saitunc 39505c8
refactor: remove block and pendingTx serializers
saitunc 3f72d18
style: run lint fix
saitunc e3789b8
refactor(fix): fix mistaken conversions and fix lint errors
saitunc d636e67
refactor: use JSONTaskSerializer in batch and settlement tasks
saitunc 2b8bd2d
Merge remote-tracking branch 'origin/develop' into refactor/refactor-…
saitunc fe529bd
style: fix lint errors
saitunc 3b08e94
refactor: assign networkState to variable to avoid repetition
saitunc 6a7899b
Merge branch 'develop' into refactor/refactor-provable-types
saitunc 851d36e
refactor: update and fix UntypedOption and UntypedStateTransition
saitunc c944bdd
refactor: refactor codebase for updated classes
saitunc e5f1fbd
refactor: get ProvableOption values from fromJSON method
saitunc ffac7b6
style: run lint fix
saitunc 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
22 changes: 0 additions & 22 deletions
22
packages/indexer/src/tasks/IndexPendingTxTaskParameters.ts
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -21,13 +21,15 @@ import { | |
| TestingAppChain, | ||
| } from "@proto-kit/sdk"; | ||
| import { | ||
| JSONTaskSerializer, | ||
| LocalTaskQueue, | ||
| PendingTransaction, | ||
| Sequencer, | ||
| TaskPayload, | ||
| VanillaTaskWorkerModules, | ||
| } from "@proto-kit/sequencer"; | ||
|
|
||
| import { IndexerNotifier, IndexBlockTaskParametersSerializer } from "../src"; | ||
| import { IndexerNotifier, IndexBlockTaskParameters } from "../src"; | ||
|
|
||
| class TestBalances extends Balances { | ||
| @runtimeMethod() | ||
|
|
@@ -130,7 +132,7 @@ async function sendTransactions( | |
| { nonce: i } | ||
| ); | ||
|
|
||
| console.log("tx nonce", tx.transaction?.nonce.toBigInt()); | ||
| console.log("tx nonce", (tx.transaction as PendingTransaction).nonce); | ||
|
Member
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. Why do you do this? tx should already be of type PendingTransaction, no? |
||
|
|
||
| await tx.sign(); | ||
| await tx.send(); | ||
|
|
@@ -141,7 +143,7 @@ async function sendTransactions( | |
| const txs = await mempool.getTxs(); | ||
| console.log( | ||
| "txs", | ||
| txs.map((tx) => tx.nonce.toBigInt()) | ||
| txs.map((tx) => tx.nonce) | ||
| ); | ||
|
|
||
| return await appChain.produceBlock(); | ||
|
|
@@ -179,11 +181,13 @@ describe.skip("IndexerNotifier", () => { | |
| }, 20000); | ||
|
|
||
| it("should create a task for every unproven block produced", async () => { | ||
| const { block } = container | ||
| .resolve(IndexBlockTaskParametersSerializer) | ||
| .fromJSON(addTaskSpy.mock.lastCall?.[0].payload!); | ||
| const serializer = JSONTaskSerializer.fromType<IndexBlockTaskParameters>(); | ||
|
|
||
| expect(block.height.toBigInt()).toBe(0n); | ||
| const { block } = await serializer.fromJSON( | ||
| addTaskSpy.mock.lastCall?.[0].payload! | ||
| ); | ||
|
|
||
| expect(block.height).toBe(0); | ||
| expect(block.transactions.length).toBe(2); | ||
| }); | ||
| }); | ||
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.