Browse Source

Signable.xmr_wallet_outputs_file.unsigned: reimplement as one-liner

The MMGen Project 11 months ago
parent
commit
feb2706fba
1 changed files with 3 additions and 7 deletions
  1. 3 7
      mmgen/autosign.py

+ 3 - 7
mmgen/autosign.py

@@ -273,13 +273,9 @@ class Signable:
 		@property
 		def unsigned(self):
 			import json
-			unsigned = super().unsigned
-			def gen():
-				for f in unsigned:
-					with open(f) as fh:
-						if not json.load(fh)['MoneroMMGenWalletOutputsFile']['data']['imported']:
-							yield f
-			return tuple(gen())
+			return tuple(
+				f for f in super().unsigned
+					if not json.loads(f.read_text())['MoneroMMGenWalletOutputsFile']['data']['imported'])
 
 		async def sign(self,f):
 			from .xmrwallet import MoneroWalletOps,xmrwallet_uargs