Skip to content
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

Prepare beta v7 #1328

Merged
merged 11 commits into from
Mar 4, 2025
Merged

Prepare beta v7 #1328

merged 11 commits into from
Mar 4, 2025

Conversation

tabaktoni
Copy link
Member

@tabaktoni tabaktoni commented Feb 18, 2025

Motivation and Resolution

Starknet 0.13.4

RPC version (if applicable)

RPC 0.8

Usage related changes

  • Changes on provider types (do tests and checks on Provider)

Some test captured BreakingChanged:

  • new feeMarginPercentage type
  • removed enum FeeMarginPercentage from constants
  • added new FeeMarginPercentage to DEFAULT_GLOBAL_CONFIG
  • Transaction Receipt Typing refactor, also removed non-existing isRejected status

Development related changes

When specVersion is not defined in constructor options, prefer usage of the provider = await RpcProvider.create() for safe spec version/ channel resolution based on the node. Else it fail back to config default rpc version that could be false based on node rpc.

  • Replace internal usage of default exported api types (in this case 0.8)
  • Consider disabling default export api (in this case 0.8)
  • Use merged types in all cases except channels

Testing

  • backward compatibility RPC 0.7 V2
  • backward compatibility RPC 0.7 V3_old
  • compatibility RPC 0.8 V3_new

Checklist:

  • Performed a self-review of the code
  • Rebased to the last commit of the target branch (or merged it into my branch)
  • Linked the issues which this PR resolves
  • Documented the changes in code (API docs will be generated automatically)
  • Updated the tests
  • All tests are passing

@@ -2,7 +2,8 @@ import { RPC, RpcError } from '../../src';

describe('Error utility tests', () => {
test('RpcError', () => {
const baseError: RPC.Errors.UNEXPECTED_ERROR = {
// TODO: @penovicp types 0.8 exporta u top level sve 0.7 exporta po komponentama, neznan jeli treba minjat test i mod da ocukuje oba tipa
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type export change shouldn't be an issue. The RPC error utility relies on the mappings set up in src/types/errors.ts, so when the mapping is updated the utility should work regardless of how the underlying types are imported. It should work even without an update since the 0.7 errors are a subset of the 0.8 errors, the difference is that without it the new 0.8 errors wouldn't be recognised for type narrowing.

@tabaktoni tabaktoni marked this pull request as ready for review March 3, 2025 01:34
@penovicp penovicp merged commit 316ae27 into beta Mar 4, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants