1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-25 00:48:19 +00:00

remove native moduleprotobuf

This commit is contained in:
Pavol Rusnak 2016-04-28 15:40:16 +02:00
parent 0e21c18c2a
commit 4f90848c0a
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
4 changed files with 2 additions and 86 deletions

View File

@ -1,75 +0,0 @@
/*
* Copyright (c) Pavol Rusnak, SatoshiLabs
*
* Licensed under Microsoft Reference Source License (Ms-RSL)
* see LICENSE.md file for details
*/
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include "py/nlr.h"
#include "py/runtime.h"
#include "py/binary.h"
#if MICROPY_PY_TREZORPROTOBUF
// class Protobuf(object):
typedef struct _mp_obj_Protobuf_t {
mp_obj_base_t base;
} mp_obj_Protobuf_t;
// def Protobuf.__init__(self)
STATIC mp_obj_t mod_TrezorProtobuf_Protobuf_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
mp_arg_check_num(n_args, n_kw, 0, 0, false);
mp_obj_Protobuf_t *o = m_new_obj(mp_obj_Protobuf_t);
o->base.type = type;
return MP_OBJ_FROM_PTR(o);
}
// def Protobuf.encode(self, message) -> bytes
STATIC mp_obj_t mod_TrezorProtobuf_Protobuf_encode(mp_obj_t self, mp_obj_t callback) {
// TODO
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_TrezorProtobuf_Protobuf_encode_obj, mod_TrezorProtobuf_Protobuf_encode);
// def Protobuf.decode(self, data: bytes) -> object
STATIC mp_obj_t mod_TrezorProtobuf_Protobuf_decode(mp_obj_t self, mp_obj_t data) {
// TODO
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_TrezorProtobuf_Protobuf_decode_obj, mod_TrezorProtobuf_Protobuf_decode);
// Protobuf stuff
STATIC const mp_rom_map_elem_t mod_TrezorProtobuf_Protobuf_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_encode), MP_ROM_PTR(&mod_TrezorProtobuf_Protobuf_encode_obj) },
{ MP_ROM_QSTR(MP_QSTR_decode), MP_ROM_PTR(&mod_TrezorProtobuf_Protobuf_decode_obj) },
};
STATIC MP_DEFINE_CONST_DICT(mod_TrezorProtobuf_Protobuf_locals_dict, mod_TrezorProtobuf_Protobuf_locals_dict_table);
STATIC const mp_obj_type_t mod_TrezorProtobuf_Protobuf_type = {
{ &mp_type_type },
.name = MP_QSTR_Protobuf,
.make_new = mod_TrezorProtobuf_Protobuf_make_new,
.locals_dict = (void*)&mod_TrezorProtobuf_Protobuf_locals_dict,
};
// module stuff
STATIC const mp_rom_map_elem_t mp_module_TrezorProtobuf_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_TrezorProtobuf) },
{ MP_ROM_QSTR(MP_QSTR_Protobuf), MP_ROM_PTR(&mod_TrezorProtobuf_Protobuf_type) },
};
STATIC MP_DEFINE_CONST_DICT(mp_module_TrezorProtobuf_globals, mp_module_TrezorProtobuf_globals_table);
const mp_obj_module_t mp_module_TrezorProtobuf = {
.base = { &mp_type_module },
.name = MP_QSTR_TrezorProtobuf,
.globals = (mp_obj_dict_t*)&mp_module_TrezorProtobuf_globals,
};
#endif // MICROPY_PY_TREZORPROTOBUF

View File

@ -71,4 +71,4 @@ const mp_obj_module_t mp_module_TrezorUtils = {
.globals = (mp_obj_dict_t*)&mp_module_TrezorUtils_globals,
};
#endif // MICROPY_PY_TREZORPROTOBUF
#endif // MICROPY_PY_TREZORUTILS

View File

@ -1,9 +0,0 @@
from TrezorProtobuf import Protobuf
_protobuf = Protobuf()
def encode(data):
return _protobuf.encode(data)
def decode(data):
return _protobuf.decode(data)

2
vendor/micropython vendored

@ -1 +1 @@
Subproject commit a97899966537f6220531c3e98f5a610a8148f29c
Subproject commit 4e2fda01bf6612823057886c98284ada320c8b22