@@ -99,7 +99,7 @@ def drep_stake_distribution(
99
99
drep_vkey : str = "" ,
100
100
drep_vkey_file : itp .FileType | None = None ,
101
101
drep_key_hash : str = "" ,
102
- ) -> list [ list ]:
102
+ ) -> dict [ str , tp . Any ]:
103
103
"""Get the DRep stake distribution.
104
104
105
105
When no key is provided, query all DReps.
@@ -111,7 +111,7 @@ def drep_stake_distribution(
111
111
drep_key_hash: DRep verification key hash (either Bech32-encoded or hex-encoded).
112
112
113
113
Returns:
114
- List[List[Dict[ str, Any]] ]: DRep stake distribution.
114
+ dict[ str, Any]: DRep stake distribution.
115
115
"""
116
116
cred_args = self ._get_cred_args (
117
117
drep_script_hash = drep_script_hash ,
@@ -122,10 +122,11 @@ def drep_stake_distribution(
122
122
if not cred_args :
123
123
cred_args = ["--all-dreps" ]
124
124
125
- out : list [list [ dict [str , tp .Any ]] ] = json .loads (
125
+ out : list [list ] | dict [str , tp .Any ] = json .loads (
126
126
self .query_cli (["drep-stake-distribution" , * cred_args ])
127
127
)
128
- return out
128
+ recs : dict [str , tp .Any ] = {i [0 ]: i [1 ] for i in out } if isinstance (out , list ) else out
129
+ return recs
129
130
130
131
def committee_state (self ) -> dict [str , tp .Any ]:
131
132
"""Get the committee state."""
0 commit comments