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

invoke V3 #1530

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

invoke V3 #1530

wants to merge 1 commit into from

Conversation

jbcaron
Copy link
Collaborator

@jbcaron jbcaron commented Nov 6, 2024

Time spent on this PR:

Resolves: #773

Pull Request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build-related changes
  • Documentation content changes
  • Testing

What is the new behavior?

Does this introduce a breaking change?

  • Yes
  • No

@Eikix
Copy link
Member

Eikix commented Nov 7, 2024

It seems for rust tests, the katana accounts are not funded in STRK?

Comment on lines +55 to +75
impl TryFrom<Felt252Wrapper> for u64 {
type Error = EthereumDataFormatError;

fn try_from(felt: Felt252Wrapper) -> Result<Self, Self::Error> {
match felt.to_be_digits() {
[0, 0, 0, d] => Ok(d),
_ => Err(EthereumDataFormatError::Primitive),
}
}
}

impl TryFrom<Felt252Wrapper> for u128 {
type Error = EthereumDataFormatError;

fn try_from(felt: Felt252Wrapper) -> Result<Self, Self::Error> {
match felt.to_be_digits() {
[0, 0, d1, d2] => Ok(Self::from(d1) << 64 | Self::from(d2)),
_ => Err(EthereumDataFormatError::Primitive),
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can't we use directly this

https://github.com/starknet-io/types-rs/blob/7ef30234da7957f7585ea832d57d13083c76995c/crates/starknet-types-core/src/felt/primitive_conversions.rs#L91-L96

by doing something like

let a = Felt252Wrapper;
let b: u64 = a.0.try_into().expect("");

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.

feat: upgrade Starknet tx type to v3 and pay fees in STRK
3 participants