Skip to content

Commit 2f6d8dc

Browse files
committed
Patches range exception bug when a specific authority type disables the new authority property
1 parent a2161f9 commit 2f6d8dc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Solnet.Programs/TokenProgramData.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,10 @@ internal static void DecodeSetAuthorityData(DecodedInstruction decodedInstructio
302302
decodedInstruction.Values.Add("Current Authority", keys[keyIndices[1]]);
303303
decodedInstruction.Values.Add("Authority Type", Enum.Parse(typeof(AuthorityType), data.GetU8(1).ToString()));
304304
decodedInstruction.Values.Add("New Authority Option", data.GetU8(2));
305-
decodedInstruction.Values.Add("New Authority", data.GetPubKey(3));
305+
if (data.Length >= 34)
306+
{
307+
decodedInstruction.Values.Add("New Authority", data.GetPubKey(3));
308+
}
306309
for (int i = 2; i < keyIndices.Length; i++)
307310
{
308311
decodedInstruction.Values.Add($"Signer {i - 1}", keys[keyIndices[i]]);

0 commit comments

Comments
 (0)