neuron icon indicating copy to clipboard operation
neuron copied to clipboard

refactor: show ckb default data structure in offline sign dialog

Open yuche opened this issue 4 years ago • 4 comments

yuche avatar Nov 18 '20 07:11 yuche

Why not transform the JSON in neuron-ui directly, or transform it before sending it to neuron-ui?

Keith-CY avatar Nov 18 '20 07:11 Keith-CY

Why not transform the JSON in neuron-ui directly, or transform it before sending it to neuron-ui?

The way to re-implement the transform method of Transaction in neuron-ui duplicates neuron-wallet. Transform it before sending requires modifying neuron-wallet's almost all offline sign controllers and changing a lot of test cases, for some reason I don't want to spend too much time on this refactoring for now.

yuche avatar Nov 18 '20 08:11 yuche

Is using the ckb.rpc.paramsFormatter.toRawTransaction in the UI sufficient to resolve the problem that this PR is trying to resolve? In this way, we can avoid implementing an additional backend API for this purpose?

katat avatar Nov 19 '20 02:11 katat

Is using the ckb.rpc.paramsFormatter.toRawTransaction in the UI sufficient to resolve the problem that this PR is trying to resolve? In this way, we can avoid implementing an additional backend API for this purpose?

What we really need is the Transaction#toSDKRawTransaction, ckb.rpc.paramsFormatter.toRawTransaction is not enough.

To be honest, I don't think this refactoring is really necessary either, because it doesn't affect the functionality without it. Further more, Neuron is a general user oriented application, what we should really show to users is income/outcome/time/transaction type(etc…) of the transaction, instead of a JSON file.

I suggest that we leave this PR unmerged until we decide on a new presentation way in the future.

@Keith-CY @katat

yuche avatar Nov 19 '20 06:11 yuche