Skip to content

Commit

Permalink
Fixe a bug where an instance of a storage object overwrote the state …
Browse files Browse the repository at this point in the history
…of another object in the file (#67)

* Fixed a bug where an instance of a storage object overwrote the state of another object in the file.

* Added coverage util

* Raised coverage of MigrateStorage to 100%.

* Updated CI

* Updated versions

* Updated CI

* Changed the way of naming for Truffle transactions to `txName`

* Popped overrides in the getMethodString function
  • Loading branch information
KyrylR authored Dec 23, 2023
1 parent 91428b4 commit b400e5f
Show file tree
Hide file tree
Showing 14 changed files with 1,746 additions and 165 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ jobs:
${{ runner.os }}-node-v${{ matrix.node }}-
- name: Install Dependencies
run: npm install
- name: Compile
run: npm run compile
- name: Run All Node.js Tests
run: npm run test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ publish
/build-test/
/dist

.nyc_output

# Below is Github's node gitignore template,
# ignoring the node_modules part, as it'd ignore every node_modules, and we have some for testing

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## Version 2.0.1

* Fixed a bug where an instance of a storage object overwrote the state of another object in the file.
* Changed the way of naming for Truffle transactions to `txName`.

## Version 2.0.0

* Removed redundant Hardhat Runtime Extensions.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,17 +259,17 @@ A special field, `txName`, is dedicated for this purpose.
Here’s an example of how to set a transaction name using Ethers.js:

```javascript
await contract.runner.sendTransaction({ customData: { txName: "Funding Transaction" }});
await govToken.transferOwnership(TOKEN_OWNER, { customData: { txName: "Transfer Ownership" }});
```

This method helps avoid potential collisions and ensures a smoother recovery process.

#### Truffle Usage:

For those using Truffle, the transaction name can be specified using the `hardfork` field. Here's how you can do it:
For those using Truffle, the transaction name can be specified using the `txName` field. Here's how you can do it:

``` javascript
await contract.send(1, { hardfork: "Funding Transaction" });
await govToken.transferOwnership(TOKEN_OWNER, { txName: "Transfer Ownership" });
```

#### Purpose
Expand Down
Loading

0 comments on commit b400e5f

Please sign in to comment.