MCPcopy Create free account
hub / github.com/citp/BlockSci / addAddressProxyMethods

Function addAddressProxyMethods

blockscipy/src/scripts/address_proxy_py.cpp:121–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121void addAddressProxyMethods(AllProxyClasses<blocksci::AnyScript, ProxyAddress> &cls) {
122 cls.base.def("with_type", [](Proxy<blocksci::AnyScript> &p , blocksci::AddressType::Enum type) {
123 static auto table = blocksci::make_dynamic_table<blocksci::AddressType, ProxyScriptWithTypeFunctor>();
124 auto index = static_cast<size_t>(type);
125 return table.at(index)(p);
126 }, "If the address has the given type return it, otherwise return None");
127
128 cls.applyToAll(AddProxyMethods{});
129 setupRangesProxy(cls);
130 addProxyOptionalMethods(cls.optional);
131
132 addProxyEqualityMethods(cls.base);
133 addProxyComparisonMethods(cls.base);
134}

Callers 1

setupScriptProxiesFunction · 0.85

Calls 4

setupRangesProxyFunction · 0.85
addProxyEqualityMethodsFunction · 0.85
applyToAllMethod · 0.80

Tested by

no test coverage detected