[Ethereum] web3.py multiple argument

web3.py

I have created a "get_all" function that reads all variables in Solidity and a "set_all" function that writes all variables.

And I did a test in remix,
1, "0", 123123, "hash", "map", "eul"
I gave this type of input to set_all and the value was normal.

But

contract.transact({"from": walletaddr}).set_all({1, "0", 123123,"hash", "gap", "eul"})

I've implemented this code.

Such an error occurs.

Could not identify the intended function with name set_all, positional argument(s) of type (<class 'set'>,) and keyword argument(s) of type {}. Found 1 function(s) with the name set_all: ['set_all(uint256,string,uint256,string,string,string)'] Function invocation failed due to improper number of arguments.

Maybe I'm not good at formatting in multi factors. Is there a way to solve this?

—–this is my python code

from web3 import Web3, HTTPProvider
import json
rpc_url = "https://ropsten.infura.io/v3/e8d944bb989245b"

w3 = Web3(HTTPProvider(rpc_url))


with open("abi.json") as f:
    info_json = json.load(f)
abi = info_json
contract = w3.eth.contract(address='0x5644cd8cED82c6d292b09204e512', abi=abi)
contract.transact({"from": "0xD10c154eCE5256422Dea1"}).set_all({1, "0", 123123, "hash", "gap", "eul"})

—— this is my solidity code

  pragma solidity ^0.4.2;
  contract blockpaper {
      string ContractType;
      uint256 TimeStamp;
      uint256 PaperId;
      string GapSign;
      string EulSign;
      string FileHash;
    
      function set_all(uint256 newPaperId, string newContractType, uint256 newTimeStamp, string newFileHash, string newGapSign, string newEulSign) public returns(uint256, string, uint256, string, string, string) {
      PaperId = newPaperId;
      ContractType = newContractType;
      TimeStamp = newTimeStamp;
      FileHash = newFileHash;
      GapSign = newGapSign;
      EulSign = newEulSign;
      return (PaperId, ContractType, TimeStamp, FileHash, GapSign, EulSign);
      }

Best Answer

I think this should work:

 contract.transact({"from": walletaddr}).set_all(1, "0", 123123,"hash", "gap", "eul")

You were passing a Python set() object to the function as one argument, instead of multiple arguments.