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

Emulator Shows Old Contract Code After Update #60

Open
ipromise2324 opened this issue Dec 31, 2024 · 0 comments
Open

Emulator Shows Old Contract Code After Update #60

ipromise2324 opened this issue Dec 31, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ipromise2324
Copy link

ipromise2324 commented Dec 31, 2024

Describe the bug
When interacting with my smart contract on the testnet using the sandbox emulator, I send a message to update the contract code. The contract's code updates successfully, and interactions reflect the new code. However, when retrieving the contract code using blockchain.getContract(contractAddress).accountState.state.code, the returned code is still the old version, despite the contract behaving as if it is running the updated code.

To Reproduce

  1. Deploy a smart contract with the ability to update its code.
  2. Use the sandbox emulator to send a message that triggers the contract to update its code.
  3. Verify that interactions with the contract reflect the updated code.
  4. Retrieve the contract code using blockchain.getContract(contractAddress).accountState.state.code.
  5. Compare the retrieved code with the new code sent during the update transaction to confirm if they match.

Expected behavior
The code retrieved from accountState.state.code should match the updated code that the contract is currently executing.

Actual behavior
The contract executes the updated code, but accountState.state.code returns the old version of the code, causing a discrepancy between the actual contract behavior and the retrieved code.

System information

  • Package version: @ton/sandbox: ^0.23.0
  • Node version: v18.20.2
  • OS name and version: MacOS (Macbook M1 pro 2021) built-in SSD
@ipromise2324 ipromise2324 added the bug Something isn't working label Dec 31, 2024
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

No branches or pull requests

1 participant