Skip to content

Runtime throws "exceeded structure bounds" when calling circuit with List of ContractAddress vectors #297

@adamreynolds-io

Description

@adamreynolds-io

Context & versions

Not specified in original ticket.

Steps to reproduce

  1. Deploy the following contract:
import CompactStandardLibrary;

export ledger c: List<Vector<2, ContractAddress>>;
export ledger k: Kernel;

circuit getVector(): Vector<2, ContractAddress> {
  return [kernel.self(), k.self()];
}

export circuit test(): [] {
  const zero = default<Vector<2, ContractAddress>>;
  const one = getVector();

  assert c.is_empty() == true "Structure should be empty";
  assert c.length() == 0 "Size should be 0";
  assert c.head().is_some == false "Head should not exist";

  c.push_front(zero);
  assert c.length() == 1 "Size should be 1";
  assert c.head().is_some == true "Head should exist";
  assert c.head().value == zero "Head should have value 0";

  c.push_front(one);
  assert c.length() == 2 "Size should be 2";
  assert c.head().is_some == true "Head should exist";
  assert c.head().value == one "Head should have value 1";

  c.reset_to_default();
  assert c.is_empty() == true "Structure should be empty";
  assert c.length() == 0 "Size should be 0";
}
  1. Call the test circuit on the deployed contract.

Actual behavior

Error: exceeded structure bounds

Expected behavior

The test circuit should execute without error. All assertions should pass and the ledger state should be consistent with the operations performed.


Migrated from PM-15087

Metadata

Metadata

Assignees

Labels

triagedIssues that have been triaged by the team

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions