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

make StrKey public. #548

Merged
merged 3 commits into from
Oct 7, 2023

Conversation

overcat
Copy link
Member

@overcat overcat commented Oct 6, 2023

Closes #318

In Soroban, we have many scenarios that require converting strkey into raw data. Making strkey public helps users handle it conveniently.

We will prudently make the following methods public:

  • encodeEd25519PublicKey
  • decodeEd25519PublicKey
  • encodeEd25519SecretSeed
  • decodeEd25519SecretSeed
  • encodePreAuthTx
  • decodePreAuthTx
  • encodeSha256Hash
  • decodeSha256Hash
  • encodeSignedPayload
  • decodeSignedPayload
  • encodeContract
  • decodeContract

In addition, we have modified the names of some functions to be consistent with other SDKs. Since StrKey was not previously public, there will be no destructive updates.

Copy link
Member Author

Choose a reason for hiding this comment

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

We only need to focus on StrKey.java and StrKeyTest.java, we don't need to worry about other files.

@@ -428,4 +493,33 @@ private static boolean isInAlphabet(final byte[] arrayOctet) {
}
return true;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

minor, can you pull this out to it's own file VersionByte.java

Copy link
Member Author

Choose a reason for hiding this comment

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

I think placing it here would also be a good choice, as there are no other parts relying on StrKey. Moreover, it is not public, so in the future, if necessary, we can still modify it without introducing breaking changes.

Copy link
Contributor

@sreuland sreuland left a comment

Choose a reason for hiding this comment

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

looks good!

@overcat overcat merged commit 1831c4e into lightsail-network:master Oct 7, 2023
6 checks passed
@overcat overcat deleted the strkey-public branch October 7, 2023 08:40
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.

Feature Request: Provide a simple way for decoding the public key as simple String.
2 participants