agicommies / communex

alternative commune cli/sdk
MIT No Attribution
25 stars 16 forks source link

Issue #11 - Invalid key type #29

Closed Bakobiibizo closed 5 months ago

Bakobiibizo commented 5 months ago

Added check for key2address to stop error from being thrown from wrong key type Comx key balances would throw an error because key2address was in the incorrect format for it to check the values of. I added a conditional check for the name=="key2address" to handle this edge case. A more robust solution will need to be found if you want to actually check the balance of key2address rather than just omit it from the balances.

steinerkelvin commented 5 months ago

Why would be a file called key2address in the keys folder? Can you send me a sample?

Bakobiibizo commented 5 months ago

commune just makes it. no clue why.

{"data": {"key2address": "5CkHmfkxN1dHuaddt9r5Ur9hxC2Ex5mJ4Qm46f9VMfXWmZ9L"}, "encrypted": false, "timestamp": 1709791965}

Bakobiibizo commented 5 months ago

image

steinerkelvin commented 5 months ago

commune just makes it. no clue why.

the bane of my existence.

Yeah, it's fine to ignore it. Just print a warning, so the user is informed something is being ignored and is not caught by surprise.

(I hope no one is naming a key key2address, but we should get used to writing our code defensively like this anyway)