-
Notifications
You must be signed in to change notification settings - Fork 792
feat: full speck version implementation #1384
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
base: develop
Are you sure you want to change the base?
Conversation
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.
A couple of rewording suggestions, otherwise lgtm
} | ||
|
||
throw new LibraryError('Unable to detect specification version'); | ||
throw new LibraryError( | ||
`Provided RPC node specification versions ${spec} is not compatible with the SDK. SDK supported RPC versions ${Object.keys(SupportedRpcVersion).toString()}` |
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.
`Provided RPC node specification versions ${spec} is not compatible with the SDK. SDK supported RPC versions ${Object.keys(SupportedRpcVersion).toString()}` | |
`Provided RPC node specification version ${spec} is not compatible with the SDK. SDK supported RPC versions: ${Object.keys(SupportedRpcVersion).toString()}` |
readonly id = 'RPC071'; | ||
|
||
/** | ||
* This Channel provide communication using spec version |
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.
* This Channel provide communication using spec version | |
* RPC specification version this Channel class implements |
This is a suggestion to sync the typedoc note with this.specVersion
.
@@ -60,6 +66,9 @@ export class RpcChannel { | |||
|
|||
private chainId?: StarknetChainId; | |||
|
|||
/** | |||
* Connected RPC node specification version |
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.
* Connected RPC node specification version | |
* RPC specification version of the connected node |
This is a suggestion to sync the typedoc note with this. channelSpecVersion
.
*/ | ||
public getSpecificationVersion() { | ||
return this.fetchEndpoint('starknet_specVersion'); | ||
public async setupSpecVersion() { |
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.
Nitpick, setup
is usually used as a noun and set up
as the corresponding verb form so the method would be setUpSpecVersion
.
Motivation and Resolution
Expand subversion specification validation on provider instantiation with create().
SupportedRpcVersion
is now the full spec version 0.8.1[provider, channel].readSpecVersion()
read recorded spec version from channel[provider, channel].getSpecVersion()
fetch from API full spec version[provider, channel].setupSpecVersion()
has functionality of oldgetSpecVersion(), return spec version if recorded else fetch, test for supported versions and store if fine, else throw errorRpcChannel.channelSpecVersion
constant specifying for which specversion the channel is designedUsage related changes
Moved version and resolution util methods from
utils/provider
toutils/resolve
Development related changes
Spec version is now in full form major.minor.patch (actual starknet spec is major.major.major)
Checklist: