fix: return contract Addresses and allow passing hex when used as an contract arg #668
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
fixes #661
fixes #662
fixes #403
replaces #663
Why
#663 missed a few other commands were we take contract IDs as args. Also, we cannot generically accept hex for
strval::scaddress_from_json
, because with just 32-byte hex, we cannot tell if it is a user address or a contract address.Incidentally, making this more consistent also fixed a bug in
soroban events --id 1
, where the given contract id was not padded out to the full 32 bytes. Now, these are all equivalent:Those ids all also work for
invoke
,deploy
, andread
Known limitations
There is one case where you cannot use a hex (padded or unpadded) as a contract Address. That is when you are passing an
Address
argument to a contract. For example: