Skip to content

Commit

Permalink
chore: rebuild artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
alvrs committed Aug 15, 2023
1 parent 097d836 commit 2be039a
Show file tree
Hide file tree
Showing 40 changed files with 887 additions and 2,019 deletions.
120 changes: 66 additions & 54 deletions packages/cli/contracts/src/codegen/tables/Dynamics1.sol

Large diffs are not rendered by default.

68 changes: 34 additions & 34 deletions packages/cli/contracts/src/codegen/tables/Dynamics2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ library Dynamics2 {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

bytes memory _blob = StoreSwitch.getField(_tableId, _keyTuple, 0);
bytes memory _blob = StoreSwitch.getField(_tableId, _keyTuple, 0, getSchema());
return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_uint64());
}

Expand All @@ -89,7 +89,7 @@ library Dynamics2 {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

bytes memory _blob = _store.getField(_tableId, _keyTuple, 0);
bytes memory _blob = _store.getField(_tableId, _keyTuple, 0, getSchema());
return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_uint64());
}

Expand All @@ -98,15 +98,15 @@ library Dynamics2 {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

StoreSwitch.setField(_tableId, _keyTuple, 0, EncodeArray.encode((u64)));
StoreSwitch.setField(_tableId, _keyTuple, 0, EncodeArray.encode((u64)), getSchema());
}

/** Set u64 (using the specified store) */
function setU64(IStore _store, bytes32 key, uint64[] memory u64) internal {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

_store.setField(_tableId, _keyTuple, 0, EncodeArray.encode((u64)));
_store.setField(_tableId, _keyTuple, 0, EncodeArray.encode((u64)), getSchema());
}

/** Get the length of u64 */
Expand Down Expand Up @@ -150,55 +150,55 @@ library Dynamics2 {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

StoreSwitch.pushToField(_tableId, _keyTuple, 0, abi.encodePacked((_element)));
StoreSwitch.pushToField(_tableId, _keyTuple, 0, abi.encodePacked((_element)), getSchema());
}

/** Push an element to u64 (using the specified store) */
function pushU64(IStore _store, bytes32 key, uint64 _element) internal {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

_store.pushToField(_tableId, _keyTuple, 0, abi.encodePacked((_element)));
_store.pushToField(_tableId, _keyTuple, 0, abi.encodePacked((_element)), getSchema());
}

/** Pop an element from u64 */
function popU64(bytes32 key) internal {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

StoreSwitch.popFromField(_tableId, _keyTuple, 0, 8);
StoreSwitch.popFromField(_tableId, _keyTuple, 0, 8, getSchema());
}

/** Pop an element from u64 (using the specified store) */
function popU64(IStore _store, bytes32 key) internal {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

_store.popFromField(_tableId, _keyTuple, 0, 8);
_store.popFromField(_tableId, _keyTuple, 0, 8, getSchema());
}

/** Update an element of u64 at `_index` */
function updateU64(bytes32 key, uint256 _index, uint64 _element) internal {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

StoreSwitch.updateInField(_tableId, _keyTuple, 0, _index * 8, abi.encodePacked((_element)));
StoreSwitch.updateInField(_tableId, _keyTuple, 0, _index * 8, abi.encodePacked((_element)), getSchema());
}

/** Update an element of u64 (using the specified store) at `_index` */
function updateU64(IStore _store, bytes32 key, uint256 _index, uint64 _element) internal {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

_store.updateInField(_tableId, _keyTuple, 0, _index * 8, abi.encodePacked((_element)));
_store.updateInField(_tableId, _keyTuple, 0, _index * 8, abi.encodePacked((_element)), getSchema());
}

/** Get str */
function getStr(bytes32 key) internal view returns (string memory str) {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

bytes memory _blob = StoreSwitch.getField(_tableId, _keyTuple, 1);
bytes memory _blob = StoreSwitch.getField(_tableId, _keyTuple, 1, getSchema());
return (string(_blob));
}

Expand All @@ -207,7 +207,7 @@ library Dynamics2 {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

bytes memory _blob = _store.getField(_tableId, _keyTuple, 1);
bytes memory _blob = _store.getField(_tableId, _keyTuple, 1, getSchema());
return (string(_blob));
}

Expand All @@ -216,15 +216,15 @@ library Dynamics2 {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

StoreSwitch.setField(_tableId, _keyTuple, 1, bytes((str)));
StoreSwitch.setField(_tableId, _keyTuple, 1, bytes((str)), getSchema());
}

/** Set str (using the specified store) */
function setStr(IStore _store, bytes32 key, string memory str) internal {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

_store.setField(_tableId, _keyTuple, 1, bytes((str)));
_store.setField(_tableId, _keyTuple, 1, bytes((str)), getSchema());
}

/** Get the length of str */
Expand Down Expand Up @@ -268,55 +268,55 @@ library Dynamics2 {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

StoreSwitch.pushToField(_tableId, _keyTuple, 1, bytes((_slice)));
StoreSwitch.pushToField(_tableId, _keyTuple, 1, bytes((_slice)), getSchema());
}

/** Push a slice to str (using the specified store) */
function pushStr(IStore _store, bytes32 key, string memory _slice) internal {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

_store.pushToField(_tableId, _keyTuple, 1, bytes((_slice)));
_store.pushToField(_tableId, _keyTuple, 1, bytes((_slice)), getSchema());
}

/** Pop a slice from str */
function popStr(bytes32 key) internal {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

StoreSwitch.popFromField(_tableId, _keyTuple, 1, 1);
StoreSwitch.popFromField(_tableId, _keyTuple, 1, 1, getSchema());
}

/** Pop a slice from str (using the specified store) */
function popStr(IStore _store, bytes32 key) internal {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

_store.popFromField(_tableId, _keyTuple, 1, 1);
_store.popFromField(_tableId, _keyTuple, 1, 1, getSchema());
}

