Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed calls to readFully method of client-utils package #10563

Closed
Jorge-Lopes opened this issue Nov 25, 2024 · 2 comments · Fixed by #10566
Closed

Failed calls to readFully method of client-utils package #10563

Jorge-Lopes opened this issue Nov 25, 2024 · 2 comments · Fixed by #10566
Assignees
Labels
bug Something isn't working

Comments

@Jorge-Lopes
Copy link
Collaborator

Describe the bug

When using the readFully method from the agoric client-utils package, the following error occurs:
TypeError: Cannot read properties of undefined (reading 'readAt').
This issue originates from the code here.

The same issue also affects other methods in the makeVStorage function of the vstorage-kit module. The problem stems from the usage of the this keyword, causing instance method invocations to fail.

To Reproduce

Steps to reproduce the behavior:

  1. Go to Draft PR test(a3p): extend governance test coverage for acceptance proposal #10555
  2. Re-run the CI action test-docker-build
  3. See error message

Expected behavior

The readFully method should correctly return the values stored in a specific node, recorded after a given block height.

Platform Environment

OS: macOS Sequoia v15.0.1
Node.js: v20.9.0
Agoric-SDK: agoric-upgrade-16av-1130-g753242866

Screenshots

Relevant CI Logs:


  Rejected promise returned by test. Reason:

  TypeError {
    message: 'Cannot read properties of undefined (reading \'readAt\')',
  }

  TypeError: Cannot read properties of undefined (reading 'readAt')
      at readFully (file:///usr/src/agoric-sdk/packages/client-utils/src/vstorage-kit.js:102:49)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async getGovernanceProposalsHistory (file:///usr/src/proposals/z:acceptance/test-lib/governance.js:228:22)
      at async file:///usr/src/proposals/z:acceptance/governance.test.js:184:19

@Jorge-Lopes Jorge-Lopes added the bug Something isn't working label Nov 25, 2024
@Jorge-Lopes
Copy link
Collaborator Author

cc: @Chris-Hibbert

@turadg
Copy link
Member

turadg commented Nov 25, 2024

This is not a bug. Your diagnosis is correct that it's missing this, but that's because you're using an instance method as a naked function. Instead, pass the vstorage object.

If you want to be able to pass the functions without their instance object that's a feature request. I don't think we need it but if you really do you can update the body and labels and re-open this. Second thought, it would be easier to support this than document it as a limitation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants