Skip to content

Commit

Permalink
add more test data for dynamic tables
Browse files Browse the repository at this point in the history
  • Loading branch information
alvrs committed Jul 5, 2023
1 parent 6ecda8c commit a46fe53
Show file tree
Hide file tree
Showing 19 changed files with 1,905 additions and 5 deletions.
155 changes: 155 additions & 0 deletions e2e/packages/client-vanilla/src/mud/contractComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,160 @@ export function defineContractComponents(world: World) {
}
);
})(),
Name: (() => {
const tableId = new TableId("", "Name");
return defineComponent(
world,
{
name: RecsType.String,
},
{
metadata: {
contractId: tableId.toHex(),
tableId: tableId.toString(),
},
}
);
})(),
Data: (() => {
const tableId = new TableId("", "Data");
return defineComponent(
world,
{
value: RecsType.String,
},
{
metadata: {
contractId: tableId.toHex(),
tableId: tableId.toString(),
},
}
);
})(),
GameConfig: (() => {
const tableId = new TableId("", "GameConfig");
return defineComponent(
world,
{
status: RecsType.Number,
maxWords: RecsType.Number,
wordsPlayed: RecsType.Number,
},
{
metadata: {
contractId: tableId.toHex(),
tableId: tableId.toString(),
},
}
);
})(),
MerkleRootConfig: (() => {
const tableId = new TableId("", "MerkleRootConfig");
return defineComponent(
world,
{
value: RecsType.String,
},
{
metadata: {
contractId: tableId.toHex(),
tableId: tableId.toString(),
},
}
);
})(),
VRGDAConfig: (() => {
const tableId = new TableId("", "VRGDAConfig");
return defineComponent(
world,
{
startTime: RecsType.BigInt,
targetPrice: RecsType.BigInt,
priceDecay: RecsType.BigInt,
perDay: RecsType.BigInt,
},
{
metadata: {
contractId: tableId.toHex(),
tableId: tableId.toString(),
},
}
);
})(),
TileLetter: (() => {
const tableId = new TableId("", "TileLetter");
return defineComponent(
world,
{
value: RecsType.Number,
},
{
metadata: {
contractId: tableId.toHex(),
tableId: tableId.toString(),
},
}
);
})(),
TilePlayer: (() => {
const tableId = new TableId("", "TilePlayer");
return defineComponent(
world,
{
value: RecsType.String,
},
{
metadata: {
contractId: tableId.toHex(),
tableId: tableId.toString(),
},
}
);
})(),
Treasury: (() => {
const tableId = new TableId("", "Treasury");
return defineComponent(
world,
{
value: RecsType.BigInt,
},
{
metadata: {
contractId: tableId.toHex(),
tableId: tableId.toString(),
},
}
);
})(),
Points: (() => {
const tableId = new TableId("", "Points");
return defineComponent(
world,
{
value: RecsType.Number,
},
{
metadata: {
contractId: tableId.toHex(),
tableId: tableId.toString(),
},
}
);
})(),
LetterCount: (() => {
const tableId = new TableId("", "LetterCount");
return defineComponent(
world,
{
value: RecsType.Number,
},
{
metadata: {
contractId: tableId.toHex(),
tableId: tableId.toString(),
},
}
);
})(),
};
}
2 changes: 1 addition & 1 deletion e2e/packages/contracts/mud.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default mudConfig({
keySchema: { user: "address" },
schema: { name: "string" },
},
Bytes: {
Data: {
keySchema: { key: "bytes32" },
schema: { value: "bytes" },
},
Expand Down
10 changes: 10 additions & 0 deletions e2e/packages/contracts/src/codegen/Tables.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,13 @@ import { Number, NumberTableId } from "./tables/Number.sol";
import { Vector, VectorData, VectorTableId } from "./tables/Vector.sol";
import { NumberList, NumberListTableId } from "./tables/NumberList.sol";
import { Multi, MultiData, MultiTableId } from "./tables/Multi.sol";
import { Name, NameTableId } from "./tables/Name.sol";
import { Data, DataTableId } from "./tables/Data.sol";
import { GameConfig, GameConfigData, GameConfigTableId } from "./tables/GameConfig.sol";
import { MerkleRootConfig, MerkleRootConfigTableId } from "./tables/MerkleRootConfig.sol";
import { VRGDAConfig, VRGDAConfigData, VRGDAConfigTableId } from "./tables/VRGDAConfig.sol";
import { TileLetter, TileLetterTableId } from "./tables/TileLetter.sol";
import { TilePlayer, TilePlayerTableId } from "./tables/TilePlayer.sol";
import { Treasury, TreasuryTableId } from "./tables/Treasury.sol";
import { Points, PointsTableId } from "./tables/Points.sol";
import { LetterCount, LetterCountTableId } from "./tables/LetterCount.sol";
Loading

0 comments on commit a46fe53

Please sign in to comment.