-
Notifications
You must be signed in to change notification settings - Fork 16
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
Support RPC 0.8.0 #530
Draft
franciszekjob
wants to merge
57
commits into
main
Choose a base branch
from
feat/519-rpc-0.8.0
base: main
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.
Draft
Support RPC 0.8.0 #530
Changes from 21 commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
6ff3a2f
Adapt execution resources in data classes and methods
franciszekjob 4c2014d
Update tests
franciszekjob 625aa24
Add failure reason to transaction receipt
franciszekjob b0005b6
Add JSON RPC error data classes
franciszekjob 4587b9d
Add contract execution error
franciszekjob 5a96c51
Add `failureReason` to `GetTransactionStatusResponse`
franciszekjob 3c95565
Merge branch 'feat/519-2-transaction-status-error' into feat/519-3-st…
franciszekjob d547cb7
Fix linting
franciszekjob 25fdf9b
Add `getMessagesStatus` in providers
franciszekjob 74658de
Add todos for `getMessagesStatus` tests
franciszekjob 84f7dc5
Add `getStorageProof` in `Provider`
franciszekjob 5b81467
Add `GetStorageProofPayload`
franciszekjob 07a1f6f
Add `StorageProof`, `MerkleNode`, `ChildrenHashes`, `NodeHashToNodeMa…
franciszekjob 12138c6
Add `ContractStorageKey`
franciszekjob 06a8fd9
Refactor `getStorageProof`
franciszekjob 31f798c
Add `getStorageProof` test with todo
franciszekjob 0842ce5
Fix linting
franciszekjob c77b48b
Remove error-related changes
franciszekjob 6683874
Add missing params in KDoc
franciszekjob ddea038
Update tests
franciszekjob a1358d9
Rename todo; Fix `getMessagesStatus` name
franciszekjob 74f35a2
Rename todos
franciszekjob ff8e36a
Merge branch 'main' into feat/519-rpc-0.8.0
franciszekjob 13d81ad
Fix `NodeHashToNodeMapping`
franciszekjob 9097231
Fix linting
franciszekjob 1384afd
Merge branch 'feat/519-rpc-0.8.0' of https://github.com/software-mans…
franciszekjob 54d16f6
Update `getStorageProof`
franciszekjob bbd417c
Fix linting
franciszekjob b34bb52
Fix typo in `GetMessagesStatusResponse`
franciszekjob 4bf6139
Refactor `getMessagesStatus`
franciszekjob 97796fa
Update todo text
franciszekjob 475a7f7
Fix transaction hash calculator tests
franciszekjob 9a55b18
Update lib/src/main/kotlin/com/swmansion/starknet/data/types/Response…
franciszekjob 836a456
Update lib/src/main/kotlin/com/swmansion/starknet/data/types/Payloads.kt
franciszekjob b734973
Fix `GetMessagesStatusResponse`
franciszekjob c6b4806
Merge branch 'feat/519-rpc-0.8.0' of https://github.com/software-mans…
franciszekjob 2725046
Add `MessageStatusList` data class and serializer
franciszekjob 18ad358
Fix linting
franciszekjob 54d4402
Change return type of `getStorageProof` to `HttpRequest<StorageProof>`
franciszekjob 8688732
Refactor `NodeHashToNodeMappingItem`; Add `BinaryNode` and `EdgeNode`
franciszekjob 797911f
Fix linting
franciszekjob 11d2eaa
Remove unnecessarily added failure reason from tx receipt
franciszekjob 6614380
Refactor passing resource bounds
franciszekjob 303317f
Fix linting
franciszekjob a183504
Update `DeclareParamsV3` and `InvokeParamsV3` constructor params
franciszekjob 635c6a6
Fix resource bounds params in `StandardAccount`
franciszekjob a380e39
Fix linting
franciszekjob 3af0e5c
Add fixes for resource bounds
franciszekjob 63b8bd8
Fix linting
franciszekjob 1e6190b
Rename `computationResources` to executionResources`
franciszekjob a8722bb
Update mock jsons in tests
franciszekjob 5688593
Add `InnerCallExecutionResources`
franciszekjob 8f3061f
Add `DataResources` sealed class
franciszekjob 96dbac3
Fix linting
franciszekjob 25fe29c
Rename `DataResources` to `Resources`
franciszekjob 2b1c478
Restore `JvmName` annotation in `Resources.kt`
franciszekjob 8215452
Remove unnecessary formatting changes
franciszekjob 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
13 changes: 13 additions & 0 deletions
13
lib/src/main/kotlin/com/swmansion/starknet/data/types/ContractStorageKey.kt
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.swmansion.starknet.data.types | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class ContractStorageKey( | ||
@SerialName("contract_address") | ||
val contractAddress: Felt, | ||
|
||
@SerialName("key") | ||
val key: Felt, | ||
) |
16 changes: 16 additions & 0 deletions
16
lib/src/main/kotlin/com/swmansion/starknet/data/types/ExecutionResources.kt
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.swmansion.starknet.data.types | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class ExecutionResources( | ||
@SerialName("l1_gas") | ||
val l1Gas: Int, | ||
|
||
@SerialName("l1_data_gas") | ||
val l1DataGas: Int, | ||
|
||
@SerialName("l2_gas") | ||
val l2Gas: Int, | ||
) |
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
98 changes: 0 additions & 98 deletions
98
lib/src/main/kotlin/com/swmansion/starknet/data/types/Resources.kt
This file was deleted.
Oops, something went wrong.
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.
I wonder if we should just go ahead and accept
ResourceBoundsMapping
in all of these methods?Previously, there was no reason to do so. Now, my rationale is:
EstimateFeeResponse.toResourceBounds
and pass the result, transforming this:to more intuitive:
that doesn't require any knowledge of l1 or l2 gas to execute txs with auto estimated fees
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.
Definitely, makes sense. Refactored.
I just don't fully like the fact that now the param of type
ResourceBoundsMapping
is namedresourceBounds
😆 , but looks like it's because of this, so we can leave it.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.
That was the idea, but also the fact that
resourceBoundsMapping
doesn't seem like a good argument name from UX point of view.I think such naming convention also makes sense in this particular case:
ResourceBounds
-l1ResourceBounds
,l2ResourceBounds
ResourceBoundsMapping
-resourceBounds