@solana/web3.js 1.91.0 → 1.91.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -822,23 +822,19 @@ class Message {
822
822
  const accountCount = decodeLength(byteArray);
823
823
  let accountKeys = [];
824
824
  for (let i = 0; i < accountCount; i++) {
825
- const account = byteArray.slice(0, PUBLIC_KEY_LENGTH);
826
- byteArray = byteArray.slice(PUBLIC_KEY_LENGTH);
825
+ const account = byteArray.splice(0, PUBLIC_KEY_LENGTH);
827
826
  accountKeys.push(new PublicKey(Buffer.from(account)));
828
827
  }
829
- const recentBlockhash = byteArray.slice(0, PUBLIC_KEY_LENGTH);
830
- byteArray = byteArray.slice(PUBLIC_KEY_LENGTH);
828
+ const recentBlockhash = byteArray.splice(0, PUBLIC_KEY_LENGTH);
831
829
  const instructionCount = decodeLength(byteArray);
832
830
  let instructions = [];
833
831
  for (let i = 0; i < instructionCount; i++) {
834
832
  const programIdIndex = byteArray.shift();
835
833
  const accountCount = decodeLength(byteArray);
836
- const accounts = byteArray.slice(0, accountCount);
837
- byteArray = byteArray.slice(accountCount);
834
+ const accounts = byteArray.splice(0, accountCount);
838
835
  const dataLength = decodeLength(byteArray);
839
- const dataSlice = byteArray.slice(0, dataLength);
836
+ const dataSlice = byteArray.splice(0, dataLength);
840
837
  const data = bs58.encode(Buffer.from(dataSlice));
841
- byteArray = byteArray.slice(dataLength);
842
838
  instructions.push({
843
839
  programIdIndex,
844
840
  accounts,
@@ -1871,8 +1867,7 @@ class Transaction {
1871
1867
  const signatureCount = decodeLength(byteArray);
1872
1868
  let signatures = [];
1873
1869
  for (let i = 0; i < signatureCount; i++) {
1874
- const signature = byteArray.slice(0, SIGNATURE_LENGTH_IN_BYTES);
1875
- byteArray = byteArray.slice(SIGNATURE_LENGTH_IN_BYTES);
1870
+ const signature = byteArray.splice(0, SIGNATURE_LENGTH_IN_BYTES);
1876
1871
  signatures.push(bs58.encode(Buffer.from(signature)));
1877
1872
  }
1878
1873
  return Transaction.populate(Message.from(byteArray), signatures);
@@ -10097,10 +10092,8 @@ class ValidatorInfo {
10097
10092
  if (configKeyCount !== 2) return null;
10098
10093
  const configKeys = [];
10099
10094
  for (let i = 0; i < 2; i++) {
10100
- const publicKey = new PublicKey(byteArray.slice(0, PUBLIC_KEY_LENGTH));
10101
- byteArray = byteArray.slice(PUBLIC_KEY_LENGTH);
10102
- const isSigner = byteArray.slice(0, 1)[0] === 1;
10103
- byteArray = byteArray.slice(1);
10095
+ const publicKey = new PublicKey(byteArray.splice(0, PUBLIC_KEY_LENGTH));
10096
+ const isSigner = byteArray.splice(0, 1)[0] === 1;
10104
10097
  configKeys.push({
10105
10098
  publicKey,
10106
10099
  isSigner