chaintope / glueby

[WIP] A Ruby library of smart contracts that can be used on Tapyrus.
MIT License
7 stars 10 forks source link

`hex: true` in updating trackable timestamp creates invalid transactions #185

Closed rantan closed 1 year ago

rantan commented 1 year ago

sendrawtransaction RPC returns below error

{"response_code":"500","response_msg":"Internal Server Error","rpc_error":{"code":-26,"message":"mandatory-script-verify-flag-failed (Script failed an OP_EQUALVERIFY operation) (code 16)"}}

example code

ar = Glueby::Contract::AR::Timestamp.create(
          wallet_id: sender.id,
          content: 'FFFFFF',
          prefix: '617070',
          timestamp_type: :trackable,
          hex: true
        )
ar.save_with_broadcast!

update_ar = Glueby::Contract::AR::Timestamp.new(
          wallet_id: sender.id,
          content: '1234',
          prefix: '617070',
          timestamp_type: :trackable,
          prev_id: ar.id,
          hex: true
        ).save_with_broadcast!

The second #save_with_broadcast! occurs the error.