Skip to content

Commit 6b5dac3

Browse files
committed
Add kwargs to the GasPrice wrapper to fix issue with instance creating in BaseWrapper
1 parent 8ed0b7f commit 6b5dac3

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ If you would like to pay fees in cUSD, set the gas price manually:
7777
```python
7878
stable_token = kit.base_wrapper.create_and_get_contract_by_name('StableToken')
7979
gas_price_contract = kit.base_wrapper.create_and_get_contract_by_name('GasPriceMinimum')
80-
gas_price_minimum = gas_price_contract.get_gas_price_minimum(stable.address)
80+
gas_price_minimum = gas_price_contract.get_gas_price_minimum(stable_token.address)
8181
gas_price = gas_price_minimum * 1.3 # Wiggle room if gas price minimum changes before tx is sent
8282
kit.wallet_fee_currency = stable_token.address # Default to paying fees in cUSD
8383
kit.wallet_gas_price = gas_price
@@ -167,7 +167,7 @@ from celo_sdk.kit import Kit
167167
from celo_sdk.celo_account.messages import encode_defunct
168168

169169
kit = Kit('https://alfajores-forno.celo-testnet.org')
170-
message = self.kit.w3.soliditySha3(['address'], [signer]).hex() # For example we want to sign someones address
170+
message = kit.w3.soliditySha3(['address'], [signer]).hex() # For example we want to sign someones address
171171
message = encode_defunct(hexstr=message)
172-
signature = self.kit.wallet.active_account.sign_message(message)
172+
signature = kit.wallet.active_account.sign_message(message)
173173
```

celo_sdk/contracts/GasPriceMinimumWrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class GasPriceMinimum:
1818
Wallet object to sign transactions
1919
"""
2020

21-
def __init__(self, web3: Web3, address: str, abi: list, wallet: 'Wallet' = None):
21+
def __init__(self, web3: Web3, address: str, abi: list, wallet: 'Wallet' = None, **kwargs):
2222
self.web3 = web3
2323
self.address = address
2424
self._contract = self.web3.eth.contract(self.address, abi=abi)

celo_sdk/contracts/base_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def create_contract(self, contract_name: str, contract_address: str, abi: list):
8686
f"celo_sdk.contracts.{contract_name}Wrapper")
8787
contract_obj = getattr(contract_module, contract_name)
8888
contract = contract_obj(
89-
self.web3, self.registry, contract_address, abi, self.wallet)
89+
web3=self.web3, registry=self.registry, address=contract_address, abi=abi, wallet=self.wallet)
9090

9191
self.contracts[contract_name] = contract
9292
except ModuleNotFoundError:

0 commit comments

Comments
 (0)