This repository has been archived by the owner on Aug 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 110
swap: unify variable types, pt. 4 #2087
Open
mortelli
wants to merge
91
commits into
master
Choose a base branch
from
swap-unify-variable-types-iv
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
…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
mortelli
added
in progress
incentives
builds on open PR
Builds on a PR that is not yet merged. It is blocked until then and the diff won't make sense yet.
labels
Feb 3, 2020
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
mortelli
removed
the
builds on open PR
Builds on a PR that is not yet merged. It is blocked until then and the diff won't make sense yet.
label
Mar 30, 2020
…le, fix swap logic and tests to work with new pointer semantics in int256
acud
approved these changes
Apr 1, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my favorite :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i am somewhat partial to 909
as well 😛
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:
Peer
balance
field is now*Int256
-typed, instead ofint64
Peer
funcs have their signature updated to match this change*Int256
-typed results, instead ofint64
Cmp
andEquals
now work interchangeably between*Int256
and*Uint256
typesBigIntWrapper
interface was added for this*Uint256
-typed, instead ofuint64
var
s rather thanconst
s now, since they have to be computed at run-time