pixelbeat_ has joined #stellar-dev
slippy has quit [Quit: Leaving]
shiny has joined #stellar-dev
pixelbeat_ has quit [Ping timeout: 246 seconds]
shiny has quit [Disconnected by services]
de_henne_ has quit [Ping timeout: 260 seconds]
de_henne_ has joined #stellar-dev
slippy has joined #stellar-dev
sv-logger has quit [Remote host closed the connection]
sv-logger has joined #stellar-dev
sacarlson1 has joined #stellar-dev
sacarlson has quit [Ping timeout: 264 seconds]
TheSeven has quit [Ping timeout: 244 seconds]
TheSeven has joined #stellar-dev
de_henne_ has quit [Remote host closed the connection]
de_henne has joined #stellar-dev
slippy has quit [Quit: Leaving]
stellar-slack has quit [Remote host closed the connection]
stellar-slack has joined #stellar-dev
Kushed has quit [*.net *.split]
Vinnie_win has quit [*.net *.split]
Kushed has joined #stellar-dev
Vinnie_win has joined #stellar-dev
pixelbeat_ has joined #stellar-dev
de_henne has quit [Remote host closed the connection]
de_henne has joined #stellar-dev
<stellar-slack> <fredolafritte> anyone know how to decode the column txresult in the txhistory table of the stellar database
<stellar-slack> <jed> scott ^
<stellar-slack> <fredolafritte> i've tried *StellarBase.xdr.TransactionResult.fromXDR* without success
<stellar-slack> <fredolafritte> that's related to creating an offer
<stellar-slack> <jed> It gets stuck in here: TransactionFrame::storeTransaction
<stellar-slack> <jed> looks like it is xdr that has been base64 encoded
<stellar-slack> <fredolafritte> var errorXdr = 't1qpS2SGmIWfZXnpmlFsZBt6JYb2+YIUC5RcngrmvCoAAAAAAAAD6P////8AAAABAAAAAAAAAAP////5AAAAAA=='; var errorMessage = StellarBase.xdr.TransactionResult.fromXDR(new Buffer(errorXdr, "base64"));
<stellar-slack> <jed> scott should be online in a bit. I'm not sure what the state of his xdr decoder is. maybe that is the issue?
<stellar-slack> <fredolafritte> the transaction is in the txhistory table but go-horizon replies 404 when trying the transaction through its hash
<stellar-slack> <sacarlson> I only know that AAAAAAAAAAD////7AAAAAA==` is a bad sequence error, so I guess you don't have my original problem
<stellar-slack> <scott> @fredolafritte: the txresult should be a base64 encoded `TransactionResultPair`
<stellar-slack> <fredolafritte> perfect
slippy has joined #stellar-dev
slippy has quit [Ping timeout: 246 seconds]
slippy has joined #stellar-dev
slippy has quit [Client Quit]
slippy has joined #stellar-dev
<stellar-slack> <sacarlson> not sure this is it or not
<stellar-slack> <sacarlson> so I guess that indicates you have no account?
<stellar-slack> <scott> @sacarlson: the .x files (https://github.com/stellar/stellar-core/tree/master/src/xdr) are the source of truth for all the xdr encoded data structures throughout the stellar network.
<stellar-slack> <scott> The snippet you posted is generated from https://github.com/stellar/stellar-core/blob/master/src/xdr/Stellar-transaction.x#L628
<stellar-slack> <sacarlson> so I take it in in the right place but don't know how to decode base64
<stellar-slack> <sacarlson> as the error codes here are in decimal
<stellar-slack> <scott> sacarlson: All of the base64-encoded values are byte streams that contain an XDR-encoded data structures. https://tools.ietf.org/html/rfc4506 is the specification for how you go from a byte stream to in-memory structures
<stellar-slack> <scott> the actual structure encoded in any given value is not very well documented, as shown by fredolafritte’s question
<stellar-slack> <scott> for example, the value in the `txresult` column is a `TransactionResultPair` strucut, or the `txmeta` column is the `TransactionMeta` struct.
<stellar-slack> <scott> So, the procedure to get to that decimal value is 1) decode the base64 value to a raw byte stream 2) decode that byte stream to an in-memory XDR struct of the appropriate type 3) access the in-memory field to retrieve the decimal value
<stellar-slack> <scott> make sense?
<stellar-slack> <sacarlson> ya makes sense but I think it's out of my pay grade ha ha
<stellar-slack> <sacarlson> I'll await the released utility that converts it to a more readable format
<stellar-slack> <sacarlson> or force known errors and see what results I see and maybe the results will show a pattern
<stellar-slack> <scott> so, luckily we have that utility for ruby, javascript, and go. That’s what ruby-stellar-base is: https://github.com/stellar/ruby-stellar-base for example
<stellar-slack> <scott> We convert those .x files into c++, ruby, etc. to make it easier to go into the in-memory representation.
<stellar-slack> <scott> Let me explain how you would go from "AAAAAAAAAAD////7AAAAAA==“ to the error code:
<stellar-slack> <sacarlson> ok
<stellar-slack> <scott> That script will output `Stellar::TransactionResultCode.tx_bad_seq(-5)`
<stellar-slack> <sacarlson> cool in ruby I love it
<stellar-slack> <scott> :)
slippy has quit [Ping timeout: 246 seconds]
<stellar-slack> <sacarlson> so from this then I am guessing fredolafritte's code 't1qpS2SGmIWfZXnpmlFsZBt6JYb2+YIUC5RcngrmvCoAAAAAAAAD6P////8AAAABAAAAAAAAAAP////5AAAAAA==' is .tx_insufficient_balance(-7)
<stellar-slack> <scott> That’s incorrect… the -7 in that data structure is a member of the `ManageOfferResultCode` enum, which is `manage_offer_underfunded`
<stellar-slack> <scott> If you inspect the whole data structure:
<stellar-slack> <sacarlson> ok
de_henne has quit [Remote host closed the connection]
pixelbeat has joined #stellar-dev
pixelbeat_ has quit [Ping timeout: 255 seconds]
pixelbeat has quit [Ping timeout: 250 seconds]
pixelbeat has joined #stellar-dev
pixelbeat has quit [Ping timeout: 255 seconds]