WIP: Fixing silly display cases
This commit is contained in:
+10
-7
@@ -501,6 +501,7 @@ check_tx(State = #s{frame = Frame,
|
||||
State
|
||||
end;
|
||||
check_tx(State = #s{j = J,
|
||||
funret = ReturnType,
|
||||
con_id = ConID,
|
||||
tx_data = #{"tx_hash" := TXHash},
|
||||
tx_info = none,
|
||||
@@ -512,21 +513,23 @@ check_tx(State = #s{j = J,
|
||||
case hz:tx_info(TXHash) of
|
||||
{ok, Info = #{"call_info" := #{"return_type" := "ok",
|
||||
"contract_id" := ConID,
|
||||
"return_value" := Value}}} ->
|
||||
FormattedInfo = io_lib:fomat("~tp", [Info]),
|
||||
"return_value" := ReturnCB}}} ->
|
||||
FormattedInfo = io_lib:format("~tp", [Info]),
|
||||
_ = wxButton:enable(CopyB),
|
||||
_ = wxButton:disable(ActionB),
|
||||
ok = wxTextCtrl:setValue(ReturnT, Value),
|
||||
ReturnV = hz:decode_bytearray(ReturnCB, {sophia, ReturnType}),
|
||||
ok = wxTextCtrl:setValue(ReturnT, ReturnV),
|
||||
ok = wxTextCtrl:setValue(InfoT, FormattedInfo),
|
||||
ok = gd_con:show_call(ConID, Info),
|
||||
ok = gd_con:show_call(ConID, Info, false),
|
||||
State#s{status = included, tx_info = Info};
|
||||
{ok, Reason = #{"call_info" := #{"return_type" := "revert"}}} ->
|
||||
{ok, Reason = #{"call_info" := #{"return_type" := "revert", "return_value" := ReturnCB}}} ->
|
||||
_ = wxButton:enable(CopyB),
|
||||
_ = wxButton:disable(ActionB),
|
||||
ReturnV = io_lib:format("Revert: ~ts", [hz:decode_bytearray(ReturnCB, sophia)]),
|
||||
ok = wxTextCtrl:setValue(ReturnT, ReturnV),
|
||||
FormattedInfo = io_lib:format("~tp", [Reason]),
|
||||
ok = wxTextCtrl:setValue(ReturnT, FormattedInfo), % FIXME
|
||||
ok = wxTextCtrl:setValue(InfoT, FormattedInfo),
|
||||
ok = gd_con:show_call(ConID, Reason),
|
||||
ok = gd_con:show_call(ConID, Reason, false),
|
||||
State#s{status = rejected, tx_info = Reason};
|
||||
{error, "Tx not mined"} ->
|
||||
ok = wxTextCtrl:setValue(InfoT, J("[Transaction not yet mined.]")),
|
||||
|
||||
Reference in New Issue
Block a user