Skip to content

Commit

Permalink
feat(store,world): add ability to unregister hooks (#1422)
Browse files Browse the repository at this point in the history
  • Loading branch information
alvrs authored Sep 11, 2023
1 parent 391ef71 commit 1d60930
Show file tree
Hide file tree
Showing 49 changed files with 1,299 additions and 201 deletions.
18 changes: 18 additions & 0 deletions .changeset/dry-chicken-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
"@latticexyz/store": minor
"@latticexyz/world": minor
---

It is now possible to unregister Store hooks and System hooks.

```solidity
interface IStore {
function unregisterStoreHook(bytes32 table, IStoreHook hookAddress) external;
// ...
}
interface IWorld {
function unregisterSystemHook(bytes32 resourceSelector, ISystemHook hookAddress) external;
// ...
}
```
18 changes: 18 additions & 0 deletions packages/store/abi/IStore.sol/IStore.abi.json
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,24 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "table",
"type": "bytes32"
},
{
"internalType": "contract IStoreHook",
"name": "hookAddress",
"type": "address"
}
],
"name": "unregisterStoreHook",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
Expand Down
18 changes: 18 additions & 0 deletions packages/store/abi/IStore.sol/IStore.abi.json.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,24 @@ declare const abi: [
stateMutability: "nonpayable";
type: "function";
},
{
inputs: [
{
internalType: "bytes32";
name: "table";
type: "bytes32";
},
{
internalType: "contract IStoreHook";
name: "hookAddress";
type: "address";
}
];
name: "unregisterStoreHook";
outputs: [];
stateMutability: "nonpayable";
type: "function";
},
{
inputs: [
{
Expand Down
18 changes: 18 additions & 0 deletions packages/store/abi/IStore.sol/IStoreRegistration.abi.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,23 @@
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "table",
"type": "bytes32"
},
{
"internalType": "contract IStoreHook",
"name": "hookAddress",
"type": "address"
}
],
"name": "unregisterStoreHook",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
18 changes: 18 additions & 0 deletions packages/store/abi/IStore.sol/IStoreRegistration.abi.json.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,24 @@ declare const abi: [
outputs: [];
stateMutability: "nonpayable";
type: "function";
},
{
inputs: [
{
internalType: "bytes32";
name: "table";
type: "bytes32";
},
{
internalType: "contract IStoreHook";
name: "hookAddress";
type: "address";
}
];
name: "unregisterStoreHook";
outputs: [];
stateMutability: "nonpayable";
type: "function";
}
];
export default abi;
1 change: 1 addition & 0 deletions packages/store/abi/StoreHooks.sol/StoreHooks.abi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
18 changes: 18 additions & 0 deletions packages/store/abi/StoreMock.sol/StoreMock.abi.json
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,24 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "table",
"type": "bytes32"
},
{
"internalType": "contract IStoreHook",
"name": "hookAddress",
"type": "address"
}
],
"name": "unregisterStoreHook",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
Expand Down
18 changes: 18 additions & 0 deletions packages/store/abi/StoreMock.sol/StoreMock.abi.json.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,24 @@ declare const abi: [
stateMutability: "nonpayable";
type: "function";
},
{
inputs: [
{
internalType: "bytes32";
name: "table";
type: "bytes32";
},
{
internalType: "contract IStoreHook";
name: "hookAddress";
type: "address";
}
];
name: "unregisterStoreHook";
outputs: [];
stateMutability: "nonpayable";
type: "function";
},
{
inputs: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,24 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
},
{
"internalType": "contract IStoreHook",
"name": "",
"type": "address"
}
],
"name": "unregisterStoreHook",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,24 @@ declare const abi: [
stateMutability: "nonpayable";
type: "function";
},
{
inputs: [
{
internalType: "bytes32";
name: "";
type: "bytes32";
},
{
internalType: "contract IStoreHook";
name: "";
type: "address";
}
];
name: "unregisterStoreHook";
outputs: [];
stateMutability: "nonpayable";
type: "function";
},
{
inputs: [
{
Expand Down
Loading

0 comments on commit 1d60930

Please sign in to comment.