Skip to content

Commit

Permalink
Merge pull request andelf#34 from MioYvo/fix_base_url_slash
Browse files Browse the repository at this point in the history
fix: base url first slash (close andelf#28)
  • Loading branch information
andelf authored Jan 24, 2022
2 parents 9ec57b3 + 5976644 commit 53d7af9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
9 changes: 4 additions & 5 deletions tronpy/async_tron.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from typing import Union, Tuple, Optional
import asyncio
from typing import Union, Tuple
import time
from pprint import pprint
import json
import asyncio
from pprint import pprint
from decimal import Decimal
from typing import Union, Tuple, Optional

from tronpy import keys
from tronpy.async_contract import AsyncContract, ShieldedTRC20, AsyncContractMethod
Expand Down Expand Up @@ -895,7 +894,7 @@ async def trigger_const_smart_contract_function(
# Transaction handling

async def broadcast(self, txn: AsyncTransaction) -> dict:
payload = await self.provider.make_request("/wallet/broadcasttransaction", txn.to_json())
payload = await self.provider.make_request("wallet/broadcasttransaction", txn.to_json())
self._handle_api_error(payload)
return payload

Expand Down
4 changes: 2 additions & 2 deletions tronpy/contract.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Union, Optional, Any, Tuple
from typing import Union, Optional, Any, Tuple, List
from Crypto.Hash import keccak

from tronpy.exceptions import DoubleSpending
Expand Down Expand Up @@ -30,7 +30,7 @@ def __init__(
*,
bytecode: Union[str, bytes] = '',
name: str = None,
abi: Optional[dict] = None,
abi: Optional[Union[dict, List[dict]]] = None,
user_resource_percent: int = 100,
origin_energy_limit: int = 1,
origin_address: str = None,
Expand Down
6 changes: 3 additions & 3 deletions tronpy/tron.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import Union, Tuple, Optional
import time
from pprint import pprint
import json
from pprint import pprint
from decimal import Decimal
from typing import Union, Tuple, Optional

from tronpy import keys
from tronpy.contract import Contract, ShieldedTRC20, ContractMethod
Expand Down Expand Up @@ -866,7 +866,7 @@ def trigger_const_smart_contract_function(
# Transaction handling

def broadcast(self, txn: Transaction) -> dict:
payload = self.provider.make_request("/wallet/broadcasttransaction", txn.to_json())
payload = self.provider.make_request("wallet/broadcasttransaction", txn.to_json())
self._handle_api_error(payload)
if payload.get('txid') is None:
payload['txid'] = txn.txid
Expand Down

0 comments on commit 53d7af9

Please sign in to comment.