@fuel-ts/account 0.0.0-rc-2143-20240517152329 → 0.0.0-rc-2143-20240520045316

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.

Potentially problematic release.


This version of @fuel-ts/account might be problematic. Click here for more details.

@@ -32434,7 +32434,7 @@ spurious results.`);
32434
32434
  return {
32435
32435
  FORC: "0.59.0",
32436
32436
  FUEL_CORE: "0.26.0",
32437
- FUELS: "0.88.0"
32437
+ FUELS: "0.88.1"
32438
32438
  };
32439
32439
  }
32440
32440
  function parseVersion(version) {
@@ -34882,7 +34882,7 @@ This unreleased fuel-core build may include features and updates not yet support
34882
34882
  coders;
34883
34883
  #caseIndexCoder;
34884
34884
  #encodedValueSize;
34885
- #hasNestedOption;
34885
+ #shouldValidateLength;
34886
34886
  constructor(name, coders) {
34887
34887
  const caseIndexCoder = new BigNumberCoder("u64");
34888
34888
  const encodedValueSize = Object.values(coders).reduce(
@@ -34894,7 +34894,7 @@ This unreleased fuel-core build may include features and updates not yet support
34894
34894
  this.coders = coders;
34895
34895
  this.#caseIndexCoder = caseIndexCoder;
34896
34896
  this.#encodedValueSize = encodedValueSize;
34897
- this.#hasNestedOption = hasNestedOption(coders);
34897
+ this.#shouldValidateLength = !(this.type === OPTION_CODER_TYPE || hasNestedOption(coders));
34898
34898
  }
34899
34899
  #encodeNativeEnum(value) {
34900
34900
  const valueCoder = this.coders[value];
@@ -34923,7 +34923,7 @@ This unreleased fuel-core build may include features and updates not yet support
34923
34923
  return [caseKey, newOffset];
34924
34924
  }
34925
34925
  decode(data, offset) {
34926
- if (!this.#hasNestedOption && data.length < this.#encodedValueSize) {
34926
+ if (this.#shouldValidateLength && data.length < this.#encodedValueSize) {
34927
34927
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid enum data size.`);
34928
34928
  }
34929
34929
  const caseBytes = new BigNumberCoder("u64").decode(data, offset)[0];
@@ -36783,10 +36783,10 @@ This unreleased fuel-core build may include features and updates not yet support
36783
36783
  encode(value) {
36784
36784
  const parts = [];
36785
36785
  parts.push(new UpgradePurposeCoder().encode(value.upgradePurpose));
36786
- parts.push(new NumberCoder("u32").encode(value.policyTypes));
36787
- parts.push(new NumberCoder("u16").encode(value.inputsCount));
36788
- parts.push(new NumberCoder("u16").encode(value.outputsCount));
36789
- parts.push(new NumberCoder("u16").encode(value.witnessesCount));
36786
+ parts.push(new NumberCoder("u32", { padToWordSize: true }).encode(value.policyTypes));
36787
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.inputsCount));
36788
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.outputsCount));
36789
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.witnessesCount));
36790
36790
  parts.push(new PoliciesCoder().encode(value.policies));
36791
36791
  parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
36792
36792
  parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
@@ -36798,13 +36798,13 @@ This unreleased fuel-core build may include features and updates not yet support
36798
36798
  let o = offset;
36799
36799
  [decoded, o] = new UpgradePurposeCoder().decode(data, o);
36800
36800
  const upgradePurpose = decoded;
36801
- [decoded, o] = new NumberCoder("u32").decode(data, o);
36801
+ [decoded, o] = new NumberCoder("u32", { padToWordSize: true }).decode(data, o);
36802
36802
  const policyTypes = decoded;
36803
- [decoded, o] = new NumberCoder("u16").decode(data, o);
36803
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
36804
36804
  const inputsCount = decoded;
36805
- [decoded, o] = new NumberCoder("u16").decode(data, o);
36805
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
36806
36806
  const outputsCount = decoded;
36807
- [decoded, o] = new NumberCoder("u16").decode(data, o);
36807
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
36808
36808
  const witnessesCount = decoded;
36809
36809
  [decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
36810
36810
  const policies = decoded;
@@ -36838,14 +36838,14 @@ This unreleased fuel-core build may include features and updates not yet support
36838
36838
  encode(value) {
36839
36839
  const parts = [];
36840
36840
  parts.push(new B256Coder().encode(value.root));
36841
- parts.push(new NumberCoder("u16").encode(value.witnessIndex));
36842
- parts.push(new NumberCoder("u16").encode(value.subsectionIndex));
36843
- parts.push(new NumberCoder("u16").encode(value.subsectionsNumber));
36844
- parts.push(new NumberCoder("u16").encode(value.proofSetCount));
36845
- parts.push(new NumberCoder("u32").encode(value.policyTypes));
36846
- parts.push(new NumberCoder("u16").encode(value.inputsCount));
36847
- parts.push(new NumberCoder("u16").encode(value.outputsCount));
36848
- parts.push(new NumberCoder("u16").encode(value.witnessesCount));
36841
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.witnessIndex));
36842
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.subsectionIndex));
36843
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.subsectionsNumber));
36844
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.proofSetCount));
36845
+ parts.push(new NumberCoder("u32", { padToWordSize: true }).encode(value.policyTypes));
36846
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.inputsCount));
36847
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.outputsCount));
36848
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.witnessesCount));
36849
36849
  parts.push(new ArrayCoder(new B256Coder(), value.proofSetCount).encode(value.proofSet));
36850
36850
  parts.push(new PoliciesCoder().encode(value.policies));
36851
36851
  parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
@@ -36858,21 +36858,21 @@ This unreleased fuel-core build may include features and updates not yet support
36858
36858
  let o = offset;
36859
36859
  [decoded, o] = new B256Coder().decode(data, o);
36860
36860
  const root = decoded;
36861
- [decoded, o] = new NumberCoder("u16").decode(data, o);
36861
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
36862
36862
  const witnessIndex = decoded;
36863
- [decoded, o] = new NumberCoder("u16").decode(data, o);
36863
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
36864
36864
  const subsectionIndex = decoded;
36865
- [decoded, o] = new NumberCoder("u16").decode(data, o);
36865
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
36866
36866
  const subsectionsNumber = decoded;
36867
- [decoded, o] = new NumberCoder("u16").decode(data, o);
36867
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
36868
36868
  const proofSetCount = decoded;
36869
- [decoded, o] = new NumberCoder("u32").decode(data, o);
36869
+ [decoded, o] = new NumberCoder("u32", { padToWordSize: true }).decode(data, o);
36870
36870
  const policyTypes = decoded;
36871
- [decoded, o] = new NumberCoder("u16").decode(data, o);
36871
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
36872
36872
  const inputsCount = decoded;
36873
- [decoded, o] = new NumberCoder("u16").decode(data, o);
36873
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
36874
36874
  const outputsCount = decoded;
36875
- [decoded, o] = new NumberCoder("u16").decode(data, o);
36875
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
36876
36876
  const witnessesCount = decoded;
36877
36877
  [decoded, o] = new ArrayCoder(new B256Coder(), proofSetCount).decode(data, o);
36878
36878
  const proofSet = decoded;