Skip to content

Commit

Permalink
fix: storage error caching
Browse files Browse the repository at this point in the history
chore: bump version, changelog
  • Loading branch information
krigga committed Oct 10, 2023
1 parent 6b005a3 commit cd33725
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.13.1] - 2023-10-10

### Fixed

- Fixed a bug in `Blockchain` that led to storage fetch errors (for example, network errors in `RemoteBlockchainStorage`) being cached and breaking that contract address forever

## [0.13.0] - 2023-10-05

### Changed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ton/sandbox",
"version": "0.13.0",
"version": "0.13.1",
"description": "TON transaction emulator",
"main": "dist/index.js",
"license": "MIT",
Expand Down
11 changes: 8 additions & 3 deletions src/blockchain/Blockchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,14 @@ export class Blockchain {
}

async getContract(address: Address) {
const contract = await this.startFetchingContract(address)
this.contractFetches.delete(address.toRawString())
return contract
try {
const contract = await this.startFetchingContract(address)
return contract
} catch (e) {
throw e
} finally {
this.contractFetches.delete(address.toRawString())
}
}

get verbosity() {
Expand Down

0 comments on commit cd33725

Please sign in to comment.