├── .circleci └── config.yml ├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── LICENSE ├── README.md ├── accounts ├── accounts.go ├── errors.go ├── hd.go ├── keystore │ ├── account_cache.go │ ├── account_cache_test.go │ ├── file_cache.go │ ├── key.go │ ├── keystore.go │ ├── keystore_passphrase.go │ ├── keystore_passphrase_test.go │ ├── keystore_wallet.go │ ├── presale.go │ └── testdata │ │ ├── .DS_Store │ │ ├── keystore │ │ ├── UTC--2016-03-22T12-57-55.920751759Z--7ef5a6135f1fd6a02593eedc869c6d41d934aef8 │ │ ├── aaa │ │ └── zzz │ │ └── very-light-scrypt.json ├── manager.go └── url.go ├── cmd └── paradigm │ └── main.go ├── common ├── big.go ├── bytes.go ├── common.go ├── crypto │ ├── crypto.go │ ├── hash.go │ ├── randentropy │ │ └── rand_entropy.go │ ├── sha3 │ │ ├── hashes.go │ │ ├── keccakf.go │ │ ├── sha3.go │ │ └── xor_unaligned.go │ ├── signature.go │ └── utils.go ├── event │ ├── feed.go │ └── subscription.go ├── file │ ├── chown.go │ └── chown_linux.go ├── hexutil │ ├── hexutil.go │ ├── hexutil_test.go │ ├── json.go │ ├── json_example_test.go │ └── json_test.go ├── inventory.go ├── log │ ├── logger.go │ ├── logger_test.go │ └── rotate.go ├── lru.go ├── math │ └── big.go ├── rlp │ ├── decode.go │ ├── decode_tail_test.go │ ├── decode_test.go │ ├── encode.go │ ├── encode_test.go │ ├── encoder_example_test.go │ ├── raw.go │ ├── raw_test.go │ └── typecache.go ├── rolling_index.go ├── rolling_index_map.go ├── safeMath.go ├── serialization │ ├── serialize.go │ └── serialize_test.go ├── size.go ├── timer │ └── control_timer.go ├── types.go ├── uint256.go ├── zero_copy_sink.go └── zero_copy_source.go ├── config └── config.go ├── core ├── accretion │ └── accretion.go ├── core.go ├── node.go ├── node_state.go └── sequentia │ ├── peer_selector.go │ ├── sequentia.go │ └── sorter.go ├── docker ├── makefile └── paradigm │ └── Dockerfile ├── errors ├── callstack.go ├── errcode.go ├── errors.go └── onterror.go ├── glide.lock ├── glide.yaml ├── makefile ├── network ├── actor │ ├── actor.go │ ├── behaviorstack.go │ ├── child_restart_stats.go │ ├── context.go │ ├── deadletter.go │ ├── directive.go │ ├── directive_string.go │ ├── eventstream │ │ └── eventstream.go │ ├── future.go │ ├── guardian.go │ ├── internal │ │ └── queue │ │ │ ├── goring │ │ │ ├── queue.go │ │ │ └── queue_test.go │ │ │ └── mpsc │ │ │ ├── mpsc.go │ │ │ └── mpsc_test.go │ ├── local_context.go │ ├── local_process.go │ ├── log.go │ ├── log │ │ ├── encoder.go │ │ ├── event.go │ │ ├── field.go │ │ ├── log.go │ │ ├── log_test.go │ │ ├── options.go │ │ ├── stream.go │ │ └── string_encoder.go │ ├── mailbox.go │ ├── mailbox │ │ ├── bounded.go │ │ ├── dispatcher.go │ │ ├── doc.go │ │ ├── log.go │ │ ├── mailbox.go │ │ ├── messages.go │ │ ├── queue.go │ │ ├── unbounded.go │ │ └── unbounded_lock_free.go │ ├── message_envelope.go │ ├── message_producer.go │ ├── messages.go │ ├── middleware_chain.go │ ├── op.go │ ├── options.go │ ├── pid.go │ ├── pid_test.go │ ├── pidset.go │ ├── process.go │ ├── process_registry.go │ ├── props.go │ ├── protos.pb.go │ ├── protos.proto │ ├── root_supervisor.go │ ├── spawn.go │ ├── strategy_all_for_one.go │ ├── strategy_exponential_backoff.go │ ├── strategy_one_for_one.go │ ├── strategy_restarting.go │ ├── supervision.go │ └── supervision_event.go ├── http │ ├── base │ │ └── rpc │ │ │ └── rpc.go │ ├── error │ │ └── error.go │ ├── jsonrpc │ │ └── rpc_server.go │ └── service │ │ └── service.go ├── peer │ └── peer.go ├── tcp │ ├── net_transport.go │ └── tcp_stream_layer.go └── transport.go ├── p2pserver ├── actor │ ├── req │ │ ├── consensus.go │ │ └── txnpool.go │ └── server │ │ ├── actor.go │ │ └── common.go ├── block_sync.go ├── common │ ├── checksum.go │ ├── checksum_test.go │ └── p2p_common.go ├── link │ └── link.go ├── message │ ├── msg_pack │ │ └── msg_pack.go │ ├── types │ │ ├── address.go │ │ ├── address_req.go │ │ ├── address_req_test.go │ │ ├── address_test.go │ │ ├── block.go │ │ ├── block_header.go │ │ ├── block_headers_req.go │ │ ├── block_headers_req_test.go │ │ ├── blocks_req.go │ │ ├── blocks_req_test.go │ │ ├── consensus.go │ │ ├── consensus_payload.go │ │ ├── data_req.go │ │ ├── data_req_test.go │ │ ├── disconnected.go │ │ ├── inventory.go │ │ ├── message.go │ │ ├── message_test.go │ │ ├── notfound.go │ │ ├── notfound_test.go │ │ ├── ping.go │ │ ├── ping_test.go │ │ ├── pong.go │ │ ├── pong_test.go │ │ ├── transaction.go │ │ ├── verack.go │ │ ├── verack_test.go │ │ └── version.go │ └── utils │ │ ├── msg_handler.go │ │ └── msg_router.go ├── net │ ├── netserver │ │ ├── net_utils.go │ │ └── netserver.go │ └── protocol │ │ └── server.go ├── p2pserver.go ├── p2pserver_test.go └── peer │ ├── nbr_peers.go │ └── peer.go ├── proxy ├── account_map.go ├── errors.go ├── gaspool.go ├── inmem_proxy.go ├── mem_pool.go ├── proxy_handlers.go ├── proxy_processor.go ├── proxy_service.go ├── proxy_state.go ├── proxy_was_state.go └── tx_message.go ├── state ├── database.go ├── journal.go ├── managed_state.go ├── state_object.go └── statedb.go ├── storage ├── badger_store.go ├── caches.go ├── memory_store.go └── store.go ├── trie ├── encoding.go ├── errors.go ├── hasher.go ├── iterator.go ├── node.go ├── secure_trie.go └── trie.go ├── types ├── block.go ├── bloom9.go ├── comet.go ├── comet_test.go ├── frame.go ├── gen_tx_json.go ├── log.go ├── receipt.go ├── root.go ├── round_info.go ├── signer.go └── transaction.go ├── vendor ├── github.com │ ├── AndreasBriese │ │ └── bbloom │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── bbloom.go │ │ │ ├── bbloom_test.go │ │ │ └── sipHash.go │ ├── dgraph-io │ │ └── badger │ │ │ ├── .travis.yml │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── appveyor.yml │ │ │ ├── backup.go │ │ │ ├── backup_test.go │ │ │ ├── badger │ │ │ ├── .gitignore │ │ │ ├── cmd │ │ │ │ ├── backup.go │ │ │ │ ├── info.go │ │ │ │ ├── restore.go │ │ │ │ └── root.go │ │ │ └── main.go │ │ │ ├── compaction.go │ │ │ ├── contrib │ │ │ └── cover.sh │ │ │ ├── db.go │ │ │ ├── db_test.go │ │ │ ├── dir_unix.go │ │ │ ├── dir_windows.go │ │ │ ├── doc.go │ │ │ ├── errors.go │ │ │ ├── images │ │ │ ├── benchmarks-rocksdb.png │ │ │ ├── diggy-shadow.png │ │ │ └── sketch.jpg │ │ │ ├── integration │ │ │ └── testgc │ │ │ │ ├── .gitignore │ │ │ │ └── main.go │ │ │ ├── iterator.go │ │ │ ├── level_handler.go │ │ │ ├── levels.go │ │ │ ├── managed_db.go │ │ │ ├── managed_db_test.go │ │ │ ├── manifest.go │ │ │ ├── manifest_test.go │ │ │ ├── options.go │ │ │ ├── options │ │ │ └── options.go │ │ │ ├── protos │ │ │ ├── backup.pb.go │ │ │ ├── backup.proto │ │ │ ├── gen.sh │ │ │ ├── manifest.pb.go │ │ │ └── manifest.proto │ │ │ ├── skl │ │ │ ├── README.md │ │ │ ├── arena.go │ │ │ ├── skl.go │ │ │ └── skl_test.go │ │ │ ├── structs.go │ │ │ ├── table │ │ │ ├── README.md │ │ │ ├── builder.go │ │ │ ├── iterator.go │ │ │ ├── table.go │ │ │ └── table_test.go │ │ │ ├── test.sh │ │ │ ├── transaction.go │ │ │ ├── transaction_test.go │ │ │ ├── util.go │ │ │ ├── value.go │ │ │ ├── value_test.go │ │ │ └── y │ │ │ ├── error.go │ │ │ ├── file_dsync.go │ │ │ ├── file_nodsync.go │ │ │ ├── iterator.go │ │ │ ├── iterator_test.go │ │ │ ├── metrics.go │ │ │ ├── mmap_unix.go │ │ │ ├── mmap_windows.go │ │ │ ├── watermark.go │ │ │ └── y.go │ ├── dgryski │ │ └── go-farm │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── VERSION │ │ │ ├── basics.go │ │ │ ├── bench_test.go │ │ │ ├── farmhash_test.go │ │ │ ├── farmhashcc.go │ │ │ ├── farmhashmk.go │ │ │ ├── farmhashna.go │ │ │ ├── farmhashuo.go │ │ │ └── platform.go │ ├── golang │ │ └── protobuf │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── AUTHORS │ │ │ ├── CONTRIBUTORS │ │ │ ├── LICENSE │ │ │ ├── Make.protobuf │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── _conformance │ │ │ ├── Makefile │ │ │ ├── conformance.go │ │ │ └── conformance_proto │ │ │ │ ├── conformance.pb.go │ │ │ │ └── conformance.proto │ │ │ ├── descriptor │ │ │ ├── descriptor.go │ │ │ └── descriptor_test.go │ │ │ ├── jsonpb │ │ │ ├── jsonpb.go │ │ │ ├── jsonpb_test.go │ │ │ └── jsonpb_test_proto │ │ │ │ ├── Makefile │ │ │ │ ├── more_test_objects.pb.go │ │ │ │ ├── more_test_objects.proto │ │ │ │ ├── test_objects.pb.go │ │ │ │ └── test_objects.proto │ │ │ ├── proto │ │ │ ├── Makefile │ │ │ ├── all_test.go │ │ │ ├── any_test.go │ │ │ ├── clone.go │ │ │ ├── clone_test.go │ │ │ ├── decode.go │ │ │ ├── decode_test.go │ │ │ ├── encode.go │ │ │ ├── encode_test.go │ │ │ ├── equal.go │ │ │ ├── equal_test.go │ │ │ ├── extensions.go │ │ │ ├── extensions_test.go │ │ │ ├── lib.go │ │ │ ├── map_test.go │ │ │ ├── message_set.go │ │ │ ├── message_set_test.go │ │ │ ├── pointer_reflect.go │ │ │ ├── pointer_unsafe.go │ │ │ ├── properties.go │ │ │ ├── proto3_proto │ │ │ │ ├── proto3.pb.go │ │ │ │ └── proto3.proto │ │ │ ├── proto3_test.go │ │ │ ├── size2_test.go │ │ │ ├── size_test.go │ │ │ ├── testdata │ │ │ │ ├── Makefile │ │ │ │ ├── golden_test.go │ │ │ │ ├── test.pb.go │ │ │ │ └── test.proto │ │ │ ├── text.go │ │ │ ├── text_parser.go │ │ │ ├── text_parser_test.go │ │ │ └── text_test.go │ │ │ ├── protoc-gen-go │ │ │ ├── Makefile │ │ │ ├── descriptor │ │ │ │ ├── Makefile │ │ │ │ ├── descriptor.pb.go │ │ │ │ └── descriptor.proto │ │ │ ├── doc.go │ │ │ ├── generator │ │ │ │ ├── Makefile │ │ │ │ ├── generator.go │ │ │ │ └── name_test.go │ │ │ ├── grpc │ │ │ │ └── grpc.go │ │ │ ├── link_grpc.go │ │ │ ├── main.go │ │ │ ├── plugin │ │ │ │ ├── Makefile │ │ │ │ ├── plugin.pb.go │ │ │ │ ├── plugin.pb.golden │ │ │ │ └── plugin.proto │ │ │ └── testdata │ │ │ │ ├── Makefile │ │ │ │ ├── extension_base.proto │ │ │ │ ├── extension_extra.proto │ │ │ │ ├── extension_test.go │ │ │ │ ├── extension_user.proto │ │ │ │ ├── grpc.proto │ │ │ │ ├── imp.pb.go.golden │ │ │ │ ├── imp.proto │ │ │ │ ├── imp2.proto │ │ │ │ ├── imp3.proto │ │ │ │ ├── main_test.go │ │ │ │ ├── multi │ │ │ │ ├── multi1.proto │ │ │ │ ├── multi2.proto │ │ │ │ └── multi3.proto │ │ │ │ ├── my_test │ │ │ │ ├── test.pb.go │ │ │ │ ├── test.pb.go.golden │ │ │ │ └── test.proto │ │ │ │ └── proto3.proto │ │ │ └── ptypes │ │ │ ├── any.go │ │ │ ├── any │ │ │ ├── any.pb.go │ │ │ └── any.proto │ │ │ ├── any_test.go │ │ │ ├── doc.go │ │ │ ├── duration.go │ │ │ ├── duration │ │ │ ├── duration.pb.go │ │ │ └── duration.proto │ │ │ ├── duration_test.go │ │ │ ├── empty │ │ │ ├── empty.pb.go │ │ │ └── empty.proto │ │ │ ├── regen.sh │ │ │ ├── struct │ │ │ ├── struct.pb.go │ │ │ └── struct.proto │ │ │ ├── timestamp.go │ │ │ ├── timestamp │ │ │ ├── timestamp.pb.go │ │ │ └── timestamp.proto │ │ │ ├── timestamp_test.go │ │ │ └── wrappers │ │ │ ├── wrappers.pb.go │ │ │ └── wrappers.proto │ ├── itchyny │ │ └── base58-go │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── base58.go │ │ │ ├── base58_test.go │ │ │ └── cmd │ │ │ └── base58 │ │ │ ├── main.go │ │ │ └── main_test.go │ ├── pkg │ │ └── errors │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── appveyor.yml │ │ │ ├── bench_test.go │ │ │ ├── errors.go │ │ │ ├── errors_test.go │ │ │ ├── example_test.go │ │ │ ├── format_test.go │ │ │ ├── stack.go │ │ │ └── stack_test.go │ ├── rs │ │ └── zerolog │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── array.go │ │ │ ├── array_test.go │ │ │ ├── benchmark_test.go │ │ │ ├── binary_test.go │ │ │ ├── console.go │ │ │ ├── console_test.go │ │ │ ├── context.go │ │ │ ├── ctx.go │ │ │ ├── ctx_test.go │ │ │ ├── diode │ │ │ ├── diode.go │ │ │ ├── diode_example_test.go │ │ │ ├── diode_test.go │ │ │ └── internal │ │ │ │ └── diodes │ │ │ │ ├── README │ │ │ │ ├── many_to_one.go │ │ │ │ ├── one_to_one.go │ │ │ │ ├── poller.go │ │ │ │ └── waiter.go │ │ │ ├── encoder.go │ │ │ ├── encoder_cbor.go │ │ │ ├── encoder_json.go │ │ │ ├── event.go │ │ │ ├── fields.go │ │ │ ├── globals.go │ │ │ ├── go.mod │ │ │ ├── hlog │ │ │ ├── hlog.go │ │ │ ├── hlog_example_test.go │ │ │ └── hlog_test.go │ │ │ ├── hook.go │ │ │ ├── hook_test.go │ │ │ ├── internal │ │ │ ├── cbor │ │ │ │ ├── README.md │ │ │ │ ├── base.go │ │ │ │ ├── cbor.go │ │ │ │ ├── decode_stream.go │ │ │ │ ├── decoder_test.go │ │ │ │ ├── examples │ │ │ │ │ ├── genLog.go │ │ │ │ │ └── makefile │ │ │ │ ├── string.go │ │ │ │ ├── string_test.go │ │ │ │ ├── time.go │ │ │ │ ├── time_test.go │ │ │ │ ├── types.go │ │ │ │ └── types_test.go │ │ │ └── json │ │ │ │ ├── base.go │ │ │ │ ├── bytes.go │ │ │ │ ├── bytes_test.go │ │ │ │ ├── string.go │ │ │ │ ├── string_test.go │ │ │ │ ├── time.go │ │ │ │ ├── types.go │ │ │ │ └── types_test.go │ │ │ ├── journald │ │ │ ├── journald.go │ │ │ └── journald_test.go │ │ │ ├── log.go │ │ │ ├── log │ │ │ ├── log.go │ │ │ └── log_example_test.go │ │ │ ├── log_example_test.go │ │ │ ├── log_test.go │ │ │ ├── pretty.png │ │ │ ├── sampler.go │ │ │ ├── sampler_test.go │ │ │ ├── syslog.go │ │ │ ├── syslog_test.go │ │ │ ├── writer.go │ │ │ └── writer_test.go │ └── stretchr │ │ └── testify │ │ ├── .gitignore │ │ ├── .travis.gofmt.sh │ │ ├── .travis.gogenerate.sh │ │ ├── .travis.govet.sh │ │ ├── .travis.yml │ │ ├── Godeps │ │ ├── Godeps.json │ │ └── Readme │ │ ├── LICENCE.txt │ │ ├── LICENSE │ │ ├── README.md │ │ ├── _codegen │ │ └── main.go │ │ ├── assert │ │ ├── assertion_format.go │ │ ├── assertion_format.go.tmpl │ │ ├── assertion_forward.go │ │ ├── assertion_forward.go.tmpl │ │ ├── assertions.go │ │ ├── assertions_test.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── forward_assertions.go │ │ ├── forward_assertions_test.go │ │ ├── http_assertions.go │ │ └── http_assertions_test.go │ │ ├── doc.go │ │ ├── http │ │ ├── doc.go │ │ ├── test_response_writer.go │ │ └── test_round_tripper.go │ │ ├── mock │ │ ├── doc.go │ │ ├── mock.go │ │ └── mock_test.go │ │ ├── package_test.go │ │ ├── require │ │ ├── doc.go │ │ ├── forward_requirements.go │ │ ├── forward_requirements_test.go │ │ ├── require.go │ │ ├── require.go.tmpl │ │ ├── require_forward.go │ │ ├── require_forward.go.tmpl │ │ ├── requirements.go │ │ └── requirements_test.go │ │ ├── suite │ │ ├── doc.go │ │ ├── interfaces.go │ │ ├── suite.go │ │ └── suite_test.go │ │ └── vendor │ │ └── github.com │ │ ├── davecgh │ │ └── go-spew │ │ │ ├── LICENSE │ │ │ └── spew │ │ │ ├── bypass.go │ │ │ ├── bypasssafe.go │ │ │ ├── common.go │ │ │ ├── config.go │ │ │ ├── doc.go │ │ │ ├── dump.go │ │ │ ├── format.go │ │ │ └── spew.go │ │ ├── pmezard │ │ └── go-difflib │ │ │ ├── LICENSE │ │ │ └── difflib │ │ │ └── difflib.go │ │ └── stretchr │ │ └── objx │ │ ├── .gitignore │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── accessors.go │ │ ├── codegen │ │ ├── array-access.txt │ │ ├── index.html │ │ ├── template.txt │ │ └── types_list.txt │ │ ├── constants.go │ │ ├── conversions.go │ │ ├── doc.go │ │ ├── map.go │ │ ├── mutations.go │ │ ├── security.go │ │ ├── tests.go │ │ ├── type_specific_codegen.go │ │ └── value.go ├── golang.org │ └── x │ │ ├── net │ │ ├── .gitattributes │ │ ├── .gitignore │ │ ├── AUTHORS │ │ ├── CONTRIBUTING.md │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── README.md │ │ ├── bpf │ │ │ ├── asm.go │ │ │ ├── constants.go │ │ │ ├── doc.go │ │ │ ├── instructions.go │ │ │ ├── instructions_test.go │ │ │ ├── setter.go │ │ │ ├── testdata │ │ │ │ ├── all_instructions.bpf │ │ │ │ └── all_instructions.txt │ │ │ ├── vm.go │ │ │ ├── vm_aluop_test.go │ │ │ ├── vm_bpf_test.go │ │ │ ├── vm_extension_test.go │ │ │ ├── vm_instructions.go │ │ │ ├── vm_jump_test.go │ │ │ ├── vm_load_test.go │ │ │ ├── vm_ret_test.go │ │ │ ├── vm_scratch_test.go │ │ │ └── vm_test.go │ │ ├── codereview.cfg │ │ ├── context │ │ │ ├── context.go │ │ │ ├── context_test.go │ │ │ ├── ctxhttp │ │ │ │ ├── ctxhttp.go │ │ │ │ ├── ctxhttp_17_test.go │ │ │ │ ├── ctxhttp_pre17.go │ │ │ │ ├── ctxhttp_pre17_test.go │ │ │ │ └── ctxhttp_test.go │ │ │ ├── go17.go │ │ │ ├── go19.go │ │ │ ├── pre_go17.go │ │ │ ├── pre_go19.go │ │ │ └── withtimeout_test.go │ │ ├── dict │ │ │ └── dict.go │ │ ├── dns │ │ │ └── dnsmessage │ │ │ │ ├── example_test.go │ │ │ │ ├── message.go │ │ │ │ └── message_test.go │ │ ├── html │ │ │ ├── atom │ │ │ │ ├── atom.go │ │ │ │ ├── atom_test.go │ │ │ │ ├── gen.go │ │ │ │ ├── table.go │ │ │ │ └── table_test.go │ │ │ ├── charset │ │ │ │ ├── charset.go │ │ │ │ ├── charset_test.go │ │ │ │ └── testdata │ │ │ │ │ ├── HTTP-charset.html │ │ │ │ │ ├── HTTP-vs-UTF-8-BOM.html │ │ │ │ │ ├── HTTP-vs-meta-charset.html │ │ │ │ │ ├── HTTP-vs-meta-content.html │ │ │ │ │ ├── No-encoding-declaration.html │ │ │ │ │ ├── README │ │ │ │ │ ├── UTF-16BE-BOM.html │ │ │ │ │ ├── UTF-16LE-BOM.html │ │ │ │ │ ├── UTF-8-BOM-vs-meta-charset.html │ │ │ │ │ ├── UTF-8-BOM-vs-meta-content.html │ │ │ │ │ ├── meta-charset-attribute.html │ │ │ │ │ └── meta-content-attribute.html │ │ │ ├── const.go │ │ │ ├── doc.go │ │ │ ├── doctype.go │ │ │ ├── entity.go │ │ │ ├── entity_test.go │ │ │ ├── escape.go │ │ │ ├── escape_test.go │ │ │ ├── example_test.go │ │ │ ├── foreign.go │ │ │ ├── node.go │ │ │ ├── node_test.go │ │ │ ├── parse.go │ │ │ ├── parse_test.go │ │ │ ├── render.go │ │ │ ├── render_test.go │ │ │ ├── testdata │ │ │ │ ├── go1.html │ │ │ │ └── webkit │ │ │ │ │ ├── README │ │ │ │ │ ├── adoption01.dat │ │ │ │ │ ├── adoption02.dat │ │ │ │ │ ├── comments01.dat │ │ │ │ │ ├── doctype01.dat │ │ │ │ │ ├── entities01.dat │ │ │ │ │ ├── entities02.dat │ │ │ │ │ ├── html5test-com.dat │ │ │ │ │ ├── inbody01.dat │ │ │ │ │ ├── isindex.dat │ │ │ │ │ ├── pending-spec-changes-plain-text-unsafe.dat │ │ │ │ │ ├── pending-spec-changes.dat │ │ │ │ │ ├── plain-text-unsafe.dat │ │ │ │ │ ├── scriptdata01.dat │ │ │ │ │ ├── scripted │ │ │ │ │ ├── adoption01.dat │ │ │ │ │ └── webkit01.dat │ │ │ │ │ ├── tables01.dat │ │ │ │ │ ├── tests1.dat │ │ │ │ │ ├── tests10.dat │ │ │ │ │ ├── tests11.dat │ │ │ │ │ ├── tests12.dat │ │ │ │ │ ├── tests14.dat │ │ │ │ │ ├── tests15.dat │ │ │ │ │ ├── tests16.dat │ │ │ │ │ ├── tests17.dat │ │ │ │ │ ├── tests18.dat │ │ │ │ │ ├── tests19.dat │ │ │ │ │ ├── tests2.dat │ │ │ │ │ ├── tests20.dat │ │ │ │ │ ├── tests21.dat │ │ │ │ │ ├── tests22.dat │ │ │ │ │ ├── tests23.dat │ │ │ │ │ ├── tests24.dat │ │ │ │ │ ├── tests25.dat │ │ │ │ │ ├── tests26.dat │ │ │ │ │ ├── tests3.dat │ │ │ │ │ ├── tests4.dat │ │ │ │ │ ├── tests5.dat │ │ │ │ │ ├── tests6.dat │ │ │ │ │ ├── tests7.dat │ │ │ │ │ ├── tests8.dat │ │ │ │ │ ├── tests9.dat │ │ │ │ │ ├── tests_innerHTML_1.dat │ │ │ │ │ ├── tricky01.dat │ │ │ │ │ ├── webkit01.dat │ │ │ │ │ └── webkit02.dat │ │ │ ├── token.go │ │ │ └── token_test.go │ │ ├── http2 │ │ │ ├── .gitignore │ │ │ ├── Dockerfile │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── ciphers.go │ │ │ ├── ciphers_test.go │ │ │ ├── client_conn_pool.go │ │ │ ├── configure_transport.go │ │ │ ├── databuffer.go │ │ │ ├── databuffer_test.go │ │ │ ├── errors.go │ │ │ ├── errors_test.go │ │ │ ├── flow.go │ │ │ ├── flow_test.go │ │ │ ├── frame.go │ │ │ ├── frame_test.go │ │ │ ├── go16.go │ │ │ ├── go17.go │ │ │ ├── go17_not18.go │ │ │ ├── go18.go │ │ │ ├── go18_test.go │ │ │ ├── go19.go │ │ │ ├── go19_test.go │ │ │ ├── gotrack.go │ │ │ ├── gotrack_test.go │ │ │ ├── h2demo │ │ │ │ ├── .gitignore │ │ │ │ ├── Makefile │ │ │ │ ├── README │ │ │ │ ├── h2demo.go │ │ │ │ ├── launch.go │ │ │ │ ├── rootCA.key │ │ │ │ ├── rootCA.pem │ │ │ │ ├── rootCA.srl │ │ │ │ ├── server.crt │ │ │ │ ├── server.key │ │ │ │ └── tmpl.go │ │ │ ├── h2i │ │ │ │ ├── README.md │ │ │ │ └── h2i.go │ │ │ ├── headermap.go │ │ │ ├── hpack │ │ │ │ ├── encode.go │ │ │ │ ├── encode_test.go │ │ │ │ ├── hpack.go │ │ │ │ ├── hpack_test.go │ │ │ │ ├── huffman.go │ │ │ │ ├── tables.go │ │ │ │ └── tables_test.go │ │ │ ├── http2.go │ │ │ ├── http2_test.go │ │ │ ├── not_go16.go │ │ │ ├── not_go17.go │ │ │ ├── not_go18.go │ │ │ ├── not_go19.go │ │ │ ├── pipe.go │ │ │ ├── pipe_test.go │ │ │ ├── server.go │ │ │ ├── server_push_test.go │ │ │ ├── server_test.go │ │ │ ├── testdata │ │ │ │ └── draft-ietf-httpbis-http2.xml │ │ │ ├── transport.go │ │ │ ├── transport_test.go │ │ │ ├── write.go │ │ │ ├── writesched.go │ │ │ ├── writesched_priority.go │ │ │ ├── writesched_priority_test.go │ │ │ ├── writesched_random.go │ │ │ ├── writesched_random_test.go │ │ │ ├── writesched_test.go │ │ │ └── z_spec_test.go │ │ ├── icmp │ │ │ ├── dstunreach.go │ │ │ ├── echo.go │ │ │ ├── endpoint.go │ │ │ ├── example_test.go │ │ │ ├── extension.go │ │ │ ├── extension_test.go │ │ │ ├── helper_posix.go │ │ │ ├── interface.go │ │ │ ├── ipv4.go │ │ │ ├── ipv4_test.go │ │ │ ├── ipv6.go │ │ │ ├── listen_posix.go │ │ │ ├── listen_stub.go │ │ │ ├── message.go │ │ │ ├── message_test.go │ │ │ ├── messagebody.go │ │ │ ├── mpls.go │ │ │ ├── multipart.go │ │ │ ├── multipart_test.go │ │ │ ├── packettoobig.go │ │ │ ├── paramprob.go │ │ │ ├── ping_test.go │ │ │ ├── sys_freebsd.go │ │ │ └── timeexceeded.go │ │ ├── idna │ │ │ ├── example_test.go │ │ │ ├── idna.go │ │ │ ├── idna_test.go │ │ │ ├── punycode.go │ │ │ ├── punycode_test.go │ │ │ ├── tables.go │ │ │ ├── trie.go │ │ │ └── trieval.go │ │ ├── internal │ │ │ ├── iana │ │ │ │ ├── const.go │ │ │ │ └── gen.go │ │ │ ├── nettest │ │ │ │ ├── helper_bsd.go │ │ │ │ ├── helper_nobsd.go │ │ │ │ ├── helper_posix.go │ │ │ │ ├── helper_stub.go │ │ │ │ ├── helper_unix.go │ │ │ │ ├── helper_windows.go │ │ │ │ ├── interface.go │ │ │ │ ├── rlimit.go │ │ │ │ └── stack.go │ │ │ ├── socket │ │ │ │ ├── cmsghdr.go │ │ │ │ ├── cmsghdr_bsd.go │ │ │ │ ├── cmsghdr_linux_32bit.go │ │ │ │ ├── cmsghdr_linux_64bit.go │ │ │ │ ├── cmsghdr_solaris_64bit.go │ │ │ │ ├── cmsghdr_stub.go │ │ │ │ ├── defs_darwin.go │ │ │ │ ├── defs_dragonfly.go │ │ │ │ ├── defs_freebsd.go │ │ │ │ ├── defs_linux.go │ │ │ │ ├── defs_netbsd.go │ │ │ │ ├── defs_openbsd.go │ │ │ │ ├── defs_solaris.go │ │ │ │ ├── error_unix.go │ │ │ │ ├── error_windows.go │ │ │ │ ├── iovec_32bit.go │ │ │ │ ├── iovec_64bit.go │ │ │ │ ├── iovec_solaris_64bit.go │ │ │ │ ├── iovec_stub.go │ │ │ │ ├── mmsghdr_stub.go │ │ │ │ ├── mmsghdr_unix.go │ │ │ │ ├── msghdr_bsd.go │ │ │ │ ├── msghdr_bsdvar.go │ │ │ │ ├── msghdr_linux.go │ │ │ │ ├── msghdr_linux_32bit.go │ │ │ │ ├── msghdr_linux_64bit.go │ │ │ │ ├── msghdr_openbsd.go │ │ │ │ ├── msghdr_solaris_64bit.go │ │ │ │ ├── msghdr_stub.go │ │ │ │ ├── rawconn.go │ │ │ │ ├── rawconn_mmsg.go │ │ │ │ ├── rawconn_msg.go │ │ │ │ ├── rawconn_nommsg.go │ │ │ │ ├── rawconn_nomsg.go │ │ │ │ ├── rawconn_stub.go │ │ │ │ ├── reflect.go │ │ │ │ ├── socket.go │ │ │ │ ├── socket_go1_9_test.go │ │ │ │ ├── socket_test.go │ │ │ │ ├── sys.go │ │ │ │ ├── sys_bsd.go │ │ │ │ ├── sys_bsdvar.go │ │ │ │ ├── sys_darwin.go │ │ │ │ ├── sys_dragonfly.go │ │ │ │ ├── sys_linux.go │ │ │ │ ├── sys_linux_386.go │ │ │ │ ├── sys_linux_386.s │ │ │ │ ├── sys_linux_amd64.go │ │ │ │ ├── sys_linux_arm.go │ │ │ │ ├── sys_linux_arm64.go │ │ │ │ ├── sys_linux_mips.go │ │ │ │ ├── sys_linux_mips64.go │ │ │ │ ├── sys_linux_mips64le.go │ │ │ │ ├── sys_linux_mipsle.go │ │ │ │ ├── sys_linux_ppc64.go │ │ │ │ ├── sys_linux_ppc64le.go │ │ │ │ ├── sys_linux_s390x.go │ │ │ │ ├── sys_linux_s390x.s │ │ │ │ ├── sys_netbsd.go │ │ │ │ ├── sys_posix.go │ │ │ │ ├── sys_solaris.go │ │ │ │ ├── sys_solaris_amd64.s │ │ │ │ ├── sys_stub.go │ │ │ │ ├── sys_unix.go │ │ │ │ ├── sys_windows.go │ │ │ │ ├── zsys_darwin_386.go │ │ │ │ ├── zsys_darwin_amd64.go │ │ │ │ ├── zsys_darwin_arm.go │ │ │ │ ├── zsys_dragonfly_amd64.go │ │ │ │ ├── zsys_freebsd_386.go │ │ │ │ ├── zsys_freebsd_amd64.go │ │ │ │ ├── zsys_freebsd_arm.go │ │ │ │ ├── zsys_linux_386.go │ │ │ │ ├── zsys_linux_amd64.go │ │ │ │ ├── zsys_linux_arm.go │ │ │ │ ├── zsys_linux_arm64.go │ │ │ │ ├── zsys_linux_mips.go │ │ │ │ ├── zsys_linux_mips64.go │ │ │ │ ├── zsys_linux_mips64le.go │ │ │ │ ├── zsys_linux_mipsle.go │ │ │ │ ├── zsys_linux_ppc64.go │ │ │ │ ├── zsys_linux_ppc64le.go │ │ │ │ ├── zsys_linux_s390x.go │ │ │ │ ├── zsys_netbsd_386.go │ │ │ │ ├── zsys_netbsd_amd64.go │ │ │ │ ├── zsys_netbsd_arm.go │ │ │ │ ├── zsys_openbsd_386.go │ │ │ │ ├── zsys_openbsd_amd64.go │ │ │ │ ├── zsys_openbsd_arm.go │ │ │ │ └── zsys_solaris_amd64.go │ │ │ └── timeseries │ │ │ │ ├── timeseries.go │ │ │ │ └── timeseries_test.go │ │ ├── ipv4 │ │ │ ├── batch.go │ │ │ ├── bpf_test.go │ │ │ ├── control.go │ │ │ ├── control_bsd.go │ │ │ ├── control_pktinfo.go │ │ │ ├── control_stub.go │ │ │ ├── control_test.go │ │ │ ├── control_unix.go │ │ │ ├── control_windows.go │ │ │ ├── defs_darwin.go │ │ │ ├── defs_dragonfly.go │ │ │ ├── defs_freebsd.go │ │ │ ├── defs_linux.go │ │ │ ├── defs_netbsd.go │ │ │ ├── defs_openbsd.go │ │ │ ├── defs_solaris.go │ │ │ ├── dgramopt.go │ │ │ ├── doc.go │ │ │ ├── endpoint.go │ │ │ ├── example_test.go │ │ │ ├── gen.go │ │ │ ├── genericopt.go │ │ │ ├── header.go │ │ │ ├── header_test.go │ │ │ ├── helper.go │ │ │ ├── iana.go │ │ │ ├── icmp.go │ │ │ ├── icmp_linux.go │ │ │ ├── icmp_stub.go │ │ │ ├── icmp_test.go │ │ │ ├── multicast_test.go │ │ │ ├── multicastlistener_test.go │ │ │ ├── multicastsockopt_test.go │ │ │ ├── packet.go │ │ │ ├── packet_go1_8.go │ │ │ ├── packet_go1_9.go │ │ │ ├── payload.go │ │ │ ├── payload_cmsg.go │ │ │ ├── payload_cmsg_go1_8.go │ │ │ ├── payload_cmsg_go1_9.go │ │ │ ├── payload_nocmsg.go │ │ │ ├── readwrite_go1_8_test.go │ │ │ ├── readwrite_go1_9_test.go │ │ │ ├── readwrite_test.go │ │ │ ├── sockopt.go │ │ │ ├── sockopt_posix.go │ │ │ ├── sockopt_stub.go │ │ │ ├── sys_asmreq.go │ │ │ ├── sys_asmreq_stub.go │ │ │ ├── sys_asmreqn.go │ │ │ ├── sys_asmreqn_stub.go │ │ │ ├── sys_bpf.go │ │ │ ├── sys_bpf_stub.go │ │ │ ├── sys_bsd.go │ │ │ ├── sys_darwin.go │ │ │ ├── sys_dragonfly.go │ │ │ ├── sys_freebsd.go │ │ │ ├── sys_linux.go │ │ │ ├── sys_solaris.go │ │ │ ├── sys_ssmreq.go │ │ │ ├── sys_ssmreq_stub.go │ │ │ ├── sys_stub.go │ │ │ ├── sys_windows.go │ │ │ ├── unicast_test.go │ │ │ ├── unicastsockopt_test.go │ │ │ ├── zsys_darwin.go │ │ │ ├── zsys_dragonfly.go │ │ │ ├── zsys_freebsd_386.go │ │ │ ├── zsys_freebsd_amd64.go │ │ │ ├── zsys_freebsd_arm.go │ │ │ ├── zsys_linux_386.go │ │ │ ├── zsys_linux_amd64.go │ │ │ ├── zsys_linux_arm.go │ │ │ ├── zsys_linux_arm64.go │ │ │ ├── zsys_linux_mips.go │ │ │ ├── zsys_linux_mips64.go │ │ │ ├── zsys_linux_mips64le.go │ │ │ ├── zsys_linux_mipsle.go │ │ │ ├── zsys_linux_ppc.go │ │ │ ├── zsys_linux_ppc64.go │ │ │ ├── zsys_linux_ppc64le.go │ │ │ ├── zsys_linux_s390x.go │ │ │ ├── zsys_netbsd.go │ │ │ ├── zsys_openbsd.go │ │ │ └── zsys_solaris.go │ │ ├── ipv6 │ │ │ ├── batch.go │ │ │ ├── bpf_test.go │ │ │ ├── control.go │ │ │ ├── control_rfc2292_unix.go │ │ │ ├── control_rfc3542_unix.go │ │ │ ├── control_stub.go │ │ │ ├── control_test.go │ │ │ ├── control_unix.go │ │ │ ├── control_windows.go │ │ │ ├── defs_darwin.go │ │ │ ├── defs_dragonfly.go │ │ │ ├── defs_freebsd.go │ │ │ ├── defs_linux.go │ │ │ ├── defs_netbsd.go │ │ │ ├── defs_openbsd.go │ │ │ ├── defs_solaris.go │ │ │ ├── dgramopt.go │ │ │ ├── doc.go │ │ │ ├── endpoint.go │ │ │ ├── example_test.go │ │ │ ├── gen.go │ │ │ ├── genericopt.go │ │ │ ├── header.go │ │ │ ├── header_test.go │ │ │ ├── helper.go │ │ │ ├── iana.go │ │ │ ├── icmp.go │ │ │ ├── icmp_bsd.go │ │ │ ├── icmp_linux.go │ │ │ ├── icmp_solaris.go │ │ │ ├── icmp_stub.go │ │ │ ├── icmp_test.go │ │ │ ├── icmp_windows.go │ │ │ ├── mocktransponder_test.go │ │ │ ├── multicast_test.go │ │ │ ├── multicastlistener_test.go │ │ │ ├── multicastsockopt_test.go │ │ │ ├── payload.go │ │ │ ├── payload_cmsg.go │ │ │ ├── payload_cmsg_go1_8.go │ │ │ ├── payload_cmsg_go1_9.go │ │ │ ├── payload_nocmsg.go │ │ │ ├── readwrite_go1_8_test.go │ │ │ ├── readwrite_go1_9_test.go │ │ │ ├── readwrite_test.go │ │ │ ├── sockopt.go │ │ │ ├── sockopt_posix.go │ │ │ ├── sockopt_stub.go │ │ │ ├── sockopt_test.go │ │ │ ├── sys_asmreq.go │ │ │ ├── sys_asmreq_stub.go │ │ │ ├── sys_bpf.go │ │ │ ├── sys_bpf_stub.go │ │ │ ├── sys_bsd.go │ │ │ ├── sys_darwin.go │ │ │ ├── sys_freebsd.go │ │ │ ├── sys_linux.go │ │ │ ├── sys_solaris.go │ │ │ ├── sys_ssmreq.go │ │ │ ├── sys_ssmreq_stub.go │ │ │ ├── sys_stub.go │ │ │ ├── sys_windows.go │ │ │ ├── unicast_test.go │ │ │ ├── unicastsockopt_test.go │ │ │ ├── zsys_darwin.go │ │ │ ├── zsys_dragonfly.go │ │ │ ├── zsys_freebsd_386.go │ │ │ ├── zsys_freebsd_amd64.go │ │ │ ├── zsys_freebsd_arm.go │ │ │ ├── zsys_linux_386.go │ │ │ ├── zsys_linux_amd64.go │ │ │ ├── zsys_linux_arm.go │ │ │ ├── zsys_linux_arm64.go │ │ │ ├── zsys_linux_mips.go │ │ │ ├── zsys_linux_mips64.go │ │ │ ├── zsys_linux_mips64le.go │ │ │ ├── zsys_linux_mipsle.go │ │ │ ├── zsys_linux_ppc.go │ │ │ ├── zsys_linux_ppc64.go │ │ │ ├── zsys_linux_ppc64le.go │ │ │ ├── zsys_linux_s390x.go │ │ │ ├── zsys_netbsd.go │ │ │ ├── zsys_openbsd.go │ │ │ └── zsys_solaris.go │ │ ├── lex │ │ │ └── httplex │ │ │ │ ├── httplex.go │ │ │ │ └── httplex_test.go │ │ ├── lif │ │ │ ├── address.go │ │ │ ├── address_test.go │ │ │ ├── binary.go │ │ │ ├── defs_solaris.go │ │ │ ├── lif.go │ │ │ ├── link.go │ │ │ ├── link_test.go │ │ │ ├── sys.go │ │ │ ├── sys_solaris_amd64.s │ │ │ ├── syscall.go │ │ │ └── zsys_solaris_amd64.go │ │ ├── nettest │ │ │ ├── conntest.go │ │ │ ├── conntest_go16.go │ │ │ ├── conntest_go17.go │ │ │ └── conntest_test.go │ │ ├── netutil │ │ │ ├── listen.go │ │ │ └── listen_test.go │ │ ├── proxy │ │ │ ├── direct.go │ │ │ ├── per_host.go │ │ │ ├── per_host_test.go │ │ │ ├── proxy.go │ │ │ ├── proxy_test.go │ │ │ └── socks5.go │ │ ├── publicsuffix │ │ │ ├── gen.go │ │ │ ├── list.go │ │ │ ├── list_test.go │ │ │ ├── table.go │ │ │ └── table_test.go │ │ ├── route │ │ │ ├── address.go │ │ │ ├── address_darwin_test.go │ │ │ ├── address_test.go │ │ │ ├── binary.go │ │ │ ├── defs_darwin.go │ │ │ ├── defs_dragonfly.go │ │ │ ├── defs_freebsd.go │ │ │ ├── defs_netbsd.go │ │ │ ├── defs_openbsd.go │ │ │ ├── interface.go │ │ │ ├── interface_announce.go │ │ │ ├── interface_classic.go │ │ │ ├── interface_freebsd.go │ │ │ ├── interface_multicast.go │ │ │ ├── interface_openbsd.go │ │ │ ├── message.go │ │ │ ├── message_darwin_test.go │ │ │ ├── message_freebsd_test.go │ │ │ ├── message_test.go │ │ │ ├── route.go │ │ │ ├── route_classic.go │ │ │ ├── route_openbsd.go │ │ │ ├── route_test.go │ │ │ ├── sys.go │ │ │ ├── sys_darwin.go │ │ │ ├── sys_dragonfly.go │ │ │ ├── sys_freebsd.go │ │ │ ├── sys_netbsd.go │ │ │ ├── sys_openbsd.go │ │ │ ├── syscall.go │ │ │ ├── zsys_darwin.go │ │ │ ├── zsys_dragonfly.go │ │ │ ├── zsys_freebsd_386.go │ │ │ ├── zsys_freebsd_amd64.go │ │ │ ├── zsys_freebsd_arm.go │ │ │ ├── zsys_netbsd.go │ │ │ └── zsys_openbsd.go │ │ ├── trace │ │ │ ├── events.go │ │ │ ├── histogram.go │ │ │ ├── histogram_test.go │ │ │ ├── trace.go │ │ │ ├── trace_go16.go │ │ │ ├── trace_go17.go │ │ │ └── trace_test.go │ │ ├── webdav │ │ │ ├── file.go │ │ │ ├── file_go1.6.go │ │ │ ├── file_go1.7.go │ │ │ ├── file_test.go │ │ │ ├── if.go │ │ │ ├── if_test.go │ │ │ ├── internal │ │ │ │ └── xml │ │ │ │ │ ├── README │ │ │ │ │ ├── atom_test.go │ │ │ │ │ ├── example_test.go │ │ │ │ │ ├── marshal.go │ │ │ │ │ ├── marshal_test.go │ │ │ │ │ ├── read.go │ │ │ │ │ ├── read_test.go │ │ │ │ │ ├── typeinfo.go │ │ │ │ │ ├── xml.go │ │ │ │ │ └── xml_test.go │ │ │ ├── litmus_test_server.go │ │ │ ├── lock.go │ │ │ ├── lock_test.go │ │ │ ├── prop.go │ │ │ ├── prop_test.go │ │ │ ├── webdav.go │ │ │ ├── webdav_test.go │ │ │ ├── xml.go │ │ │ └── xml_test.go │ │ ├── websocket │ │ │ ├── client.go │ │ │ ├── dial.go │ │ │ ├── dial_test.go │ │ │ ├── exampledial_test.go │ │ │ ├── examplehandler_test.go │ │ │ ├── hybi.go │ │ │ ├── hybi_test.go │ │ │ ├── server.go │ │ │ ├── websocket.go │ │ │ └── websocket_test.go │ │ └── xsrftoken │ │ │ ├── xsrf.go │ │ │ └── xsrf_test.go │ │ └── sys │ │ ├── .gitattributes │ │ ├── .gitignore │ │ ├── AUTHORS │ │ ├── CONTRIBUTING.md │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── README.md │ │ ├── codereview.cfg │ │ ├── plan9 │ │ ├── asm.s │ │ ├── asm_plan9_386.s │ │ ├── asm_plan9_amd64.s │ │ ├── const_plan9.go │ │ ├── dir_plan9.go │ │ ├── env_plan9.go │ │ ├── env_unset.go │ │ ├── errors_plan9.go │ │ ├── mkall.sh │ │ ├── mkerrors.sh │ │ ├── mksyscall.pl │ │ ├── mksysnum_plan9.sh │ │ ├── pwd_go15_plan9.go │ │ ├── pwd_plan9.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_plan9.go │ │ ├── syscall_test.go │ │ ├── zsyscall_plan9_386.go │ │ ├── zsyscall_plan9_amd64.go │ │ └── zsysnum_plan9.go │ │ ├── unix │ │ ├── .gitignore │ │ ├── README.md │ │ ├── asm_darwin_386.s │ │ ├── asm_darwin_amd64.s │ │ ├── asm_darwin_arm.s │ │ ├── asm_darwin_arm64.s │ │ ├── asm_dragonfly_amd64.s │ │ ├── asm_freebsd_386.s │ │ ├── asm_freebsd_amd64.s │ │ ├── asm_freebsd_arm.s │ │ ├── asm_linux_386.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_arm64.s │ │ ├── asm_linux_mips64x.s │ │ ├── asm_linux_mipsx.s │ │ ├── asm_linux_ppc64x.s │ │ ├── asm_linux_s390x.s │ │ ├── asm_netbsd_386.s │ │ ├── asm_netbsd_amd64.s │ │ ├── asm_netbsd_arm.s │ │ ├── asm_openbsd_386.s │ │ ├── asm_openbsd_amd64.s │ │ ├── asm_openbsd_arm.s │ │ ├── asm_solaris_amd64.s │ │ ├── bluetooth_linux.go │ │ ├── cap_freebsd.go │ │ ├── constants.go │ │ ├── creds_test.go │ │ ├── dev_darwin.go │ │ ├── dev_darwin_test.go │ │ ├── dev_dragonfly.go │ │ ├── dev_dragonfly_test.go │ │ ├── dev_freebsd.go │ │ ├── dev_linux.go │ │ ├── dev_linux_test.go │ │ ├── dev_netbsd.go │ │ ├── dev_netbsd_test.go │ │ ├── dev_openbsd.go │ │ ├── dev_openbsd_test.go │ │ ├── dev_solaris_test.go │ │ ├── dirent.go │ │ ├── endian_big.go │ │ ├── endian_little.go │ │ ├── env_unix.go │ │ ├── env_unset.go │ │ ├── errors_freebsd_386.go │ │ ├── errors_freebsd_amd64.go │ │ ├── errors_freebsd_arm.go │ │ ├── export_test.go │ │ ├── file_unix.go │ │ ├── flock.go │ │ ├── flock_linux_32bit.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.go │ │ ├── linux │ │ │ ├── Dockerfile │ │ │ ├── mkall.go │ │ │ ├── mksysnum.pl │ │ │ └── types.go │ │ ├── mkall.sh │ │ ├── mkerrors.sh │ │ ├── mkpost.go │ │ ├── mksyscall.pl │ │ ├── mksyscall_solaris.pl │ │ ├── mksysctl_openbsd.pl │ │ ├── mksysnum_darwin.pl │ │ ├── mksysnum_dragonfly.pl │ │ ├── mksysnum_freebsd.pl │ │ ├── mksysnum_netbsd.pl │ │ ├── mksysnum_openbsd.pl │ │ ├── mmap_unix_test.go │ │ ├── openbsd_pledge.go │ │ ├── openbsd_test.go │ │ ├── pagesize_unix.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── sockcmsg_linux.go │ │ ├── sockcmsg_unix.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_bsd.go │ │ ├── syscall_bsd_test.go │ │ ├── syscall_darwin.go │ │ ├── syscall_darwin_386.go │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall_darwin_arm.go │ │ ├── syscall_darwin_arm64.go │ │ ├── syscall_dragonfly.go │ │ ├── syscall_dragonfly_amd64.go │ │ ├── syscall_freebsd.go │ │ ├── syscall_freebsd_386.go │ │ ├── syscall_freebsd_amd64.go │ │ ├── syscall_freebsd_arm.go │ │ ├── syscall_freebsd_test.go │ │ ├── syscall_linux.go │ │ ├── syscall_linux_386.go │ │ ├── syscall_linux_amd64.go │ │ ├── syscall_linux_amd64_gc.go │ │ ├── syscall_linux_arm.go │ │ ├── syscall_linux_arm64.go │ │ ├── syscall_linux_mips64x.go │ │ ├── syscall_linux_mipsx.go │ │ ├── syscall_linux_ppc64x.go │ │ ├── syscall_linux_s390x.go │ │ ├── syscall_linux_sparc64.go │ │ ├── syscall_linux_test.go │ │ ├── syscall_netbsd.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_no_getwd.go │ │ ├── syscall_openbsd.go │ │ ├── syscall_openbsd_386.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_openbsd_arm.go │ │ ├── syscall_solaris.go │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_solaris_test.go │ │ ├── syscall_test.go │ │ ├── syscall_unix.go │ │ ├── syscall_unix_gc.go │ │ ├── syscall_unix_test.go │ │ ├── timestruct.go │ │ ├── types_darwin.go │ │ ├── types_dragonfly.go │ │ ├── types_freebsd.go │ │ ├── types_netbsd.go │ │ ├── types_openbsd.go │ │ ├── types_solaris.go │ │ ├── zerrors_darwin_386.go │ │ ├── zerrors_darwin_amd64.go │ │ ├── zerrors_darwin_arm.go │ │ ├── zerrors_darwin_arm64.go │ │ ├── zerrors_dragonfly_amd64.go │ │ ├── zerrors_freebsd_386.go │ │ ├── zerrors_freebsd_amd64.go │ │ ├── zerrors_freebsd_arm.go │ │ ├── zerrors_linux_386.go │ │ ├── zerrors_linux_amd64.go │ │ ├── zerrors_linux_arm.go │ │ ├── zerrors_linux_arm64.go │ │ ├── zerrors_linux_mips.go │ │ ├── zerrors_linux_mips64.go │ │ ├── zerrors_linux_mips64le.go │ │ ├── zerrors_linux_mipsle.go │ │ ├── zerrors_linux_ppc64.go │ │ ├── zerrors_linux_ppc64le.go │ │ ├── zerrors_linux_s390x.go │ │ ├── zerrors_linux_sparc64.go │ │ ├── zerrors_netbsd_386.go │ │ ├── zerrors_netbsd_amd64.go │ │ ├── zerrors_netbsd_arm.go │ │ ├── zerrors_openbsd_386.go │ │ ├── zerrors_openbsd_amd64.go │ │ ├── zerrors_openbsd_arm.go │ │ ├── zerrors_solaris_amd64.go │ │ ├── zptrace386_linux.go │ │ ├── zptracearm_linux.go │ │ ├── zptracemips_linux.go │ │ ├── zptracemipsle_linux.go │ │ ├── zsyscall_darwin_386.go │ │ ├── zsyscall_darwin_amd64.go │ │ ├── zsyscall_darwin_arm.go │ │ ├── zsyscall_darwin_arm64.go │ │ ├── zsyscall_dragonfly_amd64.go │ │ ├── zsyscall_freebsd_386.go │ │ ├── zsyscall_freebsd_amd64.go │ │ ├── zsyscall_freebsd_arm.go │ │ ├── zsyscall_linux_386.go │ │ ├── zsyscall_linux_amd64.go │ │ ├── zsyscall_linux_arm.go │ │ ├── zsyscall_linux_arm64.go │ │ ├── zsyscall_linux_mips.go │ │ ├── zsyscall_linux_mips64.go │ │ ├── zsyscall_linux_mips64le.go │ │ ├── zsyscall_linux_mipsle.go │ │ ├── zsyscall_linux_ppc64.go │ │ ├── zsyscall_linux_ppc64le.go │ │ ├── zsyscall_linux_s390x.go │ │ ├── zsyscall_linux_sparc64.go │ │ ├── zsyscall_netbsd_386.go │ │ ├── zsyscall_netbsd_amd64.go │ │ ├── zsyscall_netbsd_arm.go │ │ ├── zsyscall_openbsd_386.go │ │ ├── zsyscall_openbsd_amd64.go │ │ ├── zsyscall_openbsd_arm.go │ │ ├── zsyscall_solaris_amd64.go │ │ ├── zsysctl_openbsd_386.go │ │ ├── zsysctl_openbsd_amd64.go │ │ ├── zsysctl_openbsd_arm.go │ │ ├── zsysnum_darwin_386.go │ │ ├── zsysnum_darwin_amd64.go │ │ ├── zsysnum_darwin_arm.go │ │ ├── zsysnum_darwin_arm64.go │ │ ├── zsysnum_dragonfly_amd64.go │ │ ├── zsysnum_freebsd_386.go │ │ ├── zsysnum_freebsd_amd64.go │ │ ├── zsysnum_freebsd_arm.go │ │ ├── zsysnum_linux_386.go │ │ ├── zsysnum_linux_amd64.go │ │ ├── zsysnum_linux_arm.go │ │ ├── zsysnum_linux_arm64.go │ │ ├── zsysnum_linux_mips.go │ │ ├── zsysnum_linux_mips64.go │ │ ├── zsysnum_linux_mips64le.go │ │ ├── zsysnum_linux_mipsle.go │ │ ├── zsysnum_linux_ppc64.go │ │ ├── zsysnum_linux_ppc64le.go │ │ ├── zsysnum_linux_s390x.go │ │ ├── zsysnum_linux_sparc64.go │ │ ├── zsysnum_netbsd_386.go │ │ ├── zsysnum_netbsd_amd64.go │ │ ├── zsysnum_netbsd_arm.go │ │ ├── zsysnum_openbsd_386.go │ │ ├── zsysnum_openbsd_amd64.go │ │ ├── zsysnum_openbsd_arm.go │ │ ├── zsysnum_solaris_amd64.go │ │ ├── ztypes_darwin_386.go │ │ ├── ztypes_darwin_amd64.go │ │ ├── ztypes_darwin_arm.go │ │ ├── ztypes_darwin_arm64.go │ │ ├── ztypes_dragonfly_amd64.go │ │ ├── ztypes_freebsd_386.go │ │ ├── ztypes_freebsd_amd64.go │ │ ├── ztypes_freebsd_arm.go │ │ ├── ztypes_linux_386.go │ │ ├── ztypes_linux_amd64.go │ │ ├── ztypes_linux_arm.go │ │ ├── ztypes_linux_arm64.go │ │ ├── ztypes_linux_mips.go │ │ ├── ztypes_linux_mips64.go │ │ ├── ztypes_linux_mips64le.go │ │ ├── ztypes_linux_mipsle.go │ │ ├── ztypes_linux_ppc64.go │ │ ├── ztypes_linux_ppc64le.go │ │ ├── ztypes_linux_s390x.go │ │ ├── ztypes_linux_sparc64.go │ │ ├── ztypes_netbsd_386.go │ │ ├── ztypes_netbsd_amd64.go │ │ ├── ztypes_netbsd_arm.go │ │ ├── ztypes_openbsd_386.go │ │ ├── ztypes_openbsd_amd64.go │ │ ├── ztypes_openbsd_arm.go │ │ └── ztypes_solaris_amd64.go │ │ └── windows │ │ ├── asm_windows_386.s │ │ ├── asm_windows_amd64.s │ │ ├── dll_windows.go │ │ ├── env_unset.go │ │ ├── env_windows.go │ │ ├── eventlog.go │ │ ├── exec_windows.go │ │ ├── memory_windows.go │ │ ├── mksyscall.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── registry │ │ ├── export_test.go │ │ ├── key.go │ │ ├── mksyscall.go │ │ ├── registry_test.go │ │ ├── syscall.go │ │ ├── value.go │ │ └── zsyscall_windows.go │ │ ├── security_windows.go │ │ ├── service.go │ │ ├── str.go │ │ ├── svc │ │ ├── debug │ │ │ ├── log.go │ │ │ └── service.go │ │ ├── event.go │ │ ├── eventlog │ │ │ ├── install.go │ │ │ ├── log.go │ │ │ └── log_test.go │ │ ├── example │ │ │ ├── beep.go │ │ │ ├── install.go │ │ │ ├── main.go │ │ │ ├── manage.go │ │ │ └── service.go │ │ ├── go12.c │ │ ├── go12.go │ │ ├── go13.go │ │ ├── mgr │ │ │ ├── config.go │ │ │ ├── mgr.go │ │ │ ├── mgr_test.go │ │ │ └── service.go │ │ ├── security.go │ │ ├── service.go │ │ ├── svc_test.go │ │ ├── sys_386.s │ │ └── sys_amd64.s │ │ ├── syscall.go │ │ ├── syscall_test.go │ │ ├── syscall_windows.go │ │ ├── syscall_windows_test.go │ │ ├── types_windows.go │ │ ├── types_windows_386.go │ │ ├── types_windows_amd64.go │ │ └── zsyscall_windows.go └── gopkg.in │ └── urfave │ └── cli.v1 │ ├── .flake8 │ ├── .gitignore │ ├── .travis.yml │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── altsrc │ ├── altsrc.go │ ├── flag.go │ ├── flag_generated.go │ ├── flag_test.go │ ├── helpers_test.go │ ├── input_source_context.go │ ├── map_input_source.go │ ├── toml_command_test.go │ ├── toml_file_loader.go │ ├── yaml_command_test.go │ └── yaml_file_loader.go │ ├── app.go │ ├── app_test.go │ ├── appveyor.yml │ ├── autocomplete │ ├── bash_autocomplete │ └── zsh_autocomplete │ ├── category.go │ ├── cli.go │ ├── command.go │ ├── command_test.go │ ├── context.go │ ├── context_test.go │ ├── errors.go │ ├── errors_test.go │ ├── flag-types.json │ ├── flag.go │ ├── flag_generated.go │ ├── flag_test.go │ ├── funcs.go │ ├── generate-flag-types │ ├── help.go │ ├── help_test.go │ ├── helpers_test.go │ ├── helpers_unix_test.go │ ├── helpers_windows_test.go │ └── runtests └── version └── version.go /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Pull Requests 2 | If you are working directly on this repository instead of forking it, please make sure 3 | that you follow the [git-flow](http://nvie.com/posts/a-successful-git-branching-model/) 4 | naming convention. 5 | Your branch should start with `feature/your_feature_name`. When there is a lot of development 6 | happening on the `develop` branch, you should `rebase` your feature branch onto develop 7 | regularly. 8 | 9 | If opening a PR against Paradigm, please use branch `develop` as the base branch 10 | for changes. 11 | `unstable` should only be used to integrate multiple PRs that might have effects on each other. 12 | 13 | Please make sure that all tests run with `make test` pass. 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | *Please describe the issue as detailed as possible.* 3 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | Relates to: 3 | *Please provide a description of this PR.* 4 | 5 | ## Checklist 6 | - [ ] Update the documentation/architecture to reflect the changes 7 | - [ ] Merge this PR by squashing. 8 | - [ ] Close any related issues once this PR is merged. 9 | - [ ] Remove the original branch once the PR is merged. 10 | -------------------------------------------------------------------------------- /accounts/hd.go: -------------------------------------------------------------------------------- 1 | package accounts 2 | 3 | // DerivationPath represents the computer friendly version of a hierarchical 4 | // deterministic wallet account derivaion path. 5 | type DerivationPath []uint32 6 | -------------------------------------------------------------------------------- /accounts/keystore/testdata/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paradigm-network/paradigm/c1cffc982a6efd50b5c2d9e3e5e6898c4c8f3f87/accounts/keystore/testdata/.DS_Store -------------------------------------------------------------------------------- /accounts/keystore/testdata/keystore/UTC--2016-03-22T12-57-55.920751759Z--7ef5a6135f1fd6a02593eedc869c6d41d934aef8: -------------------------------------------------------------------------------- 1 | {"address":"7ef5a6135f1fd6a02593eedc869c6d41d934aef8","crypto":{"cipher":"aes-128-ctr","ciphertext":"1d0839166e7a15b9c1333fc865d69858b22df26815ccf601b28219b6192974e1","cipherparams":{"iv":"8df6caa7ff1b00c4e871f002cb7921ed"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":8,"p":16,"r":8,"salt":"e5e6ef3f4ea695f496b643ebd3f75c0aa58ef4070e90c80c5d3fb0241bf1595c"},"mac":"6d16dfde774845e4585357f24bce530528bc69f4f84e1e22880d34fa45c273e5"},"id":"950077c7-71e3-4c44-a4a1-143919141ed4","version":3} -------------------------------------------------------------------------------- /accounts/keystore/testdata/keystore/aaa: -------------------------------------------------------------------------------- 1 | {"address":"f466859ead1932d743d622cb74fc058882e8648a","crypto":{"cipher":"aes-128-ctr","ciphertext":"cb664472deacb41a2e995fa7f96fe29ce744471deb8d146a0e43c7898c9ddd4d","cipherparams":{"iv":"dfd9ee70812add5f4b8f89d0811c9158"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":8,"p":16,"r":8,"salt":"0d6769bf016d45c479213990d6a08d938469c4adad8a02ce507b4a4e7b7739f1"},"mac":"bac9af994b15a45dd39669fc66f9aa8a3b9dd8c22cb16e4d8d7ea089d0f1a1a9"},"id":"472e8b3d-afb6-45b5-8111-72c89895099a","version":3} -------------------------------------------------------------------------------- /accounts/keystore/testdata/keystore/zzz: -------------------------------------------------------------------------------- 1 | {"address":"289d485d9771714cce91d3393d764e1311907acc","crypto":{"cipher":"aes-128-ctr","ciphertext":"faf32ca89d286b107f5e6d842802e05263c49b78d46eac74e6109e9a963378ab","cipherparams":{"iv":"558833eec4a665a8c55608d7d503407d"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":8,"p":16,"r":8,"salt":"d571fff447ffb24314f9513f5160246f09997b857ac71348b73e785aab40dc04"},"mac":"21edb85ff7d0dab1767b9bf498f2c3cb7be7609490756bd32300bb213b59effe"},"id":"3279afcf-55ba-43ff-8997-02dcc46a6525","version":3} -------------------------------------------------------------------------------- /accounts/keystore/testdata/very-light-scrypt.json: -------------------------------------------------------------------------------- 1 | {"address":"45dea0fb0bba44f4fcf290bba71fd57d7117cbb8","crypto":{"cipher":"aes-128-ctr","ciphertext":"b87781948a1befd247bff51ef4063f716cf6c2d3481163e9a8f42e1f9bb74145","cipherparams":{"iv":"dc4926b48a105133d2f16b96833abf1e"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":2,"p":1,"r":8,"salt":"004244bbdc51cadda545b1cfa43cff9ed2ae88e08c61f1479dbb45410722f8f0"},"mac":"39990c1684557447940d4c69e06b1b82b2aceacb43f284df65c956daf3046b85"},"id":"ce541d8d-c79b-40f8-9f8c-20f59616faba","version":3} 2 | -------------------------------------------------------------------------------- /common/big.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import "math/big" 4 | 5 | var ( 6 | Big1 = big.NewInt(1) 7 | Big2 = big.NewInt(2) 8 | Big3 = big.NewInt(3) 9 | Big0 = big.NewInt(0) 10 | Big32 = big.NewInt(32) 11 | Big256 = big.NewInt(256) 12 | Big257 = big.NewInt(257) 13 | ) 14 | -------------------------------------------------------------------------------- /common/crypto/hash.go: -------------------------------------------------------------------------------- 1 | package crypto 2 | 3 | import ( 4 | "crypto/sha256" 5 | ) 6 | 7 | func SHA256(hashBytes []byte) []byte { 8 | hasher := sha256.New() 9 | hasher.Write(hashBytes) 10 | hash := hasher.Sum(nil) 11 | return hash 12 | } 13 | 14 | func SimpleHashFromTwoHashes(left []byte, right []byte) []byte { 15 | var hasher = sha256.New() 16 | hasher.Write(left) 17 | hasher.Write(right) 18 | return hasher.Sum(nil) 19 | } 20 | 21 | func SimpleHashFromHashes(hashes [][]byte) []byte { 22 | // Recursive impl. 23 | switch len(hashes) { 24 | case 0: 25 | return nil 26 | case 1: 27 | return hashes[0] 28 | default: 29 | left := SimpleHashFromHashes(hashes[:(len(hashes)+1)/2]) 30 | right := SimpleHashFromHashes(hashes[(len(hashes)+1)/2:]) 31 | return SimpleHashFromTwoHashes(left, right) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /common/crypto/randentropy/rand_entropy.go: -------------------------------------------------------------------------------- 1 | package randentropy 2 | 3 | import ( 4 | crand "crypto/rand" 5 | "io" 6 | ) 7 | 8 | func GetEntropyCSPRNG(n int) []byte { 9 | mainBuff := make([]byte, n) 10 | _, err := io.ReadFull(crand.Reader, mainBuff) 11 | if err != nil { 12 | panic("reading from crypto/rand failed: " + err.Error()) 13 | } 14 | return mainBuff 15 | } 16 | -------------------------------------------------------------------------------- /common/event/feed.go: -------------------------------------------------------------------------------- 1 | package event 2 | 3 | //accounts--manager--Manager struct 4 | // Feed implements one-to-many subscriptions where the carrier of events is a channel. 5 | // Values sent to a Feed are delivered to all subscribed channels simultaneously. 6 | type Feed struct { 7 | } 8 | 9 | // To be finished. 10 | func (f *Feed) Send(value interface{}) (nsent int) { 11 | 12 | return nsent 13 | } 14 | 15 | func (f *Feed) Subscribe(channel interface{}) Subscription { 16 | 17 | return nil 18 | } 19 | -------------------------------------------------------------------------------- /common/event/subscription.go: -------------------------------------------------------------------------------- 1 | package event 2 | 3 | import "sync" 4 | 5 | //accounts -- accounts -- backend interface 6 | // Subscription represents a stream of events. The carrier of the events is typically a 7 | // channel, but isn't part of the interface. 8 | type Subscription interface { 9 | Err() <-chan error // returns the error channel 10 | Unsubscribe() // cancels sending of events, closing the error channel 11 | } 12 | 13 | 14 | type SubscriptionScope struct { 15 | mu sync.Mutex 16 | subs map[*scopeSub]struct{} 17 | closed bool 18 | } 19 | 20 | type scopeSub struct { 21 | sc *SubscriptionScope 22 | s Subscription 23 | } -------------------------------------------------------------------------------- /common/file/chown.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package file 4 | 5 | import ( 6 | "os" 7 | ) 8 | 9 | func Chown(_ string, _ os.FileInfo) error { 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /common/file/chown_linux.go: -------------------------------------------------------------------------------- 1 | package file 2 | 3 | import ( 4 | "os" 5 | "syscall" 6 | ) 7 | 8 | // os_Chown is a var so we can mock it out during tests. 9 | var os_Chown = os.Chown 10 | 11 | func Chown(name string, info os.FileInfo) error { 12 | f, err := os.OpenFile(name, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, info.Mode()) 13 | if err != nil { 14 | return err 15 | } 16 | f.Close() 17 | stat := info.Sys().(*syscall.Stat_t) 18 | return os_Chown(name, int(stat.Uid), int(stat.Gid)) 19 | } 20 | -------------------------------------------------------------------------------- /common/inventory.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | type InventoryType byte 4 | 5 | const ( 6 | TRANSACTION InventoryType = 0x01 7 | BLOCK InventoryType = 0x02 8 | CONSENSUS InventoryType = 0xe0 9 | ) 10 | 11 | //TODO: temp inventory 12 | type Inventory interface { 13 | //sig.SignableData 14 | Hash() Uint256 15 | Verify() error 16 | Type() InventoryType 17 | } 18 | -------------------------------------------------------------------------------- /common/log/logger_test.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestLogger(t *testing.T) { 8 | //InitRotateWriter("./log.log") 9 | 10 | logger := GetConsoleLogger("main") 11 | logger.Info().Msg("log info xxx") 12 | } 13 | -------------------------------------------------------------------------------- /common/safeMath.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import "math" 4 | 5 | const ( 6 | MAX_UINT64 = math.MaxUint64 7 | ) 8 | 9 | func SafeSub(x, y uint64) (uint64, bool) { 10 | return x - y, x < y 11 | } 12 | 13 | func SafeAdd(x, y uint64) (uint64, bool) { 14 | return x + y, y > MAX_UINT64-x 15 | } 16 | 17 | func SafeMul(x, y uint64) (uint64, bool) { 18 | if x == 0 || y == 0 { 19 | return 0, false 20 | } 21 | return x * y, y > MAX_UINT64/x 22 | } 23 | -------------------------------------------------------------------------------- /common/size.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | type StorageSize float64 8 | 9 | func (self StorageSize) String() string { 10 | if self > 1000000 { 11 | return fmt.Sprintf("%.2f mB", self/1000000) 12 | } else if self > 1000 { 13 | return fmt.Sprintf("%.2f kB", self/1000) 14 | } else { 15 | return fmt.Sprintf("%.2f B", self) 16 | } 17 | } 18 | 19 | func (self StorageSize) Int64() int64 { 20 | return int64(self) 21 | } 22 | 23 | type WriteCounter StorageSize 24 | 25 | func (c *WriteCounter) Write(b []byte) (int, error) { 26 | *c += WriteCounter(len(b)) 27 | return len(b), nil 28 | } -------------------------------------------------------------------------------- /core/accretion/accretion.go: -------------------------------------------------------------------------------- 1 | package accretion 2 | -------------------------------------------------------------------------------- /docker/makefile: -------------------------------------------------------------------------------- 1 | PARADIGM_VERSION=0.1 2 | 3 | all: paradigm-image 4 | 5 | paradigm-image: 6 | go build \ 7 | --ldflags '-extldflags "-static"' \ 8 | -o paradigm/paradigm ../cmd/paradigm/ 9 | docker build -t paradigm-network/paradigm:$(PARADIGM_VERSION) \ 10 | -t paradigm-network/paradigm:latest \ 11 | paradigm/ 12 | 13 | 14 | .PHONY: all paradigm-image -------------------------------------------------------------------------------- /docker/paradigm/Dockerfile: -------------------------------------------------------------------------------- 1 | from ubuntu 2 | ADD paradigm /usr/local/bin 3 | EXPOSE 1339 80 8090 4 | ENV HOME=/ 5 | ENTRYPOINT ["paradigm"] 6 | CMD [] -------------------------------------------------------------------------------- /errors/onterror.go: -------------------------------------------------------------------------------- 1 | package errors 2 | 3 | type ontError struct { 4 | errmsg string 5 | callstack *CallStack 6 | root error 7 | code ErrCode 8 | } 9 | 10 | func (e ontError) Error() string { 11 | return e.errmsg 12 | } 13 | 14 | func (e ontError) GetErrCode() ErrCode { 15 | return e.code 16 | } 17 | 18 | func (e ontError) GetRoot() error { 19 | return e.root 20 | } 21 | 22 | func (e ontError) GetCallStack() *CallStack { 23 | return e.callstack 24 | } 25 | -------------------------------------------------------------------------------- /glide.yaml: -------------------------------------------------------------------------------- 1 | package: github.com/paradigm-network/paradigm 2 | import: 3 | - package: github.com/itchyny/base58-go 4 | - package: github.com/rs/zerolog 5 | version: v1.8.0 6 | - package: golang.org/x/net 7 | subpackages: 8 | - trace 9 | - package: github.com/btcsuite/btcd/btcec 10 | - package: github.com/pborman/uuid 11 | - package: gopkg.in/fatih/set.v0 12 | - package: golang.org/x/crypto 13 | subpackages: 14 | - pbkdf2 15 | - scrypt 16 | testImport: 17 | - package: github.com/stretchr/testify 18 | subpackages: 19 | - assert 20 | -------------------------------------------------------------------------------- /makefile: -------------------------------------------------------------------------------- 1 | BUILD_TAGS?=paradigm 2 | 3 | # vendor uses Glide to install all the Go dependencies in vendor/ 4 | vendor: 5 | glide install 6 | 7 | # install compiles and places the binary in GOPATH/bin 8 | install: 9 | go install --ldflags '-extldflags "-static"' \ 10 | --ldflags "-X github.com/paradigm-network/paradigm/version.GitCommit=`git rev-parse HEAD`" \ 11 | ./cmd/paradigm 12 | 13 | # build compiles and places the binary in /build 14 | build: 15 | CGO_ENABLED=0 go build \ 16 | --ldflags "-X github.com/paradigm-network/paradigm/version.GitCommit=`git rev-parse HEAD`" \ 17 | -o build/paradigm ./cmd/paradigm/ 18 | 19 | test: 20 | glide novendor | xargs go test 21 | 22 | .PHONY: vendor install build dist test 23 | -------------------------------------------------------------------------------- /network/actor/behaviorstack.go: -------------------------------------------------------------------------------- 1 | package actor 2 | 3 | type behaviorStack []ActorFunc 4 | 5 | func (b *behaviorStack) Clear() { 6 | if len(*b) == 0 { 7 | return 8 | } 9 | 10 | for i := range *b { 11 | (*b)[i] = nil 12 | } 13 | *b = (*b)[:0] 14 | } 15 | 16 | func (b *behaviorStack) Peek() (v ActorFunc, ok bool) { 17 | l := b.Len() 18 | if l > 0 { 19 | ok = true 20 | v = (*b)[l-1] 21 | } 22 | return 23 | } 24 | 25 | func (b *behaviorStack) Push(v ActorFunc) { 26 | *b = append(*b, v) 27 | } 28 | 29 | func (b *behaviorStack) Pop() (v ActorFunc, ok bool) { 30 | l := b.Len() 31 | if l > 0 { 32 | l-- 33 | ok = true 34 | v = (*b)[l] 35 | (*b)[l] = nil 36 | *b = (*b)[:l] 37 | } 38 | return 39 | } 40 | 41 | func (b *behaviorStack) Len() int { 42 | return len(*b) 43 | } 44 | -------------------------------------------------------------------------------- /network/actor/directive.go: -------------------------------------------------------------------------------- 1 | package actor 2 | 3 | //Directive is an enum for supervision actions 4 | type Directive int 5 | 6 | // Directive determines how a supervisor should handle a faulting actor 7 | const ( 8 | // ResumeDirective instructs the supervisor to resume the actor and continue processing messages 9 | ResumeDirective Directive = iota 10 | 11 | // RestartDirective instructs the supervisor to discard the actor, replacing it with a new instance, 12 | // before processing additional messages 13 | RestartDirective 14 | 15 | // StopDirective instructs the supervisor to stop the actor 16 | StopDirective 17 | 18 | // EscalateDirective instructs the supervisor to escalate handling of the failure to the actor's parent supervisor 19 | EscalateDirective 20 | ) 21 | -------------------------------------------------------------------------------- /network/actor/directive_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=Directive"; DO NOT EDIT 2 | 3 | package actor 4 | 5 | import "fmt" 6 | 7 | const _Directive_name = "ResumeDirectiveRestartDirectiveStopDirectiveEscalateDirective" 8 | 9 | var _Directive_index = [...]uint8{0, 15, 31, 44, 61} 10 | 11 | func (i Directive) String() string { 12 | if i < 0 || i >= Directive(len(_Directive_index)-1) { 13 | return fmt.Sprintf("Directive(%d)", i) 14 | } 15 | return _Directive_name[_Directive_index[i]:_Directive_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /network/actor/local_process.go: -------------------------------------------------------------------------------- 1 | package actor 2 | 3 | import ( 4 | "sync/atomic" 5 | 6 | "github.com/paradigm-network/paradigm/network/actor/mailbox" 7 | ) 8 | 9 | type localProcess struct { 10 | mailbox mailbox.Inbound 11 | dead int32 12 | } 13 | 14 | func (ref *localProcess) SendUserMessage(pid *PID, message interface{}) { 15 | ref.mailbox.PostUserMessage(message) 16 | } 17 | func (ref *localProcess) SendSystemMessage(pid *PID, message interface{}) { 18 | ref.mailbox.PostSystemMessage(message) 19 | } 20 | 21 | func (ref *localProcess) Stop(pid *PID) { 22 | atomic.StoreInt32(&ref.dead, 1) 23 | ref.SendSystemMessage(pid, stopMessage) 24 | } 25 | -------------------------------------------------------------------------------- /network/actor/log.go: -------------------------------------------------------------------------------- 1 | package actor 2 | 3 | import ( 4 | "github.com/paradigm-network/paradigm/network/actor/log" 5 | ) 6 | 7 | var ( 8 | plog = log.New(log.DebugLevel, "[ACTOR]") 9 | ) 10 | 11 | // SetLogLevel sets the log level for the logger. 12 | // 13 | // SetLogLevel is safe to call concurrently 14 | func SetLogLevel(level log.Level) { 15 | plog.SetLevel(level) 16 | } 17 | -------------------------------------------------------------------------------- /network/actor/log/encoder.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "reflect" 5 | "time" 6 | ) 7 | 8 | type Encoder interface { 9 | EncodeBool(key string, val bool) 10 | EncodeFloat64(key string, val float64) 11 | EncodeInt(key string, val int) 12 | EncodeInt64(key string, val int64) 13 | EncodeDuration(key string, val time.Duration) 14 | EncodeUint(key string, val uint) 15 | EncodeUint64(key string, val uint64) 16 | EncodeString(key string, val string) 17 | EncodeObject(key string, val interface{}) 18 | EncodeType(key string, val reflect.Type) 19 | } 20 | -------------------------------------------------------------------------------- /network/actor/log/event.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import "time" 4 | 5 | type Event struct { 6 | Time time.Time 7 | Level Level 8 | Prefix string 9 | Message string 10 | Context []Field 11 | Fields []Field 12 | } 13 | -------------------------------------------------------------------------------- /network/actor/log/options.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | type optionFn func() 4 | 5 | // WithEventSubscriber option replaces the default Event subscriber with fn. 6 | // 7 | // Specifying nil will disable logging of events. 8 | func WithEventSubscriber(fn func(evt Event)) optionFn { 9 | return func() { 10 | if sub != nil { 11 | Unsubscribe(sub) 12 | } 13 | if fn != nil { 14 | sub = Subscribe(fn) 15 | } 16 | } 17 | } 18 | 19 | // SetOptions is used to configure the log system 20 | func SetOptions(opts ...optionFn) { 21 | for _, opt := range opts { 22 | opt() 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /network/actor/mailbox.go: -------------------------------------------------------------------------------- 1 | package actor 2 | 3 | import "github.com/paradigm-network/paradigm/network/actor/mailbox" 4 | 5 | var ( 6 | defaultDispatcher = mailbox.NewDefaultDispatcher(300) 7 | ) 8 | 9 | var defaultMailboxProducer = mailbox.Unbounded() 10 | -------------------------------------------------------------------------------- /network/actor/mailbox/dispatcher.go: -------------------------------------------------------------------------------- 1 | package mailbox 2 | 3 | type Dispatcher interface { 4 | Schedule(fn func()) 5 | Throughput() int 6 | } 7 | 8 | type goroutineDispatcher int 9 | 10 | func (goroutineDispatcher) Schedule(fn func()) { 11 | go fn() 12 | } 13 | 14 | func (d goroutineDispatcher) Throughput() int { 15 | return int(d) 16 | } 17 | 18 | func NewDefaultDispatcher(throughput int) Dispatcher { 19 | return goroutineDispatcher(throughput) 20 | } 21 | 22 | type synchronizedDispatcher int 23 | 24 | func (synchronizedDispatcher) Schedule(fn func()) { 25 | fn() 26 | } 27 | 28 | func (d synchronizedDispatcher) Throughput() int { 29 | return int(d) 30 | } 31 | 32 | func NewSynchronizedDispatcher(throughput int) Dispatcher { 33 | return synchronizedDispatcher(throughput) 34 | } 35 | -------------------------------------------------------------------------------- /network/actor/mailbox/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package mailbox implements mailbox queues and dispatching 3 | */ 4 | package mailbox 5 | -------------------------------------------------------------------------------- /network/actor/mailbox/log.go: -------------------------------------------------------------------------------- 1 | package mailbox 2 | 3 | import ( 4 | "github.com/paradigm-network/paradigm/network/actor/log" 5 | ) 6 | 7 | var ( 8 | plog = log.New(log.DebugLevel, "[MAILBOX]") 9 | ) 10 | 11 | // SetLogLevel sets the log level for the logger. 12 | // 13 | // SetLogLevel is safe to call concurrently 14 | func SetLogLevel(level log.Level) { 15 | plog.SetLevel(level) 16 | } 17 | -------------------------------------------------------------------------------- /network/actor/mailbox/messages.go: -------------------------------------------------------------------------------- 1 | package mailbox 2 | 3 | // ResumeMailbox is message sent by the actor system to resume mailbox processing. 4 | // 5 | // This will not be forwarded to the Receive method 6 | type ResumeMailbox struct{} 7 | 8 | // SuspendMailbox is message sent by the actor system to suspend mailbox processing. 9 | // 10 | // This will not be forwarded to the Receive method 11 | type SuspendMailbox struct{} 12 | -------------------------------------------------------------------------------- /network/actor/mailbox/queue.go: -------------------------------------------------------------------------------- 1 | package mailbox 2 | 3 | type queue interface { 4 | Push(interface{}) 5 | Pop() interface{} 6 | } 7 | -------------------------------------------------------------------------------- /network/actor/mailbox/unbounded_lock_free.go: -------------------------------------------------------------------------------- 1 | package mailbox 2 | 3 | import ( 4 | "github.com/paradigm-network/paradigm/network/actor/internal/queue/mpsc" 5 | ) 6 | 7 | // UnboundedLockfree returns a producer which creates an unbounded, lock-free mailbox. 8 | // This mailbox is cheaper to allocate, but has a slower throughput than the plain Unbounded mailbox. 9 | func UnboundedLockfree(mailboxStats ...Statistics) Producer { 10 | return func(invoker MessageInvoker, dispatcher Dispatcher) Inbound { 11 | return &defaultMailbox{ 12 | userMailbox: mpsc.New(), 13 | systemMailbox: mpsc.New(), 14 | invoker: invoker, 15 | mailboxStats: mailboxStats, 16 | dispatcher: dispatcher, 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /network/actor/middleware_chain.go: -------------------------------------------------------------------------------- 1 | package actor 2 | 3 | func makeInboundMiddlewareChain(middleware []InboundMiddleware, lastReceiver ActorFunc) ActorFunc { 4 | if len(middleware) == 0 { 5 | return nil 6 | } 7 | 8 | h := middleware[len(middleware)-1](lastReceiver) 9 | for i := len(middleware) - 2; i >= 0; i-- { 10 | h = middleware[i](h) 11 | } 12 | return h 13 | } 14 | 15 | func makeOutboundMiddlewareChain(outboundMiddleware []OutboundMiddleware, lastSender SenderFunc) SenderFunc { 16 | if len(outboundMiddleware) == 0 { 17 | return nil 18 | } 19 | 20 | h := outboundMiddleware[len(outboundMiddleware)-1](lastSender) 21 | for i := len(outboundMiddleware) - 2; i >= 0; i-- { 22 | h = outboundMiddleware[i](h) 23 | } 24 | return h 25 | } 26 | -------------------------------------------------------------------------------- /network/actor/op.go: -------------------------------------------------------------------------------- 1 | package actor 2 | 3 | /* 4 | //user messages 5 | type PoisonPill struct { 6 | } 7 | 8 | type Watch struct { 9 | Watcher *PID 10 | } 11 | 12 | type Unwatch struct { 13 | Watcher *PID 14 | } 15 | 16 | type Terminated struct { 17 | Who *PID 18 | AddressTerminated bool 19 | } 20 | 21 | type Stop struct { 22 | */ 23 | -------------------------------------------------------------------------------- /network/actor/pid_test.go: -------------------------------------------------------------------------------- 1 | package actor 2 | 3 | import ( 4 | "reflect" 5 | "testing" 6 | 7 | "github.com/stretchr/testify/assert" 8 | ) 9 | 10 | type ShortLivingActor struct { 11 | } 12 | 13 | func (self *ShortLivingActor) Receive(ctx Context) { 14 | 15 | } 16 | 17 | func TestStopFuture(t *testing.T) { 18 | ID := "UniqueID" 19 | { 20 | props := FromProducer(func() Actor { return &ShortLivingActor{} }) 21 | a, _ := SpawnNamed(props, ID) 22 | 23 | fut := a.StopFuture() 24 | 25 | res, errR := fut.Result() 26 | if errR != nil { 27 | assert.Fail(t, "Failed to wait stop actor %s", errR) 28 | return 29 | } 30 | 31 | _, ok := res.(*Terminated) 32 | if !ok { 33 | assert.Fail(t, "Cannot cast %s", reflect.TypeOf(res)) 34 | return 35 | } 36 | 37 | _, found := ProcessRegistry.Get(a) 38 | assert.False(t, found) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /network/actor/process.go: -------------------------------------------------------------------------------- 1 | package actor 2 | 3 | // A Process is an interface that defines the base contract for interaction of actors 4 | type Process interface { 5 | SendUserMessage(pid *PID, message interface{}) 6 | SendSystemMessage(pid *PID, message interface{}) 7 | Stop(pid *PID) 8 | } 9 | -------------------------------------------------------------------------------- /network/actor/protos.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package actor; 3 | 4 | //import "google/protobuf/any.proto"; 5 | import "github.com/gogo/protobuf/gogoproto/gogo.proto"; 6 | 7 | option (gogoproto.gostring_all) = false; 8 | 9 | message PID { 10 | option (gogoproto.typedecl) = false; 11 | option (gogoproto.stringer) = false; 12 | string address = 1; 13 | string id = 2; 14 | } 15 | 16 | //user messages 17 | message PoisonPill {} 18 | 19 | //system messages 20 | message Watch { 21 | PID watcher = 1; 22 | } 23 | 24 | message Unwatch { 25 | PID watcher = 1; 26 | } 27 | 28 | message Terminated { 29 | PID who = 1; 30 | bool address_terminated = 2; 31 | } 32 | 33 | message Stop {} -------------------------------------------------------------------------------- /network/actor/strategy_restarting.go: -------------------------------------------------------------------------------- 1 | package actor 2 | 3 | func NewRestartingStrategy() SupervisorStrategy { 4 | return &restartingStrategy{} 5 | } 6 | 7 | type restartingStrategy struct{} 8 | 9 | func (strategy *restartingStrategy) HandleFailure(supervisor Supervisor, child *PID, rs *RestartStatistics, reason interface{}, message interface{}) { 10 | //always restart 11 | supervisor.RestartChildren(child) 12 | } 13 | -------------------------------------------------------------------------------- /network/actor/supervision_event.go: -------------------------------------------------------------------------------- 1 | package actor 2 | 3 | import ( 4 | "github.com/paradigm-network/paradigm/network/actor/eventstream" 5 | "github.com/paradigm-network/paradigm/network/actor/log" 6 | ) 7 | 8 | //SupervisorEvent is sent on the EventStream when a supervisor have applied a directive to a failing child actor 9 | type SupervisorEvent struct { 10 | Child *PID 11 | Reason interface{} 12 | Directive Directive 13 | } 14 | 15 | var ( 16 | supervisionSubscriber *eventstream.Subscription 17 | ) 18 | 19 | func init() { 20 | supervisionSubscriber = eventstream.Subscribe(func(evt interface{}) { 21 | if supervisorEvent, ok := evt.(*SupervisorEvent); ok { 22 | plog.Debug("[SUPERVISION]", log.Stringer("actor", supervisorEvent.Child), log.Stringer("directive", supervisorEvent.Directive), log.Object("reason", supervisorEvent.Reason)) 23 | } 24 | }) 25 | } 26 | -------------------------------------------------------------------------------- /network/http/error/error.go: -------------------------------------------------------------------------------- 1 | package error 2 | 3 | const ( 4 | INVALID_METHOD int64 = 42001 5 | ) 6 | -------------------------------------------------------------------------------- /p2pserver/actor/req/consensus.go: -------------------------------------------------------------------------------- 1 | package req 2 | 3 | import ( 4 | "github.com/paradigm-network/paradigm/network/actor" 5 | ) 6 | 7 | var ConsensusPid *actor.PID 8 | 9 | func SetConsensusPid(conPid *actor.PID) { 10 | ConsensusPid = conPid 11 | } 12 | -------------------------------------------------------------------------------- /p2pserver/common/checksum.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "crypto/sha256" 5 | "hash" 6 | ) 7 | 8 | // checksum implement hash.Hash interface and io.Writer 9 | type checksum struct { 10 | hash.Hash 11 | } 12 | 13 | func (self *checksum) Size() int { 14 | return CHECKSUM_LEN 15 | } 16 | 17 | func (self *checksum) Sum(b []byte) []byte { 18 | temp := self.Hash.Sum(nil) 19 | h := sha256.Sum256(temp) 20 | 21 | return append(b, h[:CHECKSUM_LEN]...) 22 | } 23 | 24 | func NewChecksum() hash.Hash { 25 | return &checksum{sha256.New()} 26 | } 27 | 28 | func Checksum(data []byte) [CHECKSUM_LEN]byte { 29 | var checksum [CHECKSUM_LEN]byte 30 | t := sha256.Sum256(data) 31 | s := sha256.Sum256(t[:]) 32 | 33 | copy(checksum[:], s[:]) 34 | 35 | return checksum 36 | } 37 | -------------------------------------------------------------------------------- /p2pserver/common/checksum_test.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "github.com/stretchr/testify/assert" 5 | "testing" 6 | ) 7 | 8 | func TestChecksum(t *testing.T) { 9 | data := []byte{1, 2, 3} 10 | cs := Checksum(data) 11 | 12 | writer := NewChecksum() 13 | writer.Write(data) 14 | checksum2 := writer.Sum(nil) 15 | assert.Equal(t, cs[:], checksum2) 16 | 17 | } 18 | -------------------------------------------------------------------------------- /p2pserver/message/types/address_req.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "github.com/paradigm-network/paradigm/common" 5 | comm "github.com/paradigm-network/paradigm/p2pserver/common" 6 | ) 7 | 8 | type AddrReq struct{} 9 | 10 | //Serialize message payload 11 | func (this AddrReq) Serialization(sink *common.ZeroCopySink) error { 12 | return nil 13 | } 14 | 15 | func (this *AddrReq) CmdType() string { 16 | return comm.GetADDR_TYPE 17 | } 18 | 19 | //Deserialize message payload 20 | func (this *AddrReq) Deserialization(source *common.ZeroCopySource) error { 21 | return nil 22 | } 23 | -------------------------------------------------------------------------------- /p2pserver/message/types/address_req_test.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestAddrReqSerializationDeserialization(t *testing.T) { 8 | var msg AddrReq 9 | 10 | MessageTest(t, &msg) 11 | } 12 | -------------------------------------------------------------------------------- /p2pserver/message/types/block_headers_req_test.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "testing" 5 | 6 | cm "github.com/paradigm-network/paradigm/common" 7 | ) 8 | 9 | func TestBlkHdrReqSerializationDeserialization(t *testing.T) { 10 | var msg HeadersReq 11 | msg.Len = 1 12 | 13 | hashstr := "8932da73f52b1e22f30c609988ed1f693b6144f74fed9a2a20869afa7abfdf5e" 14 | msg.HashStart, _ = cm.Uint256FromHexString(hashstr) 15 | 16 | MessageTest(t, &msg) 17 | } 18 | -------------------------------------------------------------------------------- /p2pserver/message/types/blocks_req_test.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "testing" 5 | 6 | cm "github.com/paradigm-network/paradigm/common" 7 | ) 8 | 9 | func TestBlkReqSerializationDeserialization(t *testing.T) { 10 | var msg BlocksReq 11 | msg.HeaderHashCount = 1 12 | 13 | hashstr := "8932da73f52b1e22f30c609988ed1f693b6144f74fed9a2a20869afa7abfdf5e" 14 | msg.HashStart, _ = cm.Uint256FromHexString(hashstr) 15 | 16 | MessageTest(t, &msg) 17 | } 18 | -------------------------------------------------------------------------------- /p2pserver/message/types/consensus.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | comm "github.com/paradigm-network/paradigm/common" 5 | "github.com/paradigm-network/paradigm/p2pserver/common" 6 | ) 7 | 8 | type Consensus struct { 9 | Cons ConsensusPayload 10 | } 11 | 12 | //Serialize message payload 13 | func (this *Consensus) Serialization(sink *comm.ZeroCopySink) error { 14 | return this.Cons.Serialization(sink) 15 | } 16 | 17 | func (this *Consensus) CmdType() string { 18 | return common.CONSENSUS_TYPE 19 | } 20 | 21 | //Deserialize message payload 22 | func (this *Consensus) Deserialization(source *comm.ZeroCopySource) error { 23 | return this.Cons.Deserialization(source) 24 | } 25 | -------------------------------------------------------------------------------- /p2pserver/message/types/data_req_test.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "testing" 5 | 6 | cm "github.com/paradigm-network/paradigm/common" 7 | ) 8 | 9 | func TestDataReqSerializationDeserialization(t *testing.T) { 10 | var msg DataReq 11 | msg.DataType = 0x02 12 | 13 | hashstr := "8932da73f52b1e22f30c609988ed1f693b6144f74fed9a2a20869afa7abfdf5e" 14 | bhash, _ := cm.HexToBytes(hashstr) 15 | copy(msg.Hash[:], bhash) 16 | 17 | MessageTest(t, &msg) 18 | } 19 | -------------------------------------------------------------------------------- /p2pserver/message/types/disconnected.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | comm "github.com/paradigm-network/paradigm/common" 5 | "github.com/paradigm-network/paradigm/p2pserver/common" 6 | ) 7 | 8 | type Disconnected struct{} 9 | 10 | //Serialize message payload 11 | func (this Disconnected) Serialization(sink *comm.ZeroCopySink) error { 12 | return nil 13 | } 14 | 15 | func (this Disconnected) CmdType() string { 16 | return common.DISCONNECT_TYPE 17 | } 18 | 19 | //Deserialize message payload 20 | func (this *Disconnected) Deserialization(source *comm.ZeroCopySource) error { 21 | return nil 22 | } 23 | -------------------------------------------------------------------------------- /p2pserver/message/types/message_test.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "bytes" 5 | "testing" 6 | 7 | "github.com/paradigm-network/paradigm/p2pserver/common" 8 | "github.com/stretchr/testify/assert" 9 | ) 10 | 11 | func TestMsgHdrSerializationDeserialization(t *testing.T) { 12 | hdr := newMessageHeader("hdrtest", 0, common.Checksum(nil)) 13 | 14 | buf := bytes.NewBuffer(nil) 15 | err := writeMessageHeader(buf, hdr) 16 | if err != nil { 17 | return 18 | } 19 | 20 | dehdr, err := readMessageHeader(buf) 21 | assert.Nil(t, err) 22 | 23 | assert.Equal(t, hdr, dehdr) 24 | 25 | } 26 | -------------------------------------------------------------------------------- /p2pserver/message/types/notfound.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "io" 5 | 6 | "github.com/paradigm-network/paradigm/common" 7 | comm "github.com/paradigm-network/paradigm/p2pserver/common" 8 | ) 9 | 10 | type NotFound struct { 11 | Hash common.Uint256 12 | } 13 | 14 | //Serialize message payload 15 | func (this NotFound) Serialization(sink *common.ZeroCopySink) error { 16 | sink.WriteHash(this.Hash) 17 | return nil 18 | } 19 | 20 | func (this NotFound) CmdType() string { 21 | return comm.NOT_FOUND_TYPE 22 | } 23 | 24 | //Deserialize message payload 25 | func (this *NotFound) Deserialization(source *common.ZeroCopySource) error { 26 | var eof bool 27 | this.Hash, eof = source.NextHash() 28 | if eof { 29 | return io.ErrUnexpectedEOF 30 | } 31 | 32 | return nil 33 | } 34 | -------------------------------------------------------------------------------- /p2pserver/message/types/notfound_test.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "testing" 5 | 6 | cm "github.com/paradigm-network/paradigm/common" 7 | ) 8 | 9 | func Uint256ParseFromBytes(f []byte) cm.Uint256 { 10 | if len(f) != 32 { 11 | return cm.Uint256{} 12 | } 13 | 14 | var hash [32]uint8 15 | for i := 0; i < 32; i++ { 16 | hash[i] = f[i] 17 | } 18 | return cm.Uint256(hash) 19 | } 20 | 21 | func TestNotFoundSerializationDeserialization(t *testing.T) { 22 | var msg NotFound 23 | str := "123456" 24 | hash := []byte(str) 25 | msg.Hash = Uint256ParseFromBytes(hash) 26 | 27 | MessageTest(t, &msg) 28 | } 29 | -------------------------------------------------------------------------------- /p2pserver/message/types/ping.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "io" 5 | 6 | comm "github.com/paradigm-network/paradigm/common" 7 | "github.com/paradigm-network/paradigm/p2pserver/common" 8 | ) 9 | 10 | type Ping struct { 11 | Height uint64 12 | } 13 | 14 | //Serialize message payload 15 | func (this Ping) Serialization(sink *comm.ZeroCopySink) error { 16 | sink.WriteUint64(this.Height) 17 | return nil 18 | } 19 | 20 | func (this *Ping) CmdType() string { 21 | return common.PING_TYPE 22 | } 23 | 24 | //Deserialize message payload 25 | func (this *Ping) Deserialization(source *comm.ZeroCopySource) error { 26 | var eof bool 27 | this.Height, eof = source.NextUint64() 28 | if eof { 29 | return io.ErrUnexpectedEOF 30 | } 31 | 32 | return nil 33 | } 34 | -------------------------------------------------------------------------------- /p2pserver/message/types/ping_test.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestPingSerializationDeserialization(t *testing.T) { 8 | var msg Ping 9 | msg.Height = 1 10 | 11 | MessageTest(t, &msg) 12 | } 13 | -------------------------------------------------------------------------------- /p2pserver/message/types/pong.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "io" 5 | 6 | comm "github.com/paradigm-network/paradigm/common" 7 | "github.com/paradigm-network/paradigm/p2pserver/common" 8 | ) 9 | 10 | type Pong struct { 11 | Height uint64 12 | } 13 | 14 | //Serialize message payload 15 | func (this Pong) Serialization(sink *comm.ZeroCopySink) error { 16 | sink.WriteUint64(this.Height) 17 | return nil 18 | } 19 | 20 | func (this Pong) CmdType() string { 21 | return common.PONG_TYPE 22 | } 23 | 24 | //Deserialize message payload 25 | func (this *Pong) Deserialization(source *comm.ZeroCopySource) error { 26 | var eof bool 27 | this.Height, eof = source.NextUint64() 28 | if eof { 29 | return io.ErrUnexpectedEOF 30 | } 31 | 32 | return nil 33 | } 34 | -------------------------------------------------------------------------------- /p2pserver/message/types/pong_test.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestPongSerializationDeserialization(t *testing.T) { 8 | var msg Pong 9 | msg.Height = 1 10 | 11 | MessageTest(t, &msg) 12 | } 13 | -------------------------------------------------------------------------------- /p2pserver/message/types/transaction.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | comm "github.com/paradigm-network/paradigm/common" 5 | "github.com/paradigm-network/paradigm/core/types" 6 | "github.com/paradigm-network/paradigm/p2pserver/common" 7 | ) 8 | 9 | // Transaction message 10 | type Trn struct { 11 | Txn *types.Transaction 12 | } 13 | 14 | //Serialize message payload 15 | func (this Trn) Serialization(sink *comm.ZeroCopySink) error { 16 | return this.Txn.Serialization(sink) 17 | } 18 | 19 | func (this *Trn) CmdType() string { 20 | return common.TX_TYPE 21 | } 22 | 23 | //Deserialize message payload 24 | func (this *Trn) Deserialization(source *comm.ZeroCopySource) error { 25 | tx := &types.Transaction{} 26 | err := tx.Deserialization(source) 27 | if err != nil { 28 | return err 29 | } 30 | 31 | this.Txn = tx 32 | return nil 33 | } 34 | -------------------------------------------------------------------------------- /p2pserver/message/types/verack.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "io" 5 | 6 | comm "github.com/paradigm-network/paradigm/common" 7 | "github.com/paradigm-network/paradigm/p2pserver/common" 8 | ) 9 | 10 | type VerACK struct { 11 | IsConsensus bool 12 | } 13 | 14 | //Serialize message payload 15 | func (this *VerACK) Serialization(sink *comm.ZeroCopySink) error { 16 | sink.WriteBool(this.IsConsensus) 17 | return nil 18 | } 19 | 20 | func (this *VerACK) CmdType() string { 21 | return common.VERACK_TYPE 22 | } 23 | 24 | //Deserialize message payload 25 | func (this *VerACK) Deserialization(source *comm.ZeroCopySource) error { 26 | var irregular, eof bool 27 | this.IsConsensus, irregular, eof = source.NextBool() 28 | if eof { 29 | return io.ErrUnexpectedEOF 30 | } 31 | if irregular { 32 | return comm.ErrIrregularData 33 | } 34 | 35 | return nil 36 | } 37 | -------------------------------------------------------------------------------- /p2pserver/message/types/verack_test.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestVerackSerializationDeserialization(t *testing.T) { 8 | var msg VerACK 9 | msg.IsConsensus = false 10 | 11 | MessageTest(t, &msg) 12 | } 13 | -------------------------------------------------------------------------------- /p2pserver/p2pserver_test.go: -------------------------------------------------------------------------------- 1 | package p2pserver 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | 7 | "github.com/paradigm-network/paradigm/p2pserver/common" 8 | ) 9 | 10 | 11 | 12 | func init() { 13 | 14 | fmt.Println("Start test the netserver...") 15 | 16 | } 17 | func TestNewP2PServer(t *testing.T) { 18 | 19 | fmt.Println("Start test new p2pserver...") 20 | 21 | p2p := NewServer() 22 | 23 | if p2p.GetVersion() != common.PROTOCOL_VERSION { 24 | t.Error("TestNewP2PServer p2p version error", p2p.GetVersion()) 25 | } 26 | 27 | if p2p.GetVersion() != common.PROTOCOL_VERSION { 28 | t.Error("TestNewP2PServer p2p version error") 29 | } 30 | sync, cons := p2p.GetPort() 31 | if sync != 20338 { 32 | t.Error("TestNewP2PServer sync port error") 33 | } 34 | 35 | if cons != 20339 { 36 | t.Error("TestNewP2PServer consensus port error") 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /proxy/account_map.go: -------------------------------------------------------------------------------- 1 | package proxy 2 | 3 | type AccountMap map[string]struct { 4 | Code string 5 | Storage map[string]string 6 | Balance string 7 | } -------------------------------------------------------------------------------- /proxy/errors.go: -------------------------------------------------------------------------------- 1 | package proxy 2 | 3 | import "errors" 4 | 5 | var ( 6 | ErrNonceTooHigh = errors.New("nonce is too high") 7 | ErrNonceTooLow = errors.New("nonce is too low") 8 | ErrInsufficientBalanceForGas = errors.New("insufficient balance to pay for gas") 9 | ErrInsufficientBalance = errors.New("insufficient balance") 10 | ErrOutOfGas = errors.New("out of gas") 11 | ErrGasLimitReached = errors.New("gas limit reached") 12 | ) 13 | -------------------------------------------------------------------------------- /proxy/gaspool.go: -------------------------------------------------------------------------------- 1 | package proxy 2 | 3 | import "math/big" 4 | 5 | // GasPool tracks the amount of gas available during 6 | // execution of the transactions in a block. 7 | // The zero value is a pool with zero gas available. 8 | type GasPool big.Int 9 | 10 | // AddGas makes gas available for execution. 11 | func (gp *GasPool) AddGas(amount *big.Int) *GasPool { 12 | i := (*big.Int)(gp) 13 | i.Add(i, amount) 14 | return gp 15 | } 16 | 17 | // SubGas deducts the given amount from the pool if enough gas is 18 | // available and returns an error otherwise. 19 | func (gp *GasPool) SubGas(amount *big.Int) error { 20 | i := (*big.Int)(gp) 21 | if i.Cmp(amount) < 0 { 22 | return ErrGasLimitReached 23 | } 24 | i.Sub(i, amount) 25 | return nil 26 | } 27 | 28 | func (gp *GasPool) String() string { 29 | return (*big.Int)(gp).String() 30 | } 31 | -------------------------------------------------------------------------------- /trie/errors.go: -------------------------------------------------------------------------------- 1 | package trie 2 | 3 | import ( 4 | "fmt" 5 | "github.com/paradigm-network/paradigm/common" 6 | ) 7 | 8 | // MissingNodeError is returned by the trie functions (TryGet, TryUpdate, TryDelete) 9 | // in the case where a trie node is not present in the local database. It contains 10 | // information necessary for retrieving the missing node. 11 | type MissingNodeError struct { 12 | NodeHash common.Hash // hash of the missing node 13 | Path []byte // hex-encoded path to the missing node 14 | } 15 | 16 | func (err *MissingNodeError) Error() string { 17 | return fmt.Sprintf("missing trie node %x (path %x)", err.NodeHash, err.Path) 18 | } 19 | -------------------------------------------------------------------------------- /types/frame.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | type Frame struct { 4 | Roots map[string]Root 5 | Comets []Comet 6 | } 7 | -------------------------------------------------------------------------------- /types/root.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | ) 7 | 8 | type Root struct { 9 | X, Y string 10 | Index int 11 | Round int 12 | Others map[string]string 13 | } 14 | 15 | func NewBaseRoot() Root { 16 | return Root{ 17 | X: "", 18 | Y: "", 19 | Index: -1, 20 | Round: -1, 21 | } 22 | } 23 | 24 | func (root *Root) Marshal() ([]byte, error) { 25 | var b bytes.Buffer 26 | enc := json.NewEncoder(&b) //will write to b 27 | if err := enc.Encode(root); err != nil { 28 | return nil, err 29 | } 30 | return b.Bytes(), nil 31 | } 32 | 33 | func (root *Root) Unmarshal(data []byte) error { 34 | b := bytes.NewBuffer(data) 35 | dec := json.NewDecoder(b) //will read from b 36 | return dec.Decode(root) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/AndreasBriese/bbloom/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 1.1 3 | -------------------------------------------------------------------------------- /vendor/github.com/dgraph-io/badger/badger/.gitignore: -------------------------------------------------------------------------------- 1 | /badger 2 | -------------------------------------------------------------------------------- /vendor/github.com/dgraph-io/badger/contrib/cover.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SRC="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.." 4 | TMP=$(mktemp /tmp/badger-coverage-XXXXX.txt) 5 | 6 | BUILD=$1 7 | OUT=$2 8 | 9 | set -e 10 | 11 | pushd $SRC &> /dev/null 12 | 13 | # create coverage output 14 | echo 'mode: atomic' > $OUT 15 | for PKG in $(go list ./...|grep -v -E 'vendor'); do 16 | go test -covermode=atomic -coverprofile=$TMP $PKG 17 | tail -n +2 $TMP >> $OUT 18 | done 19 | 20 | # Another round of tests after turning off mmap 21 | go test -v -vlog_mmap=false github.com/dgraph-io/badger 22 | 23 | popd &> /dev/null 24 | -------------------------------------------------------------------------------- /vendor/github.com/dgraph-io/badger/images/benchmarks-rocksdb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paradigm-network/paradigm/c1cffc982a6efd50b5c2d9e3e5e6898c4c8f3f87/vendor/github.com/dgraph-io/badger/images/benchmarks-rocksdb.png -------------------------------------------------------------------------------- /vendor/github.com/dgraph-io/badger/images/diggy-shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paradigm-network/paradigm/c1cffc982a6efd50b5c2d9e3e5e6898c4c8f3f87/vendor/github.com/dgraph-io/badger/images/diggy-shadow.png -------------------------------------------------------------------------------- /vendor/github.com/dgraph-io/badger/images/sketch.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paradigm-network/paradigm/c1cffc982a6efd50b5c2d9e3e5e6898c4c8f3f87/vendor/github.com/dgraph-io/badger/images/sketch.jpg -------------------------------------------------------------------------------- /vendor/github.com/dgraph-io/badger/integration/testgc/.gitignore: -------------------------------------------------------------------------------- 1 | /testgc 2 | -------------------------------------------------------------------------------- /vendor/github.com/dgraph-io/badger/protos/gen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # You might need to go get -v github.com/gogo/protobuf/... 4 | 5 | protos=${GOPATH-$HOME/go}/src/github.com/dgraph-io/badger/protos 6 | pushd $protos > /dev/null 7 | protoc --gofast_out=plugins=grpc:. -I=. *.proto 8 | -------------------------------------------------------------------------------- /vendor/github.com/dgraph-io/badger/test.sh: -------------------------------------------------------------------------------- 1 | l=$(go list ./...) 2 | for x in $l; do 3 | echo "Testing package $x" 4 | go test -race -v $x 5 | done 6 | -------------------------------------------------------------------------------- /vendor/github.com/dgraph-io/badger/y/file_nodsync.go: -------------------------------------------------------------------------------- 1 | // +build dragonfly freebsd windows 2 | 3 | /* 4 | * Copyright 2017 Dgraph Labs, Inc. and Contributors 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package y 20 | 21 | import "syscall" 22 | 23 | func init() { 24 | datasyncFileFlag = syscall.O_SYNC 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/dgryski/go-farm/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | *.exe 21 | *.test 22 | *.prof 23 | 24 | target 25 | -------------------------------------------------------------------------------- /vendor/github.com/dgryski/go-farm/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | sudo: false 4 | 5 | branches: 6 | except: 7 | - release 8 | 9 | branches: 10 | only: 11 | - master 12 | - develop 13 | - travis 14 | 15 | go: 16 | - 1.9 17 | - tip 18 | 19 | matrix: 20 | allow_failures: 21 | - go: tip 22 | 23 | before_install: 24 | - if [ -n "$GH_USER" ]; then git config --global github.user ${GH_USER}; fi; 25 | - if [ -n "$GH_TOKEN" ]; then git config --global github.token ${GH_TOKEN}; fi; 26 | - go get github.com/mattn/goveralls 27 | 28 | before_script: 29 | - make deps 30 | 31 | script: 32 | - make qa 33 | 34 | after_failure: 35 | - cat ./target/test/report.xml 36 | 37 | after_success: 38 | - if [ "$TRAVIS_GO_VERSION" = "1.9" ]; then $HOME/gopath/bin/goveralls -covermode=count -coverprofile=target/report/coverage.out -service=travis-ci; fi; 39 | -------------------------------------------------------------------------------- /vendor/github.com/dgryski/go-farm/VERSION: -------------------------------------------------------------------------------- 1 | 2.0.1 2 | -------------------------------------------------------------------------------- /vendor/github.com/dgryski/go-farm/basics.go: -------------------------------------------------------------------------------- 1 | package farm 2 | 3 | // Some primes between 2^63 and 2^64 for various uses. 4 | const k0 uint64 = 0xc3a5c85c97cb3127 5 | const k1 uint64 = 0xb492b66fbe98f273 6 | const k2 uint64 = 0x9ae16a3b2f90404f 7 | 8 | // Magic numbers for 32-bit hashing. Copied from Murmur3. 9 | const c1 uint32 = 0xcc9e2d51 10 | const c2 uint32 = 0x1b873593 11 | 12 | // A 32-bit to 32-bit integer hash copied from Murmur3. 13 | func fmix(h uint32) uint32 { 14 | h ^= h >> 16 15 | h *= 0x85ebca6b 16 | h ^= h >> 13 17 | h *= 0xc2b2ae35 18 | h ^= h >> 16 19 | return h 20 | } 21 | 22 | func mur(a, h uint32) uint32 { 23 | // Helper from Murmur3 for combining two 32-bit values. 24 | a *= c1 25 | a = rotate32(a, 17) 26 | a *= c2 27 | h ^= a 28 | h = rotate32(h, 19) 29 | return h*5 + 0xe6546b64 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/dgryski/go-farm/platform.go: -------------------------------------------------------------------------------- 1 | package farm 2 | 3 | func rotate32(val uint32, shift uint) uint32 { 4 | return ((val >> shift) | (val << (32 - shift))) 5 | } 6 | 7 | func rotate64(val uint64, shift uint) uint64 { 8 | return ((val >> shift) | (val << (64 - shift))) 9 | } 10 | 11 | func fetch32(s []byte, idx int) uint32 { 12 | return uint32(s[idx+0]) | uint32(s[idx+1])<<8 | uint32(s[idx+2])<<16 | uint32(s[idx+3])<<24 13 | } 14 | 15 | func fetch64(s []byte, idx int) uint64 { 16 | return uint64(s[idx+0]) | uint64(s[idx+1])<<8 | uint64(s[idx+2])<<16 | uint64(s[idx+3])<<24 | 17 | uint64(s[idx+4])<<32 | uint64(s[idx+5])<<40 | uint64(s[idx+6])<<48 | uint64(s[idx+7])<<56 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.[568ao] 3 | *.ao 4 | *.so 5 | *.pyc 6 | ._* 7 | .nfs.* 8 | [568a].out 9 | *~ 10 | *.orig 11 | core 12 | _obj 13 | _test 14 | _testmain.go 15 | protoc-gen-go/testdata/multi/*.pb.go 16 | _conformance/_conformance 17 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | go: 4 | - 1.6.x 5 | - 1.7.x 6 | - 1.8.x 7 | - 1.9.x 8 | 9 | install: 10 | - go get -v -d -t github.com/golang/protobuf/... 11 | - curl -L https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip -o /tmp/protoc.zip 12 | - unzip /tmp/protoc.zip -d $HOME/protoc 13 | 14 | env: 15 | - PATH=$HOME/protoc/bin:$PATH 16 | 17 | script: 18 | - make all test 19 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/github.com/itchyny/base58-go/Makefile: -------------------------------------------------------------------------------- 1 | all: clean build 2 | 3 | build: deps 4 | go build -o build/base58 ./cmd/base58 5 | 6 | install: deps 7 | go install ./... 8 | 9 | deps: 10 | go get -d -v ./... 11 | 12 | test: testdeps build 13 | go test -v ./... 14 | 15 | testdeps: 16 | go get -d -v -t ./... 17 | go get -u github.com/golang/lint/golint 18 | 19 | lint: testdeps 20 | go vet ./... 21 | golint -set_exit_status ./... 22 | 23 | GOFMT_RET = .gofmt.txt 24 | gofmt: testdeps 25 | rm -f $(GOFMT_RET) 26 | gofmt -s -d *.go | tee $(GOFMT_RET) 27 | test ! -s $(GOFMT_RET) 28 | 29 | clean: 30 | rm -rf build 31 | go clean 32 | 33 | .PHONY: build install deps test testdeps lint gofmt clean 34 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go_import_path: github.com/pkg/errors 3 | go: 4 | - 1.4.3 5 | - 1.5.4 6 | - 1.6.2 7 | - 1.7.1 8 | - tip 9 | 10 | script: 11 | - go test -v ./... 12 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: build-{build}.{branch} 2 | 3 | clone_folder: C:\gopath\src\github.com\pkg\errors 4 | shallow_clone: true # for startup speed 5 | 6 | environment: 7 | GOPATH: C:\gopath 8 | 9 | platform: 10 | - x64 11 | 12 | # http://www.appveyor.com/docs/installed-software 13 | install: 14 | # some helpful output for debugging builds 15 | - go version 16 | - go env 17 | # pre-installed MinGW at C:\MinGW is 32bit only 18 | # but MSYS2 at C:\msys64 has mingw64 19 | - set PATH=C:\msys64\mingw64\bin;%PATH% 20 | - gcc --version 21 | - g++ --version 22 | 23 | build_script: 24 | - go install -v ./... 25 | 26 | test_script: 27 | - set PATH=C:\gopath\bin;%PATH% 28 | - go test -v ./... 29 | 30 | #artifacts: 31 | # - path: '%GOPATH%\bin\*.exe' 32 | deploy: off 33 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - "1.7" 4 | - "1.8" 5 | - "1.9" 6 | - "1.10" 7 | - "master" 8 | matrix: 9 | allow_failures: 10 | - go: "master" 11 | script: 12 | - go test -v -race -cpu=1,2,4 -bench . -benchmem ./... 13 | - go test -v -tags binary_log -race -cpu=1,2,4 -bench . -benchmem ./... 14 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/array_test.go: -------------------------------------------------------------------------------- 1 | package zerolog 2 | 3 | import ( 4 | "net" 5 | "testing" 6 | "time" 7 | ) 8 | 9 | func TestArray(t *testing.T) { 10 | a := Arr(). 11 | Bool(true). 12 | Int(1). 13 | Int8(2). 14 | Int16(3). 15 | Int32(4). 16 | Int64(5). 17 | Uint(6). 18 | Uint8(7). 19 | Uint16(8). 20 | Uint32(9). 21 | Uint64(10). 22 | Float32(11.98122). 23 | Float64(12.987654321). 24 | Str("a"). 25 | Bytes([]byte("b")). 26 | Hex([]byte{0x1f}). 27 | Time(time.Time{}). 28 | IPAddr(net.IP{192, 168, 0, 10}). 29 | Dur(0) 30 | want := `[true,1,2,3,4,5,6,7,8,9,10,11.98122,12.987654321,"a","b","1f","0001-01-01T00:00:00Z","192.168.0.10",0]` 31 | if got := decodeObjectToStr(a.write([]byte{})); got != want { 32 | t.Errorf("Array.write()\ngot: %s\nwant: %s", got, want) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/console_test.go: -------------------------------------------------------------------------------- 1 | package zerolog_test 2 | 3 | import ( 4 | "bytes" 5 | "os" 6 | "strings" 7 | "testing" 8 | 9 | "github.com/rs/zerolog" 10 | ) 11 | 12 | func ExampleConsoleWriter_Write() { 13 | log := zerolog.New(zerolog.ConsoleWriter{Out: os.Stdout, NoColor: true}) 14 | 15 | log.Info().Msg("hello world") 16 | // Output: |INFO| hello world 17 | } 18 | 19 | func TestConsoleWriterNumbers(t *testing.T) { 20 | buf := &bytes.Buffer{} 21 | log := zerolog.New(zerolog.ConsoleWriter{Out: buf, NoColor: true}) 22 | log.Info(). 23 | Float64("float", 1.23). 24 | Uint64("small", 123). 25 | Uint64("big", 1152921504606846976). 26 | Msg("msg") 27 | if got, want := strings.TrimSpace(buf.String()), " |INFO| msg big=1152921504606846976 float=1.23 small=123"; got != want { 28 | t.Errorf("\ngot:\n%s\nwant:\n%s", got, want) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/diode/diode_example_test.go: -------------------------------------------------------------------------------- 1 | // +build !binary_log 2 | 3 | package diode_test 4 | 5 | import ( 6 | "fmt" 7 | "os" 8 | "time" 9 | 10 | "github.com/rs/zerolog" 11 | "github.com/rs/zerolog/diode" 12 | ) 13 | 14 | func ExampleNewWriter() { 15 | w := diode.NewWriter(os.Stdout, 1000, 10*time.Millisecond, func(missed int) { 16 | fmt.Printf("Dropped %d messages\n", missed) 17 | }) 18 | log := zerolog.New(w) 19 | log.Print("test") 20 | 21 | w.Close() 22 | 23 | // Output: {"level":"debug","message":"test"} 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/diode/internal/diodes/README: -------------------------------------------------------------------------------- 1 | Copied from https://github.com/cloudfoundry/go-diodes to avoid test dependencies. 2 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/encoder_json.go: -------------------------------------------------------------------------------- 1 | // +build !binary_log 2 | 3 | package zerolog 4 | 5 | // encoder_json.go file contains bindings to generate 6 | // JSON encoded byte stream. 7 | 8 | import ( 9 | "github.com/rs/zerolog/internal/json" 10 | ) 11 | 12 | var ( 13 | _ encoder = (*json.Encoder)(nil) 14 | 15 | enc = json.Encoder{} 16 | ) 17 | 18 | func appendJSON(dst []byte, j []byte) []byte { 19 | return append(dst, j...) 20 | } 21 | 22 | func decodeIfBinaryToString(in []byte) string { 23 | return string(in) 24 | } 25 | 26 | func decodeObjectToStr(in []byte) string { 27 | return string(in) 28 | } 29 | 30 | func decodeIfBinaryToBytes(in []byte) []byte { 31 | return in 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/rs/zerolog 2 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/internal/cbor/examples/makefile: -------------------------------------------------------------------------------- 1 | all: genLogJSON genLogCBOR 2 | 3 | genLogJSON: genLog.go 4 | go build -o genLogJSON genLog.go 5 | 6 | genLogCBOR: genLog.go 7 | go build -tags binary_log -o genLogCBOR genLog.go 8 | 9 | clean: 10 | rm -f genLogJSON genLogCBOR 11 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/pretty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paradigm-network/paradigm/c1cffc982a6efd50b5c2d9e3e5e6898c4c8f3f87/vendor/github.com/rs/zerolog/pretty.png -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | 24 | .DS_Store 25 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/.travis.gofmt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -n "$(gofmt -l .)" ]; then 4 | echo "Go code is not formatted:" 5 | gofmt -d . 6 | exit 1 7 | fi 8 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/.travis.gogenerate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$TRAVIS_GO_VERSION" =~ ^1\.[45](\..*)?$ ]]; then 4 | exit 0 5 | fi 6 | 7 | go get github.com/ernesto-jimenez/gogen/imports 8 | go generate ./... 9 | if [ -n "$(git diff)" ]; then 10 | echo "Go generate had not been run" 11 | git diff 12 | exit 1 13 | fi 14 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/.travis.govet.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd "$(dirname $0)" 4 | DIRS=". assert require mock _codegen" 5 | set -e 6 | for subdir in $DIRS; do 7 | pushd $subdir 8 | go vet 9 | popd 10 | done 11 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | sudo: false 4 | 5 | go: 6 | - 1.4 7 | - 1.5 8 | - 1.6 9 | - 1.7 10 | - 1.8 11 | - tip 12 | 13 | script: 14 | - ./.travis.gogenerate.sh 15 | - ./.travis.gofmt.sh 16 | - ./.travis.govet.sh 17 | - go test -v ./... 18 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/Godeps/Godeps.json: -------------------------------------------------------------------------------- 1 | { 2 | "ImportPath": "github.com/stretchr/testify", 3 | "GoVersion": "go1.5", 4 | "GodepVersion": "v74", 5 | "Packages": [ 6 | "./..." 7 | ], 8 | "Deps": [ 9 | { 10 | "ImportPath": "github.com/davecgh/go-spew/spew", 11 | "Comment": "v1.0.0-3-g6d21280", 12 | "Rev": "04cdfd42973bb9c8589fd6a731800cf222fde1a9" 13 | }, 14 | { 15 | "ImportPath": "github.com/pmezard/go-difflib/difflib", 16 | "Rev": "d8ed2627bdf02c080bf22230dbb337003b7aba2d" 17 | }, 18 | { 19 | "ImportPath": "github.com/stretchr/objx", 20 | "Rev": "cbeaeb16a013161a98496fad62933b1d21786672" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/Godeps/Readme: -------------------------------------------------------------------------------- 1 | This directory tree is generated automatically by godep. 2 | 3 | Please do not edit. 4 | 5 | See https://github.com/tools/godep for more information. 6 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_format.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentFormat}} 2 | func {{.DocInfo.Name}}f(t TestingT, {{.ParamsFormat}}) bool { 3 | return {{.DocInfo.Name}}(t, {{.ForwardedParamsFormat}}) 4 | } 5 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) bool { 3 | return {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 4 | } 5 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/errors.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // AnError is an error instance useful for testing. If the code does not care 8 | // about error specifics, and only needs to return the error for example, this 9 | // error should be used to make the test code more readable. 10 | var AnError = errors.New("assert.AnError general error for testing") 11 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/forward_assertions.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate go run ../_codegen/main.go -output-package=assert -template=assertion_forward.go.tmpl -include-format-funcs 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/http/doc.go: -------------------------------------------------------------------------------- 1 | // Package http DEPRECATED USE net/http/httptest 2 | package http 3 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/http/test_round_tripper.go: -------------------------------------------------------------------------------- 1 | package http 2 | 3 | import ( 4 | "github.com/stretchr/testify/mock" 5 | "net/http" 6 | ) 7 | 8 | // TestRoundTripper DEPRECATED USE net/http/httptest 9 | type TestRoundTripper struct { 10 | mock.Mock 11 | } 12 | 13 | // RoundTrip DEPRECATED USE net/http/httptest 14 | func (t *TestRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { 15 | args := t.Called(req) 16 | return args.Get(0).(*http.Response), args.Error(1) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/package_test.go: -------------------------------------------------------------------------------- 1 | package testify 2 | 3 | import ( 4 | "github.com/stretchr/testify/assert" 5 | "testing" 6 | ) 7 | 8 | func TestImports(t *testing.T) { 9 | if assert.Equal(t, 1, 1) != true { 10 | t.Error("Something is wrong.") 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/forward_requirements.go: -------------------------------------------------------------------------------- 1 | package require 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate go run ../_codegen/main.go -output-package=require -template=require_forward.go.tmpl -include-format-funcs 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/require.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.Comment}} 2 | func {{.DocInfo.Name}}(t TestingT, {{.Params}}) { 3 | if !assert.{{.DocInfo.Name}}(t, {{.ForwardedParams}}) { 4 | t.FailNow() 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/require_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) { 3 | {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 4 | } 5 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/requirements.go: -------------------------------------------------------------------------------- 1 | package require 2 | 3 | // TestingT is an interface wrapper around *testing.T 4 | type TestingT interface { 5 | Errorf(format string, args ...interface{}) 6 | FailNow() 7 | } 8 | 9 | //go:generate go run ../_codegen/main.go -output-package=require -template=require.go.tmpl -include-format-funcs 10 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2012-2013 Dave Collins 4 | 5 | Permission to use, copy, modify, and distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/README.md: -------------------------------------------------------------------------------- 1 | # objx 2 | 3 | * Jump into the [API Documentation](http://godoc.org/github.com/stretchr/objx) 4 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/codegen/array-access.txt: -------------------------------------------------------------------------------- 1 | case []{1}: 2 | a := object.([]{1}) 3 | if isSet { 4 | a[index] = value.({1}) 5 | } else { 6 | if index >= len(a) { 7 | if panics { 8 | panic(fmt.Sprintf("objx: Index %d is out of range because the []{1} only contains %d items.", index, len(a))) 9 | } 10 | return nil 11 | } else { 12 | return a[index] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/codegen/types_list.txt: -------------------------------------------------------------------------------- 1 | Interface,interface{},"something",nil,Inter 2 | Map,map[string]interface{},map[string]interface{}{"name":"Tyler"},nil,MSI 3 | ObjxMap,(Map),New(1),New(nil),ObjxMap 4 | Bool,bool,true,false,Bool 5 | String,string,"hello","",Str 6 | Int,int,1,0,Int 7 | Int8,int8,1,0,Int8 8 | Int16,int16,1,0,Int16 9 | Int32,int32,1,0,Int32 10 | Int64,int64,1,0,Int64 11 | Uint,uint,1,0,Uint 12 | Uint8,uint8,1,0,Uint8 13 | Uint16,uint16,1,0,Uint16 14 | Uint32,uint32,1,0,Uint32 15 | Uint64,uint64,1,0,Uint64 16 | Uintptr,uintptr,1,0,Uintptr 17 | Float32,float32,1,0,Float32 18 | Float64,float64,1,0,Float64 19 | Complex64,complex64,1,0,Complex64 20 | Complex128,complex128,1,0,Complex128 21 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/constants.go: -------------------------------------------------------------------------------- 1 | package objx 2 | 3 | const ( 4 | // PathSeparator is the character used to separate the elements 5 | // of the keypath. 6 | // 7 | // For example, `location.address.city` 8 | PathSeparator string = "." 9 | 10 | // SignatureSeparator is the character that is used to 11 | // separate the Base64 string from the security signature. 12 | SignatureSeparator = "_" 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/security.go: -------------------------------------------------------------------------------- 1 | package objx 2 | 3 | import ( 4 | "crypto/sha1" 5 | "encoding/hex" 6 | ) 7 | 8 | // HashWithKey hashes the specified string using the security 9 | // key. 10 | func HashWithKey(data, key string) string { 11 | hash := sha1.New() 12 | hash.Write([]byte(data + ":" + key)) 13 | return hex.EncodeToString(hash.Sum(nil)) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/tests.go: -------------------------------------------------------------------------------- 1 | package objx 2 | 3 | // Has gets whether there is something at the specified selector 4 | // or not. 5 | // 6 | // If m is nil, Has will always return false. 7 | func (m Map) Has(selector string) bool { 8 | if m == nil { 9 | return false 10 | } 11 | return !m.Get(selector).IsNil() 12 | } 13 | 14 | // IsNil gets whether the data is nil or not. 15 | func (v *Value) IsNil() bool { 16 | return v == nil || v.data == nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/vendor/github.com/stretchr/objx/value.go: -------------------------------------------------------------------------------- 1 | package objx 2 | 3 | // Value provides methods for extracting interface{} data in various 4 | // types. 5 | type Value struct { 6 | // data contains the raw data being managed by this Value 7 | data interface{} 8 | } 9 | 10 | // Data returns the raw data contained by this Value 11 | func (v *Value) Data() interface{} { 12 | return v.data 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/.gitattributes: -------------------------------------------------------------------------------- 1 | # Treat all files in this repo as binary, with no git magic updating 2 | # line endings. Windows users contributing to Go will need to use a 3 | # modern version of git and editors capable of LF line endings. 4 | # 5 | # We'll prevent accidental CRLF line endings from entering the repo 6 | # via the git-review gofmt checks. 7 | # 8 | # See golang.org/issue/9281 9 | 10 | * -text 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/.gitignore: -------------------------------------------------------------------------------- 1 | # Add no patterns to .hgignore except for files generated by the build. 2 | last-change 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/README.md: -------------------------------------------------------------------------------- 1 | # Go Networking 2 | 3 | This repository holds supplementary Go networking libraries. 4 | 5 | ## Download/Install 6 | 7 | The easiest way to install is to run `go get -u golang.org/x/net`. You can 8 | also manually git clone the repository to `$GOPATH/src/golang.org/x/net`. 9 | 10 | ## Report Issues / Send Patches 11 | 12 | This repository uses Gerrit for code changes. To learn how to submit 13 | changes to this repository, see https://golang.org/doc/contribute.html. 14 | The main issue tracker for the net repository is located at 15 | https://github.com/golang/go/issues. Prefix your issue with "x/net:" in the 16 | subject line, so it is easy to find. 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/bpf/setter.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package bpf 6 | 7 | // A Setter is a type which can attach a compiled BPF filter to itself. 8 | type Setter interface { 9 | SetBPF(filter []RawInstruction) error 10 | } 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/bpf/testdata/all_instructions.bpf: -------------------------------------------------------------------------------- 1 | 50,0 0 0 42,1 0 0 42,96 0 0 3,97 0 0 3,48 0 0 42,40 0 0 42,32 0 0 42,80 0 0 42,72 0 0 42,64 0 0 42,177 0 0 42,128 0 0 0,32 0 0 4294963200,32 0 0 4294963204,32 0 0 4294963256,2 0 0 3,3 0 0 3,4 0 0 42,20 0 0 42,36 0 0 42,52 0 0 42,68 0 0 42,84 0 0 42,100 0 0 42,116 0 0 42,148 0 0 42,164 0 0 42,12 0 0 0,28 0 0 0,44 0 0 0,60 0 0 0,76 0 0 0,92 0 0 0,108 0 0 0,124 0 0 0,156 0 0 0,172 0 0 0,132 0 0 0,5 0 0 10,21 8 9 42,21 0 8 42,53 0 7 42,37 0 6 42,37 4 5 42,53 3 4 42,69 2 3 42,7 0 0 0,135 0 0 0,22 0 0 0,6 0 0 0, 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/codereview.cfg: -------------------------------------------------------------------------------- 1 | issuerepo: golang/go 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/context/ctxhttp/ctxhttp_17_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !plan9,go1.7 6 | 7 | package ctxhttp 8 | 9 | import ( 10 | "io" 11 | "net/http" 12 | "net/http/httptest" 13 | "testing" 14 | 15 | "context" 16 | ) 17 | 18 | func TestGo17Context(t *testing.T) { 19 | ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 20 | io.WriteString(w, "ok") 21 | })) 22 | defer ts.Close() 23 | ctx := context.Background() 24 | resp, err := Get(ctx, http.DefaultClient, ts.URL) 25 | if resp == nil || err != nil { 26 | t.Fatalf("error received from client: %v %v", err, resp) 27 | } 28 | resp.Body.Close() 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/context/go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package context 8 | 9 | import "context" // standard library's context, as of Go 1.7 10 | 11 | // A Context carries a deadline, a cancelation signal, and other values across 12 | // API boundaries. 13 | // 14 | // Context's methods may be called by multiple goroutines simultaneously. 15 | type Context = context.Context 16 | 17 | // A CancelFunc tells an operation to abandon its work. 18 | // A CancelFunc does not wait for the work to stop. 19 | // After the first call, subsequent calls to a CancelFunc do nothing. 20 | type CancelFunc = context.CancelFunc 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/html/charset/testdata/README: -------------------------------------------------------------------------------- 1 | These test cases come from 2 | http://www.w3.org/International/tests/repository/html5/the-input-byte-stream/results-basics 3 | 4 | Distributed under both the W3C Test Suite License 5 | (http://www.w3.org/Consortium/Legal/2008/04-testsuite-license) 6 | and the W3C 3-clause BSD License 7 | (http://www.w3.org/Consortium/Legal/2008/03-bsd-license). 8 | To contribute to a W3C Test Suite, see the policies and contribution 9 | forms (http://www.w3.org/2004/10/27-testcases). 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paradigm-network/paradigm/c1cffc982a6efd50b5c2d9e3e5e6898c4c8f3f87/vendor/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html -------------------------------------------------------------------------------- /vendor/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paradigm-network/paradigm/c1cffc982a6efd50b5c2d9e3e5e6898c4c8f3f87/vendor/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html -------------------------------------------------------------------------------- /vendor/golang.org/x/net/html/testdata/webkit/adoption02.dat: -------------------------------------------------------------------------------- 1 | #data 2 | 12

34 3 | #errors 4 | #document 5 | | 6 | | 7 | | 8 | | 9 | | "1" 10 | | 11 | | "2" 12 | | 13 | |

14 | | 15 | | "3" 16 | | "4" 17 | 18 | #data 19 |

20 | #errors 21 | #document 22 | | 23 | | 24 | | 25 | | 26 | |
27 | | 28 | |