You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Arbitrary impl for Address currently can generate either contract addresses or native addresses, since #1122.
After further experience writing tests with native addresses, I think adding this support was a mistake, as the SDK does not provide the additional tools needed to correctly test using native addresses.
In particular, native addresses need to have storage initialized, trustlines setup, and they cannot sign transactions without additional support code that is not obviously available to testers.
I have written tests where I had to filter out the native addresses because I didn't have those capabilities available.
For now, I think it would be good to just remove the ability to generate native addresses via Arbitrary. This might be considered a regression, but I suspect few are using it anyway.
My token fuzzer does have those capabilities but only with a bunch of custom code that is quite fiddly. It does not use the SDKs ability to generate addresses, but instead has a randomly-generated address "generator" (builder) that can set up storage, create trustlines, and sign transactions.
Something similar might be useful in the SDK.
The text was updated successfully, but these errors were encountered:
This reverts commit 6b04bfc.
Closes#1221
### What
In #1122, I changed the
impl of `Arbitrary` for `Address` to generate all types of addresses
instead of only contract addresses. I no longer think that was the
correct thing to do, so this changes the impl back to only generate
contract addresses.
### Why
Described in the issue
#1221
In short, native addresses are difficult to test with, particularly in
conjunction with the native token contract, because they require set up
of storage and trustlines. Doing this setup is possible, but is not
obvious, and users running into such errors during testing are likely to
get stuck.
### Known limitations
This is arguably a breaking change, though only to the testing
environment, and only to fuzzers. I think it is likely there are so few
fuzzing users that nobody will notice; better to do it sooner than
later.
What version are you using?
20.2
The
Arbitrary
impl forAddress
currently can generate either contract addresses or native addresses, since #1122.After further experience writing tests with native addresses, I think adding this support was a mistake, as the SDK does not provide the additional tools needed to correctly test using native addresses.
In particular, native addresses need to have storage initialized, trustlines setup, and they cannot sign transactions without additional support code that is not obviously available to testers.
I have written tests where I had to filter out the native addresses because I didn't have those capabilities available.
For now, I think it would be good to just remove the ability to generate native addresses via Arbitrary. This might be considered a regression, but I suspect few are using it anyway.
My token fuzzer does have those capabilities but only with a bunch of custom code that is quite fiddly. It does not use the SDKs ability to generate addresses, but instead has a randomly-generated address "generator" (builder) that can set up storage, create trustlines, and sign transactions.
Something similar might be useful in the SDK.
The text was updated successfully, but these errors were encountered: