Skip to content

Commit c75d332

Browse files
committed
Working!
1 parent 321c827 commit c75d332

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

async_substrate_interface/types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def serialize(self):
176176
"chain": self.chain,
177177
"type_registry": self.type_registry,
178178
"metadata_value": metadata_value,
179-
"metadata_v15": None, # TODO new bt-decode
179+
"metadata_v15": self.metadata_v15.encode_to_metadata_option(),
180180
"runtime_info": {
181181
"specVersion": self.runtime_version,
182182
"transactionVersion": self.transaction_version,
@@ -201,7 +201,7 @@ def deserialize(cls, serialized: dict) -> "Runtime":
201201
metadata=metadata,
202202
type_registry=serialized["type_registry"],
203203
runtime_config=runtime_config,
204-
metadata_v15=None,
204+
metadata_v15=MetadataV15.decode_from_metadata_option(serialized["metadata_v15"]),
205205
registry=registry,
206206
ss58_format=ss58_format,
207207
runtime_info=serialized["runtime_info"],

async_substrate_interface/utils/cache.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ async def _create_if_not_exists(self, chain: str, table_name: str):
5454
key BLOB,
5555
value BLOB,
5656
chain TEXT,
57-
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
57+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
58+
UNIQUE(key, chain)
5859
);
5960
"""
6061
)
@@ -208,7 +209,8 @@ def _create_table(c, conn, table_name):
208209
key BLOB,
209210
value BLOB,
210211
chain TEXT,
211-
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
212+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
213+
UNIQUE(key, chain)
212214
);
213215
"""
214216
)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ keywords = ["substrate", "development", "bittensor"]
88

99
dependencies = [
1010
"wheel",
11-
"bt-decode==v0.6.0",
11+
"bt-decode==v0.8.0",
1212
"scalecodec~=1.2.11",
1313
"websockets>=14.1",
1414
"xxhash",

0 commit comments

Comments
 (0)