Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add burn to registry #1141

Merged
merged 1 commit into from
Mar 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions bittensor/_subtensor/chain_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from typing import List, Tuple, Dict, Optional, Any
import bittensor
from bittensor import Balance
import json
import torch
from scalecodec.base import RuntimeConfiguration, ScaleBytes
from scalecodec.type_registry import load_type_registry_preset
Expand Down Expand Up @@ -52,7 +51,8 @@
["tempo", "Compact<u16>"],
["network_modality", "Compact<u16>"],
["network_connect", "Vec<[Compact<u16>; 2]>"],
["emission_values", "Compact<u64>"]
["emission_values", "Compact<u64>"],
["burn", "Compact<u64>"],
]
},
"DelegateInfo": {
Expand Down Expand Up @@ -399,6 +399,7 @@ class SubnetInfo:
modality: int
connection_requirements: Dict[str, int] # netuid -> connection requirements
emission_value: float
burn: Balance

@classmethod
def from_vec_u8(cls, vec_u8: List[int]) -> Optional['SubnetInfo']:
Expand Down Expand Up @@ -455,6 +456,7 @@ def fix_decoded_values(cls, decoded: Dict) -> 'SubnetInfo':
str(int(netuid)): int(req) for netuid, req in decoded['network_connect']
},
emission_value= decoded['emission_values'],
burn = Balance.from_rao(decoded['burn'])
)

def to_parameter_dict( self ) -> 'torch.nn.ParameterDict':
Expand Down