Skip to content

Commit

Permalink
fix: next version (#1024)
Browse files Browse the repository at this point in the history
* test: eth signer

* test: move secp256k1Point tests in a dedicated test file

* feat: helper for  transaction receipt

* simplify extends for account class

* feat: handling of cairo u512 type

* refactor: change name of variable : GetTxReceiptResponseWithoutHelper

* fix: double lines for same imports

* fix: solve an error in validate.ts initiated by pr 1007

* fix: correction of a word in guide

* docs: validateChecksumAddress

* fix: jsdoc correction

* docs: add tsdoc in utils/address.ts

* test: add extra fees

* fix: estimateFeeBulk include skipValidate in accountInvocationsFactory

* feat: add type guard to receipt response status methods

* fix: repair i128 typed data encoding and add typed data range checks

* chore: update left over StarkNet casing

---------

Co-authored-by: PhilippeR26 <philippe.rostan@yahoo.fr>
Co-authored-by: Philippe ROSTAN <81040730+PhilippeR26@users.noreply.github.com>
Co-authored-by: gregory <10611760+gregoryguillou@users.noreply.github.com>
Co-authored-by: ivpavici <ivan.pavicic@live.com>
Co-authored-by: Petar Penovic <pp@spaceshard.io>
  • Loading branch information
6 people authored Mar 25, 2024
1 parent 6235080 commit 07d4a26
Show file tree
Hide file tree
Showing 61 changed files with 30,862 additions and 210 deletions.
41 changes: 41 additions & 0 deletions __mocks__/cairo/cairo260/u512.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Cairo 2.6.0

use core::integer::u512;

#[starknet::interface]
trait IUint512<TContractState> {
fn get_u512(self: @TContractState) -> u512;
fn return_u512(self: @TContractState, my_u512: u512) -> u512;
fn div_u512(self: @TContractState, my_u512: u512, divisor: u256) -> (u512, u256);
}


#[starknet::contract]
mod TestUint512 {
use core::integer::{u512, u512_safe_div_rem_by_u256};

#[storage]
struct Storage {}

#[abi(embed_v0)]
impl Uint512 of super::IUint512<ContractState> {
fn get_u512(self: @ContractState) -> u512 {
u512 {
limb0: 0x00000000000000000000000000000000,
limb1: 0x11111111111111111111111111111111,
limb2: 0x22222222222222222222222222222222,
limb3: 0x33333333333333333333333333333333,
}
}

fn return_u512(self: @ContractState, my_u512: u512) -> u512 {
my_u512
}

fn div_u512(self: @ContractState, my_u512: u512, divisor: u256) -> (u512, u256) {
let (q, r) = u512_safe_div_rem_by_u256(my_u512, divisor.try_into().unwrap());
(q, r)
}
}
}

Loading

0 comments on commit 07d4a26

Please sign in to comment.