This repository was archived by the owner on Aug 2, 2021. It is now read-only.
Open
Conversation
…to swap-generalize-uint256 # Conflicts: # swap/common_test.go # swap/swap.go # swap/swap_test.go
…ignature to receive BoundedInt param, change disconnect threshold and payment threshold types to Uint256, change peer balance type to Int256
swap: fix calculateExpectedBalances & TestSwapRPC nil pointer bugs
…nto swap-unify-variable-types-iv # Conflicts: # boundedint/int256.go
…-types-iii # Conflicts: # swap/simulations_test.go
…py and set funcs for Int256 and Uint256 structs
…rs rather than values
…rror in Int256 and Uint256 DecodeRLP funcs, iterate func comments
…nto swap-unify-variable-types-iv # Conflicts: # swap/int256/int256.go # swap/int256/uint256.go
…arshaling functions to prevent json number overflow
…nto swap-unify-variable-types-iv # Conflicts: # swap/peer.go # swap/swap.go
…-types-iv # Conflicts: # swap/api.go # swap/int256/int256.go # swap/int256/uint256.go # swap/protocol_test.go # swap/swap.go # swap/swap_test.go
…le, fix swap logic and tests to work with new pointer semantics in int256
acud
approved these changes
Apr 1, 2020
Contributor
acud
left a comment
There was a problem hiding this comment.
LGTM, but one small comment about the big int wrapper. not sure why this is needed
| // test balances after balance change for peer | ||
| setBalance(t, testPeer, 303) | ||
| testBalances(t, swap, map[enode.ID]int64{testPeerID: 303, testPeer2ID: 123}) | ||
| balancePeer = int256.Int256From(303) |
Contributor
Author
There was a problem hiding this comment.
i am somewhat partial to 909 as well 😛
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is the 4th and final part of implementing issue #1581, which aims at unifying variable types between the SWAP smart contracts and the related code on the go side.
Changes:
Peerbalancefield is now*Int256-typed, instead ofint64Peerfuncs have their signature updated to match this change*Int256-typed results, instead ofint64CmpandEqualsnow work interchangeably between*Int256and*Uint256typesBigIntWrapperinterface was added for this*Uint256-typed, instead ofuint64vars rather thanconsts now, since they have to be computed at run-time