pendulum-chain / substrate-stellar-sdk

A Rust SDK for Stellar that can be used for Substrate projects
Apache License 2.0
11 stars 11 forks source link

to support additional stellar messages and message types #13

Closed b-yap closed 2 years ago

b-yap commented 2 years ago

@ebma Okay, so I got stuck last Friday and partially today, on mapping the slot id, given the tx_set_hash from the scpmessage, and the transactionset which we get from TxSet(...).

I followed the hashing function from Stellar Core: https://github.com/stellar/stellar-core/blob/master/src/herder/TxSetFrame.cpp#L180-L190 and temporarily placed it in a helper file https://github.com/pendulum-chain/stellar-experiments/blob/85-collect-and-store-scp-messages-in-vault-client/src/helper.rs#L33-L43

And this function is also called from another function, only if the message type is isGeneralizedTxSet... which is something that we don't have. https://github.com/stellar/stellar-core/blob/master/src/herder/TxSetFrame.cpp#L825-L829

It's more of a "just in case".

ebma commented 2 years ago

But it says in most comments, that it was auto-generated. Is it?

b-yap commented 2 years ago

yes. i had to run the npm install and npm build in the autogenerator directory. That's how the type.rs is updated.

b-yap commented 2 years ago

@TorstenStueber the code compiled with no problems, even with the updated types.rs.

update: ah, the test did not, however. You are correct, it needs to be updated.

TorstenStueber commented 2 years ago

The tests are fixed now.