Skip to content

Instantly share code, notes, and snippets.

@luyzdeleon
Created June 24, 2022 17:29
Show Gist options
  • Save luyzdeleon/c54fb0a449c5f5312521e28544bdd258 to your computer and use it in GitHub Desktop.
Save luyzdeleon/c54fb0a449c5f5312521e28544bdd258 to your computer and use it in GitHub Desktop.
LeanPocket unit test failure
=== RUN TestSetGetSessionLean
cache_test.go:284:
Error Trace: cache_test.go:284
Error: Should be true
Test: TestSetGetSessionLean
cache_test.go:285:
Error Trace: cache_test.go:285
Error: Not equal:
expected: types.Session{SessionHeader:types.SessionHeader{ApplicationPubKey:"", Chain:"", SessionBlockHeight:0}, SessionKey:types.SessionKey(nil), SessionNodes:types.SessionNodes(nil)}
actual : types.Session{SessionHeader:types.SessionHeader{ApplicationPubKey:"8072c3e6f9be8a412be70470eb553455853e2c3ce94941f48ad1ea9affb3403c", Chain:"cceefd7e0545bcf8b6d19f3b5750c8a3ee8350418877bc6fb12e32de28137355", SessionBlockHeight:1}, SessionKey:types.SessionKey{0x80, 0x72, 0xc3, 0xe6, 0xf9, 0xbe, 0x8a, 0x41, 0x2b, 0xe7, 0x4, 0x70, 0xeb, 0x55, 0x34, 0x55, 0x85, 0x3e, 0x2c, 0x3c, 0xe9, 0x49, 0x41, 0xf4, 0x8a, 0xd1, 0xea, 0x9a, 0xff, 0xb3, 0x40, 0x3c}, SessionNodes:types.SessionNodes{06B2FBEE68FF33BE781D6A6CE8C8031E2CA9AFC1, 97511EAE433E7B5BC160E590011871BC7DB261E1, 3554F81BC9F35AC53211C845F9E84E4F8E9E241D, 64CAFF7B6433C545739CEA375CB50701D4942061, 746CCF4F11E69164E45E8276AD34FB18E02A2428}}
Diff:
--- Expected
+++ Actual
@@ -2,8 +2,32 @@
SessionHeader: (types.SessionHeader) {
- ApplicationPubKey: (string) "",
- Chain: (string) "",
- SessionBlockHeight: (int64) 0
+ ApplicationPubKey: (string) (len=64) "8072c3e6f9be8a412be70470eb553455853e2c3ce94941f48ad1ea9affb3403c",
+ Chain: (string) (len=64) "cceefd7e0545bcf8b6d19f3b5750c8a3ee8350418877bc6fb12e32de28137355",
+ SessionBlockHeight: (int64) 1
},
- SessionKey: (types.SessionKey) <nil>,
- SessionNodes: (types.SessionNodes) <nil>
+ SessionKey: (types.SessionKey) (len=32) {
+ 00000000 80 72 c3 e6 f9 be 8a 41 2b e7 04 70 eb 55 34 55 |.r.....A+..p.U4U|
+ 00000010 85 3e 2c 3c e9 49 41 f4 8a d1 ea 9a ff b3 40 3c |.>,<.IA.......@<|
+ },
+ SessionNodes: (types.SessionNodes) (len=5) {
+ (types.Address) (len=20) {
+ 00000000 06 b2 fb ee 68 ff 33 be 78 1d 6a 6c e8 c8 03 1e |....h.3.x.jl....|
+ 00000010 2c a9 af c1 |,...|
+ },
+ (types.Address) (len=20) {
+ 00000000 97 51 1e ae 43 3e 7b 5b c1 60 e5 90 01 18 71 bc |.Q..C>{[.`....q.|
+ 00000010 7d b2 61 e1 |}.a.|
+ },
+ (types.Address) (len=20) {
+ 00000000 35 54 f8 1b c9 f3 5a c5 32 11 c8 45 f9 e8 4e 4f |5T....Z.2..E..NO|
+ 00000010 8e 9e 24 1d |..$.|
+ },
+ (types.Address) (len=20) {
+ 00000000 64 ca ff 7b 64 33 c5 45 73 9c ea 37 5c b5 07 01 |d..{d3.Es..7\...|
+ 00000010 d4 94 20 61 |.. a|
+ },
+ (types.Address) (len=20) {
+ 00000000 74 6c cf 4f 11 e6 91 64 e4 5e 82 76 ad 34 fb 18 |tl.O...d.^.v.4..|
+ 00000010 e0 2a 24 28 |.*$(|
+ }
+ }
}
Test: TestSetGetSessionLean
--- FAIL: TestSetGetSessionLean (0.00s)
Expected:
types.Session{SessionHeader:types.SessionHeader{ApplicationPubKey:"", Chain:"", SessionBlockHeight:0}, SessionKey:types.SessionKey(nil), SessionNodes:types.SessionNodes(nil)}
Actual:
types.Session{SessionHeader:types.SessionHeader{ApplicationPubKey:"8072c3e6f9be8a412be70470eb553455853e2c3ce94941f48ad1ea9affb3403c", Chain:"cceefd7e0545bcf8b6d19f3b5750c8a3ee8350418877bc6fb12e32de28137355", SessionBlockHeight:1}, SessionKey:types.SessionKey{0x80, 0x72, 0xc3, 0xe6, 0xf9, 0xbe, 0x8a, 0x41, 0x2b, 0xe7, 0x4, 0x70, 0xeb, 0x55, 0x34, 0x55, 0x85, 0x3e, 0x2c, 0x3c, 0xe9, 0x49, 0x41, 0xf4, 0x8a, 0xd1, 0xea, 0x9a, 0xff, 0xb3, 0x40, 0x3c}, SessionNodes:types.SessionNodes{06B2FBEE68FF33BE781D6A6CE8C8031E2CA9AFC1, 97511EAE433E7B5BC160E590011871BC7DB261E1, 3554F81BC9F35AC53211C845F9E84E4F8E9E241D, 64CAFF7B6433C545739CEA375CB50701D4942061, 746CCF4F11E69164E45E8276AD34FB18E02A2428}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment