fix namespace lbryschema->lbrynet.schema

This commit is contained in:
Victor Shyba 2018-09-17 17:31:44 -03:00 committed by Lex Berezhny
parent 00bc7995c4
commit e46f0e2444
47 changed files with 185 additions and 185 deletions

View file

@ -5,7 +5,7 @@ import os
from six.moves.urllib import request
from six.moves.urllib.error import URLError
from lbryschema import __version__ as lbryschema_version
from lbrynet.schema import __version__ as schema_version
from lbrynet import build_type, __version__ as lbrynet_version
from lbrynet.conf import ROOT_DIR
import logging.handlers
@ -35,7 +35,7 @@ def get_platform(get_ip: bool = True) -> dict:
"os_release": platform.release(),
"os_system": platform.system(),
"lbrynet_version": get_lbrynet_version(),
"lbryschema_version": lbryschema_version,
"lbryschema_version": schema_version,
"build": build_type.BUILD, # CI server sets this during build step
}
if p["os_system"] == "Linux":

View file

@ -11,7 +11,7 @@ import logging
import pkg_resources
from twisted.python.failure import Failure
from twisted.internet import defer
from lbryschema.claim import ClaimDict
from lbrynet.schema.claim import ClaimDict
from lbrynet.core.cryptoutils import get_lbry_hash_obj
log = logging.getLogger(__name__)

View file

@ -7,7 +7,7 @@ import binascii
from hashlib import sha256
from types import SimpleNamespace
from twisted.internet import defer, threads, reactor, error, task
import lbryschema
import lbrynet.schema
from aioupnp import __version__ as aioupnp_version
from aioupnp.upnp import UPnP
from aioupnp.fault import UPnPError
@ -353,7 +353,7 @@ class WalletComponent(Component):
conf.settings.ensure_wallet_dir()
log.info("Starting torba wallet")
storage = self.component_manager.get_component(DATABASE_COMPONENT)
lbryschema.BLOCKCHAIN_NAME = conf.settings['blockchain_name']
lbrynet.schema.BLOCKCHAIN_NAME = conf.settings['blockchain_name']
self.wallet_manager = yield f2d(LbryWalletManager.from_lbrynet_config(conf.settings, storage))
self.wallet_manager.old_db = storage
yield f2d(self.wallet_manager.start())

View file

@ -17,12 +17,12 @@ from twisted.python.failure import Failure
from torba.client.constants import COIN
from torba.client.baseaccount import SingleKey, HierarchicalDeterministic
from lbryschema.claim import ClaimDict
from lbryschema.uri import parse_lbry_uri
from lbryschema.error import URIParseError, DecodeError
from lbryschema.validator import validate_claim_id
from lbryschema.address import decode_address
from lbryschema.decode import smart_decode
from lbrynet.schema.claim import ClaimDict
from lbrynet.schema.uri import parse_lbry_uri
from lbrynet.schema.error import URIParseError, DecodeError
from lbrynet.schema.validator import validate_claim_id
from lbrynet.schema.address import decode_address
from lbrynet.schema.decode import smart_decode
# TODO: importing this when internet is disabled raises a socket.gaierror
from lbrynet.core.system_info import get_lbrynet_version
@ -820,7 +820,7 @@ class Daemon(AuthJSONRPCServer):
'ip': (str) remote ip, if available,
'lbrynet_version': (str) lbrynet_version,
'lbryum_version': (str) lbryum_version,
'lbryschema_version': (str) lbryschema_version,
'lbrynet.schema_version': (str) lbrynet.schema_version,
'os_release': (str) os release string
'os_system': (str) os name
'platform': (str) platform string
@ -2271,7 +2271,7 @@ class Daemon(AuthJSONRPCServer):
}
}
# this will be used to verify the format with lbryschema
# this will be used to verify the format with lbrynet.schema
claim_copy = deepcopy(claim_dict)
if sources is not None:
claim_dict['stream']['source'] = sources
@ -2292,7 +2292,7 @@ class Daemon(AuthJSONRPCServer):
raise Exception("no source provided to publish")
try:
ClaimDict.load_dict(claim_copy)
# the metadata to use in the claim can be serialized by lbryschema
# the metadata to use in the claim can be serialized by lbrynet.schema
except DecodeError as err:
# there was a problem with a metadata field, raise an error here rather than
# waiting to find out when we go to publish the claim (after having made the stream)

View file

@ -4,7 +4,7 @@ from twisted.internet import defer
from twisted.internet.task import LoopingCall
from lbrynet.daemon.Components import f2d
from lbryschema.fee import Fee
from lbrynet.schema.fee import Fee
from lbrynet.core.Error import InsufficientFundsError, KeyFeeAboveMaxAllowed, InvalidStreamDescriptorError
from lbrynet.core.Error import DownloadDataTimeout, DownloadCanceledError, DownloadSDTimeout

View file

@ -2,7 +2,7 @@ import sqlite3
import os
import json
import logging
from lbryschema.decode import smart_decode
from lbrynet.schema.decode import smart_decode
from lbrynet import conf
log = logging.getLogger(__name__)

View file

@ -7,8 +7,8 @@ from decimal import Decimal
from twisted.internet import defer, task, threads
from twisted.enterprise import adbapi
from lbryschema.claim import ClaimDict
from lbryschema.decode import smart_decode
from lbrynet.schema.claim import ClaimDict
from lbrynet.schema.decode import smart_decode
from lbrynet import conf
from lbrynet.cryptstream.CryptBlob import CryptBlobInfo
from lbrynet.dht.constants import dataExpireTimeout

View file

@ -1,9 +1,9 @@
import six
import lbryschema
from lbryschema.base import b58encode, b58decode, validate_b58_checksum
from lbryschema.hashing import double_sha256, hash160
from lbryschema.error import InvalidAddress
from lbryschema.schema import ADDRESS_LENGTH, ADDRESS_PREFIXES, PUBKEY_ADDRESS, SCRIPT_ADDRESS
import lbrynet.schema
from lbrynet.schema.base import b58encode, b58decode, validate_b58_checksum
from lbrynet.schema.hashing import double_sha256, hash160
from lbrynet.schema.error import InvalidAddress
from lbrynet.schema.schema import ADDRESS_LENGTH, ADDRESS_PREFIXES, PUBKEY_ADDRESS, SCRIPT_ADDRESS
def validate_address_length(addr_bytes):
@ -16,7 +16,7 @@ def validate_address_prefix(addr_bytes):
prefix = addr_bytes[0]
else:
prefix = ord(addr_bytes[0])
if prefix not in ADDRESS_PREFIXES[lbryschema.BLOCKCHAIN_NAME].values():
if prefix not in ADDRESS_PREFIXES[lbrynet.schema.BLOCKCHAIN_NAME].values():
raise InvalidAddress("Invalid address prefix: %.2X" % prefix)
@ -40,9 +40,9 @@ def encode_address(addr_bytes):
def hash_160_bytes_to_address(h160, addrtype=PUBKEY_ADDRESS):
if addrtype == PUBKEY_ADDRESS:
prefix = chr(ADDRESS_PREFIXES[lbryschema.BLOCKCHAIN_NAME][PUBKEY_ADDRESS])
prefix = chr(ADDRESS_PREFIXES[lbrynet.schema.BLOCKCHAIN_NAME][PUBKEY_ADDRESS])
elif addrtype == SCRIPT_ADDRESS:
prefix = chr(ADDRESS_PREFIXES[lbryschema.BLOCKCHAIN_NAME][SCRIPT_ADDRESS])
prefix = chr(ADDRESS_PREFIXES[lbrynet.schema.BLOCKCHAIN_NAME][SCRIPT_ADDRESS])
else:
raise Exception("Invalid address prefix")
return b58encode(prefix + h160 + double_sha256(prefix + h160)[0:4])
@ -55,7 +55,7 @@ def public_key_to_address(public_key):
def address_to_hash_160(addr):
bytes = decode_address(addr)
prefix, pubkey_bytes, addr_checksum = bytes[0], bytes[1:21], bytes[21:]
if prefix == chr(ADDRESS_PREFIXES[lbryschema.BLOCKCHAIN_NAME][PUBKEY_ADDRESS]):
if prefix == chr(ADDRESS_PREFIXES[lbrynet.schema.BLOCKCHAIN_NAME][PUBKEY_ADDRESS]):
return PUBKEY_ADDRESS, pubkey_bytes
return SCRIPT_ADDRESS, pubkey_bytes

View file

@ -1,7 +1,7 @@
import six
from lbryschema.schema import ADDRESS_CHECKSUM_LENGTH
from lbryschema.hashing import double_sha256
from lbryschema.error import InvalidAddress
from lbrynet.schema.schema import ADDRESS_CHECKSUM_LENGTH
from lbrynet.schema.hashing import double_sha256
from lbrynet.schema.error import InvalidAddress
alphabet = b'123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'

View file

@ -5,14 +5,14 @@ from google.protobuf.message import DecodeError as DecodeError_pb # pylint: dis
from collections import OrderedDict
from lbryschema.schema.claim import Claim
from lbryschema.proto import claim_pb2
from lbryschema.validator import get_validator
from lbryschema.signer import get_signer
from lbryschema.schema import NIST256p, CURVE_NAMES, CLAIM_TYPE_NAMES
from lbryschema.encoding import decode_fields, decode_b64_fields, encode_fields
from lbryschema.error import DecodeError
from lbryschema.fee import Fee
from lbrynet.schema.schema.claim import Claim
from lbrynet.schema.proto import claim_pb2
from lbrynet.schema.validator import get_validator
from lbrynet.schema.signer import get_signer
from lbrynet.schema.schema import NIST256p, CURVE_NAMES, CLAIM_TYPE_NAMES
from lbrynet.schema.encoding import decode_fields, decode_b64_fields, encode_fields
from lbrynet.schema.error import DecodeError
from lbrynet.schema.fee import Fee
class ClaimDict(OrderedDict):
@ -180,10 +180,10 @@ class ClaimDict(OrderedDict):
def get_validator(self, certificate_id):
"""
Get a lbryschema.validator.Validator object for a certificate claim
Get a lbrynet.schema.validator.Validator object for a certificate claim
:param certificate_id: claim id of this certificate claim
:return: None or lbryschema.validator.Validator object
:return: None or lbrynet.schema.validator.Validator object
"""
claim = self.protobuf

View file

@ -3,9 +3,9 @@ import binascii
import six
from lbryschema.error import DecodeError, InvalidAddress
from lbryschema.legacy.migrate import migrate as schema_migrator
from lbryschema.claim import ClaimDict
from lbrynet.schema.error import DecodeError, InvalidAddress
from lbrynet.schema.legacy.migrate import migrate as schema_migrator
from lbrynet.schema.claim import ClaimDict
from google.protobuf import json_format # pylint: disable=no-name-in-module

View file

@ -1,9 +1,9 @@
import base64, binascii
from copy import deepcopy
from lbryschema.address import decode_address, encode_address
from lbryschema.schema import CLAIM_TYPES, CLAIM_TYPE, STREAM_TYPE, CERTIFICATE_TYPE
from lbryschema.schema import SIGNATURE
from lbryschema.error import DecodeError, InvalidAddress
from lbrynet.schema.address import decode_address, encode_address
from lbrynet.schema.schema import CLAIM_TYPES, CLAIM_TYPE, STREAM_TYPE, CERTIFICATE_TYPE
from lbrynet.schema.schema import SIGNATURE
from lbrynet.schema.error import DecodeError, InvalidAddress
def encode_fields(claim_dictionary):

View file

@ -1,9 +1,9 @@
from collections import OrderedDict
from lbryschema.address import encode_address, decode_address
from lbryschema.schema import CURRENCY_NAMES, CURRENCY_MAP
from lbryschema.schema.fee import Fee as FeeHelper
from lbryschema.proto import fee_pb2
from lbrynet.schema.address import encode_address, decode_address
from lbrynet.schema.schema import CURRENCY_NAMES, CURRENCY_MAP
from lbrynet.schema.schema.fee import Fee as FeeHelper
from lbrynet.schema.proto import fee_pb2
def migrate(fee):

View file

@ -2,8 +2,8 @@
migrate claim json schema (0.0.1-3) to protobuf (0.1.0)
"""
from lbryschema.legacy import metadata_schemas
from lbryschema.claim import ClaimDict
from lbrynet.schema.legacy import metadata_schemas
from lbrynet.schema.claim import ClaimDict
from .StructuredDict import StructuredDict

View file

@ -1,5 +1,5 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: lbryschema/proto/certificate.proto
# source: lbrynet.schema/proto/certificate.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
@ -17,9 +17,9 @@ _sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='lbryschema/proto/certificate.proto',
name='lbrynet.schema/proto/certificate.proto',
package='',
serialized_pb=_b('\n\"lbryschema/proto/certificate.proto\"\x8e\x01\n\x0b\x43\x65rtificate\x12%\n\x07version\x18\x01 \x02(\x0e\x32\x14.Certificate.Version\x12\x19\n\x07keyType\x18\x02 \x02(\x0e\x32\x08.KeyType\x12\x11\n\tpublicKey\x18\x04 \x02(\x0c\"*\n\x07Version\x12\x13\n\x0fUNKNOWN_VERSION\x10\x00\x12\n\n\x06_0_0_1\x10\x01*Q\n\x07KeyType\x12\x1b\n\x17UNKNOWN_PUBLIC_KEY_TYPE\x10\x00\x12\x0c\n\x08NIST256p\x10\x01\x12\x0c\n\x08NIST384p\x10\x02\x12\r\n\tSECP256k1\x10\x03')
serialized_pb=_b('\n\"lbrynet.schema/proto/certificate.proto\"\x8e\x01\n\x0b\x43\x65rtificate\x12%\n\x07version\x18\x01 \x02(\x0e\x32\x14.Certificate.Version\x12\x19\n\x07keyType\x18\x02 \x02(\x0e\x32\x08.KeyType\x12\x11\n\tpublicKey\x18\x04 \x02(\x0c\"*\n\x07Version\x12\x13\n\x0fUNKNOWN_VERSION\x10\x00\x12\n\n\x06_0_0_1\x10\x01*Q\n\x07KeyType\x12\x1b\n\x17UNKNOWN_PUBLIC_KEY_TYPE\x10\x00\x12\x0c\n\x08NIST256p\x10\x01\x12\x0c\n\x08NIST384p\x10\x02\x12\r\n\tSECP256k1\x10\x03')
)
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
@ -135,7 +135,7 @@ DESCRIPTOR.enum_types_by_name['KeyType'] = _KEYTYPE
Certificate = _reflection.GeneratedProtocolMessageType('Certificate', (_message.Message,), dict(
DESCRIPTOR = _CERTIFICATE,
__module__ = 'lbryschema.proto.certificate_pb2'
__module__ = 'lbrynet.schema.proto.certificate_pb2'
# @@protoc_insertion_point(class_scope:Certificate)
))
_sym_db.RegisterMessage(Certificate)

View file

@ -1,8 +1,8 @@
syntax = "proto2";
import "lbryschema/proto/stream.proto";
import "lbryschema/proto/certificate.proto";
import "lbryschema/proto/signature.proto";
import "lbrynet.schema/proto/stream.proto";
import "lbrynet.schema/proto/certificate.proto";
import "lbrynet.schema/proto/signature.proto";
message Claim {
enum Version {

View file

@ -1,5 +1,5 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: lbryschema/proto/claim.proto
# source: lbrynet.schema/proto/claim.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
@ -13,17 +13,17 @@ from google.protobuf import descriptor_pb2
_sym_db = _symbol_database.Default()
import lbryschema.proto.stream_pb2
import lbryschema.proto.certificate_pb2
import lbryschema.proto.signature_pb2
import lbrynet.schema.proto.stream_pb2
import lbrynet.schema.proto.certificate_pb2
import lbrynet.schema.proto.signature_pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name='lbryschema/proto/claim.proto',
name='lbrynet.schema/proto/claim.proto',
package='',
serialized_pb=_b('\n\x1clbryschema/proto/claim.proto\x1a\x1dlbryschema/proto/stream.proto\x1a\"lbryschema/proto/certificate.proto\x1a lbryschema/proto/signature.proto\"\xa7\x02\n\x05\x43laim\x12\x1f\n\x07version\x18\x01 \x02(\x0e\x32\x0e.Claim.Version\x12#\n\tclaimType\x18\x02 \x02(\x0e\x32\x10.Claim.ClaimType\x12\x17\n\x06stream\x18\x03 \x01(\x0b\x32\x07.Stream\x12!\n\x0b\x63\x65rtificate\x18\x04 \x01(\x0b\x32\x0c.Certificate\x12&\n\x12publisherSignature\x18\x05 \x01(\x0b\x32\n.Signature\"*\n\x07Version\x12\x13\n\x0fUNKNOWN_VERSION\x10\x00\x12\n\n\x06_0_0_1\x10\x01\"H\n\tClaimType\x12\x16\n\x12UNKNOWN_CLAIM_TYPE\x10\x00\x12\x0e\n\nstreamType\x10\x01\x12\x13\n\x0f\x63\x65rtificateType\x10\x02')
serialized_pb=_b('\n\x1clbrynet.schema/proto/claim.proto\x1a\x1dlbrynet.schema/proto/stream.proto\x1a\"lbrynet.schema/proto/certificate.proto\x1a lbrynet.schema/proto/signature.proto\"\xa7\x02\n\x05\x43laim\x12\x1f\n\x07version\x18\x01 \x02(\x0e\x32\x0e.Claim.Version\x12#\n\tclaimType\x18\x02 \x02(\x0e\x32\x10.Claim.ClaimType\x12\x17\n\x06stream\x18\x03 \x01(\x0b\x32\x07.Stream\x12!\n\x0b\x63\x65rtificate\x18\x04 \x01(\x0b\x32\x0c.Certificate\x12&\n\x12publisherSignature\x18\x05 \x01(\x0b\x32\n.Signature\"*\n\x07Version\x12\x13\n\x0fUNKNOWN_VERSION\x10\x00\x12\n\n\x06_0_0_1\x10\x01\"H\n\tClaimType\x12\x16\n\x12UNKNOWN_CLAIM_TYPE\x10\x00\x12\x0e\n\nstreamType\x10\x01\x12\x13\n\x0f\x63\x65rtificateType\x10\x02')
,
dependencies=[lbryschema.proto.stream_pb2.DESCRIPTOR,lbryschema.proto.certificate_pb2.DESCRIPTOR,lbryschema.proto.signature_pb2.DESCRIPTOR,])
dependencies=[lbrynet.schema.proto.stream_pb2.DESCRIPTOR,lbrynet.schema.proto.certificate_pb2.DESCRIPTOR,lbrynet.schema.proto.signature_pb2.DESCRIPTOR,])
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
@ -138,16 +138,16 @@ _CLAIM = _descriptor.Descriptor(
_CLAIM.fields_by_name['version'].enum_type = _CLAIM_VERSION
_CLAIM.fields_by_name['claimType'].enum_type = _CLAIM_CLAIMTYPE
_CLAIM.fields_by_name['stream'].message_type = lbryschema.proto.stream_pb2._STREAM
_CLAIM.fields_by_name['certificate'].message_type = lbryschema.proto.certificate_pb2._CERTIFICATE
_CLAIM.fields_by_name['publisherSignature'].message_type = lbryschema.proto.signature_pb2._SIGNATURE
_CLAIM.fields_by_name['stream'].message_type = lbrynet.schema.proto.stream_pb2._STREAM
_CLAIM.fields_by_name['certificate'].message_type = lbrynet.schema.proto.certificate_pb2._CERTIFICATE
_CLAIM.fields_by_name['publisherSignature'].message_type = lbrynet.schema.proto.signature_pb2._SIGNATURE
_CLAIM_VERSION.containing_type = _CLAIM
_CLAIM_CLAIMTYPE.containing_type = _CLAIM
DESCRIPTOR.message_types_by_name['Claim'] = _CLAIM
Claim = _reflection.GeneratedProtocolMessageType('Claim', (_message.Message,), dict(
DESCRIPTOR = _CLAIM,
__module__ = 'lbryschema.proto.claim_pb2'
__module__ = 'lbrynet.schema.proto.claim_pb2'
# @@protoc_insertion_point(class_scope:Claim)
))
_sym_db.RegisterMessage(Claim)

View file

@ -1,5 +1,5 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: lbryschema/proto/fee.proto
# source: lbrynet.schema/proto/fee.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
@ -16,9 +16,9 @@ _sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='lbryschema/proto/fee.proto',
name='lbrynet.schema/proto/fee.proto',
package='',
serialized_pb=_b('\n\x1albryschema/proto/fee.proto\"\xcf\x01\n\x03\x46\x65\x65\x12\x1d\n\x07version\x18\x01 \x02(\x0e\x32\x0c.Fee.Version\x12\x1f\n\x08\x63urrency\x18\x02 \x02(\x0e\x32\r.Fee.Currency\x12\x0f\n\x07\x61\x64\x64ress\x18\x03 \x02(\x0c\x12\x0e\n\x06\x61mount\x18\x04 \x02(\x02\"*\n\x07Version\x12\x13\n\x0fUNKNOWN_VERSION\x10\x00\x12\n\n\x06_0_0_1\x10\x01\";\n\x08\x43urrency\x12\x14\n\x10UNKNOWN_CURRENCY\x10\x00\x12\x07\n\x03LBC\x10\x01\x12\x07\n\x03\x42TC\x10\x02\x12\x07\n\x03USD\x10\x03')
serialized_pb=_b('\n\x1albrynet.schema/proto/fee.proto\"\xcf\x01\n\x03\x46\x65\x65\x12\x1d\n\x07version\x18\x01 \x02(\x0e\x32\x0c.Fee.Version\x12\x1f\n\x08\x63urrency\x18\x02 \x02(\x0e\x32\r.Fee.Currency\x12\x0f\n\x07\x61\x64\x64ress\x18\x03 \x02(\x0c\x12\x0e\n\x06\x61mount\x18\x04 \x02(\x02\"*\n\x07Version\x12\x13\n\x0fUNKNOWN_VERSION\x10\x00\x12\n\n\x06_0_0_1\x10\x01\";\n\x08\x43urrency\x12\x14\n\x10UNKNOWN_CURRENCY\x10\x00\x12\x07\n\x03LBC\x10\x01\x12\x07\n\x03\x42TC\x10\x02\x12\x07\n\x03USD\x10\x03')
)
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
@ -137,7 +137,7 @@ DESCRIPTOR.message_types_by_name['Fee'] = _FEE
Fee = _reflection.GeneratedProtocolMessageType('Fee', (_message.Message,), dict(
DESCRIPTOR = _FEE,
__module__ = 'lbryschema.proto.fee_pb2'
__module__ = 'lbrynet.schema.proto.fee_pb2'
# @@protoc_insertion_point(class_scope:Fee)
))
_sym_db.RegisterMessage(Fee)

View file

@ -1,6 +1,6 @@
syntax = "proto2";
import "lbryschema/proto/fee.proto";
import "lbrynet.schema/proto/fee.proto";
message Metadata {
enum Version {

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
syntax = "proto2";
import "lbryschema/proto/certificate.proto";
import "lbrynet.schema/proto/certificate.proto";
message Signature {
enum Version {

View file

@ -1,5 +1,5 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: lbryschema/proto/signature.proto
# source: lbrynet.schema/proto/signature.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
@ -13,15 +13,15 @@ from google.protobuf import descriptor_pb2
_sym_db = _symbol_database.Default()
import lbryschema.proto.certificate_pb2
import lbrynet.schema.proto.certificate_pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name='lbryschema/proto/signature.proto',
name='lbrynet.schema/proto/signature.proto',
package='',
serialized_pb=_b('\n lbryschema/proto/signature.proto\x1a\"lbryschema/proto/certificate.proto\"\xa7\x01\n\tSignature\x12#\n\x07version\x18\x01 \x02(\x0e\x32\x12.Signature.Version\x12\x1f\n\rsignatureType\x18\x02 \x02(\x0e\x32\x08.KeyType\x12\x11\n\tsignature\x18\x03 \x02(\x0c\x12\x15\n\rcertificateId\x18\x04 \x02(\x0c\"*\n\x07Version\x12\x13\n\x0fUNKNOWN_VERSION\x10\x00\x12\n\n\x06_0_0_1\x10\x01')
serialized_pb=_b('\n lbrynet.schema/proto/signature.proto\x1a\"lbrynet.schema/proto/certificate.proto\"\xa7\x01\n\tSignature\x12#\n\x07version\x18\x01 \x02(\x0e\x32\x12.Signature.Version\x12\x1f\n\rsignatureType\x18\x02 \x02(\x0e\x32\x08.KeyType\x12\x11\n\tsignature\x18\x03 \x02(\x0c\x12\x15\n\rcertificateId\x18\x04 \x02(\x0c\"*\n\x07Version\x12\x13\n\x0fUNKNOWN_VERSION\x10\x00\x12\n\n\x06_0_0_1\x10\x01')
,
dependencies=[lbryschema.proto.certificate_pb2.DESCRIPTOR,])
dependencies=[lbrynet.schema.proto.certificate_pb2.DESCRIPTOR,])
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
@ -101,13 +101,13 @@ _SIGNATURE = _descriptor.Descriptor(
)
_SIGNATURE.fields_by_name['version'].enum_type = _SIGNATURE_VERSION
_SIGNATURE.fields_by_name['signatureType'].enum_type = lbryschema.proto.certificate_pb2._KEYTYPE
_SIGNATURE.fields_by_name['signatureType'].enum_type = lbrynet.schema.proto.certificate_pb2._KEYTYPE
_SIGNATURE_VERSION.containing_type = _SIGNATURE
DESCRIPTOR.message_types_by_name['Signature'] = _SIGNATURE
Signature = _reflection.GeneratedProtocolMessageType('Signature', (_message.Message,), dict(
DESCRIPTOR = _SIGNATURE,
__module__ = 'lbryschema.proto.signature_pb2'
__module__ = 'lbrynet.schema.proto.signature_pb2'
# @@protoc_insertion_point(class_scope:Signature)
))
_sym_db.RegisterMessage(Signature)

View file

@ -1,5 +1,5 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: lbryschema/proto/source.proto
# source: lbrynet.schema/proto/source.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
@ -16,9 +16,9 @@ _sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='lbryschema/proto/source.proto',
name='lbrynet.schema/proto/source.proto',
package='',
serialized_pb=_b('\n\x1dlbryschema/proto/source.proto\"\xde\x01\n\x06Source\x12 \n\x07version\x18\x01 \x02(\x0e\x32\x0f.Source.Version\x12\'\n\nsourceType\x18\x02 \x02(\x0e\x32\x13.Source.SourceTypes\x12\x0e\n\x06source\x18\x03 \x02(\x0c\x12\x13\n\x0b\x63ontentType\x18\x04 \x02(\t\"*\n\x07Version\x12\x13\n\x0fUNKNOWN_VERSION\x10\x00\x12\n\n\x06_0_0_1\x10\x01\"8\n\x0bSourceTypes\x12\x17\n\x13UNKNOWN_SOURCE_TYPE\x10\x00\x12\x10\n\x0clbry_sd_hash\x10\x01')
serialized_pb=_b('\n\x1dlbrynet.schema/proto/source.proto\"\xde\x01\n\x06Source\x12 \n\x07version\x18\x01 \x02(\x0e\x32\x0f.Source.Version\x12\'\n\nsourceType\x18\x02 \x02(\x0e\x32\x13.Source.SourceTypes\x12\x0e\n\x06source\x18\x03 \x02(\x0c\x12\x13\n\x0b\x63ontentType\x18\x04 \x02(\t\"*\n\x07Version\x12\x13\n\x0fUNKNOWN_VERSION\x10\x00\x12\n\n\x06_0_0_1\x10\x01\"8\n\x0bSourceTypes\x12\x17\n\x13UNKNOWN_SOURCE_TYPE\x10\x00\x12\x10\n\x0clbry_sd_hash\x10\x01')
)
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
@ -129,7 +129,7 @@ DESCRIPTOR.message_types_by_name['Source'] = _SOURCE
Source = _reflection.GeneratedProtocolMessageType('Source', (_message.Message,), dict(
DESCRIPTOR = _SOURCE,
__module__ = 'lbryschema.proto.source_pb2'
__module__ = 'lbrynet.schema.proto.source_pb2'
# @@protoc_insertion_point(class_scope:Source)
))
_sym_db.RegisterMessage(Source)

View file

@ -1,7 +1,7 @@
syntax = "proto2";
import "lbryschema/proto/metadata.proto";
import "lbryschema/proto/source.proto";
import "lbrynet.schema/proto/metadata.proto";
import "lbrynet.schema/proto/source.proto";
message Stream {

View file

@ -1,5 +1,5 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: lbryschema/proto/stream.proto
# source: lbrynet.schema/proto/stream.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
@ -13,16 +13,16 @@ from google.protobuf import descriptor_pb2
_sym_db = _symbol_database.Default()
import lbryschema.proto.metadata_pb2
import lbryschema.proto.source_pb2
import lbrynet.schema.proto.metadata_pb2
import lbrynet.schema.proto.source_pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name='lbryschema/proto/stream.proto',
name='lbrynet.schema/proto/stream.proto',
package='',
serialized_pb=_b('\n\x1dlbryschema/proto/stream.proto\x1a\x1flbryschema/proto/metadata.proto\x1a\x1dlbryschema/proto/source.proto\"\x8c\x01\n\x06Stream\x12 \n\x07version\x18\x01 \x02(\x0e\x32\x0f.Stream.Version\x12\x1b\n\x08metadata\x18\x02 \x02(\x0b\x32\t.Metadata\x12\x17\n\x06source\x18\x03 \x02(\x0b\x32\x07.Source\"*\n\x07Version\x12\x13\n\x0fUNKNOWN_VERSION\x10\x00\x12\n\n\x06_0_0_1\x10\x01')
serialized_pb=_b('\n\x1dlbrynet.schema/proto/stream.proto\x1a\x1flbrynet.schema/proto/metadata.proto\x1a\x1dlbrynet.schema/proto/source.proto\"\x8c\x01\n\x06Stream\x12 \n\x07version\x18\x01 \x02(\x0e\x32\x0f.Stream.Version\x12\x1b\n\x08metadata\x18\x02 \x02(\x0b\x32\t.Metadata\x12\x17\n\x06source\x18\x03 \x02(\x0b\x32\x07.Source\"*\n\x07Version\x12\x13\n\x0fUNKNOWN_VERSION\x10\x00\x12\n\n\x06_0_0_1\x10\x01')
,
dependencies=[lbryschema.proto.metadata_pb2.DESCRIPTOR,lbryschema.proto.source_pb2.DESCRIPTOR,])
dependencies=[lbrynet.schema.proto.metadata_pb2.DESCRIPTOR,lbrynet.schema.proto.source_pb2.DESCRIPTOR,])
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
@ -95,14 +95,14 @@ _STREAM = _descriptor.Descriptor(
)
_STREAM.fields_by_name['version'].enum_type = _STREAM_VERSION
_STREAM.fields_by_name['metadata'].message_type = lbryschema.proto.metadata_pb2._METADATA
_STREAM.fields_by_name['source'].message_type = lbryschema.proto.source_pb2._SOURCE
_STREAM.fields_by_name['metadata'].message_type = lbrynet.schema.proto.metadata_pb2._METADATA
_STREAM.fields_by_name['source'].message_type = lbrynet.schema.proto.source_pb2._SOURCE
_STREAM_VERSION.containing_type = _STREAM
DESCRIPTOR.message_types_by_name['Stream'] = _STREAM
Stream = _reflection.GeneratedProtocolMessageType('Stream', (_message.Message,), dict(
DESCRIPTOR = _STREAM,
__module__ = 'lbryschema.proto.stream_pb2'
__module__ = 'lbrynet.schema.proto.stream_pb2'
# @@protoc_insertion_point(class_scope:Stream)
))
_sym_db.RegisterMessage(Stream)

View file

@ -1,9 +1,9 @@
from copy import deepcopy
from lbryschema.proto import certificate_pb2 as cert_pb
from lbryschema.schema.schema import Schema
from lbryschema.schema import VERSION_MAP, V_0_0_1, ECDSA_CURVES, CURVE_NAMES
from lbryschema.validator import get_key_type_from_dem
from lbrynet.schema.proto import certificate_pb2 as cert_pb
from lbrynet.schema.schema.schema import Schema
from lbrynet.schema.schema import VERSION_MAP, V_0_0_1, ECDSA_CURVES, CURVE_NAMES
from lbrynet.schema.validator import get_key_type_from_dem
class _ECDSAKeyHelper(object):

View file

@ -1,11 +1,11 @@
from copy import deepcopy
from lbryschema.proto import claim_pb2 as claim_pb
from lbryschema.schema import VERSION_MAP
from lbryschema.schema.signature import Signature
from lbryschema.schema.certificate import Certificate
from lbryschema.schema.schema import Schema
from lbryschema.schema.stream import Stream
from lbrynet.schema.proto import claim_pb2 as claim_pb
from lbrynet.schema.schema import VERSION_MAP
from lbrynet.schema.schema.signature import Signature
from lbrynet.schema.schema.certificate import Certificate
from lbrynet.schema.schema.schema import Schema
from lbrynet.schema.schema.stream import Stream
class Claim(Schema):

View file

@ -1,8 +1,8 @@
from copy import deepcopy
from lbryschema.schema.schema import Schema
from lbryschema.proto import fee_pb2 as fee_pb
from lbryschema.schema import VERSION_MAP, CURRENCY_MAP
from lbrynet.schema.schema.schema import Schema
from lbrynet.schema.proto import fee_pb2 as fee_pb
from lbrynet.schema.schema import VERSION_MAP, CURRENCY_MAP
class Fee(Schema):

View file

@ -1,8 +1,8 @@
from copy import deepcopy
from lbryschema.proto import metadata_pb2 as metadata_pb
from lbryschema.schema.fee import Fee
from lbryschema.schema.schema import Schema
from lbryschema.schema import VERSION_MAP
from lbrynet.schema.proto import metadata_pb2 as metadata_pb
from lbrynet.schema.schema.fee import Fee
from lbrynet.schema.schema.schema import Schema
from lbrynet.schema.schema import VERSION_MAP
class Metadata(Schema):

View file

@ -1,8 +1,8 @@
from copy import deepcopy
from lbryschema.proto import signature_pb2 as signature_pb
from lbryschema.schema import VERSION_MAP, ECDSA_CURVES
from lbryschema.schema.schema import Schema
from lbrynet.schema.proto import signature_pb2 as signature_pb
from lbrynet.schema.schema import VERSION_MAP, ECDSA_CURVES
from lbrynet.schema.schema.schema import Schema
class Signature(Schema):

View file

@ -1,8 +1,8 @@
from copy import deepcopy
from lbryschema.proto import source_pb2 as source_pb
from lbryschema.schema import SOURCE_TYPES, LBRY_SD_HASH_LENGTH, VERSION_MAP
from lbryschema.schema.schema import Schema
from lbryschema.error import InvalidSourceHashLength
from lbrynet.schema.proto import source_pb2 as source_pb
from lbrynet.schema.schema import SOURCE_TYPES, LBRY_SD_HASH_LENGTH, VERSION_MAP
from lbrynet.schema.schema.schema import Schema
from lbrynet.schema.error import InvalidSourceHashLength
class Source(Schema):

View file

@ -1,10 +1,10 @@
from copy import deepcopy
from lbryschema.schema.source import Source
from lbryschema.proto import stream_pb2 as stream_pb
from lbryschema.schema import VERSION_MAP
from lbryschema.schema.metadata import Metadata
from lbryschema.schema.schema import Schema
from lbrynet.schema.schema.source import Source
from lbrynet.schema.proto import stream_pb2 as stream_pb
from lbrynet.schema.schema import VERSION_MAP
from lbrynet.schema.schema.metadata import Metadata
from lbrynet.schema.schema.schema import Schema
class Stream(Schema):

View file

@ -1,13 +1,13 @@
import ecdsa
import hashlib
import binascii
from lbryschema.address import decode_address
from lbryschema.encoding import decode_b64_fields
from lbryschema.schema.certificate import Certificate
from lbryschema.schema.claim import Claim
from lbryschema.validator import validate_claim_id
from lbryschema.schema import V_0_0_1, CLAIM_TYPE, CLAIM_TYPES, CERTIFICATE_TYPE, VERSION
from lbryschema.schema import NIST256p, NIST384p, SECP256k1, SHA256, SHA384
from lbrynet.schema.address import decode_address
from lbrynet.schema.encoding import decode_b64_fields
from lbrynet.schema.schema.certificate import Certificate
from lbrynet.schema.schema.claim import Claim
from lbrynet.schema.validator import validate_claim_id
from lbrynet.schema.schema import V_0_0_1, CLAIM_TYPE, CLAIM_TYPES, CERTIFICATE_TYPE, VERSION
from lbrynet.schema.schema import NIST256p, NIST384p, SECP256k1, SHA256, SHA384
class NIST_ECDSASigner(object):

View file

@ -1,5 +1,5 @@
import re
from lbryschema.error import URIParseError
from lbrynet.schema.error import URIParseError
PROTOCOL = 'lbry://'
CHANNEL_CHAR = '@'

View file

@ -13,8 +13,8 @@ from cryptography.hazmat.primitives.asymmetric.utils import Prehashed
from cryptography.exceptions import InvalidSignature
from ecdsa.util import sigencode_der
from lbryschema.address import decode_address
from lbryschema.schema import NIST256p, NIST384p, SECP256k1, ECDSA_CURVES, CURVE_NAMES
from lbrynet.schema.address import decode_address
from lbrynet.schema.schema import NIST256p, NIST384p, SECP256k1, ECDSA_CURVES, CURVE_NAMES
def validate_claim_id(claim_id):

View file

@ -4,8 +4,8 @@ import logging
from torba.client.baseaccount import BaseAccount
from torba.client.basetransaction import TXORef
from lbryschema.claim import ClaimDict
from lbryschema.signer import SECP256k1, get_signer
from lbrynet.schema.claim import ClaimDict
from lbrynet.schema.signer import SECP256k1, get_signer
log = logging.getLogger(__name__)

View file

@ -2,8 +2,8 @@ import asyncio
import logging
from binascii import unhexlify
from lbryschema.error import URIParseError
from lbryschema.uri import parse_lbry_uri
from lbrynet.schema.error import URIParseError
from lbrynet.schema.uri import parse_lbry_uri
from torba.client.baseledger import BaseLedger
from .resolve import Resolver

View file

@ -12,7 +12,7 @@ from twisted.internet import defer
from lbryschema.schema import SECP256k1
from torba.client.basemanager import BaseWalletManager
from lbryschema.claim import ClaimDict
from lbrynet.schema.claim import ClaimDict
from .ledger import MainNetLedger
from .account import BaseAccount, generate_certificate

View file

@ -4,11 +4,11 @@ from ecdsa import BadSignatureError
from binascii import unhexlify, hexlify
from lbrynet.core.Error import UnknownNameError, UnknownClaimID, UnknownURI, UnknownOutpoint
from lbryschema.address import is_address
from lbryschema.claim import ClaimDict
from lbryschema.decode import smart_decode
from lbryschema.error import DecodeError
from lbryschema.uri import parse_lbry_uri
from lbrynet.schema.address import is_address
from lbrynet.schema.claim import ClaimDict
from lbrynet.schema.decode import smart_decode
from lbrynet.schema.error import DecodeError
from lbrynet.schema.uri import parse_lbry_uri
from .claim_proofs import verify_proof, InvalidProofError
log = logging.getLogger(__name__)
@ -235,7 +235,7 @@ class Resolver:
# these results can include those where `signature_is_valid` is False. if they are skipped,
# page indexing becomes tricky, as the number of results isn't known until after having
# processed them.
# TODO: fix ^ in lbryschema
# TODO: fix ^ in lbrynet.schema
async def iter_validate_channel_claims():
formatted_claims = []

View file

@ -2,12 +2,12 @@ import struct
from binascii import hexlify, unhexlify
from typing import List, Iterable, Optional
from lbryschema.decode import smart_decode
from lbrynet.schema.decode import smart_decode
from .account import Account
from torba.client.basetransaction import BaseTransaction, BaseInput, BaseOutput
from torba.client.hash import hash160
from lbryschema.claim import ClaimDict
from lbrynet.schema.claim import ClaimDict
from .script import InputScript, OutputScript

View file

@ -10,8 +10,8 @@ from twisted.internet.utils import runWithWarningsSuppressed as originalRunWith
from torba.testcase import IntegrationTestCase as BaseIntegrationTestCase
import lbryschema
lbryschema.BLOCKCHAIN_NAME = 'lbrycrd_regtest'
import lbrynet.schema
lbrynet.schema.BLOCKCHAIN_NAME = 'lbrycrd_regtest'
from lbrynet import conf as lbry_conf
from lbrynet.dht.node import Node

View file

@ -2,13 +2,13 @@ import logging
import asyncio
from torba.testcase import IntegrationTestCase
from lbryschema.claim import ClaimDict
from lbrynet.schema.claim import ClaimDict
from lbrynet.wallet.transaction import Transaction
from lbrynet.wallet.account import generate_certificate
from lbrynet.wallet.dewies import dewies_to_lbc as d2l, lbc_to_dewies as l2d
import lbryschema
lbryschema.BLOCKCHAIN_NAME = 'lbrycrd_regtest'
import lbrynet.schema
lbrynet.schema.BLOCKCHAIN_NAME = 'lbrycrd_regtest'
example_claim_dict = {

View file

@ -13,7 +13,7 @@ from lbrynet.core.Error import InsufficientFundsError
#from lbrynet.core.Wallet import LBRYumWallet, ReservedPoints
#from lbryum.commands import Commands
#from lbryum.simple_config import SimpleConfig
from lbryschema.claim import ClaimDict
from lbrynet.schema.claim import ClaimDict
test_metadata = {
'license': 'NASA',

View file

@ -8,7 +8,7 @@ from twisted.trial import unittest
from faker import Faker
from lbryschema.decode import smart_decode
from lbrynet.schema.decode import smart_decode
from lbrynet import conf
from lbrynet.database.storage import SQLiteStorage
from lbrynet.daemon.ComponentManager import ComponentManager

View file

@ -1,4 +1,4 @@
from lbryschema.fee import Fee
from lbrynet.schema.fee import Fee
from lbrynet.daemon import ExchangeRateManager
from lbrynet.core.Error import InvalidExchangeRateResponse
from twisted.trial import unittest

View file

@ -6,22 +6,22 @@ import binascii
from copy import deepcopy
import unittest
from test_data import example_003, example_010, example_010_serialized
from test_data import claim_id_1, claim_address_1, claim_address_2
from test_data import binary_claim, expected_binary_claim_decoded
from test_data import nist256p_private_key, claim_010_signed_nist256p, nist256p_cert
from test_data import nist384p_private_key, claim_010_signed_nist384p, nist384p_cert
from test_data import secp256k1_private_key, claim_010_signed_secp256k1, secp256k1_cert
from test_data import hex_encoded_003, decoded_hex_encoded_003, malformed_secp256k1_cert
import lbryschema
from lbryschema.claim import ClaimDict
from lbryschema.schema import NIST256p, NIST384p, SECP256k1
from lbryschema.legacy.migrate import migrate
from lbryschema.signer import get_signer
from lbryschema.uri import URI, URIParseError
from lbryschema.decode import smart_decode
from lbryschema.error import DecodeError, InvalidAddress
from lbryschema.address import decode_address, encode_address
from .test_data import example_003, example_010, example_010_serialized
from .test_data import claim_id_1, claim_address_1, claim_address_2
from .test_data import binary_claim, expected_binary_claim_decoded
from .test_data import nist256p_private_key, claim_010_signed_nist256p, nist256p_cert
from .test_data import nist384p_private_key, claim_010_signed_nist384p, nist384p_cert
from .test_data import secp256k1_private_key, claim_010_signed_secp256k1, secp256k1_cert
from .test_data import hex_encoded_003, decoded_hex_encoded_003, malformed_secp256k1_cert
from lbrynet import schema
from lbrynet.schema.claim import ClaimDict
from lbrynet.schema.schema import NIST256p, NIST384p, SECP256k1
from lbrynet.schema.legacy.migrate import migrate
from lbrynet.schema.signer import get_signer
from lbrynet.schema.uri import URI, URIParseError
from lbrynet.schema.decode import smart_decode
from lbrynet.schema.error import DecodeError, InvalidAddress
from lbrynet.schema.address import decode_address, encode_address
parsed_uri_matches = [
@ -372,10 +372,10 @@ class TestMainnetAddressValidation(UnitTest):
class TestRegtestAddressValidation(UnitTest):
def setUp(self):
lbryschema.BLOCKCHAIN_NAME = "lbrycrd_regtest"
schema.BLOCKCHAIN_NAME = "lbrycrd_regtest"
def tearDown(self):
lbryschema.BLOCKCHAIN_NAME = "lbrycrd_main"
schema.BLOCKCHAIN_NAME = "lbrycrd_main"
def test_regtest_address_encode_decode(self):
valid_addr_hex = "6fcdac187757dbf05500f613ada6fdd953d59b9acbf3c9343f"

View file

@ -2,7 +2,7 @@ import unittest
from binascii import hexlify, unhexlify
from lbrynet.wallet.claim_proofs import get_hash_for_outpoint, verify_proof
from lbryschema.hashing import double_sha256
from lbrynet.schema.hashing import double_sha256
class ClaimProofsTestCase(unittest.TestCase):