¿Por qué mi llamada de contrato no crea una nueva transacción en mi sección de transacciones de ganache?

es fácil para mí porque soy bastante nuevo en todo esto.

Así que creé una función que firma mi transacción usando la biblioteca web3js y se ve así:

   signTx = async () => {
     const { accounts, contract, web3} = this.state
     const msg = 'henlo frendo'
     const hex_msg = web3.utils.toHex(msg)
     let signature = await web3.eth.sign(hex_msg, accounts[0])

     signature = signature.substr(2);
     var r = '0x' + signature.slice(0, 64)
     var s = '0x' + signature.slice(64, 128)
     var v = '0x' + signature.slice(128, 130)
     var v_decimal = this.state.web3.utils.toDecimal(v)
     //v_decimal has to be either 27 or 28
     if (v_decimal != 27 || v_decimal != 28) {
       v_decimal += 27
     }

    // Get the value from the contract to prove it worked.
const fixed_msg = `\x19Ethereum Signed Message:\n${msg.length}${msg}`
const fixed_msg_sha = this.state.web3.utils.sha3(fixed_msg)
const response = await contract.methods.recoverAddr(fixed_msg_sha, 
v_decimal, r, s).call()

};

Puedo ver claramente que la transacción se firmó correctamente si realizo algunos registros de la consola, pero, por ejemplo, si agrego un botón en mi interfaz que sigue llamando a esta función signTx(), nunca se realiza una nueva transacción. ¿Cuál es la razón de esto? ¿Es porque no estoy alimentando la transacción con fondos? Si alguien pudiera proporcionar alguna documentación sobre esto, ¡lo agradecería mucho!

PD: estoy usando ganache como mi proveedor de red.

Respuestas (1)

Bueno, supongo que la respuesta es porque hacer una llamada () en un contrato solo lee los datos

Consulte: https://truffleframework.com/docs/truffle/getting-started/interacting-with-your-contracts