mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-25 17:09:44 +00:00
use filecache module if possible
This commit is contained in:
parent
2e9104f3c2
commit
dc54376b15
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
*.pyc
|
*.pyc
|
||||||
*.bin
|
*.bin
|
||||||
|
*.py.cache
|
||||||
|
@ -4,6 +4,14 @@
|
|||||||
import binascii
|
import binascii
|
||||||
import urllib2
|
import urllib2
|
||||||
import json
|
import json
|
||||||
|
try:
|
||||||
|
from filecache import filecache, MONTH
|
||||||
|
except:
|
||||||
|
def filecache(x):
|
||||||
|
def _inner(y):
|
||||||
|
return y
|
||||||
|
return _inner
|
||||||
|
MONTH = None
|
||||||
|
|
||||||
import types_pb2 as proto_types
|
import types_pb2 as proto_types
|
||||||
|
|
||||||
@ -18,6 +26,7 @@ class BlockchainApi(object):
|
|||||||
def submit(self, tx):
|
def submit(self, tx):
|
||||||
raise Exception("Not implemented yet")
|
raise Exception("Not implemented yet")
|
||||||
|
|
||||||
|
@filecache(MONTH)
|
||||||
def get_tx(self, txhash):
|
def get_tx(self, txhash):
|
||||||
# Build protobuf transaction structure from blockchain.info
|
# Build protobuf transaction structure from blockchain.info
|
||||||
d = self._raw_tx(txhash)
|
d = self._raw_tx(txhash)
|
||||||
|
Loading…
Reference in New Issue
Block a user