Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

invoke V3 #1530

Closed
wants to merge 1 commit into from
Closed

invoke V3 #1530

wants to merge 1 commit into from

Conversation

jbcaron
Copy link

@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("");

@Eikix Eikix closed this Jan 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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