-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add StandardAccount.create()
#501
Add StandardAccount.create()
#501
Conversation
StandardAccount
StandardAccount
to static method
StandardAccount
to static methodStandardAccount
creation with automatic determination of Cairo version to static method
@Test | ||
fun `creating account with automatic Cairo version determination`() { | ||
StandardAccount.create( | ||
address = accountAddress, | ||
privateKey = Felt(1234), | ||
provider = provider, | ||
chainId = chainId, | ||
) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: It would be ideal if we could check resolved cairoVersion
and compare it with expected value. However, cairoVersion
is a private field, so we cannot do this. Wdyt @ddoktorski ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we can add a test similar to cairo1 account calldata
? Would it be possible to use Cairo 0 account?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I've added test both for Cairo 0 and 1.
StandardAccount
creation with automatic determination of Cairo version to static methodStandardAccount.create()
lib/src/main/kotlin/com/swmansion/starknet/account/StandardAccount.kt
Outdated
Show resolved
Hide resolved
@Test | ||
fun `creating account with automatic Cairo version determination`() { | ||
StandardAccount.create( | ||
address = accountAddress, | ||
privateKey = Felt(1234), | ||
provider = provider, | ||
chainId = chainId, | ||
) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we can add a test similar to cairo1 account calldata
? Would it be possible to use Cairo 0 account?
Co-authored-by: ddoktorski <45050160+ddoktorski@users.noreply.github.com>
Describe your changes
StandardAccount
constructor withcairoVersion
paramcairoVersion
toCairoVersion.ONE
StandardAccount.create()
, which allows to create aStandardAccount
instance with automatic determination of Cairo versionLinked issues
Closes
Breaking changes