Conversation
04387de to
6a0e390
Compare
| func VerifyOpenLong(clientCtx client.Context, | ||
| from string, | ||
| height int64, | ||
| collateralAmount sdk.Uint, | ||
| collateralAsset, | ||
| borrowAsset string, | ||
| leverage sdk.Dec) error { | ||
|
|
||
| return nil | ||
| } |
There was a problem hiding this comment.
is it actually needed if it returns nil ?
There was a problem hiding this comment.
keeping this here as WIP
| Wallet native balance after 499999807448702459100223367291740 | ||
| Wallet external balance after 499999999999999999999022148656694 | ||
|
|
||
| Wallet native diff 900027225498984213 (expected: 1000032419169645384 unexpected: -100005193670661171) |
There was a problem hiding this comment.
do we want to show in the examples a failure case (think this is what unexpected states)?
There was a problem hiding this comment.
This unexpected value is the fee.
| Pool health after 0.999999999999999000 | ||
| Pool native custody after 0 | ||
| Pool external custody after 0 | ||
| Pool native liabilities after 0 | ||
| Pool external liabilities after 0 |
There was a problem hiding this comment.
What if there are multiple MTPs and we're only closing one of them? How are we verifying the values then?
There was a problem hiding this comment.
Added expected values.
| Wallet collateral balance after: 488999999999999994008999412 (diff: 494008999412) | ||
| Wallet custody balance after: 499999211271873732838129967124882 (diff: -99999999999999996) |
There was a problem hiding this comment.
are those diffs expected or not? Would be great to have that info
There was a problem hiding this comment.
Added collateral and custody assets so it's easier to see which are fees, as well as expected diff for collateral balance (return amount).
cmd/siftest/test.go
Outdated
| //txf = txf.WithAccountNumber(accountNumber).WithSequence(seq) | ||
| //err = TestAddLiquidity(clientCtx, txf, key) | ||
| //if err != nil { | ||
| // panic(err) | ||
| //} |
There was a problem hiding this comment.
shall we get rid of this code?
| return nil | ||
| } | ||
|
|
||
| func TestOpenPosition(clientCtx client.Context, txf tx.Factory, key keyring.Info) error { |
There was a problem hiding this comment.
Naming convention question: why some functions are prefixed Test and some GetVerify ?
There was a problem hiding this comment.
The Test functions execute transactions, they aren't in use yet.
There was a problem hiding this comment.
Would be great to execute transactions and verify them ina single go. Are you actively working on it or what is the plan?
cmd/siftest/verify.go
Outdated
| //fmt.Printf("External deduction %s \n", externalDiff.String()) | ||
| //fmt.Printf("External expected %s \n\n", externalAmount.String()) | ||
| // | ||
| //fmt.Printf("Native diff %s \n", nativeDiff.String()) | ||
| //fmt.Printf("Native expected %s \n", sdk.NewIntFromBigInt(nativeAmount.BigInt()).Neg().String()) | ||
| //fmt.Printf("Native diff - expected %s \n\n", nativeDiff.Sub(sdk.NewIntFromBigInt(nativeAmount.BigInt()).Neg()).String()) | ||
|
|
||
| //fmt.Printf("LP units expected diff %s \n", lpUnits.String()) |
No description provided.