-
Notifications
You must be signed in to change notification settings - Fork 570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[react-cat][1.5] Visualize transactions and display transaction hash #2719
Comments
Why not for all actions on the blockchain IDs? |
By the way, please show current block ID as well. |
Exactly where in the application are we talking? |
@sschiessl-bcp You are talking about Explore/Blockchain recent activity ? And the task is to create an indent like "create order" / "cancel order" |
I assume @sschiessl-bcp is talking about HTCL Transactions?
|
|
I think this issue is about the blockchain explorer, e.g. https://wallet.bitshares.org/#/block/39402693/17 What to show in the page:
Do not break the link:
By the way, in order to get virtual operations in the explorer, we need a new API from bitshares-core (see bitshares/bitshares-core#243), or query from ES. |
@abitmore This task is about transactions and not about whole Explore/Blockchain page, so maybe it would be better to focus here on current task and split your checklist to different task and create an issues for them ? |
@react-cat that's actually the same thing. We don't show transactions in the explorer right now, if to show them, need to reorganize the whole page. |
Still waiting for @sschiessl-bcp to explain this issue in more details. |
Thanks @sschiessl-bcp. So we want to add which TX the op was included in as well, not a bad idea. The indent would do good for now to keep the current design. Note for example this block, one or more OPs has more than 1 TX. Block https://open-explorer.io/#/blocks/39621703
|
@react-cat you still interested? Otherwise I would. |
@sschiessl-bcp any idea about my comments above (#2719 (comment))? If it's not appropriate to discuss in this issue, I can create a new issue and move the discussion there. |
I like to revisit after seeing the tx splitup |
@sschiessl-bcp I'll take it if you don't mind.
|
@sschiessl-bcp @react-cat to be clear, "block ID" is not |
While we're at it, can we look on a way to visualize that you can click the block number to search for another one by typing it in? |
I think we can add an "edit" or "search" icon near the block number. A clickable block number just doesn't make sense. |
@startailcoon Actually, when I was searching for the way to search for another block, block number was the last place that I was looking on. That number looks more like a link and it's a bit confusing cause I'm already on that block. I think as a quick fix, search icon could be good, but it would be better to make some changes in UI, for example: Also we can move arrows (arrows that switch to next or previous block) to top and place |
I think it would be better to have
Agree. You could make them center and have them cover enough width to fit them, so they are always centered on the same spot when you change block. |
@startailcoon So as I understand you agreed with the image, but want to change "Search for block" to "Go to Block", correct me If I misunderstand something. Also I didn't get what you mean here "You could make them center and have them cover enough width to fit them, so they are always centered on the same spot when you change block.", could you please explain ? |
Correct
Like this, where they are centered.
|
@startailcoon Okay, got it. |
@startailcoon To not repeat the mistakes like in #2931, I created a new issue for redesign #3025 and let's stick here to initial task. |
@sschiessl-bcp, @startailcoon could anyone please help me a little, I can't find a way to get transaction hash. I searched all across the project, there is no tx hash none in operation objects neither in blocks. I visit open-explorer github and found that they get tx data by url using tx id (github link) |
Implement a dummy method for now, I can fill in / point you to the actual tx id calculation when you are done with all the rest. |
Result of
|
@abitmore @sschiessl-bcp Thanks, now I understand how to get it, I'll create an util |
@sschiessl-bcp, @abitmore After a lot of work I end up with a decision that it's impossible to get a same hash from objects on python or c++ and js, maybe some issues with how those languages write object to memory or something like that. @sschiessl-bcp I will just create a dummy method for now as you told me before tldr;I showed how I tried to get a hash simmilar to c++ or python hash in js. If we are going to get hash via request don't waste your time on reading unless it is interesting for you .I tried to recreate methods that was provided by @abitmore and here what I end up with show code
sha256(str) {
// Get the string as arraybuffer.
let buffer = new TextEncoder("utf-8").encode(str);
return crypto.subtle.digest("SHA-256", buffer).then((hash) => {
return this.hex(hash);
});
}
hex(buffer) {
let digest = "";
let view = new DataView(buffer);
for(let i = 0; i < view.byteLength; i += 4) {
// We use getUint32 to reduce the number of iterations (notice the `i += 4`)
let value = view.getUint32(i);
// toString(16) will transform the integer into the corresponding hex string
// but will remove any initial "0"
let stringValue = value.toString(16);
// One Uint32 element is 4 bytes or 8 hex chars (it would also work with 4
// chars for Uint16 and 2 chars for Uint8)
let padding = "00000000";
let paddedValue = (padding + stringValue).slice(-padding.length);
digest += paddedValue;
}
return digest;
}
getTransactionHash(transaction) {
let buffer = cloneDeep(transaction);
delete buffer.signatures;
this.sha256(JSON.stringify(buffer)).then((hash)=>{console.log(hash);});
} Then I though that the problem might be because of double quotes that appear around object properties after stringifying, so I modified getTransactionHash(transaction) {
let buffer = cloneDeep(transaction);
delete buffer.signatures;
buffer = JSON.stringify(buffer).replace(/"([^,{]+)"(:)/gm,"$1$2");
this.sha256(buffer).then((hash)=>{console.log(hash);});
} So now object like Also This is the only way to get hash that I found and it require string as an input so I can't simply pass object. Currently I don't now how to create hash using JS that will be simmilar to hash from python or c++ |
Current explorer does not show transactions. Add a visual indent with transaction header information (transaction number in block and transaction id/hash)
The text was updated successfully, but these errors were encountered: