@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.

@@ -29472,7 +29472,7 @@ spurious results.`);
29472
29472
  return {
29473
29473
  FORC: "0.59.0",
29474
29474
  FUEL_CORE: "0.26.0",
29475
- FUELS: "0.88.0"
29475
+ FUELS: "0.88.1"
29476
29476
  };
29477
29477
  }
29478
29478
  function parseVersion(version) {
@@ -31175,7 +31175,7 @@ This unreleased fuel-core build may include features and updates not yet support
31175
31175
  coders;
31176
31176
  #caseIndexCoder;
31177
31177
  #encodedValueSize;
31178
- #hasNestedOption;
31178
+ #shouldValidateLength;
31179
31179
  constructor(name, coders) {
31180
31180
  const caseIndexCoder = new BigNumberCoder("u64");
31181
31181
  const encodedValueSize = Object.values(coders).reduce(
@@ -31187,7 +31187,7 @@ This unreleased fuel-core build may include features and updates not yet support
31187
31187
  this.coders = coders;
31188
31188
  this.#caseIndexCoder = caseIndexCoder;
31189
31189
  this.#encodedValueSize = encodedValueSize;
31190
- this.#hasNestedOption = hasNestedOption(coders);
31190
+ this.#shouldValidateLength = !(this.type === OPTION_CODER_TYPE || hasNestedOption(coders));
31191
31191
  }
31192
31192
  #encodeNativeEnum(value) {
31193
31193
  const valueCoder = this.coders[value];
@@ -31216,7 +31216,7 @@ This unreleased fuel-core build may include features and updates not yet support
31216
31216
  return [caseKey, newOffset];
31217
31217
  }
31218
31218
  decode(data, offset) {
31219
- if (!this.#hasNestedOption && data.length < this.#encodedValueSize) {
31219
+ if (this.#shouldValidateLength && data.length < this.#encodedValueSize) {
31220
31220
  throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid enum data size.`);
31221
31221
  }
31222
31222
  const caseBytes = new BigNumberCoder("u64").decode(data, offset)[0];
@@ -33076,10 +33076,10 @@ This unreleased fuel-core build may include features and updates not yet support
33076
33076
  encode(value) {
33077
33077
  const parts = [];
33078
33078
  parts.push(new UpgradePurposeCoder().encode(value.upgradePurpose));
33079
- parts.push(new NumberCoder("u32").encode(value.policyTypes));
33080
- parts.push(new NumberCoder("u16").encode(value.inputsCount));
33081
- parts.push(new NumberCoder("u16").encode(value.outputsCount));
33082
- parts.push(new NumberCoder("u16").encode(value.witnessesCount));
33079
+ parts.push(new NumberCoder("u32", { padToWordSize: true }).encode(value.policyTypes));
33080
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.inputsCount));
33081
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.outputsCount));
33082
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.witnessesCount));
33083
33083
  parts.push(new PoliciesCoder().encode(value.policies));
33084
33084
  parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
33085
33085
  parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
@@ -33091,13 +33091,13 @@ This unreleased fuel-core build may include features and updates not yet support
33091
33091
  let o = offset;
33092
33092
  [decoded, o] = new UpgradePurposeCoder().decode(data, o);
33093
33093
  const upgradePurpose = decoded;
33094
- [decoded, o] = new NumberCoder("u32").decode(data, o);
33094
+ [decoded, o] = new NumberCoder("u32", { padToWordSize: true }).decode(data, o);
33095
33095
  const policyTypes = decoded;
33096
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33096
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
33097
33097
  const inputsCount = decoded;
33098
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33098
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
33099
33099
  const outputsCount = decoded;
33100
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33100
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
33101
33101
  const witnessesCount = decoded;
33102
33102
  [decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
33103
33103
  const policies = decoded;
@@ -33131,14 +33131,14 @@ This unreleased fuel-core build may include features and updates not yet support
33131
33131
  encode(value) {
33132
33132
  const parts = [];
33133
33133
  parts.push(new B256Coder().encode(value.root));
33134
- parts.push(new NumberCoder("u16").encode(value.witnessIndex));
33135
- parts.push(new NumberCoder("u16").encode(value.subsectionIndex));
33136
- parts.push(new NumberCoder("u16").encode(value.subsectionsNumber));
33137
- parts.push(new NumberCoder("u16").encode(value.proofSetCount));
33138
- parts.push(new NumberCoder("u32").encode(value.policyTypes));
33139
- parts.push(new NumberCoder("u16").encode(value.inputsCount));
33140
- parts.push(new NumberCoder("u16").encode(value.outputsCount));
33141
- parts.push(new NumberCoder("u16").encode(value.witnessesCount));
33134
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.witnessIndex));
33135
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.subsectionIndex));
33136
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.subsectionsNumber));
33137
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.proofSetCount));
33138
+ parts.push(new NumberCoder("u32", { padToWordSize: true }).encode(value.policyTypes));
33139
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.inputsCount));
33140
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.outputsCount));
33141
+ parts.push(new NumberCoder("u16", { padToWordSize: true }).encode(value.witnessesCount));
33142
33142
  parts.push(new ArrayCoder(new B256Coder(), value.proofSetCount).encode(value.proofSet));
33143
33143
  parts.push(new PoliciesCoder().encode(value.policies));
33144
33144
  parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
@@ -33151,21 +33151,21 @@ This unreleased fuel-core build may include features and updates not yet support
33151
33151
  let o = offset;
33152
33152
  [decoded, o] = new B256Coder().decode(data, o);
33153
33153
  const root = decoded;
33154
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33154
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
33155
33155
  const witnessIndex = decoded;
33156
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33156
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
33157
33157
  const subsectionIndex = decoded;
33158
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33158
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
33159
33159
  const subsectionsNumber = decoded;
33160
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33160
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
33161
33161
  const proofSetCount = decoded;
33162
- [decoded, o] = new NumberCoder("u32").decode(data, o);
33162
+ [decoded, o] = new NumberCoder("u32", { padToWordSize: true }).decode(data, o);
33163
33163
  const policyTypes = decoded;
33164
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33164
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
33165
33165
  const inputsCount = decoded;
33166
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33166
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
33167
33167
  const outputsCount = decoded;
33168
- [decoded, o] = new NumberCoder("u16").decode(data, o);
33168
+ [decoded, o] = new NumberCoder("u16", { padToWordSize: true }).decode(data, o);
33169
33169
  const witnessesCount = decoded;
33170
33170
  [decoded, o] = new ArrayCoder(new B256Coder(), proofSetCount).decode(data, o);
33171
33171
  const proofSet = decoded;