Skip to content

Commit

Permalink
Merge pull request #121 from euri10/develop
Browse files Browse the repository at this point in the history
setEtherbase
  • Loading branch information
pipermerriam committed Oct 27, 2016
2 parents e2aab74 + 4b85343 commit 656903b
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,49 @@ chains

# Test output logs
logs
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml

# Sensitive or high-churn files:
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml

# Gradle:
.idea/gradle.xml
.idea/libraries

# Mongo Explorer plugin:
.idea/mongoSettings.xml

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

7 changes: 7 additions & 0 deletions tests/mining-module/test_setEtherBase.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

def test_miner_setEtherbase(web3_empty):
web3 = web3_empty
assert web3.eth.coinbase == web3.eth.accounts[0]
new_account = web3.personal.newAccount('this-is-a-password')
web3.miner.setEtherBase(new_account)
assert web3.eth.coinbase == new_account
3 changes: 3 additions & 0 deletions web3/miner.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ def makeDAG(self, number):
def setExtra(self, extra):
return self.web3._requestManager.request_blocking("miner_setExtra", [extra])

def setEtherBase(self, etherbase):
return self.web3._requestManager.request_blocking("miner_setEtherbase", [etherbase])

def setGasPrice(self, gas_price):
return self.web3._requestManager.request_blocking(
"miner_setGasPrice", [gas_price],
Expand Down

0 comments on commit 656903b

Please sign in to comment.