Conversation
|
| bytes2 constant RESOURCE_TABLE = "tb"; | ||
| bytes2 constant RESOURCE_TABLE_OFFCHAIN = "tf"; | ||
| bytes2 constant RESOURCE_SYSTEM = "sy"; | ||
| bytes2 constant RESOURCE_MODULE = "md"; |
There was a problem hiding this comment.
I wish Solidity had something like TypeScript's enums where you can define the value of each, e.g.
enum ResourceType {
NAMESPACE = 'ns',
TABLE = 'tb',
...
}a5d0da5 to
b403f46
Compare
b403f46 to
362b348
Compare
| /** | ||
| * A ResourceSelector is a 32-byte value that uniquely identifies a resource | ||
| * - 2 bytes for the resource type | ||
| * - 14 bytes for the namespace |
There was a problem hiding this comment.
decided to steal from the namespace rather than name, but we could also steal 1 byte each (bytes2+bytes15+bytes15) to avoid juggling three diff types
There was a problem hiding this comment.
from @alvrs in discord
feels right! agree with stealing from the namespace (I actually like two different types bytes14 and bytes16 to distinguish them better)
|
|
||
| bytes2 constant RESOURCE_NAMESPACE = "ns"; | ||
| bytes2 constant RESOURCE_TABLE = "tb"; | ||
| bytes2 constant RESOURCE_TABLE_OFFCHAIN = "tf"; |
There was a problem hiding this comment.
considered it but "offchain" and "onchain" are both "o"
also tb and to look too similar and wanted to visually differentiate
🤷
There was a problem hiding this comment.
fair, f is the only diff between onchain and offchain 🙈
There was a problem hiding this comment.
@dk1a in case you weren't following our chat, we probably want to define the table ID prefix separately and inside store, and the other resource prefixes here in world
|
closing in favor of #1544 |
No description provided.