Skip to content

Commit

Permalink
Thiagodeev/rpcv08 write methods, blockHeader and error 53 (#626)
Browse files Browse the repository at this point in the history
Update write methods, error 53 and block header for rpc08
  • Loading branch information
thiagodeev authored Sep 30, 2024
1 parent 182a073 commit f35d88f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions rpc/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ var (
Code: 52,
Message: "Invalid transaction nonce",
}
ErrInsufficientMaxFee = &RPCError{
ErrInsufficientResourcesForValidate = &RPCError{
Code: 53,
Message: "Max fee is smaller than the minimal transaction cost (validation plus fee transfer)",
Message: "The transaction's resources don't cover validation or the minimal transaction fee",
}
ErrInsufficientAccountBalance = &RPCError{
Code: 54,
Expand Down
2 changes: 2 additions & 0 deletions rpc/types_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ type BlockHeader struct {
SequencerAddress *felt.Felt `json:"sequencer_address"`
// The price of l1 gas in the block
L1GasPrice ResourcePrice `json:"l1_gas_price"`
// The price of l2 gas in the block
L2GasPrice ResourcePrice `json:"l2_gas_price"`
// The price of l1 data gas in the block
L1DataGasPrice ResourcePrice `json:"l1_data_gas_price"`
// Specifies whether the data of this block is published via blob data or calldata
Expand Down
6 changes: 3 additions & 3 deletions rpc/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func (provider *Provider) AddInvokeTransaction(ctx context.Context, invokeTxn Br
return nil, tryUnwrapToRPCErr(
err,
ErrInsufficientAccountBalance,
ErrInsufficientMaxFee,
ErrInsufficientResourcesForValidate,
ErrInvalidTransactionNonce,
ErrValidationFailure,
ErrNonAccount,
Expand Down Expand Up @@ -47,7 +47,7 @@ func (provider *Provider) AddDeclareTransaction(ctx context.Context, declareTran
ErrCompilationFailed,
ErrCompiledClassHashMismatch,
ErrInsufficientAccountBalance,
ErrInsufficientMaxFee,
ErrInsufficientResourcesForValidate,
ErrInvalidTransactionNonce,
ErrValidationFailure,
ErrNonAccount,
Expand All @@ -73,7 +73,7 @@ func (provider *Provider) AddDeployAccountTransaction(ctx context.Context, deplo
return nil, tryUnwrapToRPCErr(
err,
ErrInsufficientAccountBalance,
ErrInsufficientMaxFee,
ErrInsufficientResourcesForValidate,
ErrInvalidTransactionNonce,
ErrValidationFailure,
ErrNonAccount,
Expand Down

0 comments on commit f35d88f

Please sign in to comment.