Blockchain changes

This commit is contained in:
Ubuntu 2024-06-19 12:41:54 +00:00
parent 7040284d39
commit aa94152b31
3 changed files with 3 additions and 4 deletions

View File

@ -29,7 +29,7 @@ def UploadConversionData(privatekey,pubkey, user_id,project,data):
nonce = web3.eth.get_transaction_count(acc1)
gas = 300000
uploadData = contractInst.functions.UploadConversionData(pubkey,user_id,project,data).build_transaction({
'gas': gas ,'gasPrice': web3.eth.gas_price, 'chainId': CHAIN_ID, 'from': acc1, 'nonce': nonce})
'gasPrice': web3.eth.gas_price, 'chainId': CHAIN_ID, 'from': acc1, 'nonce': nonce})
signed_transaction = web3.eth.account.sign_transaction(uploadData, private_key=privatekey)
transaction_hash = web3.eth.send_raw_transaction(signed_transaction.rawTransaction)
print("transaction hash",transaction_hash)

View File

@ -23,9 +23,8 @@ def UploadScriptAuditData(privatekey,pubkey,user_id,project,data):
acc1 = web3.eth.account.from_key(privatekey).address
def send_transaction():
nonce = web3.eth.get_transaction_count(acc1)
gas = 300000
uploadData = contractInst.functions.UploadScriptAuditData(pubkey,user_id,project,data).build_transaction({
'gas': gas,'gasPrice': web3.eth.gas_price, 'chainId': CHAIN_ID, 'from': acc1, 'nonce': nonce})
'gasPrice': web3.eth.gas_price, 'chainId': CHAIN_ID, 'from': acc1, 'nonce': nonce})
signed_transaction = web3.eth.account.sign_transaction(uploadData, private_key=privatekey)
transaction_hash = web3.eth.send_raw_transaction(signed_transaction.rawTransaction)
print("transaction hash",transaction_hash)

View File

@ -29,7 +29,7 @@ def UploadScriptPadData(privatekey,pubkey,user_id,project,data):
nonce = web3.eth.get_transaction_count(acc1)
gas = 300000
uploadData = contractInst.functions.UploadScriptPadData(pubkey,user_id,project,data).build_transaction({
'gas': gas , 'gasPrice': web3.eth.gas_price, 'chainId': CHAIN_ID, 'from': acc1, 'nonce': nonce})
'gasPrice': web3.eth.gas_price, 'chainId': CHAIN_ID, 'from': acc1, 'nonce': nonce})
signed_transaction = web3.eth.account.sign_transaction(uploadData, private_key=privatekey)
transaction_hash = web3.eth.send_raw_transaction(signed_transaction.rawTransaction)
print(web3.eth.gas_price)