Fix erros found by dialyzer and warnings.

This commit is contained in:
Erik Stenman
2019-02-15 13:47:40 +01:00
parent c5a9878bd9
commit afdb78b933
4 changed files with 15 additions and 8 deletions
+4 -1
View File
@@ -129,7 +129,7 @@ format(M) when ?IS_FATE_MAP(M) ->
"#{ "
++ format_kvs(maps:to_list(?FATE_MAP_VALUE(M)))
++" }";
format(?FATE_ADDRESS(Address)) -> base58:binary_to_base58(Address);
format(?FATE_ADDRESS(Address)) -> address_to_base58(Address);
format(V) -> exit({not_a_fate_type, V}).
format_list([]) -> " ]";
@@ -167,6 +167,9 @@ base58_to_address(Base58) ->
Bin = <<I:256>>,
Bin.
address_to_base58(<<A:256>>) ->
integer_to_base58(A).
integer_to_base58(0) -> <<"1">>;
integer_to_base58(Integer) ->
Base58String = integer_to_base58(Integer, []),