@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.
@@ -850,23 +850,19 @@ class Message {
850
850
  const accountCount = decodeLength(byteArray);
851
851
  let accountKeys = [];
852
852
  for (let i = 0; i < accountCount; i++) {
853
- const account = byteArray.slice(0, PUBLIC_KEY_LENGTH);
854
- byteArray = byteArray.slice(PUBLIC_KEY_LENGTH);
853
+ const account = byteArray.splice(0, PUBLIC_KEY_LENGTH);
855
854
  accountKeys.push(new PublicKey(buffer.Buffer.from(account)));
856
855
  }
857
- const recentBlockhash = byteArray.slice(0, PUBLIC_KEY_LENGTH);
858
- byteArray = byteArray.slice(PUBLIC_KEY_LENGTH);
856
+ const recentBlockhash = byteArray.splice(0, PUBLIC_KEY_LENGTH);
859
857
  const instructionCount = decodeLength(byteArray);
860
858
  let instructions = [];
861
859
  for (let i = 0; i < instructionCount; i++) {
862
860
  const programIdIndex = byteArray.shift();
863
861
  const accountCount = decodeLength(byteArray);
864
- const accounts = byteArray.slice(0, accountCount);
865
- byteArray = byteArray.slice(accountCount);
862
+ const accounts = byteArray.splice(0, accountCount);
866
863
  const dataLength = decodeLength(byteArray);
867
- const dataSlice = byteArray.slice(0, dataLength);
864
+ const dataSlice = byteArray.splice(0, dataLength);
868
865
  const data = bs58__default.default.encode(buffer.Buffer.from(dataSlice));
869
- byteArray = byteArray.slice(dataLength);
870
866
  instructions.push({
871
867
  programIdIndex,
872
868
  accounts,
@@ -1899,8 +1895,7 @@ class Transaction {
1899
1895
  const signatureCount = decodeLength(byteArray);
1900
1896
  let signatures = [];
1901
1897
  for (let i = 0; i < signatureCount; i++) {
1902
- const signature = byteArray.slice(0, SIGNATURE_LENGTH_IN_BYTES);
1903
- byteArray = byteArray.slice(SIGNATURE_LENGTH_IN_BYTES);
1898
+ const signature = byteArray.splice(0, SIGNATURE_LENGTH_IN_BYTES);
1904
1899
  signatures.push(bs58__default.default.encode(buffer.Buffer.from(signature)));
1905
1900
  }
1906
1901
  return Transaction.populate(Message.from(byteArray), signatures);
@@ -10125,10 +10120,8 @@ class ValidatorInfo {
10125
10120
  if (configKeyCount !== 2) return null;
10126
10121
  const configKeys = [];
10127
10122
  for (let i = 0; i < 2; i++) {
10128
- const publicKey = new PublicKey(byteArray.slice(0, PUBLIC_KEY_LENGTH));
10129
- byteArray = byteArray.slice(PUBLIC_KEY_LENGTH);
10130
- const isSigner = byteArray.slice(0, 1)[0] === 1;
10131
- byteArray = byteArray.slice(1);
10123
+ const publicKey = new PublicKey(byteArray.splice(0, PUBLIC_KEY_LENGTH));
10124
+ const isSigner = byteArray.splice(0, 1)[0] === 1;
10132
10125
  configKeys.push({
10133
10126
  publicKey,
10134
10127
  isSigner