Skip to content

Instantly share code, notes, and snippets.

View glaksmono's full-sized avatar

Grady Laksmono glaksmono

View GitHub Profile
(venv) ➜ py-evm git:(eth-py-evm-667) ✗ pytest tests/json-fixtures/test_blockchain.py -x --ff --pdb
======================================================= test session starts =======================================================
platform darwin -- Python 3.6.4, pytest-3.2.5, py-1.5.3, pluggy-0.4.0
rootdir: /Users/glaksmono/Documents/py-evm, inifile: pytest.ini
plugins: xdist-1.22.2, pythonpath-0.7.2, mock-1.10.0, forked-0.2, cov-2.5.1, hypothesis-3.56.9, flaky-3.4.0
collecting 0 items
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> traceback >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ImportError while importing test module '/Users/glaksmono/Documents/py-evm/tests/json-fixtures/test_blockchain.py'.
Hint: make sure your test modules/packages have valid Python names.
/Users/glaksmono/Documents/py-evm/tests/trinity/integration/test_trinity_cli.py:134: Exception
------------------------------------------------------------ Captured stdout call ------------------------------------------------------------
b' INFO 08-09 12:51:59 main \n'
b' ______ _ _ __ \n'
b' /_ __/____(_)___ (_) /___ __\n'
b' / / / ___/ / __ \\/ / __/ / / /\n'
b' / / / / / / / / / / /_/ /_/ / \n'
b' /_/ /_/ /_/_/ /_/_/\\__/\\__, / \n'
b' /____/ \n'
b' INFO 08-09 12:51:59 main Trinity/eth-0.2.0a29/darwin/cpython3.6.4\n'
@glaksmono
glaksmono / contracts...artifacts...artifacts...MappingStructExample.sol
Created August 21, 2021 08:09
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.0+commit.26b70077.js&optimize=false&runs=200&gist=
pragma solidity ^0.5.13;
contract MappingStructExample {
struct Payment {
uint amount;
uint timestamp;
}
struct Balance {
@glaksmono
glaksmono / contracts...artifacts...SendMoneyExample.sol
Created August 21, 2021 08:10
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.0+commit.26b70077.js&optimize=false&runs=200&gist=
pragma solidity ^0.5.13;
contract SendMoneyExample {
uint public balanceReceived;
uint public lockedUntil;
function receiveMoney() public payable {
balanceReceived += msg.value;
lockedUntil = block.timestamp + 1 minutes;
@glaksmono
glaksmono / contracts...artifacts...StartStopUpdateExample.sol
Created August 21, 2021 08:10
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.0+commit.26b70077.js&optimize=false&runs=200&gist=
pragma solidity ^0.5.13;
contract StartStopUpdateExample {
address owner;
bool paused;
constructor() public {
owner = msg.sender;
@glaksmono
glaksmono / contracts...artifacts...SimpleMappingExample.sol
Created August 21, 2021 08:10
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.0+commit.26b70077.js&optimize=false&runs=200&gist=
pragma solidity ^0.6.0;
contract SimpleMappingExample {
mapping(uint => bool) public myMapping;
mapping(address => bool) public myAddressMapping;
mapping(uint => mapping(uint => bool)) uintUintBoolMapping;
@glaksmono
glaksmono / contracts...artifacts...ExceptionExample.sol
Created August 21, 2021 08:10
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.0+commit.26b70077.js&optimize=false&runs=200&gist=
pragma solidity ^0.5.13;
contract ExceptionExample {
mapping(address => uint64) public balanceReceived;
function receiveMoney() public payable {
assert(balanceReceived[msg.sender] + uint64(msg.value) >= balanceReceived[msg.sender]);
balanceReceived[msg.sender] += uint64(msg.value);
}
@glaksmono
glaksmono / contracts...IntegerExample.sol
Created August 21, 2021 08:11
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.0+commit.26b70077.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.1;
contract IntegerExample {
uint public myUint;
}
@glaksmono
glaksmono / contracts...TryCatchExample.sol
Created August 22, 2021 02:10
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
//SPDX-License-Idenfitier: MIT
pragma solidity 0.8.4;
contract WillThrow {
function aFunction() public {
require (false, "Error message Test");
}
}
@glaksmono
glaksmono / contracts...FunctionExample.sol
Created August 22, 2021 08:13
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.13+commit.5b0b510c.js&optimize=false&runs=200&gist=
pragma solidity ^0.5.13;
contract FunctionExample {
mapping(address => uint) public balanceReceived;
address payable owner;
constructor() public {
owner = msg.sender;