Update `getTotalSupply` function in LIP 0051
Closed this issue · 0 comments
mjerkov commented
Motivation
In LIP 0051, getTotalSupply
function differs from the implementation.
Current Specifications
Currently, getTotalSupply
returns the total supply for a provided tokenID
:
def getTotalSupply(tokenID: TokenID) -> uint64:
if totalSupply(tokenID) does not exist:
raise Exception("Total supply entry does not exist.")
return totalSupply(tokenID)
Proposed Specifications
We propose to change the getTotalSupply
function to return total supply for all tokenID
:
def getTotalSupply() -> dict[TokenID, uint64]:
totalSupply: dict[TokenID, uint64] = {}
for (storeKey, storeValue) in supplyStore.items():
tokenID = storeKey
totalSupply[tokenID] = storeValue.totalSupply
return totalSupply
Affected LIPs
0051