/** Update a slice of str at `_index` */
function updateStr(bytes32 key, uint256 _index, string memory _slice) internal {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

StoreSwitch.updateInField(_tableId, _keyTuple, 1, _index * 1, bytes((_slice)));
StoreSwitch.updateInField(_tableId, _keyTuple, 1, _index * 1, bytes((_slice)), getSchema());
}

/** Update a slice of str (using the specified store) at `_index` */
function updateStr(IStore _store, bytes32 key, uint256 _index, string memory _slice) internal {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

_store.updateInField(_tableId, _keyTuple, 1, _index * 1, bytes((_slice)));
_store.updateInField(_tableId, _keyTuple, 1, _index * 1, bytes((_slice)), getSchema());
}

/** Get b */
function getB(bytes32 key) internal view returns (bytes memory b) {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

bytes memory _blob = StoreSwitch.getField(_tableId, _keyTuple, 2);
bytes memory _blob = StoreSwitch.getField(_tableId, _keyTuple, 2, getSchema());
return (bytes(_blob));
}

Expand All @@ -325,7 +325,7 @@ library Dynamics2 {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

bytes memory _blob = _store.getField(_tableId, _keyTuple, 2);
bytes memory _blob = _store.getField(_tableId, _keyTuple, 2, getSchema());
return (bytes(_blob));
}

Expand All @@ -334,15 +334,15 @@ library Dynamics2 {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

StoreSwitch.setField(_tableId, _keyTuple, 2, bytes((b)));
StoreSwitch.setField(_tableId, _keyTuple, 2, bytes((b)), getSchema());
}

/** Set b (using the specified store) */
function setB(IStore _store, bytes32 key, bytes memory b) internal {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

_store.setField(_tableId, _keyTuple, 2, bytes((b)));
_store.setField(_tableId, _keyTuple, 2, bytes((b)), getSchema());
}

/** Get the length of b */
Expand Down Expand Up @@ -386,47 +386,47 @@ library Dynamics2 {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

StoreSwitch.pushToField(_tableId, _keyTuple, 2, bytes((_slice)));
StoreSwitch.pushToField(_tableId, _keyTuple, 2, bytes((_slice)), getSchema());
}

/** Push a slice to b (using the specified store) */
function pushB(IStore _store, bytes32 key, bytes memory _slice) internal {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

_store.pushToField(_tableId, _keyTuple, 2, bytes((_slice)));
_store.pushToField(_tableId, _keyTuple, 2, bytes((_slice)), getSchema());
}

/** Pop a slice from b */
function popB(bytes32 key) internal {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

StoreSwitch.popFromField(_tableId, _keyTuple, 2, 1);
StoreSwitch.popFromField(_tableId, _keyTuple, 2, 1, getSchema());
}

/** Pop a slice from b (using the specified store) */
function popB(IStore _store, bytes32 key) internal {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

_store.popFromField(_tableId, _keyTuple, 2, 1);
_store.popFromField(_tableId, _keyTuple, 2, 1, getSchema());
}

/** Update a slice of b at `_index` */
function updateB(bytes32 key, uint256 _index, bytes memory _slice) internal {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

StoreSwitch.updateInField(_tableId, _keyTuple, 2, _index * 1, bytes((_slice)));
StoreSwitch.updateInField(_tableId, _keyTuple, 2, _index * 1, bytes((_slice)), getSchema());
}

/** Update a slice of b (using the specified store) at `_index` */
function updateB(IStore _store, bytes32 key, uint256 _index, bytes memory _slice) internal {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

_store.updateInField(_tableId, _keyTuple, 2, _index * 1, bytes((_slice)));
_store.updateInField(_tableId, _keyTuple, 2, _index * 1, bytes((_slice)), getSchema());
}

/** Get the full data */
Expand Down Expand Up @@ -454,7 +454,7 @@ library Dynamics2 {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

StoreSwitch.setRecord(_tableId, _keyTuple, _data);
StoreSwitch.setRecord(_tableId, _keyTuple, _data, getSchema());
}

/** Set the full data using individual values (using the specified store) */
Expand All @@ -464,7 +464,7 @@ library Dynamics2 {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

_store.setRecord(_tableId, _keyTuple, _data);
_store.setRecord(_tableId, _keyTuple, _data, getSchema());
}

/** Set the full data using the data struct */
Expand Down Expand Up @@ -524,14 +524,14 @@ library Dynamics2 {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

StoreSwitch.deleteRecord(_tableId, _keyTuple);
StoreSwitch.deleteRecord(_tableId, _keyTuple, getSchema());
}

/* Delete all data for given keys (using the specified store) */
function deleteRecord(IStore _store, bytes32 key) internal {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

_store.deleteRecord(_tableId, _keyTuple);
_store.deleteRecord(_tableId, _keyTuple, getSchema());
}
}
4 changes: 2 additions & 2 deletions packages/cli/contracts/src/codegen/tables/Ephemeral.sol
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ library Ephemeral {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

StoreSwitch.emitEphemeralRecord(_tableId, _keyTuple, _data);
StoreSwitch.emitEphemeralRecord(_tableId, _keyTuple, _data, getSchema());
}

/** Emit the ephemeral event using individual values (using the specified store) */
Expand All @@ -82,7 +82,7 @@ library Ephemeral {
bytes32[] memory _keyTuple = new bytes32[](1);
_keyTuple[0] = key;

_store.emitEphemeralRecord(_tableId, _keyTuple, _data);
_store.emitEphemeralRecord(_tableId, _keyTuple, _data, getSchema());
}

/** Tightly pack full data using this table's schema */
Expand Down
Loading

0 comments on commit 2be039a

Please sign in to comment.