Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/ar_wallet.erl
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ to_pubkey(PubKey, {rsa, 65537}) ->
PubKey.

%% @doc Generate an address from a public key.
to_address(Pubkey) ->
to_address(Pubkey, ?DEFAULT_KEY_TYPE).
to_address(Pubkey) when byte_size(Pubkey) == 65 ->
to_address(Pubkey, {ecdsa, 256});
to_address(PubKey) ->
to_address(PubKey, ?DEFAULT_KEY_TYPE).
to_address(PubKey, {rsa, 65537}) when bit_size(PubKey) == 256 ->
PubKey;
to_address({{_, _, PubKey}, {_, PubKey}}, _) ->
Expand Down
2 changes: 1 addition & 1 deletion src/dev_genesis_wasm.erl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ init(Msg, _Msg2, _Opts) -> {ok, Msg}.
normalize(Msg, Msg2, Opts) ->
dev_delegated_compute:normalize(Msg, Msg2, Opts).

%% @doc All the `[email protected]' device to execute the request. We then apply
%% @doc Call the `[email protected]' device to execute the request. We then apply
%% the `[email protected]' device, applying any state patches that the AO process may have
%% requested.
compute(Msg, Msg2, Opts) ->
Expand Down
9 changes: 7 additions & 2 deletions src/dev_json_iface.erl
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,17 @@ message_to_json_struct(RawMsg, Features, Opts) ->
end,
Data = hb_ao:get(<<"data">>, {as, <<"[email protected]">>, MsgWithoutCommitments}, <<>>, Opts),
Target = hb_ao:get(<<"target">>, {as, <<"[email protected]">>, MsgWithoutCommitments}, <<>>, Opts),
OwnerAddress =
case Owner of
<<>> -> <<>>;
_ -> hb_util:human_id(Owner)
end,
% Set "From" if From-Process is Tag or set with "Owner" address
From =
hb_ao:get(
<<"from-process">>,
{as, <<"[email protected]">>, MsgWithoutCommitments},
hb_util:encode(Owner),
OwnerAddress,
Opts
),
Sig = hb_ao:get(<<"signature">>, {as, <<"[email protected]">>, MsgWithoutCommitments}, <<>>, Opts),
Expand All @@ -144,7 +149,7 @@ message_to_json_struct(RawMsg, Features, Opts) ->
% NOTE: In Arweave TXs, these are called "last_tx"
<<"Anchor">> => Last,
% NOTE: When sent to ao "Owner" is the wallet address
<<"Owner">> => hb_util:encode(Owner),
<<"Owner">> => OwnerAddress,
<<"From">> => case ?IS_ID(From) of true -> safe_to_id(From); false -> From end,
<<"Tags">> => prepare_tags(TABM, Opts),
<<"Target">> => safe_to_id(Target),
Expand Down