-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use 168 byte exit id [Contracts v2] (#80)
* Fix Dialyzer Warnings for Elixir 1.10.2 (#47) * stricter dialyzer for 1.10 * fix spec for ExPlasma.decode * Remove client from ex_plasma (#46) * ex plasma is a statless lib that provides utilities for transaction building * remove client * clean up circleci * add credo.exs * fix conformance tests * clean up tests * fix dialyzer * remove missing field Co-authored-by: achiurizo <24772+achiurizo@users.noreply.github.com> * Refactor Transaction and Outputs (#48) * ex plasma is a statless lib that provides utilities for transaction building * add base output * remove client * clean up circleci * add credo.exs * fix conformance tests * clean up tests * fix dialyzer * remove missing field * wip output/position * add payment_v1 * broken wips * add paymentv1 transaction validation * add initial Transaction.encode/1 * add some validation tests to Transaction * standardize around method convention * encode/1 - Encodes an ex_plasma struct/map into RLP encoded bytes * decode/1 - Decodes an RLP encoded byte into an ex_plasma struct/map * validate/1 - Validates an ex_plasma struct/map to ensure that it follows the type format. * eh trying to clean up the decode patterns * more wip * fix doctests * behaviour -> to_rlp / to_map to_rlp -> encode decode -> to_map * wrap ExPlasma.Output in struct * default output_data to nil technically an empty list is also an encodable rlp struct * fix output specs * clean up Output.Position interface * fix paymentv1 output type dialyzer * fix dialyzer * add an empty output, typed_data hash for output * add typed_data output * pass entire output to the output type modules * encode/decode amount into integer * typed data txn2 * fix lint * call it Output.to_rlp instead * wip to_rlp/to_map for payment type * fix rlp encoding to not include empty sigs * update test to use new Transaction * update ExPlasma.Block to use new Transaction * s/Transaction2/Transaction/gec * remove unused utxo alias * remove utxo * dont typecast, use the value * add Output.encode Also, TODO: Check that we really need to pad the binaries. * bump to latest plasma-contracts * fix dialyzer * fix credo * mix format * remove FIXME and leave comment explaining why * Update mix.exs Co-Authored-By: Ino Murko <ino.murko@outlook.com> * update build timeout * bump * multi-line the methods * add hash * use a better return value for validate * fix pr comments * raise an error on invalid output type * raise error on invalid transaction type * fix configs/comments Co-authored-by: Ino Murko <ino.murko@outlook.com> * Add Builder to help create Transactions easier (#50) * add missing specs * use ExPlasma.Output struct * use ExPlasma.Transaction struct * add builder module * fix metadata typing * Update lib/ex_plasma/output.ex Co-authored-by: Ino Murko <ino.murko@outlook.com> * adjust formatter's line length to 120 Co-authored-by: Ino Murko <ino.murko@outlook.com> * txbytes -> tx_bytes (#51) * Add per env config (#53) * Add configuration module to load and validate app env variables (#52) * Add a configuration module to retrieve app variables * Split validation in its own module * refactor * Use :binary.decode_unsigned to convert amounts (#56) * binary decode unsign amounts * simple 'property' test for rlp amount decoding * test to ensure to_rlp encodes amount correctly * update ex_abi to 0.4 (#59) * Add signature related functions (#62) * add signature related functions * use latest working plasma commit * Add more tests (#66) * use delegates * add doctests for ExPlasma * add ExPlasma.Transaction tests * add signature_digest/2 test * add ExPlasma.Output tests * add ExPlasma.Encoding tests * add ExPlasma.Crypto and ExPlasma.Builder tests * add Block.new test * change error format (#65) * Refactor transactions (#67) * Add fee transaction & output type (#63) * Refactor outputs (#70) * prepare to publish to hex pm (#71) * update mix file and README * add usage section * remove integration section * fix typo * add builder example * create transaction with builder * use ex_keccak for hash generation (#72) * use ex_keccak for hash generation * Add create position helper (#73) * Migrate to ex_secp256k1 (#74) * migrate to ex_secp256k1 * fix dialyzer * use ex_secp256k1 from hex.pm * update README * rust 1.46.0 ex_keccak (#75) * add applications (#76) * Fix Documentation Rendering (#77) * add ex_doc * fix code example formatting * wrap code (warnings) * Use 168 byte exit id Co-authored-by: Arthur Chiu <24772+achiurizo@users.noreply.github.com> Co-authored-by: Ino Murko <ino.murko@outlook.com> Co-authored-by: Mederic <32560642+mederic-p@users.noreply.github.com>
- Loading branch information
1 parent
8efb48a
commit 8d51a76
Showing
107 changed files
with
5,818 additions
and
3,082 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
# This file contains the configuration for Credo and you are probably reading | ||
# this after creating it with `mix credo.gen.config`. | ||
# | ||
# If you find anything wrong or unclear in this file, please report an | ||
# issue on GitHub: https://github.com/rrrene/credo/issues | ||
# | ||
%{ | ||
# | ||
# You can have as many configs as you like in the `configs:` field. | ||
configs: [ | ||
%{ | ||
# | ||
# Run any config using `mix credo -C <name>`. If no config name is given | ||
# "default" is used. | ||
# | ||
name: "default", | ||
# | ||
# These are the files included in the analysis: | ||
files: %{ | ||
# | ||
# You can give explicit globs or simply directories. | ||
# In the latter case `**/*.{ex,exs}` will be used. | ||
# | ||
included: [ | ||
"lib/", | ||
"src/", | ||
"test/", | ||
"web/", | ||
"apps/*/lib/", | ||
"apps/*/src/", | ||
"apps/*/test/", | ||
"apps/*/web/" | ||
], | ||
excluded: [~r"/_build/", ~r"/deps/", ~r"/node_modules/"] | ||
}, | ||
# | ||
# Load and configure plugins here: | ||
# | ||
plugins: [], | ||
# | ||
# If you create your own checks, you must specify the source files for | ||
# them here, so they can be loaded by Credo before running the analysis. | ||
# | ||
requires: [], | ||
# | ||
# If you want to enforce a style guide and need a more traditional linting | ||
# experience, you can change `strict` to `true` below: | ||
# | ||
strict: false, | ||
# | ||
# To modify the timeout for parsing files, change this value: | ||
# | ||
parse_timeout: 5000, | ||
# | ||
# If you want to use uncolored output by default, you can change `color` | ||
# to `false` below: | ||
# | ||
color: true, | ||
# | ||
# You can customize the parameters of any check by adding a second element | ||
# to the tuple. | ||
# | ||
# To disable a check put `false` as second element: | ||
# | ||
# {Credo.Check.Design.DuplicatedCode, false} | ||
# | ||
checks: [ | ||
# | ||
## Consistency Checks | ||
# | ||
{Credo.Check.Consistency.ExceptionNames, []}, | ||
{Credo.Check.Consistency.LineEndings, []}, | ||
{Credo.Check.Consistency.ParameterPatternMatching, []}, | ||
{Credo.Check.Consistency.SpaceAroundOperators, []}, | ||
{Credo.Check.Consistency.SpaceInParentheses, []}, | ||
{Credo.Check.Consistency.TabsOrSpaces, []}, | ||
|
||
# | ||
## Design Checks | ||
# | ||
# You can customize the priority of any check | ||
# Priority values are: `low, normal, high, higher` | ||
# | ||
{Credo.Check.Design.AliasUsage, | ||
[priority: :low, if_nested_deeper_than: 2, if_called_more_often_than: 0]}, | ||
# You can also customize the exit_status of each check. | ||
# If you don't want TODO comments to cause `mix credo` to fail, just | ||
# set this value to 0 (zero). | ||
# | ||
{Credo.Check.Design.TagTODO, [exit_status: 2]}, | ||
{Credo.Check.Design.TagFIXME, []}, | ||
|
||
# | ||
## Readability Checks | ||
# | ||
{Credo.Check.Readability.AliasOrder, []}, | ||
{Credo.Check.Readability.FunctionNames, []}, | ||
{Credo.Check.Readability.LargeNumbers, []}, | ||
{Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 120]}, | ||
{Credo.Check.Readability.ModuleAttributeNames, []}, | ||
{Credo.Check.Readability.ModuleDoc, []}, | ||
{Credo.Check.Readability.ModuleNames, []}, | ||
{Credo.Check.Readability.ParenthesesInCondition, []}, | ||
{Credo.Check.Readability.ParenthesesOnZeroArityDefs, [parens: true]}, | ||
{Credo.Check.Readability.PredicateFunctionNames, []}, | ||
{Credo.Check.Readability.PreferImplicitTry, []}, | ||
{Credo.Check.Readability.RedundantBlankLines, []}, | ||
{Credo.Check.Readability.Semicolons, []}, | ||
{Credo.Check.Readability.SpaceAfterCommas, []}, | ||
{Credo.Check.Readability.StringSigils, []}, | ||
{Credo.Check.Readability.TrailingBlankLine, []}, | ||
{Credo.Check.Readability.TrailingWhiteSpace, []}, | ||
# TODO: enable by default in Credo 1.1 | ||
{Credo.Check.Readability.UnnecessaryAliasExpansion, false}, | ||
{Credo.Check.Readability.VariableNames, []}, | ||
|
||
# | ||
## Refactoring Opportunities | ||
# | ||
{Credo.Check.Refactor.CondStatements, []}, | ||
{Credo.Check.Refactor.CyclomaticComplexity, []}, | ||
{Credo.Check.Refactor.FunctionArity, []}, | ||
{Credo.Check.Refactor.LongQuoteBlocks, []}, | ||
{Credo.Check.Refactor.MapInto, false}, | ||
{Credo.Check.Refactor.MatchInCondition, []}, | ||
{Credo.Check.Refactor.NegatedConditionsInUnless, []}, | ||
{Credo.Check.Refactor.NegatedConditionsWithElse, []}, | ||
{Credo.Check.Refactor.Nesting, []}, | ||
{Credo.Check.Refactor.UnlessWithElse, []}, | ||
{Credo.Check.Refactor.WithClauses, []}, | ||
|
||
# | ||
## Warnings | ||
# | ||
{Credo.Check.Warning.BoolOperationOnSameValues, []}, | ||
{Credo.Check.Warning.ExpensiveEmptyEnumCheck, []}, | ||
{Credo.Check.Warning.IExPry, []}, | ||
{Credo.Check.Warning.IoInspect, []}, | ||
{Credo.Check.Warning.LazyLogging, false}, | ||
{Credo.Check.Warning.MixEnv, false}, | ||
{Credo.Check.Warning.OperationOnSameValues, []}, | ||
{Credo.Check.Warning.OperationWithConstantResult, []}, | ||
{Credo.Check.Warning.RaiseInsideRescue, []}, | ||
{Credo.Check.Warning.UnusedEnumOperation, []}, | ||
{Credo.Check.Warning.UnusedFileOperation, []}, | ||
{Credo.Check.Warning.UnusedKeywordOperation, []}, | ||
{Credo.Check.Warning.UnusedListOperation, []}, | ||
{Credo.Check.Warning.UnusedPathOperation, []}, | ||
{Credo.Check.Warning.UnusedRegexOperation, []}, | ||
{Credo.Check.Warning.UnusedStringOperation, []}, | ||
{Credo.Check.Warning.UnusedTupleOperation, []}, | ||
|
||
# | ||
# Checks scheduled for next check update (opt-in for now, just replace `false` with `[]`) | ||
|
||
# | ||
# Controversial and experimental checks (opt-in, just replace `false` with `[]`) | ||
# | ||
{Credo.Check.Readability.StrictModuleLayout, []}, | ||
{Credo.Check.Readability.SinglePipe, []}, | ||
{Credo.Check.Consistency.MultiAliasImportRequireUse, false}, | ||
{Credo.Check.Consistency.UnusedVariableNames, false}, | ||
{Credo.Check.Design.DuplicatedCode, false}, | ||
{Credo.Check.Readability.AliasAs, false}, | ||
{Credo.Check.Readability.MultiAlias, false}, | ||
{Credo.Check.Readability.Specs, false}, | ||
{Credo.Check.Refactor.ABCSize, false}, | ||
{Credo.Check.Refactor.AppendSingleItem, false}, | ||
{Credo.Check.Refactor.DoubleBooleanNegation, []}, | ||
{Credo.Check.Refactor.ModuleDependencies, false}, | ||
{Credo.Check.Refactor.NegatedIsNil, []}, | ||
{Credo.Check.Refactor.PipeChainStart, []}, | ||
{Credo.Check.Refactor.VariableRebinding, []}, | ||
{Credo.Check.Warning.MapGetUnsafePass, false}, | ||
{Credo.Check.Warning.UnsafeToAtom, []} | ||
|
||
# | ||
# Custom checks can be created using `mix credo.gen.check`. | ||
# | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# Used by "mix format" | ||
[ | ||
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] | ||
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"], | ||
line_length: 120 | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
erlang 23.0.3 | ||
elixir 1.10.4-otp-23 | ||
rust 1.46.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
.PHONY: test | ||
|
||
test: | ||
mix test | ||
|
||
logs: | ||
docker-compose logs -f | ||
up: | ||
|
Oops, something went wrong.