Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
PyTest plugin for testing Smart Contracts for Ethereum blockchain.
This library requires the solc
executable to be present.
Only versions >=0.4.2
are supported and tested though this library may work
with other versions.
solc installation instructions
Install Solidity compiler (solc) using Node Package Manager(npm)
npm install -g solc
or for Ubuntu(Linux)
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install solc
Installation
pip install pytest-cobra
Clone the repository and then run
pip install -e . -r requirements.txt
Example MetaCoin picture
# MetaCoin Testing
# cobra is pytest fixture
def test_metacoin(cobra):
# Getting Contract Factory by name
metacoin = cobra.contract('MetaCoin')
# Getting Contract Instance of MetaCoin
metacoin = metacoin.deploy()
assert metacoin.getBalance(cobra.accounts[0]) == 10000
pytest --cobra MetaCoin.sol
solc
provides path aliasing allow you to have more reusable project configurations.
pytest --cobra MetaCoin.sol --import_remappings ["zeppeling=/my-zeppelin-checkout-folder"]
pytest --cobra MetaCoin.sol --allow_paths "/home/meheret,/user,/"
Compile your contracts into a package (soon to be ethPM-compliant)
solc --combined-json abi,bin,bin-runtime contracts/ > MetaCoin.json
Testing Contracts.json
pytest --cobra MetaCoin.json
Comming Soon
with Cobra Framework
Go check out the PyTest.
This project is licensed under the MIT License - see the LICENSE file for details
FAQs
PyTest plugin for testing Smart Contracts for Ethereum blockchain.
We found that pytest-cobra demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.