From 92daf539cf990d188a288474ccf7b3364c1b3b73 Mon Sep 17 00:00:00 2001 From: Valerii Reutov Date: Fri, 25 Oct 2024 04:53:10 -0700 Subject: [PATCH] feat: remove deepbook (#3654) * feat: remove deepbook * feat(iota-framework-snapshot): the snapshots were regenerated * feat(iota-graphql-e2e-tests): update baseline * fix: update schemas and baselines * fix(docs): remove deepbook mentions --- .github/ISSUE_TEMPLATE/release.md | 1 - .gitignore | 1 - .../tests/data/deepbook_client/Move.toml | 10 - .../sources/deepbook_client.move | 11 - ...00000000000000000000000000000000000000dee9 | Bin 33352 -> 0 bytes crates/iota-framework-snapshot/manifest.json | 3 +- crates/iota-framework-snapshot/src/lib.rs | 5 +- .../packages/deepbook/Move.toml | 12 - .../packages/deepbook/README.md | 5 - .../packages/deepbook/sources/clob.move | 1697 ----- .../packages/deepbook/sources/clob_v2.move | 3229 --------- .../packages/deepbook/sources/critbit.move | 453 -- .../packages/deepbook/sources/custodian.move | 271 - .../deepbook/sources/custodian_v2.move | 338 - .../packages/deepbook/sources/math.move | 211 - .../deepbook/sources/order_query.move | 205 - .../packages/deepbook/tests/clob_tests.move | 6189 ----------------- .../deepbook/tests/critbit_tests.move | 511 -- .../deepbook/tests/order_query_tests.move | 354 - .../iota-framework/packages_compiled/deepbook | Bin 33255 -> 0 bytes crates/iota-framework/published_api.txt | 579 -- crates/iota-framework/src/lib.rs | 8 +- .../tests/build-system-packages.rs | 19 - .../tests/available_range/available_range.exp | 16 +- .../tests/call/dynamic_fields.exp | 100 +- .../tests/call/simple.exp | 66 +- .../tests/consistency/balances.exp | 40 +- .../checkpoints/transaction_blocks.exp | 36 +- .../tests/consistency/coins.exp | 250 +- .../consistency/dynamic_fields/deleted_df.exp | 78 +- .../dynamic_fields/deleted_dof.exp | 18 +- .../dof_add_reclaim_transfer.exp | 20 +- .../dof_add_reclaim_transfer_reclaim_add.exp | 24 +- .../dynamic_fields/dynamic_fields.exp | 386 +- .../dynamic_fields/immutable_dof.exp | 22 +- .../consistency/dynamic_fields/mutated_df.exp | 28 +- .../dynamic_fields/mutated_dof.exp | 30 +- .../consistency/dynamic_fields/nested_dof.exp | 32 +- .../consistency/epochs/transaction_blocks.exp | 216 +- .../tests/consistency/object_at_version.exp | 16 +- .../tests/consistency/objects_pagination.exp | 291 +- .../consistency/objects_pagination_single.exp | 150 +- .../consistency/performance/many_objects.exp | 132 +- .../tests/consistency/staked_iota.exp | 32 +- .../tests/consistency/tx_address_objects.exp | 690 +- .../tests/epoch/chain_identifier.exp | 2 +- .../tests/epoch/epoch.exp | 6 +- .../tests/epoch/system_state.exp | 4 +- .../tests/errors/clever_errors.exp | 40 +- .../tests/errors/clever_errors_in_macros.exp | 6 +- .../event_connection/event_connection.exp | 24 +- .../event_connection/nested_emit_event.exp | 6 +- .../tests/event_connection/no_filter.exp | 4 +- .../tests/event_connection/pagination.exp | 18 +- .../tests/event_connection/tx_digest.exp | 10 +- .../tests/event_connection/tx_digest.move | 28 +- .../tests/event_connection/type_filter.exp | 16 +- .../event_connection/type_param_filter.exp | 24 +- .../event_connection/type_param_filter.move | 2 +- .../tests/limits/directives.exp | 4 +- .../tests/limits/output_node_estimation.exp | 26 +- .../tests/objects/coin.exp | 30 +- .../tests/objects/data.exp | 246 +- .../tests/objects/display.exp | 18 +- .../tests/objects/enum_data.exp | 330 +- .../tests/objects/filter_by_type.exp | 18 +- .../tests/objects/pagination.exp | 66 +- .../tests/objects/public_transfer.exp | 8 +- .../tests/objects/received.exp | 2 +- .../tests/objects/staked_iota.exp | 24 +- .../tests/owner/downcasts.exp | 2 +- .../tests/owner/root_version.exp | 32 +- .../tests/packages/datatypes.exp | 4 +- .../tests/packages/enums.exp | 52 +- .../tests/packages/friends.exp | 30 +- .../tests/packages/functions.exp | 38 +- .../tests/packages/modules.exp | 48 +- .../tests/packages/structs.exp | 62 +- .../tests/packages/types.exp | 2 +- .../tests/packages/versioning.exp | 87 +- .../balance_changes.exp | 12 +- .../dependencies.exp | 10 +- .../tests/transactions/at_checkpoint.exp | 12 +- .../tests/transactions/errors.exp | 4 +- .../tests/transactions/filters/kind.exp | 20 +- .../tests/transactions/programmable.exp | 154 +- .../tests/transactions/random.exp | 2 +- .../transactions/scan_limit/alternating.exp | 18 +- .../transactions/scan_limit/both_cursors.exp | 8 +- .../transactions/scan_limit/equal/first.exp | 24 +- .../transactions/scan_limit/equal/last.exp | 20 +- .../transactions/scan_limit/ge_page/first.exp | 20 +- .../transactions/scan_limit/ge_page/last.exp | 16 +- .../transactions/scan_limit/le_page/first.exp | 30 +- .../transactions/scan_limit/le_page/last.exp | 30 +- .../tests/transactions/scan_limit/require.exp | 82 +- .../tests/transactions/shared.exp | 16 +- .../tests/transactions/system.exp | 365 +- crates/iota-graphql-rpc/tests/e2e_tests.rs | 38 +- crates/iota-move-build/src/lib.rs | 12 +- crates/iota-open-rpc/spec/openrpc.json | 1 - ...tocol_config__test__Mainnet_version_1.snap | 1 - ...tocol_config__test__Testnet_version_1.snap | 1 - ...iota_protocol_config__test__version_1.snap | 1 - .../iota-source-validation-service/README.md | 8 +- .../config.toml | 3 - .../tests/tests.rs | 7 - ..._populated_genesis_snapshot_matches-2.snap | 28 +- .../src/test_adapter.rs | 30 +- crates/iota-types/src/iota_serde.rs | 7 +- crates/iota-types/src/lib.rs | 22 +- .../developer/advanced/iota-repository.mdx | 2 +- .../developer/iota-101/using-events.mdx | 60 +- 113 files changed, 2552 insertions(+), 16616 deletions(-) delete mode 100644 crates/iota-benchmark/tests/data/deepbook_client/Move.toml delete mode 100644 crates/iota-benchmark/tests/data/deepbook_client/sources/deepbook_client.move delete mode 100644 crates/iota-framework-snapshot/bytecode_snapshot/1/0x000000000000000000000000000000000000000000000000000000000000dee9 delete mode 100644 crates/iota-framework/packages/deepbook/Move.toml delete mode 100644 crates/iota-framework/packages/deepbook/README.md delete mode 100644 crates/iota-framework/packages/deepbook/sources/clob.move delete mode 100644 crates/iota-framework/packages/deepbook/sources/clob_v2.move delete mode 100644 crates/iota-framework/packages/deepbook/sources/critbit.move delete mode 100644 crates/iota-framework/packages/deepbook/sources/custodian.move delete mode 100644 crates/iota-framework/packages/deepbook/sources/custodian_v2.move delete mode 100644 crates/iota-framework/packages/deepbook/sources/math.move delete mode 100644 crates/iota-framework/packages/deepbook/sources/order_query.move delete mode 100644 crates/iota-framework/packages/deepbook/tests/clob_tests.move delete mode 100644 crates/iota-framework/packages/deepbook/tests/critbit_tests.move delete mode 100644 crates/iota-framework/packages/deepbook/tests/order_query_tests.move delete mode 100644 crates/iota-framework/packages_compiled/deepbook diff --git a/.github/ISSUE_TEMPLATE/release.md b/.github/ISSUE_TEMPLATE/release.md index da16cd19358..30e18010ae6 100644 --- a/.github/ISSUE_TEMPLATE/release.md +++ b/.github/ISSUE_TEMPLATE/release.md @@ -10,7 +10,6 @@ title: '[Task(*)]: release version x.y.z' - [ ] Edit `crates/iota-open-rpc/spec/openrpc.json` - [ ] Update `sdk/typescript/src/version.ts` (`pnpm sdk build`) - [ ] Update `Cargo.lock` (`cargo check`) -- [ ] Update `crates/iota-framework/packages/deepbook/Move.lock` - [ ] Update `crates/iota-framework/packages/iota-framework/Move.lock` - [ ] Update `crates/iota-framework/packages/iota-system/Move.lock` - [ ] Update `crates/iota-framework/packages/move-stdlib/Move.lock` diff --git a/.gitignore b/.gitignore index 17c1974647f..642158476ae 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,6 @@ Move.lock !crates/iota-framework/packages/move-stdlib/Move.lock !crates/iota-framework/packages/iota-framework/Move.lock !crates/iota-framework/packages/iota-system/Move.lock -!crates/iota-framework/packages/deepbook/Move.lock !crates/iota-framework/packages/stardust/Move.lock !crates/iota-framework/packages/timelock/Move.lock .trace diff --git a/crates/iota-benchmark/tests/data/deepbook_client/Move.toml b/crates/iota-benchmark/tests/data/deepbook_client/Move.toml deleted file mode 100644 index 75bc146d1fe..00000000000 --- a/crates/iota-benchmark/tests/data/deepbook_client/Move.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "deepbook_client" -version = "0.0.1" -edition = "2024.beta" - -[dependencies] -DeepBook = { local = "../../../../iota-framework/packages/deepbook" } - -[addresses] -deepbook_client = "0x0" diff --git a/crates/iota-benchmark/tests/data/deepbook_client/sources/deepbook_client.move b/crates/iota-benchmark/tests/data/deepbook_client/sources/deepbook_client.move deleted file mode 100644 index 02e33f28ce9..00000000000 --- a/crates/iota-benchmark/tests/data/deepbook_client/sources/deepbook_client.move +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -module deepbook_client::deepbook_client { - use deepbook::clob::Order; - - public fun f(): Order { - abort(0) - } -} diff --git a/crates/iota-framework-snapshot/bytecode_snapshot/1/0x000000000000000000000000000000000000000000000000000000000000dee9 b/crates/iota-framework-snapshot/bytecode_snapshot/1/0x000000000000000000000000000000000000000000000000000000000000dee9 deleted file mode 100644 index 4de9bf3843e94268b3581aea32eedde6fbaace31..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33352 zcmeIbd30ULecyTO-n#FuZ-032VI=^91VIqs(%s}`uLQ|vZ|rXNLbY1zZZrryHqitD zHURdft*y<(!`NB*-nnnNlqpiPsTHzOp?hsQD)-UahyomPjWJz z&#&&gZy`Z;+ftnQBag(by0usRe)X&E_pNJLxBC6g?|Z-NeQD$mq8y=oW!a9s&)r}1 z?){+ut7<&=57gfH!}c$_#b5SvmTQHUvaHCmEh{HBPi(%}0Tx%_@tggSb_-1Q!W6N9KT;0B~x*e>nzPh-H|BAk{ zw0+6Ba&0Z(FLes9t#2(|Y%LO|)V22e5jgYf#Jg1!Sk~|SzT;be^GENJP`Z@avN#US z(*8M?rM$?BR9VHgifrmgQw&Ac9kCOsJ7Vp}cIbq<>8ZgZS)|OI(3K#zBRg^;2{3d! z(Mhk+NiVd82K zyL1vF(iAV(&Do7_k+VlW-sRBRp~l|fw_@e49=0fV*Z+^&zmXkcG$QNpiG#5f*@sWm z`(jDMNW`6D?IG598f*Ngn=7nJ^O zHRk>+^)Hq84d=7k|E6~${Hnh<`a8ak|Gxj5cK&A~zwnhPSNvLJTXj`bH8rWG)E@eY zB2g7%i7}Ne@3td$$Mr17*Ot!3wucCCJxVYxQX(|WJRxzd8CTeA*ptrH2tuACk=UED z*vA5~Psj2MY|2Z4<-lp;$bP&j5U$_tdYux#XV*fvis zUG+{btu3uDxAduv)%D=iwXN-qmDQzn`=QhB(@PiDTEWw=pW0a8ZoR(koPX%_;8L2v z;?k>2t83!Fcp;5n%zWDKrR(0e>Y2mZ#`5LXN*2#qT3IRIkeb&{C3j(Cb93XhFf|sh zT-zS%S{Jhv+kwphq?f6Ozf6&rR@b+J<*Y)xR$9xOt);Ej;G$t1WPEXR z<4RUydv#^k>iVq{>-XobjNrSBsVi1RWP`6Gt6ZrlGo+S> zL+h9os>B-C5xn0S@j4bn;W5VHgmE~ukEz6F0Je|Wm|DhHhE0;pg(MkSiE~`0Bsj>} zZ4-+yiEBno->zA+ugTw;vDukBU>f741Fe5NkZIw+s7#k zLrTx9rdXs!c7YxAdW0R1h!H(aB(0EChMwH#M7?Z8t>ss`?UE0zqtZli5+7GdKH`mv z6wIUo`GBlc6}w_pt>0^Aa=)M~$~WRn{f5%NtB$%qX8%Lw{U_(k+W(S&BKHmdJ>l1b z+oFFF==fg+f0WOEt1(jebhB3cQd3(6YfR0ld1MeNrv%YTW_qcNcQi77f^4;Q03olf zIs<~X#%-79F7w=*6Z>xS9L`CY{pMNo#9l!zYO8Eq_Awl2D-0r@UM}Y8n`cSo;e;Yj zZBHuFezJ7;9P9gK|0Td`~$OJd~gdR2?#NENZG?Fp+a#`MT2 z#%O7@GEy0?*kPj*hPAL!@R1I^X8;(^}*eo?GW2HhkR2r%bRt8H90XiKP zkjFAmAn_Rro%XOHB3E1;1b9c(i+D!l(vS=l*=WK@kS0J}CY^ANk@hw$B*78(>3e1| z(W$xPIC;sAD2!H48XQM5PGiWJA#?E%H~eKxlG1d&75)qWu$^Qq&-Q>r$mmo$FMoQo z)rucNo@}l!tv$A}($Z&JOBZh#29{P<+G4rZmc`8SFD_nq1L?EUdcAU;t9B zBfk5hz2ntGex1Hvwbn&axwN{r;t(rGIkB?|K77^*qbtE^9){|}8gn{vpl!_f&>XW;=wAotU z&R^YZy}G(_O-e>~o2@GwueNHbVVpYDh&ESWy3{UvF|~J!sW&$^w)NKPo2?zjldCIB z+pVU>R{hiIXA1oYSrm6CCM1Y!~Od>Oz+p&2ao8PguEpIt~wzTNjK7@>FI)?&l zkHaK&)ERPSoIQ?hd$Z0!%IXW9sG>zJw~?lHSYG*y$i^GyRfoq$da zIciz;M?*7W#f}OcFE`0bktL)g?RlZoh+WA+#BM{eT9w!6nH^Yr0J zo1kv!CVnYLPIty4h+Cdtwq$J|I0(5oduL&h$KXUT&qAbF%%kNxqBHI)@> zoO10=%XQ?Y<+|%u!!;}TzM7@z_6W<;v@>K zc^SV`B2DO1VZPJs6Z)Xb>Qs43sG4sO$sI?+kRp!mSWo8)C!`+Yf3|Kkhyy zvF+)@Cn6k1?VyGE`$Z)Y%f<)aX>;;m$?f@C!kcvhl`K8VHgF8 zRF<|YGB8IW&)xdV3MV%#CVrd?3t_Gl*QWFjs3@o0FRQ3XFl8J^IwhXaU&32RP;}oC z8@Y-tq`yt*uPB*5QD660NO?Xa8yFYLMG+sRJ#$|URm!_yY)ZE%QUR}FO;xF-j;=^!%Q^MnpvU>=nLc|6f?8W&`$ZE z=5C6g4=2gI&0&&86j{o3YD`2XXYGjapL86itSo?kQd&<^6(<@{iW{m44aw)jTvDW) zLqVZCUXJmCh32DNQi_>&XuKSujwDgO6C%cuv|3W>D9;=BHHd1EYh{udJvjG&QC*5VUrJ; z++m`mS|o!{AW@~*&@F5vwWE3f>Kdwl!BE{JGfyN`6Zs-++oDJ1=6E6|$M~ z){X`?Gh5?erqJ%Oz-F7ka)cL{n8&uxxlGle%3Zfn6kdCsS61e2AHCsic8l z(=Ll&qX1Qs?uOii_S~S;q$JZD(@qA7J;ZFAjgC25iWZrUg@() zsVTjW<%enK$WGhYJ!o7+3<@RenxxI>gkV%gFh=$SBbf|kHZy!%$$VDXc8(RD3_uE2 zBOkUonGgr`)kykOWX0CMelS~UuqQKakAGY_UsgY)^{==;q1?Zl`)c5QqVzWk{{J%e zV(zQEep-e9>-hhrqOVNm;;&8q(w_VuKCrLwxd(@=IqP=o4(oY)#Gbbg+V|Oy+fUmU z?f2UsR_c=ah_cFv^&)#pZ2Q0*shMw^Atb6YYbY_D5dT8koxN0fXDgcZf=y9vSGKBT z-C!w~0U&3#u6%+8P{(77D$IFSSl3omNtZZr&8C?=8lW&h3GO02_U34$BeKhFS&3_m z<2hq|FRKD^{WSAxG2aZ?K(nm(L0gRH@&z&8n;P#anzt*ZvN)ctRK-|h34`%+wQgDW zG)$WJHjQy$&={`|4O`aih_O$N8sq%fE{W3|8yDljiAgaY*gYl2nbf#{53Kai-f5iF z^ds}sf1i2ozvo`;3y)NJo_ypq&qtpW`xAH9dA@M>B+o_jY&|0O4fA~Mo>`^s#=EO* zzBS)H$@AzFhj<=4CC^6=vkbN0^@Kb>rcR0RDRmoLdd`cJRm=IflIM4u=O@(UX-hwK zhJ^GR_Y+xvQXP|*&nU&4`<6OdwQ{EtBIh3SamhXPIO*j+sSXgzyL%QU4TkSK!6Gi$ zyKqvBnTH<|(`k?=?lX={_I`1^uwdf7@{|ek>cdBH3?H69sQmDw z>dw2YXz*R)6YV`O2}d&zO2W~h^O8n>?}>S3<)1uJSJtVSduAVY?wXyOz30eXN9K+k znmu$Ro(txV&E7eC=aFP~x3$OGWu2ZmSG|Ac#LU6j(%gaBqet#Ia>s0W?tz&ns*gSJ z(Bwli3p0DIeb$7P9GS8X9yxI2=c37nVCuJ!I^uXe*A$mlV=}z zaB}9z?2%(fW@qzr_da{?drnTCm>jiE&fGtF-{hkYoSq!B9+=!eyZ;FLufB^k@oUsd zvqmf^zsMVF#GF}G;t*IlA3@dQpm1OyOGB`33?;q^X`U+A@iUI{APO^|nq$%`;svcdJSP1KP}sO04A_$1f|Nje~YUNTt(I9LV?_-E@6a=xZ_{i_DP}bY_?J zH**Wd2Uh!%0|7gJq(lQUu9GR*@h4WZem6S+(x~Yx8wZLqnMR{15gvZoywR34pg6Q! zLH80PZBf(Al+R~J#Y9S5AG(aN6JUy!rkoN-QqpX5n4%8IhC`Z{$)2t!t?9{DcFwQx zS0+)}rKY*WaMGQQtRlH+K>Tv;_jDJdQw2FUB%bg>W~K!sN1+6MRnr2*lPwFOPr4^g ziYB)vlRmT1neMG2i8qY7c>nZ$$ z)s&Ztb}PX~3@0{HA*z#A6#vW`F#XB;iRmm>y9OrTv@Q^b$SFt2^2V?a%QVwWDbJ;4 za$sp8Wy<3=6l51R^Xe9xQfFa`ebJ#h(KWu^RJ@$;!v8c{+FtZ6LpNb_0_KG89UfZR z)dVsA^q4eh31cGca0=m`lAUXF7SX#a)pstTAA0=hh3M?+I;RNch$8p+)$P@db@%bj zmDXn7JWt7y##(D7GH+*A*RZEPsr_9?QlE2cOUs#0YJb-eeQsl8Et1D64h*(iE7=a% z>hk5Ytyf!X-6IkI={K&n9$UK7`s1CA$eD*`Z)i(jSX#cEoppp4aO2PqsqsMo9Gd;7v*lKMRjCs81Z8#|n`NYy&Z2%XA(dnZIIt*aYbtJ@suY_-^;OkZBPwy`a5JsXzQzBe}OU?|bjhB zEv~J0nxl7@HfFnYBReR@tE4xY}CJ zII8!U%wOBsrW$Xy%2$>yb3(Y;g4tV(n>_NpE?WUgD|7-{rEMek(bP>^LeAOfv=F}2 zb#Jx@jPi=?18dpjEt{QQY3j7WR##FNNiuWk?hCh11EZeGoXBd(5sOXmIt~)+Jhh`Ldshr6{ec5nIh3`(m#cDW)Es zu6C;(>$ts*Z3>efcMfj7wsdu|_4*QgVFc2}jm@-)dwtS8#7n}YTiT^v}e)D6|+PG4HQvQ^lIvDP~D>p5r*wvqUY>xg`FN|E$Z0h^izJ0Uq~(3WK%?bUF9tls@Sfu*{on@l9lT%=Ar9;dDO3O`SlMv?{+@q zJi}RlxUD+p)MdXs?p$?Fa3+xJI*sAPIY8IpyA+256S#iBd6v`8+$z@1H2Mk0we73U zOEPU?PGc7z_A7hLq;JSPSDa<%dlXZ+_7pZN!)`N2yCzR{8&fyGIBDi~+h!W)^%h4; z$kFW%#ZhzioHHlQu#X+bD%%>elO@f-3ZIRPX`^H&7CDYkwE}1686m7mHpXO=i33WH z{Uq5>E`xtmD5V`}KDDky>2mWMYIJUY{e6Cfj%po7~=fQqqG`eos-brY$bz zcq|?d;!)!}uJ?!Ip}i+|-2*}FMy~!Efx@w*67LFkm2^@~YPER4SO>=S7j3bH14&)> z`b#dy6+t|REmsSjJ^BUrai3QxkCRt3A(BQ|4+}}t{l~IfUSKb>d^j$LWy-B<<=f*S zy%7y{&j;e6upAB5<5D;hmZtOvqf#73Ww!nEap3-WD&+ zO%5J{)cH1IaV(N%GpzrtiiUgg84japxX!+^1j*IPx5bqxA95U(k4D%;jz_xH2$I1# z&Nta?9*X7gM3KH%;~b?DM)hPUVfXr|7d4V$mG?P{8IetRp-EVP7s#d&Rg%$YQ2$ek zpL73!cIa@$1k9AvpRvP%xYlmkvA7ymlU?KbKhw)i>$`u1jYN<7kz|~VhqYuvg}aJ6 zswI=k{Sn!>kXHz^J1%mhQ!Kgz;iyg`A>n}jiV!{;Po`8n9(vJOvZrj}5{@T(<1t0R z@m?OG_n-Z~4qw&as|I`(z*llK;K-hRhp#x_5268ET*~nfjV4~>dLPs?Otn8{s!tOl z9D=Ea!{Lmns>TXaeM^arI`=XaJkw^X=iEpASk8_5nTpnhseVC)jW9o@m*J0`+k$Si zCqxZX7C78y0Yl$Xmm8WeRGi_2p9aJY-h#nD3s9`m`UgbR z+>9&!ZI>(ZVO~THr%`omh#Gs3e$jnIxI#R57@<-$^vTmhqGB?G#!Vgu`DKMU=Fo-zk zZ(tB%h+&}~$F&l`=R|5Y;lM3rkUZTeV~}4rV&XSc7x@-6>^NVcCk&c5d zJ;p(lVsw(DLrNKi$zf^{*34OU*nfx}iY%l^E`tvf9hdW48HS=XaMT|-N(CpUknO{+ zIMfwQp=eM=pNq!zLv#fu92E1miksXXqtpn;ROrn?Q~F`|={}!$I`kk&6@qYx&j~j2 z>@MV@bU6=}zMH8B%HK2r(W3&K!4#no(#hkfQYa<&G!UKA&#DkmPP7?35xt)KQ)&0} zAl1D>(sl{~>>+vu=$9rjeY;Rh?&+iuby7fWAauQ=XcV-I%bY5X%H4BZ8~@UT{%c)- zA=QNbb>;q5PF|;P3|*ek|4&~x*Z;F}>BT8UAct?JgYB6nbIasD#warNQ7DL9uP~v1 zU%B7vi4aNK$5Tjn=|3<^+z?Ked1+tVEQjmLRHQ>F)Q`N%Zo4G*YD6=kzs{p74<>aA zk&8mBUqey!gk6?UOp$jAB}9_IcEg01f*iM#1-pWXc<;+H*_W;c2ZzZq9hlj@7or;g zBZtYj4BgT_PNMBH#qRji zkeP#rjV?u-A#i9j)VTB!ciuFI?IK!e4pFh7g!8b;UN95LGiiR0sdts3N9(64GmRt4 zH3&$fLc+w>p>f_TjT1)3pSgZe$T8|RSaeb@dw{~f@LB1_ru2D3^O7ljsZ;vS7%|gH-N9r@ng#+GH>w|o zG1W&!BrHzq_eNn{3_blYr4jCV6w`1I3POA1KtJU^+fE^vjsj$kr+;Z*dLOaNLbkF04%xtttl@LCQ@2Dxi-wnG^?Ud4>LP7!5?ATl$Uv+VONfS8kF)y~6Q3zB{4#}LLz0KLg-T-k$oE}b`?xN&4DB&BP{ z!Zs!X5(U3ZuU6*wt6dj|pKArGdIPfA)? zo$~SWFwKGebTyA=;^}HT7v{$Zn4UzyT}dL$I?y3U^+ggJ%F1u*bY1x!sql5>2i(^# zKPZE5v;3&z-K6}I%R4H+FxCY|aKb-a(s8%CFj_9DW{fuL7DZ{j%{y?3%)_V9GlInM zPMt0^#nwrfOBrSih6&Tj9^5iQ8!g{%dcSCt3d8nEe7M|&%V}&Q@Eh)^nZQWzjl>Do z*61r$cI*8xk95~LVIm{!wG^Ae*KMMMJk7Cp#D0^jQP0Wcasldyg&eAiprGU+(E{2y zm+o@~bKzVx7tiJA3UkG|(p-7Y`g%T7IzkByO|An@^0SITdd&T>{U4O~AD#bG`~N%e zhR>m@^pgmNzYe_NZw5c+`Y*C(muEY~v zNS=VvP)i!$g2Zh}h>H?DohQX*xqS$8x5un&s>taDlo_2%JHe28YEcPwp0D zU~ou`DNDc&!_C2Fr7_a<8?{EUQEHSM0ZS~eQEfDvLro?wo`JdvqRm5d5io(vDY76J zZi0JbGS!27OJQ%ER7(s&7)Y-(N84?O-q#+`8!HQXDEa`t>vBv^#%>?>tpj~aH8VK% z?}xsn&WJ72pyZsqcc5==yBxGj}t0Az3D!Q)addw87++gTt%obQ3 za>Zd!u4I+jEGwzn1oQV|#AyLDE^9hc<$5H}1Ql`SkYrV<@_<1xI4m&mGl;qRw~fsc zjGe<2L~=CPJVDpdNqez*0<3ec!{!Mv#7VJvz$a43o^N1v4mD=MVq67<2Qp7UbtcU& zGEbDV*))_@WIr-b6tO!Vy~sS#GnPbpka>lECqd@P5=@l7jT$$IMW#*6uTl5D4w;7p zhYkc*cEf4t2H3ox-|88>_SyS>LOFk3eah3n<^O?le>ME=lJ|YX-x%<}b?C+1Zyo-) z9sVD;{S7<%$)ol7Ye)auUHSj`%E`j7ZXPK9-ll`j>`CjCwT0^L9pE4zx0leF{hFgt zYr@uI28)hXt!K1q9ivsN(W*6CwrIy$?6#&_wE)zNX+1`^k#+?OYoQR7O^}c*bjJpfQ zxT|0sA1s?74^@outE!4puVwwZs>)z)eMt?}#r$bCK(Q?Azf(=~{%2IvykBKJ#d#w& z)`!j8Cl%O1T)$U=HpKjt0%wl-LaKiI-6~bQ{T{V@k2rrq8Rc8+!)lUBKf2Epe(+jq{Q36lXWHh6?!C{lzDp&Omh~6R^JC`ugXVc5 zq3j=LGl9)G3Gw-Mq@&3J<|=P)GCi6z&x7k5*q?k;RED2=^BT{^k5O^0mM;q;ar^Rl zp4ZIt_3+);-~Xn#d{!CbN7VW`-hM(|CW<}$Nog{BMT`jRNcV0U`X*oZyH$*HzpS2;x4)u%-rS#6mnN;;(+?3l_hJo~T z#;?A@WGk56IxWWh8?TFzY>5JK@bIH@A3<gYn?muBgW1ldgqS;fDO*H?SWD_N)B*p0U@L7!b`_1v7+&};)v7PNcy9UJ1HngB>!ILOuzvO}HMw#2 z<+JZT_td!;&b)ALa^c{@D`)8xZ=T#bzjgNV*++s$gZqPzt1Fk@|54R?FnITwr_L;% zI~z0>TIVjFYc90ToIi8^+|{#Zg3Ys+zFS>A|N6u zQETU4K0mRr5UicuIKO({T3A1SGI-_uxpU{vd{j+-1g-Pnu|Sk1jdG+bbIYiPmMKQ+ zgr&joDsCt&vg?#Odwx?z70&J1_(uGM$0AW*IA5=q0FFd(JcDH})AP`w4SdkWLFW+`%Xkrr!* z$kNO`)#@onCzcc#^fi&CnK*sODv3IW(Evx|TfCqSn(6Y$GVTzU6uLnrOB1XoGaI;+ zA9((N<6=sVom@y9mGL|*;iXLDu&P0Op{GunUG&Dggr)t_36~{Tr}k{C1fp{7*yQcV zA3Cyak`cF@DUnNVgzET_EG!V@{DF4yI4v*~hnZ7LK+%!^CSV;Fphm(Dtn$RL%~Kj2&omK}5LQWvI87`rAx(c6^6RcY0FtUy_hWS zmbGy=%ihZQro8FHFj7ywceV=Gn6zlsjP<1D#ZHZyzyhS-LG_eJgk^=d4Z9G;kSS|_ zVeJ$ZfOkftK$Wg*{*;WSlp-#&itcQ6SmJdGX>16ZT-vjIfFn4-1$Mlo&aF2HGnJBe1gZmNT|xEWGq;0EjpmEPWUqpJ}US$pk(Z>ir1d6AUH zcW~}YD#OJDrq>HlXeWeB@#?h;YpctGep%nT*xLM)B4);J2BldvxB2~v0X5C7*4jlt zT1*_|US7FJia`NjOm3^i?OmJk)+KJ3T1+n+Gz;%C=>UvG#Z-R1P$SW-lb_?u9WV0hg&)ZcD)M8!o?5VFw@BM;J>LjP>VT67 z`BQuLwqw8ee{YJO+%o*q;*L-ur7^-8c{95Pm z6yOwBdZ~Gos!-qI3Q&}n<#f@YrzGuatjgQATwnJH2Z_}%#b>e4Cz+9Y`CXigar%X( zb&7T3N+*{)i#(M0zz@xrKa`-pAoq$&1al(l4SB<&s3mubierjvlIS`S^+$9_N%6_& z3Ob3skqLA85o#92Y4oW@1slcb&@MmMQIeX{1MZ-xc$cTq=7}fum^&%21yO_qP&Mt& z$}4JlZuuH2=u!DqQRb8vkC)c~FrlnkAzjh&M!Sw!=zlpCD=Bhkmz$L2&$GNHW~ZLm zD-^a$p=-&&akMo#s=lF$b)%h5>rh|QLR68M*SC+k9QuZa$eDYgCU=2(<8HW~i_<5y zZ!XOf+*?l6SEWIoKqINiO-`u8Q9-i935D4qbC;A!Wca3uc#?>2Co%$Pq%RRW8M8&N z$LGfCo>uQe$GN0nGM2U@V<*{#IygLKC_QeM|CsT0GC_Q_tW5k#qrtm;tfvh+n&jy5 zpek+QsZVYiJlimIHb?Xkhw$hKLTV4#N*D*Iau1_UX^>Nq&uvwd zb!Egvk>h$%LCB(rZsZi`JGcae%3&11QA$OnIcVhlWRFpueJRh`V8q<#hmo%V3X}k-{c>Y&4M>2=p^8zg#ejYgCZ&jjC-nVm z$KAM*Z$^#NSKObo!%-8a{GNCsoS?OUgFPS5>Yq{3Y>x`=Y&a3k)?)cH99x@8$1&|FM*peLgP z;c#@I4$@JApiuo>JQ-F$(R-5YrZe$&q*@KLbk2iT4?)AkO)H;bb^m z2iY=;n;q>-Zd3U>fUes`XI2D`sNPE(Qy{Wwgp)u>JpFTaes>nYct?ZLP&C|#CX=J5 z?~L~ApSNK+_ZMlfj%1mD(F6VW?Qn0rr%l{r@l-gKB;)#jw4*6QfA?=;BX88?rF_Zp za8Gil3J(>%XisvNa{q}PfivV4*0?*~6^%x_id-o-ukVY5i4N-jBy1QRPVQ0h;cy^2 znA}@-aS0EDS~#c(NN-eJwgcN1n#qZA{V6A!j+)1F$wE}8-_IBY?9VyT?&M?~x~-=K>~-=K>~-=K>~-=GsppQ4L!{zE5ecaUg+ zF4D{oMoqfNTXwiF9G%i%1PlrTa9`s-Av-KOWTMh@Qie9%I^N~&8R;i8J-j^wC&R*{ z(LOPRW!s!QWH@*Z*Gp!#R+a0;22(&AV=Nf&{mzi87JkZ4oxk7MiO z=-tB62jJ-4!qLBIIGR@|*~8KMy8TAq6AASX>c1__6U_;4&xQ49*6?;6VFGW@($YOq z_6V07wkr$@mw&^K_C$k*%LSdf7f$!|AK1|ZTpqc9Xbbod^dS$s373EHqn)u}5BSD< zGGI77=o<$nj9}LWvzLtnhQk>LPQ?dy90caVdB#Z4ZU-5TD8fIdyM_nga5Sj994=Nk z{5NfJG#ow}jtc*c1aQKraJb&1&$~~`An=^w@KJam9R$7rhf5%^2%|779JkAGiG+xD zC8u#USw-^t;-!9Y{zh~f}k-hq-RXD=v_Ge&Y>AXgU zn*ux!G+pkDg%Kr}4v#1Io1SP#)37W3qb(CNq7Fm{GFd-Qe>kA7i?sVXx&LpZM|9;r*h!#U z|8LqOLiep+xi7#HpDQEMS!*`Q6gcISGN_FYfqm@vgaMdP2Kj)=mEa=YQde2t$l%_O zWCa!nlElnux#5o4cK0(%+~3QBr{5a@)xB9(%qBf%levU1)Bt(N$K^N#bP|FG-j_Ut zbPo8=1IK^dVZ0VP%uXA7^lA68z7%uQ#Bhl5Fap6;!5cKG#-NJ)`~DvNQf| z^lNC)uTI3hj>%($qJv7{ozSnYps&)EoVn^Xk4j69PgqfLLCxJ47r`=t%(D3xB#&3Z z50c>7;VFQ<^Cg7u-MhPF??e}GfOD-$g6*;+<)Iq!2|7+N(*lKrweI1Q2<-M zmyw3#{HR90kte+H8Qc9lAU8u#SRoH9$XzDL&`ttjsd3XZvWPd7avYA6FWY#{-S!0b zPpKI$N@k`nBO^#K85w~|$;b%yO-4qrQ!+9FEtg>!w5v=5Wrs(;Yh%{j!qvz9H`~>C@SnTnmI<`bv?C zu(M;AdT_vY8wb27 zpiWgD7vxwU4wz5OQNs|q67=AJiPnz;7LcOgfPoa!Nu~@A_;~{X=D{T7`Pelx09wgS zPN%?6zF{U9;RMK>kw>h~U$m!az3)>g5}0YCK>{x^338GP84{Sx1qpmW0CkL;4xn~H z0yDemLjpU31eR%IiUejIlp%rl&|crKen|SMS;+7$0$MJG3RGyhHWs+uaur%`pl7iX z%d~HKTz|I`%Zf~LOW45C(uid+tmE{}yuMvv)ZnCT_ZTMVG{XUfc`hNjFP7_i8L?sb zutIBb(~N$mP^2+>x`4;Qc-`6irI@3c>+gLkJU zakJwX4}vzHjLTgIxm85sACHH6TC)%q!}4zZmjroSJUJ;>Bn>f{fk_X$$D$!AAKyzz z-DuxxI6(WB!fH4;sh^Lk%rZ+1cPW(daZJOn%5z+fE^zM&vaKx=bMiyM7VV z@GO(fCbvq|p#s#)ufHYX#Ly}^b0z+Nv@Qoz+4OOsH5;O`9mJ>C({tA*e zWjb)gl^qg!InMNZWS*}ByfCg$L?a3h^J=KmFw`k&NMYKU2}Rn@(3N|NCiP`#HZ0v` z*pO(+T_p(-@dEfK2t2O!bsZ^^{EYluY%MOp+F4lGNTYnb=EKDUJRoG!ol1+6Rq(NL@7I z#5)06B>gd@a7$Fu8rOW=Kr}<8S=n(FkhY&(G{9h%%r6-H`Fu^}hyaA=Yvpl0XLg`v zuks~C$r0i3)GnVTFoD?rND=7lPG~C2qbQGpJPaT`FE;iAHBAY|xKXPFrwqS#2ZI5%S5)a*-M%pBeY;{e=F!+C#V?nHkqIYYhNA zB$t787m_uU>6J-^>mSBtseH^$X2sVArf(?%h+GtKyJOFi)DNqb6Ec9BA0YIuUEt1S zp_y+AhLv6f{9K%7r5V#)WqcNZ`&4fj1B2ghVDJY0ey9iiex-wczaqoGfZ3NMEv!!Y zLV1p&>rSWPvl|B5KFNAOpPrO(oK3J9(GP8ZAvrK(yGblB>JkxeC8chO_F#=RhxrUUr>zUM0lyh z`Bu>li)GI#!ZLSsq*lVIAWN2ibvj;W%zP6n&H$H2h09wfrnPk8N`C^HDu|&S`K@WLI zGl+b#M7~%?zHq4yU7s%vn1dv`R-gkf;Nz&MC%b_Y*k;mCtJAWqkptfcm@i*x^f?3c zb3UI-wKxuzV_|n8w@_LrFH{z)3$=xTh5ABsVQ^sx0Mp3A=)%~-u7&Xh*5B68cWxZu zz>@y3&pGl{#a(dY?uTtYr28%BvyT6k_hRlJac{{#^Q!TG_Wr%j|C`w7wt&bgaJ9yS z#pe=HNaxcdDT)#VC0`{G6s5yu8}juLJ~cqoSoIVRIglC+`P>NScAzgsSd3{-jz{G& z>2rJPG!I7PybZvV?K&}Hzi6?Jzd^i{kDz$QrFYgXl zYqeTqcwo3W%z}>#1&jtbCyv~2()|NRW#Oq6oZI6pc7+fU1PKTbv9P@_j&eT%7-F7T zcwfSq#KA|jFTGDwq&XDqARz;*nyP{exWFWyn#`C0tVpUPA^-~mD)Gf8cO1xf2T~g@ zq?9v0CW=JEudNO*FqPCwIMsVe{Y|f=4~&BLxuus{M$39ATmlc~!rms?x?3QdXB~q};R|w@!>#fwrwbNTw z<0e{Ca?5f0mBM(f=R$4&%JrW$)RIB>n(DmCFV+8BT`8J3Nw0nFxo8vK>I&;#&B0u% zIoPjrXLQqg^tk9xxA?v7HwvXc-s%S@tYrQ+*ZKIWqQ->D zFLN(cAzCPUbn3BubbpaWIBV6gTucQXDG9tvP{ACtQ=5uCzqKp%aIvY>yH==>TWry5kWbu_QY?LQd%xR;zc|!2;=Eqi4 zcbztg9?7mkLu%VyhU{juX(o_8BK=jS(@gsPay}m5DqpS7v-EaZEDvylTrjR5XW~xY z_lH*0x-S-D^IV$Uqn8Tg{#TTtuR#y{NUo~zsEV5FN zJ3?9N*V!HBo?zLT@Hn00bgW*EP8V4r))iN8x#oL$rV5bK{fpF^mq_R;D>hRHnb#rf z;g|vgdC4-$L has copy, store, drop { - /// object ID of the pool the order was placed on - pool_id: ID, - /// ID of the order within the pool - order_id: u64, - is_bid: bool, - /// object ID of the `AccountCap` that placed the order - owner: ID, - base_asset_quantity_placed: u64, - price: u64, - expire_timestamp: u64 - } - - /// Emitted when a maker order is canceled. - public struct OrderCanceled has copy, store, drop { - /// object ID of the pool the order was placed on - pool_id: ID, - /// ID of the order within the pool - order_id: u64, - is_bid: bool, - /// object ID of the `AccountCap` that placed the order - owner: ID, - base_asset_quantity_canceled: u64, - price: u64 - } - - /// Emitted only when a maker order is filled. - public struct OrderFilledV2 has copy, store, drop { - /// object ID of the pool the order was placed on - pool_id: ID, - /// ID of the order within the pool - order_id: u64, - is_bid: bool, - /// object ID of the `AccountCap` that placed the order - owner: ID, - total_quantity: u64, - base_asset_quantity_filled: u64, - base_asset_quantity_remaining: u64, - price: u64, - taker_commission: u64, - maker_rebates: u64 - } - // <<<<<<<<<<<<<<<<<<<<<<<< Events <<<<<<<<<<<<<<<<<<<<<<<< - - public struct Order has store, drop { - // For each pool, order id is incremental and unique for each opening order. - // Orders that are submitted earlier has lower order ids. - // 64 bits are sufficient for order ids whereas 32 bits are not. - // Assuming a maximum TPS of 100K/s of Iota chain, it would take (1<<63) / 100000 / 3600 / 24 / 365 = 2924712 years to reach the full capacity. - // The highest bit of the order id is used to denote the order type, 0 for bid, 1 for ask. - order_id: u64, - // Only used for limit orders. - price: u64, - quantity: u64, - is_bid: bool, - // Order can only be cancelled by the owner. - owner: ID, - // Expiration timestamp in ms. - expire_timestamp: u64, - } - - public struct TickLevel has store { - price: u64, - // The key is order order id. - open_orders: LinkedTable, - // other price level info - } - - #[allow(unused_field)] - public struct Pool has key { - // The key to the following Critbit Tree are order prices. - id: UID, - // All open bid orders. - bids: CritbitTree, - // All open ask orders. - asks: CritbitTree, - // Order id of the next bid order, starting from 0. - next_bid_order_id: u64, - // Order id of the next ask order, starting from 1<<63. - next_ask_order_id: u64, - // Map from user id -> (map from order id -> order price) - usr_open_orders: Table>, - // taker_fee_rate should be strictly greater than maker_rebate_rate. - // The difference between taker_fee_rate and maker_rabate_rate goes to the protocol. - // 10^9 scaling - taker_fee_rate: u64, - // 10^9 scaling - maker_rebate_rate: u64, - tick_size: u64, - lot_size: u64, - // other pool info - base_custodian: Custodian, - quote_custodian: Custodian, - // Stores the fee paid to create this pool. These funds are not accessible. - creation_fee: Balance, - // Deprecated. - base_asset_trading_fees: Balance, - // Stores the trading fees paid in `QuoteAsset`. These funds are not accessible. - quote_asset_trading_fees: Balance, - } - - fun destroy_empty_level(level: TickLevel) { - let TickLevel { - price: _, - open_orders: orders, - } = level; - - linked_table::destroy_empty(orders); - } - - public fun create_account(_ctx: &mut TxContext): AccountCap { - abort DEPRECATED - } - - #[test_only] - fun create_pool_( - taker_fee_rate: u64, - maker_rebate_rate: u64, - tick_size: u64, - lot_size: u64, - creation_fee: Balance, - ctx: &mut TxContext, - ) { - let base_type_name = type_name::get(); - let quote_type_name = type_name::get(); - - assert!(clob_math::unsafe_mul(lot_size, tick_size) > 0, EInvalidTickSizeLotSize); - assert!(base_type_name != quote_type_name, EInvalidPair); - assert!(taker_fee_rate >= maker_rebate_rate, EInvalidFeeRateRebateRate); - - let pool_uid = object::new(ctx); - let pool_id = *object::uid_as_inner(&pool_uid); - transfer::share_object( - Pool { - id: pool_uid, - bids: critbit::new(ctx), - asks: critbit::new(ctx), - next_bid_order_id: MIN_BID_ORDER_ID, - next_ask_order_id: MIN_ASK_ORDER_ID, - usr_open_orders: table::new(ctx), - taker_fee_rate, - maker_rebate_rate, - tick_size, - lot_size, - base_custodian: custodian::new(ctx), - quote_custodian: custodian::new(ctx), - creation_fee, - base_asset_trading_fees: balance::zero(), - quote_asset_trading_fees: balance::zero(), - } - ); - event::emit(PoolCreated { - pool_id, - base_asset: base_type_name, - quote_asset: quote_type_name, - taker_fee_rate, - maker_rebate_rate, - tick_size, - lot_size, - }) - } - - #[allow(unused_type_parameter)] - public fun create_pool( - _tick_size: u64, - _lot_size: u64, - _creation_fee: Coin, - _ctx: &mut TxContext, - ) { - abort DEPRECATED - } - - public fun deposit_base( - pool: &mut Pool, - coin: Coin, - account_cap: &AccountCap - ) { - assert!(coin::value(&coin) != 0, EInsufficientBaseCoin); - custodian::increase_user_available_balance( - &mut pool.base_custodian, - object::id(account_cap), - coin::into_balance(coin) - ) - } - - public fun deposit_quote( - pool: &mut Pool, - coin: Coin, - account_cap: &AccountCap - ) { - assert!(coin::value(&coin) != 0, EInsufficientQuoteCoin); - custodian::increase_user_available_balance( - &mut pool.quote_custodian, - object::id(account_cap), - coin::into_balance(coin) - ) - } - - public fun withdraw_base( - pool: &mut Pool, - quantity: u64, - account_cap: &AccountCap, - ctx: &mut TxContext - ): Coin { - assert!(quantity > 0, EInvalidQuantity); - custodian::withdraw_asset(&mut pool.base_custodian, quantity, account_cap, ctx) - } - - public fun withdraw_quote( - pool: &mut Pool, - quantity: u64, - account_cap: &AccountCap, - ctx: &mut TxContext - ): Coin { - assert!(quantity > 0, EInvalidQuantity); - custodian::withdraw_asset(&mut pool.quote_custodian, quantity, account_cap, ctx) - } - - // for smart routing - public fun swap_exact_base_for_quote( - pool: &mut Pool, - quantity: u64, - base_coin: Coin, - quote_coin: Coin, - clock: &Clock, - ctx: &mut TxContext, - ): (Coin, Coin, u64) { - assert!(quantity > 0, EInvalidQuantity); - assert!(coin::value(&base_coin) >= quantity, EInsufficientBaseCoin); - let original_val = coin::value("e_coin); - let (ret_base_coin, ret_quote_coin) = place_market_order( - pool, - quantity, - false, - base_coin, - quote_coin, - clock, - ctx - ); - let ret_val = coin::value(&ret_quote_coin); - (ret_base_coin, ret_quote_coin, ret_val - original_val) - } - - // for smart routing - public fun swap_exact_quote_for_base( - pool: &mut Pool, - quantity: u64, - clock: &Clock, - quote_coin: Coin, - ctx: &mut TxContext, - ): (Coin, Coin, u64) { - assert!(quantity > 0, EInvalidQuantity); - assert!(coin::value("e_coin) >= quantity, EInsufficientQuoteCoin); - let (base_asset_balance, quote_asset_balance) = match_bid_with_quote_quantity( - pool, - quantity, - MAX_PRICE, - clock::timestamp_ms(clock), - coin::into_balance(quote_coin) - ); - let val = balance::value(&base_asset_balance); - (coin::from_balance(base_asset_balance, ctx), coin::from_balance(quote_asset_balance, ctx), val) - } - - fun match_bid_with_quote_quantity( - pool: &mut Pool, - quantity: u64, - price_limit: u64, - current_timestamp: u64, - quote_balance: Balance, - ): (Balance, Balance) { - // Base balance received by taker, taking into account of taker commission. - // Need to individually keep track of the remaining base quantity to be filled to avoid infinite loop. - let pool_id = *object::uid_as_inner(&pool.id); - let mut taker_quote_quantity_remaining = quantity; - let mut base_balance_filled = balance::zero(); - let mut quote_balance_left = quote_balance; - let all_open_orders = &mut pool.asks; - if (critbit::is_empty(all_open_orders)) { - return (base_balance_filled, quote_balance_left) - }; - let (mut tick_price, mut tick_index) = min_leaf(all_open_orders); - let mut terminate_loop = false; - - while (!is_empty(all_open_orders) && tick_price <= price_limit) { - let tick_level = borrow_mut_leaf_by_index(all_open_orders, tick_index); - let mut order_id = *option::borrow(linked_table::front(&tick_level.open_orders)); - - while (!linked_table::is_empty(&tick_level.open_orders)) { - let maker_order = linked_table::borrow(&tick_level.open_orders, order_id); - let mut maker_base_quantity = maker_order.quantity; - let mut skip_order = false; - - if (maker_order.expire_timestamp <= current_timestamp) { - skip_order = true; - custodian::unlock_balance(&mut pool.base_custodian, maker_order.owner, maker_order.quantity); - emit_order_canceled(pool_id, maker_order); - } else { - // Calculate how much quote asset (maker_quote_quantity) is required, including the commission, to fill the maker order. - let maker_quote_quantity_without_commission = clob_math::mul( - maker_base_quantity, - maker_order.price - ); - let (is_round_down, mut taker_commission) = clob_math::unsafe_mul_round( - maker_quote_quantity_without_commission, - pool.taker_fee_rate - ); - if (is_round_down) taker_commission = taker_commission + 1; - - let maker_quote_quantity = maker_quote_quantity_without_commission + taker_commission; - - // Total base quantity filled. - let mut filled_base_quantity: u64; - // Total quote quantity filled, excluding commission and rebate. - let mut filled_quote_quantity: u64; - // Total quote quantity paid by taker. - // filled_quote_quantity_without_commission * (FLOAT_SCALING + taker_fee_rate) = filled_quote_quantity - let mut filled_quote_quantity_without_commission: u64; - if (taker_quote_quantity_remaining > maker_quote_quantity) { - filled_quote_quantity = maker_quote_quantity; - filled_quote_quantity_without_commission = maker_quote_quantity_without_commission; - filled_base_quantity = maker_base_quantity; - } else { - terminate_loop = true; - // if not enough quote quantity to pay for taker commission, then no quantity will be filled - filled_quote_quantity_without_commission = clob_math::unsafe_div( - taker_quote_quantity_remaining, - FLOAT_SCALING + pool.taker_fee_rate - ); - // filled_base_quantity = 0 is permitted since filled_quote_quantity_without_commission can be 0 - filled_base_quantity = clob_math::unsafe_div( - filled_quote_quantity_without_commission, - maker_order.price - ); - let filled_base_lot = filled_base_quantity / pool.lot_size; - filled_base_quantity = filled_base_lot * pool.lot_size; - // filled_quote_quantity_without_commission = 0 is permitted here since filled_base_quantity could be 0 - filled_quote_quantity_without_commission = clob_math::unsafe_mul( - filled_base_quantity, - maker_order.price - ); - // if taker_commission = 0 due to underflow, round it up to 1 - let (round_down, mut taker_commission) = clob_math::unsafe_mul_round( - filled_quote_quantity_without_commission, - pool.taker_fee_rate - ); - if (round_down) { - taker_commission = taker_commission + 1; - }; - filled_quote_quantity = filled_quote_quantity_without_commission + taker_commission; - }; - // if maker_rebate = 0 due to underflow, maker will not receive a rebate - let maker_rebate = clob_math::unsafe_mul( - filled_quote_quantity_without_commission, - pool.maker_rebate_rate - ); - maker_base_quantity = maker_base_quantity - filled_base_quantity; - - // maker in ask side, decrease maker's locked base asset, increase maker's available quote asset - taker_quote_quantity_remaining = taker_quote_quantity_remaining - filled_quote_quantity; - let locked_base_balance = custodian::decrease_user_locked_balance( - &mut pool.base_custodian, - maker_order.owner, - filled_base_quantity - ); - - let mut quote_balance_filled = balance::split( - &mut quote_balance_left, - filled_quote_quantity, - ); - // Send quote asset including rebate to maker. - custodian::increase_user_available_balance( - &mut pool.quote_custodian, - maker_order.owner, - balance::split( - &mut quote_balance_filled, - maker_rebate + filled_quote_quantity_without_commission, - ), - ); - // Send remaining of commission - rebate to the protocol. - // commission - rebate = filled_quote_quantity_without_commission - filled_quote_quantity - maker_rebate - balance::join(&mut pool.quote_asset_trading_fees, quote_balance_filled); - balance::join(&mut base_balance_filled, locked_base_balance); - - emit_order_filled( - *object::uid_as_inner(&pool.id), - maker_order, - filled_base_quantity, - // taker_commission = filled_quote_quantity - filled_quote_quantity_without_commission - // This guarantees that the subtraction will not underflow - filled_quote_quantity - filled_quote_quantity_without_commission, - maker_rebate - ) - }; - - if (skip_order || maker_base_quantity == 0) { - // Remove the maker order. - let old_order_id = order_id; - let maybe_order_id = linked_table::next(&tick_level.open_orders, order_id); - if (!option::is_none(maybe_order_id)) { - order_id = *option::borrow(maybe_order_id); - }; - let usr_open_order_ids = table::borrow_mut(&mut pool.usr_open_orders, maker_order.owner); - linked_table::remove(usr_open_order_ids, old_order_id); - linked_table::remove(&mut tick_level.open_orders, old_order_id); - } else { - // Update the maker order. - let maker_order_mut = linked_table::borrow_mut( - &mut tick_level.open_orders, - order_id); - maker_order_mut.quantity = maker_base_quantity; - }; - if (terminate_loop) { - break - }; - }; - if (linked_table::is_empty(&tick_level.open_orders)) { - (tick_price, _) = next_leaf(all_open_orders, tick_price); - destroy_empty_level(remove_leaf_by_index(all_open_orders, tick_index)); - (_, tick_index) = find_leaf(all_open_orders, tick_price); - }; - if (terminate_loop) { - break - }; - }; - return (base_balance_filled, quote_balance_left) - } - - fun match_bid( - pool: &mut Pool, - quantity: u64, - price_limit: u64, - current_timestamp: u64, - quote_balance: Balance, - ): (Balance, Balance) { - let pool_id = *object::uid_as_inner(&pool.id); - // Base balance received by taker. - // Need to individually keep track of the remaining base quantity to be filled to avoid infinite loop. - let mut taker_base_quantity_remaining = quantity; - let mut base_balance_filled = balance::zero(); - let mut quote_balance_left = quote_balance; - let all_open_orders = &mut pool.asks; - if (critbit::is_empty(all_open_orders)) { - return (base_balance_filled, quote_balance_left) - }; - let (mut tick_price, mut tick_index) = min_leaf(all_open_orders); - - while (!is_empty(all_open_orders) && tick_price <= price_limit) { - let tick_level = borrow_mut_leaf_by_index(all_open_orders, tick_index); - let mut order_id = *option::borrow(linked_table::front(&tick_level.open_orders)); - - while (!linked_table::is_empty(&tick_level.open_orders)) { - let maker_order = linked_table::borrow(&tick_level.open_orders, order_id); - let mut maker_base_quantity = maker_order.quantity; - let mut skip_order = false; - - if (maker_order.expire_timestamp <= current_timestamp) { - skip_order = true; - custodian::unlock_balance(&mut pool.base_custodian, maker_order.owner, maker_order.quantity); - emit_order_canceled(pool_id, maker_order); - } else { - let filled_base_quantity = - if (taker_base_quantity_remaining > maker_base_quantity) { maker_base_quantity } - else { taker_base_quantity_remaining }; - - let filled_quote_quantity = clob_math::mul(filled_base_quantity, maker_order.price); - - // if maker_rebate = 0 due to underflow, maker will not receive a rebate - let maker_rebate = clob_math::unsafe_mul(filled_quote_quantity, pool.maker_rebate_rate); - // if taker_commission = 0 due to underflow, round it up to 1 - let (is_round_down, mut taker_commission) = clob_math::unsafe_mul_round( - filled_quote_quantity, - pool.taker_fee_rate - ); - if (is_round_down) taker_commission = taker_commission + 1; - - maker_base_quantity = maker_base_quantity - filled_base_quantity; - - // maker in ask side, decrease maker's locked base asset, increase maker's available quote asset - taker_base_quantity_remaining = taker_base_quantity_remaining - filled_base_quantity; - let locked_base_balance = custodian::decrease_user_locked_balance( - &mut pool.base_custodian, - maker_order.owner, - filled_base_quantity - ); - let mut taker_commission_balance = balance::split( - &mut quote_balance_left, - taker_commission, - ); - custodian::increase_user_available_balance( - &mut pool.quote_custodian, - maker_order.owner, - balance::split( - &mut taker_commission_balance, - maker_rebate, - ), - ); - balance::join(&mut pool.quote_asset_trading_fees, taker_commission_balance); - balance::join(&mut base_balance_filled, locked_base_balance); - - custodian::increase_user_available_balance( - &mut pool.quote_custodian, - maker_order.owner, - balance::split( - &mut quote_balance_left, - filled_quote_quantity, - ), - ); - - emit_order_filled( - *object::uid_as_inner(&pool.id), - maker_order, - filled_base_quantity, - taker_commission, - maker_rebate - ); - }; - - if (skip_order || maker_base_quantity == 0) { - // Remove the maker order. - let old_order_id = order_id; - let maybe_order_id = linked_table::next(&tick_level.open_orders, order_id); - if (!option::is_none(maybe_order_id)) { - order_id = *option::borrow(maybe_order_id); - }; - let usr_open_order_ids = table::borrow_mut(&mut pool.usr_open_orders, maker_order.owner); - linked_table::remove(usr_open_order_ids, old_order_id); - linked_table::remove(&mut tick_level.open_orders, old_order_id); - } else { - // Update the maker order. - let maker_order_mut = linked_table::borrow_mut( - &mut tick_level.open_orders, - order_id); - maker_order_mut.quantity = maker_base_quantity; - }; - if (taker_base_quantity_remaining == 0) { - break - }; - }; - if (linked_table::is_empty(&tick_level.open_orders)) { - (tick_price, _) = next_leaf(all_open_orders, tick_price); - destroy_empty_level(remove_leaf_by_index(all_open_orders, tick_index)); - (_, tick_index) = find_leaf(all_open_orders, tick_price); - }; - if (taker_base_quantity_remaining == 0) { - break - }; - }; - return (base_balance_filled, quote_balance_left) - } - - fun match_ask( - pool: &mut Pool, - price_limit: u64, - current_timestamp: u64, - base_balance: Balance, - ): (Balance, Balance) { - let pool_id = *object::uid_as_inner(&pool.id); - let mut base_balance_left = base_balance; - // Base balance received by taker, taking into account of taker commission. - let mut quote_balance_filled = balance::zero(); - let all_open_orders = &mut pool.bids; - if (critbit::is_empty(all_open_orders)) { - return (base_balance_left, quote_balance_filled) - }; - let (mut tick_price, mut tick_index) = max_leaf(all_open_orders); - while (!is_empty(all_open_orders) && tick_price >= price_limit) { - let tick_level = borrow_mut_leaf_by_index(all_open_orders, tick_index); - let mut order_id = *option::borrow(linked_table::front(&tick_level.open_orders)); - while (!linked_table::is_empty(&tick_level.open_orders)) { - let maker_order = linked_table::borrow(&tick_level.open_orders, order_id); - let mut maker_base_quantity = maker_order.quantity; - let mut skip_order = false; - - if (maker_order.expire_timestamp <= current_timestamp) { - skip_order = true; - let maker_quote_quantity = clob_math::mul(maker_order.quantity, maker_order.price); - custodian::unlock_balance(&mut pool.quote_custodian, maker_order.owner, maker_quote_quantity); - emit_order_canceled(pool_id, maker_order); - } else { - let taker_base_quantity_remaining = balance::value(&base_balance_left); - let filled_base_quantity = - if (taker_base_quantity_remaining >= maker_base_quantity) { maker_base_quantity } - else { taker_base_quantity_remaining }; - - let filled_quote_quantity = clob_math::mul(filled_base_quantity, maker_order.price); - - // if maker_rebate = 0 due to underflow, maker will not receive a rebate - let maker_rebate = clob_math::unsafe_mul(filled_quote_quantity, pool.maker_rebate_rate); - // if taker_commission = 0 due to underflow, round it up to 1 - let (is_round_down, mut taker_commission) = clob_math::unsafe_mul_round( - filled_quote_quantity, - pool.taker_fee_rate - ); - if (is_round_down) taker_commission = taker_commission + 1; - - maker_base_quantity = maker_base_quantity - filled_base_quantity; - // maker in bid side, decrease maker's locked quote asset, increase maker's available base asset - let mut locked_quote_balance = custodian::decrease_user_locked_balance( - &mut pool.quote_custodian, - maker_order.owner, - filled_quote_quantity - ); - let mut taker_commission_balance = balance::split( - &mut locked_quote_balance, - taker_commission, - ); - custodian::increase_user_available_balance( - &mut pool.quote_custodian, - maker_order.owner, - balance::split( - &mut taker_commission_balance, - maker_rebate, - ), - ); - balance::join(&mut pool.quote_asset_trading_fees, taker_commission_balance); - balance::join(&mut quote_balance_filled, locked_quote_balance); - - custodian::increase_user_available_balance( - &mut pool.base_custodian, - maker_order.owner, - balance::split( - &mut base_balance_left, - filled_base_quantity, - ), - ); - - emit_order_filled( - *object::uid_as_inner(&pool.id), - maker_order, - filled_base_quantity, - taker_commission, - maker_rebate - ); - }; - - if (skip_order || maker_base_quantity == 0) { - // Remove the maker order. - let old_order_id = order_id; - let maybe_order_id = linked_table::next(&tick_level.open_orders, order_id); - if (!option::is_none(maybe_order_id)) { - order_id = *option::borrow(maybe_order_id); - }; - let usr_open_order_ids = table::borrow_mut(&mut pool.usr_open_orders, maker_order.owner); - linked_table::remove(usr_open_order_ids, old_order_id); - linked_table::remove(&mut tick_level.open_orders, old_order_id); - } else { - // Update the maker order. - let maker_order_mut = linked_table::borrow_mut( - &mut tick_level.open_orders, - order_id); - maker_order_mut.quantity = maker_base_quantity; - }; - if (balance::value(&base_balance_left) == 0) { - break - }; - }; - if (linked_table::is_empty(&tick_level.open_orders)) { - (tick_price, _) = previous_leaf(all_open_orders, tick_price); - destroy_empty_level(remove_leaf_by_index(all_open_orders, tick_index)); - (_, tick_index) = find_leaf(all_open_orders, tick_price); - }; - if (balance::value(&base_balance_left) == 0) { - break - }; - }; - return (base_balance_left, quote_balance_filled) - } - - /// Place a market order to the order book. - public fun place_market_order( - pool: &mut Pool, - quantity: u64, - is_bid: bool, - mut base_coin: Coin, - mut quote_coin: Coin, - clock: &Clock, - ctx: &mut TxContext, - ): (Coin, Coin) { - // If market bid order, match against the open ask orders. Otherwise, match against the open bid orders. - // Take market bid order for example. - // We first retrieve the PriceLevel with the lowest price by calling min_leaf on the asks Critbit Tree. - // We then match the market order by iterating through open orders on that price level in ascending order of the order id. - // Open orders that are being filled are removed from the order book. - // We stop the iteration until all quantities are filled. - // If the total quantity of open orders at the lowest price level is not large enough to fully fill the market order, - // we move on to the next price level by calling next_leaf on the asks Critbit Tree and repeat the same procedure. - // Continue iterating over the price levels in ascending order until the market order is completely filled. - // If their market order cannot be completely filled even after consuming all the open ask orders, - // the unfilled quantity will be cancelled. - // Market ask order follows similar procedure. - // The difference is that market ask order is matched against the open bid orders. - // We start with the bid PriceLeve with the highest price by calling max_leaf on the bids Critbit Tree. - // The inner loop for iterating over the open orders in ascending orders of order id is the same as above. - // Then iterate over the price levels in descending order until the market order is completely filled. - assert!(quantity % pool.lot_size == 0, EInvalidQuantity); - assert!(quantity != 0, EInvalidQuantity); - if (is_bid) { - let (base_balance_filled, quote_balance_left) = match_bid( - pool, - quantity, - MAX_PRICE, - clock::timestamp_ms(clock), - coin::into_balance(quote_coin), - ); - join( - &mut base_coin, - coin::from_balance(base_balance_filled, ctx), - ); - quote_coin = coin::from_balance(quote_balance_left, ctx); - } else { - assert!(quantity <= coin::value(&base_coin), EInsufficientBaseCoin); - let (base_balance_left, quote_balance_filled) = match_ask( - pool, - MIN_PRICE, - clock::timestamp_ms(clock), - coin::into_balance(base_coin), - ); - base_coin = coin::from_balance(base_balance_left, ctx); - join( - &mut quote_coin, - coin::from_balance(quote_balance_filled, ctx), - ); - }; - (base_coin, quote_coin) - } - - /// Injects a maker order to the order book. - /// Returns the order id. - fun inject_limit_order( - pool: &mut Pool, - price: u64, - quantity: u64, - is_bid: bool, - expire_timestamp: u64, - account_cap: &AccountCap, - ctx: &mut TxContext - ): u64 { - let user = object::id(account_cap); - let order_id: u64; - let open_orders: &mut CritbitTree; - if (is_bid) { - let quote_quantity = clob_math::mul(quantity, price); - custodian::lock_balance(&mut pool.quote_custodian, account_cap, quote_quantity); - order_id = pool.next_bid_order_id; - pool.next_bid_order_id = pool.next_bid_order_id + 1; - open_orders = &mut pool.bids; - } else { - custodian::lock_balance(&mut pool.base_custodian, account_cap, quantity); - order_id = pool.next_ask_order_id; - pool.next_ask_order_id = pool.next_ask_order_id + 1; - open_orders = &mut pool.asks; - }; - let order = Order { - order_id, - price, - quantity, - is_bid, - owner: user, - expire_timestamp, - }; - let (tick_exists, mut tick_index) = find_leaf(open_orders, price); - if (!tick_exists) { - tick_index = insert_leaf( - open_orders, - price, - TickLevel { - price, - open_orders: linked_table::new(ctx), - }); - }; - - let tick_level = borrow_mut_leaf_by_index(open_orders, tick_index); - linked_table::push_back(&mut tick_level.open_orders, order_id, order); - event::emit(OrderPlacedV2 { - pool_id: *object::uid_as_inner(&pool.id), - order_id, - is_bid, - owner: user, - base_asset_quantity_placed: quantity, - price, - expire_timestamp - }); - if (!contains(&pool.usr_open_orders, user)) { - add(&mut pool.usr_open_orders, user, linked_table::new(ctx)); - }; - linked_table::push_back(borrow_mut(&mut pool.usr_open_orders, user), order_id, price); - - return order_id - } - - /// Place a limit order to the order book. - /// Returns (base quantity filled, quote quantity filled, whether a maker order is being placed, order id of the maker order). - /// When the limit order is not successfully placed, we return false to indicate that and also returns a meaningless order_id 0. - /// When the limit order is successfully placed, we return true to indicate that and also the corresponding order_id. - /// So please check that boolean value first before using the order id. - public fun place_limit_order( - pool: &mut Pool, - price: u64, - quantity: u64, - is_bid: bool, - expire_timestamp: u64, // Expiration timestamp in ms in absolute value inclusive. - restriction: u8, - clock: &Clock, - account_cap: &AccountCap, - ctx: &mut TxContext - ): (u64, u64, bool, u64) { - // If limit bid order, check whether the price is lower than the lowest ask order by checking the min_leaf of asks Critbit Tree. - // If so, assign the sequence id of the order to be next_bid_order_id and increment next_bid_order_id by 1. - // Inject the new order to the bids Critbit Tree according to the price and order id. - // Otherwise, find the price level from the asks Critbit Tree that is no greater than the input price. - // Match the bid order against the asks Critbit Tree in the same way as a market order but up until the price level found in the previous step. - // If the bid order is not completely filled, inject the remaining quantity to the bids Critbit Tree according to the input price and order id. - // If limit ask order, vice versa. - assert!(quantity > 0, EInvalidQuantity); - assert!(price > 0, EInvalidPrice); - assert!(price % pool.tick_size == 0, EInvalidPrice); - assert!(quantity % pool.lot_size == 0, EInvalidQuantity); - assert!(expire_timestamp > clock::timestamp_ms(clock), EInvalidExpireTimestamp); - let user = object::id(account_cap); - let base_quantity_filled; - let quote_quantity_filled; - - if (is_bid) { - let quote_quantity_original = custodian::account_available_balance( - &pool.quote_custodian, - user, - ); - let quote_balance = custodian::decrease_user_available_balance( - &mut pool.quote_custodian, - account_cap, - quote_quantity_original, - ); - let (base_balance_filled, quote_balance_left) = match_bid( - pool, - quantity, - price, - clock::timestamp_ms(clock), - quote_balance, - ); - base_quantity_filled = balance::value(&base_balance_filled); - quote_quantity_filled = quote_quantity_original - balance::value("e_balance_left); - - custodian::increase_user_available_balance( - &mut pool.base_custodian, - user, - base_balance_filled, - ); - custodian::increase_user_available_balance( - &mut pool.quote_custodian, - user, - quote_balance_left, - ); - } else { - let base_balance = custodian::decrease_user_available_balance( - &mut pool.base_custodian, - account_cap, - quantity, - ); - let (base_balance_left, quote_balance_filled) = match_ask( - pool, - price, - clock::timestamp_ms(clock), - base_balance, - ); - - base_quantity_filled = quantity - balance::value(&base_balance_left); - quote_quantity_filled = balance::value("e_balance_filled); - - custodian::increase_user_available_balance( - &mut pool.base_custodian, - user, - base_balance_left, - ); - custodian::increase_user_available_balance( - &mut pool.quote_custodian, - user, - quote_balance_filled, - ); - }; - - let order_id; - if (restriction == IMMEDIATE_OR_CANCEL) { - return (base_quantity_filled, quote_quantity_filled, false, 0) - }; - if (restriction == FILL_OR_KILL) { - assert!(base_quantity_filled == quantity, EOrderCannotBeFullyFilled); - return (base_quantity_filled, quote_quantity_filled, false, 0) - }; - if (restriction == POST_OR_ABORT) { - assert!(base_quantity_filled == 0, EOrderCannotBeFullyPassive); - order_id = inject_limit_order(pool, price, quantity, is_bid, expire_timestamp, account_cap, ctx); - return (base_quantity_filled, quote_quantity_filled, true, order_id) - } else { - assert!(restriction == NO_RESTRICTION, EInvalidRestriction); - if (quantity > base_quantity_filled) { - order_id = inject_limit_order( - pool, - price, - quantity - base_quantity_filled, - is_bid, - expire_timestamp, - account_cap, - ctx - ); - return (base_quantity_filled, quote_quantity_filled, true, order_id) - }; - return (base_quantity_filled, quote_quantity_filled, false, 0) - } - } - - fun order_is_bid(order_id: u64): bool { - return order_id < MIN_ASK_ORDER_ID - } - - fun emit_order_canceled( - pool_id: ID, - order: &Order - ) { - event::emit(OrderCanceled { - pool_id, - order_id: order.order_id, - is_bid: order.is_bid, - owner: order.owner, - base_asset_quantity_canceled: order.quantity, - price: order.price - }) - } - - fun emit_order_filled( - pool_id: ID, - order: &Order, - base_asset_quantity_filled: u64, - taker_commission: u64, - maker_rebates: u64 - ) { - event::emit(OrderFilledV2 { - pool_id, - order_id: order.order_id, - is_bid: order.is_bid, - owner: order.owner, - total_quantity: order.quantity, - base_asset_quantity_filled, - // order.quantity = base_asset_quantity_filled + base_asset_quantity_remaining - // This guarantees that the subtraction will not underflow - base_asset_quantity_remaining: order.quantity - base_asset_quantity_filled, - price: order.price, - taker_commission, - maker_rebates - }) - } - - /// Cancel and opening order. - /// Abort if order_id is invalid or if the order is not submitted by the transaction sender. - public fun cancel_order( - pool: &mut Pool, - order_id: u64, - account_cap: &AccountCap - ) { - // First check the highest bit of the order id to see whether it's bid or ask. - // Then retrieve the price using the order id. - // Using the price to retrieve the corresponding PriceLevel from the bids / asks Critbit Tree. - // Retrieve and remove the order from open orders of the PriceLevel. - let user = object::id(account_cap); - assert!(contains(&pool.usr_open_orders, user), EInvalidUser); - let usr_open_orders = borrow_mut(&mut pool.usr_open_orders, user); - assert!(linked_table::contains(usr_open_orders, order_id), EInvalidOrderId); - let tick_price = *linked_table::borrow(usr_open_orders, order_id); - let is_bid = order_is_bid(order_id); - let (tick_exists, tick_index) = find_leaf( - if (is_bid) { &pool.bids } else { &pool.asks }, - tick_price); - assert!(tick_exists, EInvalidOrderId); - let order = remove_order( - if (is_bid) { &mut pool.bids } else { &mut pool.asks }, - usr_open_orders, - tick_index, - order_id, - user - ); - if (is_bid) { - let balance_locked = clob_math::mul(order.quantity, order.price); - custodian::unlock_balance(&mut pool.quote_custodian, user, balance_locked); - } else { - custodian::unlock_balance(&mut pool.base_custodian, user, order.quantity); - }; - emit_order_canceled(*object::uid_as_inner(&pool.id), &order); - } - - fun remove_order( - open_orders: &mut CritbitTree, - usr_open_orders: &mut LinkedTable, - tick_index: u64, - order_id: u64, - user: ID, - ): Order { - linked_table::remove(usr_open_orders, order_id); - let tick_level = borrow_leaf_by_index(open_orders, tick_index); - assert!(linked_table::contains(&tick_level.open_orders, order_id), EInvalidOrderId); - let mut_tick_level = borrow_mut_leaf_by_index(open_orders, tick_index); - let order = linked_table::remove(&mut mut_tick_level.open_orders, order_id); - assert!(order.owner == user, EUnauthorizedCancel); - if (linked_table::is_empty(&mut_tick_level.open_orders)) { - destroy_empty_level(remove_leaf_by_index(open_orders, tick_index)); - }; - order - } - - public fun cancel_all_orders( - pool: &mut Pool, - account_cap: &AccountCap - ) { - let pool_id = *object::uid_as_inner(&pool.id); - let user = object::id(account_cap); - assert!(contains(&pool.usr_open_orders, user), EInvalidUser); - let usr_open_order_ids = table::borrow_mut(&mut pool.usr_open_orders, user); - while (!linked_table::is_empty(usr_open_order_ids)) { - let order_id = *option::borrow(linked_table::back(usr_open_order_ids)); - let order_price = *linked_table::borrow(usr_open_order_ids, order_id); - let is_bid = order_is_bid(order_id); - let open_orders = - if (is_bid) { &mut pool.bids } - else { &mut pool.asks }; - let (_, tick_index) = critbit::find_leaf(open_orders, order_price); - let order = remove_order( - open_orders, - usr_open_order_ids, - tick_index, - order_id, - user - ); - if (is_bid) { - let balance_locked = clob_math::mul(order.quantity, order.price); - custodian::unlock_balance(&mut pool.quote_custodian, user, balance_locked); - } else { - custodian::unlock_balance(&mut pool.base_custodian, user, order.quantity); - }; - emit_order_canceled(pool_id, &order); - }; - } - - - /// Batch cancel limit orders to save gas cost. - /// Abort if any of the order_ids are not submitted by the sender. - /// Skip any order_id that is invalid. - /// Note that this function can reduce gas cost even further if caller has multiple orders at the same price level, - /// and if orders with the same price are grouped together in the vector. - /// For example, if we have the following order_id to price mapping, \{0: 100., 1: 200., 2: 100., 3: 200.}. - /// Grouping order_ids like [0, 2, 1, 3] would make it the most gas efficient. - public fun batch_cancel_order( - pool: &mut Pool, - order_ids: vector, - account_cap: &AccountCap - ) { - let pool_id = *object::uid_as_inner(&pool.id); - // First group the order ids according to price level, - // so that we don't have to retrieve the PriceLevel multiple times if there are orders at the same price level. - // Iterate over each price level, retrieve the corresponding PriceLevel. - // Iterate over the order ids that need to be canceled at that price level, - // retrieve and remove the order from open orders of the PriceLevel. - let user = object::id(account_cap); - assert!(contains(&pool.usr_open_orders, user), 0); - let mut tick_index: u64 = 0; - let mut tick_price: u64 = 0; - let n_order = vector::length(&order_ids); - let mut i_order = 0; - let usr_open_orders = borrow_mut(&mut pool.usr_open_orders, user); - while (i_order < n_order) { - let order_id = *vector::borrow(&order_ids, i_order); - assert!(linked_table::contains(usr_open_orders, order_id), EInvalidOrderId); - let new_tick_price = *linked_table::borrow(usr_open_orders, order_id); - let is_bid = order_is_bid(order_id); - if (new_tick_price != tick_price) { - tick_price = new_tick_price; - let (tick_exists, new_tick_index) = find_leaf( - if (is_bid) { &pool.bids } else { &pool.asks }, - tick_price - ); - assert!(tick_exists, EInvalidTickPrice); - tick_index = new_tick_index; - }; - let order = remove_order( - if (is_bid) { &mut pool.bids } else { &mut pool.asks }, - usr_open_orders, - tick_index, - order_id, - user - ); - if (is_bid) { - let balance_locked = clob_math::mul(order.quantity, order.price); - custodian::unlock_balance(&mut pool.quote_custodian, user, balance_locked); - } else { - custodian::unlock_balance(&mut pool.base_custodian, user, order.quantity); - }; - emit_order_canceled(pool_id, &order); - i_order = i_order + 1; - } - } - - public fun list_open_orders( - pool: &Pool, - account_cap: &AccountCap - ): vector { - let user = object::id(account_cap); - let usr_open_order_ids = table::borrow(&pool.usr_open_orders, user); - let mut open_orders = vector::empty(); - let mut order_id = linked_table::front(usr_open_order_ids); - while (!option::is_none(order_id)) { - let order_price = *linked_table::borrow(usr_open_order_ids, *option::borrow(order_id)); - let tick_level = - if (order_is_bid(*option::borrow(order_id))) borrow_leaf_by_key(&pool.bids, order_price) - else borrow_leaf_by_key(&pool.asks, order_price); - let order = linked_table::borrow(&tick_level.open_orders, *option::borrow(order_id)); - vector::push_back(&mut open_orders, Order { - order_id: order.order_id, - price: order.price, - quantity: order.quantity, - is_bid: order.is_bid, - owner: order.owner, - expire_timestamp: order.expire_timestamp - }); - order_id = linked_table::next(usr_open_order_ids, *option::borrow(order_id)); - }; - open_orders - } - - /// query user balance inside custodian - public fun account_balance( - pool: &Pool, - account_cap: &AccountCap - ): (u64, u64, u64, u64) { - let user = object::id(account_cap); - let (base_avail, base_locked) = custodian::account_balance(&pool.base_custodian, user); - let (quote_avail, quote_locked) = custodian::account_balance(&pool.quote_custodian, user); - (base_avail, base_locked, quote_avail, quote_locked) - } - - /// Query the market price of order book - /// returns (best_bid_price, best_ask_price) - public fun get_market_price( - pool: &Pool - ): (u64, u64){ - let (bid_price, _) = critbit::max_leaf(&pool.bids); - let (ask_price, _) = critbit::min_leaf(&pool.asks); - return (bid_price, ask_price) - } - - /// Enter a price range and return the level2 order depth of all valid prices within this price range in bid side - /// returns two vectors of u64 - /// The previous is a list of all valid prices - /// The latter is the corresponding depth list - public fun get_level2_book_status_bid_side( - pool: &Pool, - mut price_low: u64, - mut price_high: u64, - clock: &Clock - ): (vector, vector) { - let (price_low_, _) = critbit::min_leaf(&pool.bids); - if (price_low < price_low_) price_low = price_low_; - let (price_high_, _) = critbit::max_leaf(&pool.bids); - if (price_high > price_high_) price_high = price_high_; - price_low = critbit::find_closest_key(&pool.bids, price_low); - price_high = critbit::find_closest_key(&pool.bids, price_high); - let mut price_vec = vector::empty(); - let mut depth_vec = vector::empty(); - if (price_low == 0) { return (price_vec, depth_vec) }; - while (price_low <= price_high) { - let depth = get_level2_book_status( - &pool.bids, - price_low, - clock::timestamp_ms(clock) - ); - vector::push_back(&mut price_vec, price_low); - vector::push_back(&mut depth_vec, depth); - let (next_price, _) = critbit::next_leaf(&pool.bids, price_low); - if (next_price == 0) { break } - else { price_low = next_price }; - }; - (price_vec, depth_vec) - } - - /// Enter a price range and return the level2 order depth of all valid prices within this price range in ask side - /// returns two vectors of u64 - /// The previous is a list of all valid prices - /// The latter is the corresponding depth list - public fun get_level2_book_status_ask_side( - pool: &Pool, - mut price_low: u64, - mut price_high: u64, - clock: &Clock - ): (vector, vector) { - let (price_low_, _) = critbit::min_leaf(&pool.asks); - if (price_low < price_low_) price_low = price_low_; - let (price_high_, _) = critbit::max_leaf(&pool.asks); - if (price_high > price_high_) price_high = price_high_; - price_low = critbit::find_closest_key(&pool.asks, price_low); - price_high = critbit::find_closest_key(&pool.asks, price_high); - let mut price_vec = vector::empty(); - let mut depth_vec = vector::empty(); - if (price_low == 0) { return (price_vec, depth_vec) }; - while (price_low <= price_high) { - let depth = get_level2_book_status( - &pool.asks, - price_low, - clock::timestamp_ms(clock) - ); - vector::push_back(&mut price_vec, price_low); - vector::push_back(&mut depth_vec, depth); - let (next_price, _) = critbit::next_leaf(&pool.asks, price_low); - if (next_price == 0) { break } - else { price_low = next_price }; - }; - (price_vec, depth_vec) - } - - /// internal func to retrieve single depth of a tick price - fun get_level2_book_status( - open_orders: &CritbitTree, - price: u64, - time_stamp: u64 - ): u64 { - let tick_level = critbit::borrow_leaf_by_key(open_orders, price); - let tick_open_orders = &tick_level.open_orders; - let mut depth = 0; - let mut order_id = linked_table::front(tick_open_orders); - let mut order: &Order; - while (!option::is_none(order_id)) { - order = linked_table::borrow(tick_open_orders, *option::borrow(order_id)); - if (order.expire_timestamp > time_stamp) depth = depth + order.quantity; - order_id = linked_table::next(tick_open_orders, *option::borrow(order_id)); - }; - depth - } - - public fun get_order_status( - pool: &Pool, - order_id: u64, - account_cap: &AccountCap - ): &Order { - let user = object::id(account_cap); - assert!(table::contains(&pool.usr_open_orders, user), EInvalidUser); - let usr_open_order_ids = table::borrow(&pool.usr_open_orders, user); - assert!(linked_table::contains(usr_open_order_ids, order_id), EInvalidOrderId); - let order_price = *linked_table::borrow(usr_open_order_ids, order_id); - let open_orders = - if (order_id < MIN_ASK_ORDER_ID) { &pool.bids } - else { &pool.asks }; - let tick_level = critbit::borrow_leaf_by_key(open_orders, order_price); - let tick_open_orders = &tick_level.open_orders; - let order = linked_table::borrow(tick_open_orders, order_id); - order - } - - - // Note that open orders and quotes can be directly accessed by loading in the entire Pool. - - #[test_only] use iota::test_scenario::{Self, Scenario}; - - #[test_only] public struct USD {} - - #[test_only] - public fun setup_test_with_tick_lot( - taker_fee_rate: u64, - maker_rebate_rate: u64, - // tick size with scaling - tick_size: u64, - lot_size: u64, - scenario: &mut Scenario, - sender: address, - ) { - test_scenario::next_tx(scenario, sender); - { - clock::share_for_testing(clock::create_for_testing(test_scenario::ctx(scenario))); - }; - - test_scenario::next_tx(scenario, sender); - { - create_pool_( - taker_fee_rate, - maker_rebate_rate, - tick_size, - lot_size, - balance::create_for_testing(FEE_AMOUNT_FOR_CREATE_POOL), - test_scenario::ctx(scenario) - ); - }; - } - - #[test_only] - public fun setup_test( - taker_fee_rate: u64, - maker_rebate_rate: u64, - scenario: &mut Scenario, - sender: address, - ) { - setup_test_with_tick_lot( - taker_fee_rate, - maker_rebate_rate, - 1 * FLOAT_SCALING, - 1, - scenario, - sender, - ); - } - - #[test_only] - fun order_equal( - order_left: &Order, - order_right: &Order, - ): bool { - return (order_left.order_id == order_right.order_id) && - (order_left.price == order_right.price) && - (order_left.quantity == order_right.quantity) && - (order_left.is_bid == order_right.is_bid) && - (order_left.owner == order_right.owner) - } - - #[test_only] - fun contains_order( - tree: &LinkedTable, - expected_order: &Order, - ): bool { - if (!linked_table::contains(tree, expected_order.order_id)) { - return false - }; - let order = linked_table::borrow(tree, expected_order.order_id); - return order_equal(order, expected_order) - } - - #[test_only] - public fun check_tick_level( - tree: &CritbitTree, - price: u64, - open_orders: &vector, - ) { - let (tick_exists, tick_index) = find_leaf(tree, price); - assert!(tick_exists); - let tick_level = borrow_leaf_by_index(tree, tick_index); - assert!(tick_level.price == price); - let mut total_quote_amount: u64 = 0; - assert!(linked_table::length(&tick_level.open_orders) == vector::length(open_orders)); - let mut i_order = 0; - while (i_order < vector::length(open_orders)) { - let order = vector::borrow(open_orders, i_order); - total_quote_amount = total_quote_amount + order.quantity; - assert!(order.price == price); - assert!(contains_order(&tick_level.open_orders, order)); - i_order = i_order + 1; - }; - } - - #[test_only] - public fun check_empty_tick_level( - tree: &CritbitTree, - price: u64, - ) { - let (tick_exists, _) = find_leaf(tree, price); - assert!(!tick_exists); - } - - - #[test_only] - public fun order_id( - sequence_id: u64, - is_bid: bool - ): u64 { - return if (is_bid) { MIN_BID_ORDER_ID + sequence_id } else { MIN_ASK_ORDER_ID + sequence_id } - } - - #[test_only] - public fun mint_account_cap_transfer( - user: address, - ctx: &mut TxContext - ) { - transfer::public_transfer(create_account(ctx), user); - } - - #[test_only] - public fun borrow_mut_custodian( - pool: &mut Pool - ): (&mut Custodian, &mut Custodian) { - (&mut pool.base_custodian, &mut pool.quote_custodian) - } - - #[test_only] - public fun borrow_custodian( - pool: & Pool - ): (&Custodian, &Custodian) { - (&pool.base_custodian, &pool.quote_custodian) - } - - #[test_only] - public fun test_match_bid( - pool: &mut Pool, - quantity: u64, - price_limit: u64, // upper price limit if bid, lower price limit if ask, inclusive - current_timestamp: u64, - ): (u64, u64) { - let quote_quantity_original = 1 << 63; - let (base_balance_filled, quote_balance_left) = match_bid( - pool, - quantity, - price_limit, - current_timestamp, - balance::create_for_testing(quote_quantity_original), - ); - let base_quantity_filled = balance::value(&base_balance_filled); - let quote_quantity_filled = quote_quantity_original - balance::value("e_balance_left); - balance::destroy_for_testing(base_balance_filled); - balance::destroy_for_testing(quote_balance_left); - return (base_quantity_filled, quote_quantity_filled) - } - - #[test_only] - public fun test_match_bid_with_quote_quantity( - pool: &mut Pool, - quantity: u64, - price_limit: u64, // upper price limit if bid, lower price limit if ask, inclusive - current_timestamp: u64, - ): (u64, u64) { - let quote_quantity_original = 1 << 63; - let (base_balance_filled, quote_balance_left) = match_bid_with_quote_quantity( - pool, - quantity, - price_limit, - current_timestamp, - balance::create_for_testing(quote_quantity_original), - ); - let base_quantity_filled = balance::value(&base_balance_filled); - let quote_quantity_filled = quote_quantity_original - balance::value("e_balance_left); - balance::destroy_for_testing(base_balance_filled); - balance::destroy_for_testing(quote_balance_left); - return (base_quantity_filled, quote_quantity_filled) - } - - #[test_only] - public fun test_match_ask( - pool: &mut Pool, - quantity: u64, - price_limit: u64, // upper price limit if bid, lower price limit if ask, inclusive - current_timestamp: u64, - ): (u64, u64) { - let (base_balance_left, quote_balance_filled) = match_ask( - pool, - price_limit, - current_timestamp, - balance::create_for_testing(quantity), - ); - let base_quantity_filled = quantity - balance::value(&base_balance_left); - let quote_quantity_filled = balance::value("e_balance_filled); - balance::destroy_for_testing(base_balance_left); - balance::destroy_for_testing(quote_balance_filled); - return (base_quantity_filled, quote_quantity_filled) - } - - #[test_only] - public fun test_inject_limit_order( - pool: &mut Pool, - price: u64, - quantity: u64, - is_bid: bool, - account_cap: &AccountCap, - ctx: &mut TxContext - ) { - inject_limit_order(pool, price, quantity, is_bid, TIMESTAMP_INF, account_cap, ctx); - } - - #[test_only] - public fun test_inject_limit_order_with_expiration( - pool: &mut Pool, - price: u64, - quantity: u64, - is_bid: bool, - expire_timestamp: u64, - account_cap: &AccountCap, - ctx: &mut TxContext - ) { - inject_limit_order(pool, price, quantity, is_bid, expire_timestamp, account_cap, ctx); - } - - #[test_only] - public fun get_pool_stat( - pool: &Pool - ): (u64, u64, &CritbitTree, &CritbitTree) { - ( - pool.next_bid_order_id, - pool.next_ask_order_id, - &pool.bids, - &pool.asks - ) - } - - #[test_only] - public fun get_usr_open_orders( - pool: &Pool, - owner: ID - ): &LinkedTable { - assert!(contains(&pool.usr_open_orders, owner), 0); - table::borrow(&pool.usr_open_orders, owner) - } - - #[test_only] - public fun test_construct_order(sequence_id: u64, price: u64, quantity: u64, is_bid: bool, owner: ID): Order { - Order { - order_id: order_id(sequence_id, is_bid), - price, - quantity, - is_bid, - owner, - expire_timestamp: TIMESTAMP_INF, - } - } - - #[test_only] - public fun test_construct_order_with_expiration( - sequence_id: u64, - price: u64, - quantity: u64, - is_bid: bool, - owner: ID, - expire_timestamp: u64 - ): Order { - Order { - order_id: order_id(sequence_id, is_bid), - price, - quantity, - is_bid, - owner, - expire_timestamp, - } - } - - #[test_only] - public fun check_usr_open_orders( - usr_open_orders: &LinkedTable, - usr_open_orders_cmp: &vector, - ) { - assert!(2 * linked_table::length(usr_open_orders) == vector::length(usr_open_orders_cmp)); - let mut i_order = 0; - while (i_order < vector::length(usr_open_orders_cmp)) { - let order_id = *vector::borrow(usr_open_orders_cmp, i_order); - i_order = i_order + 1; - assert!(linked_table::contains(usr_open_orders, order_id)); - let price_cmp = *vector::borrow(usr_open_orders_cmp, i_order); - let price = *linked_table::borrow(usr_open_orders, order_id); - assert!(price_cmp == price, ENotEqual); - i_order = i_order + 1; - }; - } - - #[test_only] - public fun test_remove_order( - pool: &mut Pool, - tick_index: u64, - sequence_id: u64, - is_bid: bool, - owner: ID, - ): Order { - let order; - if (is_bid) { - order = remove_order( - &mut pool.bids, - borrow_mut(&mut pool.usr_open_orders, owner), - tick_index, - order_id(sequence_id, is_bid), - owner - ) - } else { - order = remove_order( - &mut pool.asks, - borrow_mut(&mut pool.usr_open_orders, owner), - tick_index, - order_id(sequence_id, is_bid), - owner - ) - }; - order - } - - // === Deprecated === - #[allow(unused_field)] - /// Deprecated since v1.0.0, use `OrderPlacedV2` instead. - public struct OrderPlaced has copy, store, drop { - /// object ID of the pool the order was placed on - pool_id: ID, - /// ID of the order within the pool - order_id: u64, - is_bid: bool, - /// object ID of the `AccountCap` that placed the order - owner: ID, - base_asset_quantity_placed: u64, - price: u64, - } - - #[allow(unused_field)] - /// Deprecated since v1.0.0, use `OrderFilledV2` instead. - public struct OrderFilled has copy, store, drop { - /// object ID of the pool the order was placed on - pool_id: ID, - /// ID of the order within the pool - order_id: u64, - is_bid: bool, - /// object ID of the `AccountCap` that placed the order - owner: ID, - total_quantity: u64, - base_asset_quantity_filled: u64, - base_asset_quantity_remaining: u64, - price: u64 - } - -} diff --git a/crates/iota-framework/packages/deepbook/sources/clob_v2.move b/crates/iota-framework/packages/deepbook/sources/clob_v2.move deleted file mode 100644 index f4287d07cc3..00000000000 --- a/crates/iota-framework/packages/deepbook/sources/clob_v2.move +++ /dev/null @@ -1,3229 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -module deepbook::clob_v2 { - use std::type_name::{Self, TypeName}; - - use iota::balance::{Self, Balance}; - use iota::clock::{Self, Clock}; - use iota::coin::{Self, Coin, join}; - use iota::event; - use iota::linked_table::{Self, LinkedTable}; - use iota::iota::IOTA; - use iota::table::{Self, Table, contains, add, borrow_mut}; - - use deepbook::critbit::{Self, CritbitTree, is_empty, borrow_mut_leaf_by_index, min_leaf, remove_leaf_by_index, max_leaf, next_leaf, previous_leaf, borrow_leaf_by_index, borrow_leaf_by_key, find_leaf, insert_leaf}; - use deepbook::custodian_v2::{Self as custodian, Custodian, AccountCap, mint_account_cap, account_owner}; - use deepbook::math::Self as clob_math; - - // <<<<<<<<<<<<<<<<<<<<<<<< Error codes <<<<<<<<<<<<<<<<<<<<<<<< - const EIncorrectPoolOwner: u64 = 1; - const EInvalidFeeRateRebateRate: u64 = 2; - const EInvalidOrderId: u64 = 3; - const EUnauthorizedCancel: u64 = 4; - const EInvalidPrice: u64 = 5; - const EInvalidQuantity: u64 = 6; - // Insufficient amount of base coin. - const EInsufficientBaseCoin: u64 = 7; - // Insufficient amount of quote coin. - const EInsufficientQuoteCoin: u64 = 8; - const EOrderCannotBeFullyFilled: u64 = 9; - const EOrderCannotBeFullyPassive: u64 = 10; - const EInvalidTickPrice: u64 = 11; - const EInvalidUser: u64 = 12; - const ENotEqual: u64 = 13; - const EInvalidRestriction: u64 = 14; - const EInvalidPair: u64 = 16; - const EInvalidFee: u64 = 18; - const EInvalidExpireTimestamp: u64 = 19; - const EInvalidTickSizeLotSize: u64 = 20; - const EInvalidSelfMatchingPreventionArg: u64 = 21; - - // <<<<<<<<<<<<<<<<<<<<<<<< Error codes <<<<<<<<<<<<<<<<<<<<<<<< - - // <<<<<<<<<<<<<<<<<<<<<<<< Constants <<<<<<<<<<<<<<<<<<<<<<<< - const FLOAT_SCALING: u64 = 1_000_000_000; - // Self-Trade Prevention option - // Cancel older (resting) order in full. Continue to execute the newer taking order. - const CANCEL_OLDEST: u8 = 0; - // Restrictions on limit orders. - const NO_RESTRICTION: u8 = 0; - // Mandates that whatever amount of an order that can be executed in the current transaction, be filled and then the rest of the order canceled. - const IMMEDIATE_OR_CANCEL: u8 = 1; - // Mandates that the entire order size be filled in the current transaction. Otherwise, the order is canceled. - const FILL_OR_KILL: u8 = 2; - // Mandates that the entire order be passive. Otherwise, cancel the order. - const POST_OR_ABORT: u8 = 3; - const MIN_BID_ORDER_ID: u64 = 1; - const MIN_ASK_ORDER_ID: u64 = 1 << 63; - const MIN_PRICE: u64 = 0; - const MAX_PRICE: u64 = (1u128 << 64 - 1) as u64; - #[test_only] - const TIMESTAMP_INF: u64 = (1u128 << 64 - 1) as u64; - const REFERENCE_TAKER_FEE_RATE: u64 = 2_500_000; - const REFERENCE_MAKER_REBATE_RATE: u64 = 1_500_000; - const FEE_AMOUNT_FOR_CREATE_POOL: u64 = 100 * 1_000_000_000; // 100 IOTA - #[test_only] - const PREVENT_SELF_MATCHING_DEFAULT: u8 = 0; - - // <<<<<<<<<<<<<<<<<<<<<<<< Constants <<<<<<<<<<<<<<<<<<<<<<<< - - // <<<<<<<<<<<<<<<<<<<<<<<< Events <<<<<<<<<<<<<<<<<<<<<<<< - - /// Emitted when a new pool is created - public struct PoolCreated has copy, store, drop { - /// object ID of the newly created pool - pool_id: ID, - base_asset: TypeName, - quote_asset: TypeName, - taker_fee_rate: u64, - // 10^9 scaling - maker_rebate_rate: u64, - tick_size: u64, - lot_size: u64, - } - - /// Emitted when a maker order is injected into the order book. - public struct OrderPlaced has copy, store, drop { - /// object ID of the pool the order was placed on - pool_id: ID, - /// ID of the order within the pool - order_id: u64, - /// ID of the order defined by client - client_order_id: u64, - is_bid: bool, - /// owner ID of the `AccountCap` that placed the order - owner: address, - original_quantity: u64, - base_asset_quantity_placed: u64, - price: u64, - expire_timestamp: u64 - } - - /// Emitted when a maker order is canceled. - public struct OrderCanceled has copy, store, drop { - /// object ID of the pool the order was placed on - pool_id: ID, - /// ID of the order within the pool - order_id: u64, - /// ID of the order defined by client - client_order_id: u64, - is_bid: bool, - /// owner ID of the `AccountCap` that canceled the order - owner: address, - original_quantity: u64, - base_asset_quantity_canceled: u64, - price: u64 - } - - /// A struct to make all orders canceled a more effifient struct - public struct AllOrdersCanceledComponent has copy, store, drop { - /// ID of the order within the pool - order_id: u64, - /// ID of the order defined by client - client_order_id: u64, - is_bid: bool, - /// owner ID of the `AccountCap` that canceled the order - owner: address, - original_quantity: u64, - base_asset_quantity_canceled: u64, - price: u64 - } - - /// Emitted when batch of orders are canceled. - public struct AllOrdersCanceled has copy, store, drop { - /// object ID of the pool the order was placed on - pool_id: ID, - orders_canceled: vector>, - } - - /// Emitted only when a maker order is filled. - public struct OrderFilled has copy, store, drop { - /// object ID of the pool the order was placed on - pool_id: ID, - /// ID of the order within the pool - order_id: u64, - /// ID of the order defined by taker client - taker_client_order_id: u64, - /// ID of the order defined by maker client - maker_client_order_id: u64, - is_bid: bool, - /// owner ID of the `AccountCap` that filled the order - taker_address: address, - /// owner ID of the `AccountCap` that placed the order - maker_address: address, - original_quantity: u64, - base_asset_quantity_filled: u64, - base_asset_quantity_remaining: u64, - price: u64, - taker_commission: u64, - maker_rebates: u64 - } - - /// Emitted when user deposit asset to custodian - public struct DepositAsset has copy, store, drop { - /// object id of the pool that asset deposit to - pool_id: ID, - /// quantity of the asset deposited - quantity: u64, - /// owner address of the `AccountCap` that deposit the asset - owner: address - } - - /// Emitted when user withdraw asset from custodian - public struct WithdrawAsset has copy, store, drop { - /// object id of the pool that asset withdraw from - pool_id: ID, - /// quantity of the asset user withdrew - quantity: u64, - /// owner ID of the `AccountCap` that withdrew the asset - owner: address - } - - /// Returned as metadata only when a maker order is filled from place order functions. - public struct MatchedOrderMetadata has copy, store, drop { - /// object ID of the pool the order was placed on - pool_id: ID, - /// ID of the order within the pool - order_id: u64, - /// Direction of order. - is_bid: bool, - /// owner ID of the `AccountCap` that filled the order - taker_address: address, - /// owner ID of the `AccountCap` that placed the order - maker_address: address, - /// qty of base asset filled. - base_asset_quantity_filled: u64, - /// price at which basset asset filled. - price: u64, - taker_commission: u64, - maker_rebates: u64 - } - - // <<<<<<<<<<<<<<<<<<<<<<<< Events <<<<<<<<<<<<<<<<<<<<<<<< - - public struct Order has store, drop { - // For each pool, order id is incremental and unique for each opening order. - // Orders that are submitted earlier has lower order ids. - // 64 bits are sufficient for order ids whereas 32 bits are not. - // Assuming a maximum TPS of 100K/s of Iota chain, it would take (1<<63) / 100000 / 3600 / 24 / 365 = 2924712 years to reach the full capacity. - // The highest bit of the order id is used to denote the order type, 0 for bid, 1 for ask. - order_id: u64, - client_order_id: u64, - // Only used for limit orders. - price: u64, - // quantity when the order first placed in - original_quantity: u64, - // quantity of the order currently held - quantity: u64, - is_bid: bool, - /// Order can only be canceled by the `AccountCap` with this owner ID - owner: address, - // Expiration timestamp in ms. - expire_timestamp: u64, - // reserved field for prevent self_matching - self_matching_prevention: u8 - } - - public struct TickLevel has store { - price: u64, - // The key is order's order_id. - open_orders: LinkedTable, - } - - public struct Pool has key, store { - // The key to the following Critbit Tree are order prices. - id: UID, - // All open bid orders. - bids: CritbitTree, - // All open ask orders. - asks: CritbitTree, - // Order id of the next bid order, starting from 0. - next_bid_order_id: u64, - // Order id of the next ask order, starting from 1<<63. - next_ask_order_id: u64, - // Map from AccountCap owner ID -> (map from order id -> order price) - usr_open_orders: Table>, - // taker_fee_rate should be strictly greater than maker_rebate_rate. - // The difference between taker_fee_rate and maker_rabate_rate goes to the protocol. - // 10^9 scaling - taker_fee_rate: u64, - // 10^9 scaling - maker_rebate_rate: u64, - tick_size: u64, - lot_size: u64, - // other pool info - base_custodian: Custodian, - quote_custodian: Custodian, - // Stores the fee paid to create this pool. These funds are not accessible. - creation_fee: Balance, - // Deprecated. - base_asset_trading_fees: Balance, - // Stores the trading fees paid in `QuoteAsset`. These funds are not accessible in the V1 of the Pools, but V2 Pools are accessible. - quote_asset_trading_fees: Balance, - } - - /// Capability granting permission to access an entry in `Pool.quote_asset_trading_fees`. - /// The pool objects created for older pools do not have a PoolOwnerCap because they were created - /// prior to the addition of this feature. Here is a list of 11 pools on mainnet that - /// do not have this capability: - /// 0x31d1790e617eef7f516555124155b28d663e5c600317c769a75ee6336a54c07f - /// 0x6e417ee1c12ad5f2600a66bc80c7bd52ff3cb7c072d508700d17cf1325324527 - /// 0x17625f1a241d34d2da0dc113086f67a2b832e3e8cd8006887c195cd24d3598a3 - /// 0x276ff4d99ecb3175091ba4baffa9b07590f84e2344e3f16e95d30d2c1678b84c - /// 0xd1f0a9baacc1864ab19534e2d4c5d6c14f2e071a1f075e8e7f9d51f2c17dc238 - /// 0x4405b50d791fd3346754e8171aaab6bc2ed26c2c46efdd033c14b30ae507ac33 - /// 0xf0f663cf87f1eb124da2fc9be813e0ce262146f3df60bc2052d738eb41a25899 - /// 0xd9e45ab5440d61cc52e3b2bd915cdd643146f7593d587c715bc7bfa48311d826 - /// 0x5deafda22b6b86127ea4299503362638bea0ca33bb212ea3a67b029356b8b955 - /// 0x7f526b1263c4b91b43c9e646419b5696f424de28dda3c1e6658cc0a54558baa7 - /// 0x18d871e3c3da99046dfc0d3de612c5d88859bc03b8f0568bd127d0e70dbc58be - public struct PoolOwnerCap has key, store { - id: UID, - /// The owner of this AccountCap. Note: this is - /// derived from an object ID, not a user address - owner: address - } - - /// Accessor functions - public fun usr_open_orders_exist( - pool: &Pool, - owner: address - ): bool { - table::contains(&pool.usr_open_orders, owner) - } - - public fun usr_open_orders_for_address( - pool: &Pool, - owner: address - ): &LinkedTable { - table::borrow(&pool.usr_open_orders, owner) - } - - public fun usr_open_orders( - pool: &Pool, - ): &Table> { - &pool.usr_open_orders - } - - /// Function to withdraw fees created from a pool - public fun withdraw_fees( - pool_owner_cap: &PoolOwnerCap, - pool: &mut Pool, - ctx: &mut TxContext, - ): Coin { - assert!(pool_owner_cap.owner == object::uid_to_address(&pool.id), EIncorrectPoolOwner); - let quantity = quote_asset_trading_fees_value(pool); - let to_withdraw = balance::split(&mut pool.quote_asset_trading_fees, quantity); - coin::from_balance(to_withdraw, ctx) - } - - /// Destroy the given `pool_owner_cap` object - public fun delete_pool_owner_cap(pool_owner_cap: PoolOwnerCap) { - let PoolOwnerCap { id, owner: _ } = pool_owner_cap; - object::delete(id) - } - - fun destroy_empty_level(level: TickLevel) { - let TickLevel { - price: _, - open_orders: orders, - } = level; - - linked_table::destroy_empty(orders); - } - - public fun create_account(ctx: &mut TxContext): AccountCap { - mint_account_cap(ctx) - } - - #[allow(lint(self_transfer, share_owned))] - fun create_pool_( - taker_fee_rate: u64, - maker_rebate_rate: u64, - tick_size: u64, - lot_size: u64, - creation_fee: Balance, - ctx: &mut TxContext, - ) { - let (pool, pool_owner_cap) = create_pool_with_return_( - taker_fee_rate, - maker_rebate_rate, - tick_size, - lot_size, - creation_fee, - ctx - ); - - transfer::public_transfer(pool_owner_cap, tx_context::sender(ctx)); - transfer::share_object(pool); - } - - public fun create_pool( - tick_size: u64, - lot_size: u64, - creation_fee: Coin, - ctx: &mut TxContext, - ) { - create_customized_pool( - tick_size, - lot_size, - REFERENCE_TAKER_FEE_RATE, - REFERENCE_MAKER_REBATE_RATE, - creation_fee, - ctx, - ); - } - - /// Function for creating pool with customized taker fee rate and maker rebate rate. - /// The taker_fee_rate should be greater than or equal to the maker_rebate_rate, and both should have a scaling of 10^9. - /// Taker_fee_rate of 0.25% should be 2_500_000 for example - public fun create_customized_pool( - tick_size: u64, - lot_size: u64, - taker_fee_rate: u64, - maker_rebate_rate: u64, - creation_fee: Coin, - ctx: &mut TxContext, - ) { - create_pool_( - taker_fee_rate, - maker_rebate_rate, - tick_size, - lot_size, - coin::into_balance(creation_fee), - ctx - ) - } - - /// Helper function that all the create pools now call to create pools. - fun create_pool_with_return_( - taker_fee_rate: u64, - maker_rebate_rate: u64, - tick_size: u64, - lot_size: u64, - creation_fee: Balance, - ctx: &mut TxContext, - ): (Pool, PoolOwnerCap) { - assert!(balance::value(&creation_fee) == FEE_AMOUNT_FOR_CREATE_POOL, EInvalidFee); - - let base_type_name = type_name::get(); - let quote_type_name = type_name::get(); - - assert!(clob_math::unsafe_mul(lot_size, tick_size) > 0, EInvalidTickSizeLotSize); - assert!(base_type_name != quote_type_name, EInvalidPair); - assert!(taker_fee_rate >= maker_rebate_rate, EInvalidFeeRateRebateRate); - - let pool_uid = object::new(ctx); - let pool_id = *object::uid_as_inner(&pool_uid); - - // Creates the capability to mark a pool owner. - let id = object::new(ctx); - let owner = object::uid_to_address(&pool_uid); - let pool_owner_cap = PoolOwnerCap { id, owner }; - - event::emit(PoolCreated { - pool_id, - base_asset: base_type_name, - quote_asset: quote_type_name, - taker_fee_rate, - maker_rebate_rate, - tick_size, - lot_size, - }); - (Pool { - id: pool_uid, - bids: critbit::new(ctx), - asks: critbit::new(ctx), - next_bid_order_id: MIN_BID_ORDER_ID, - next_ask_order_id: MIN_ASK_ORDER_ID, - usr_open_orders: table::new(ctx), - taker_fee_rate, - maker_rebate_rate, - tick_size, - lot_size, - base_custodian: custodian::new(ctx), - quote_custodian: custodian::new(ctx), - creation_fee, - base_asset_trading_fees: balance::zero(), - quote_asset_trading_fees: balance::zero(), - }, pool_owner_cap) - } - - /// Function for creating an external pool. This API can be used to wrap deepbook pools into other objects. - public fun create_pool_with_return( - tick_size: u64, - lot_size: u64, - creation_fee: Coin, - ctx: &mut TxContext, - ): Pool { - create_customized_pool_with_return( - tick_size, - lot_size, - REFERENCE_TAKER_FEE_RATE, - REFERENCE_MAKER_REBATE_RATE, - creation_fee, - ctx, - ) - } - - #[allow(lint(self_transfer))] - /// Function for creating pool with customized taker fee rate and maker rebate rate. - /// The taker_fee_rate should be greater than or equal to the maker_rebate_rate, and both should have a scaling of 10^9. - /// Taker_fee_rate of 0.25% should be 2_500_000 for example - public fun create_customized_pool_with_return( - tick_size: u64, - lot_size: u64, - taker_fee_rate: u64, - maker_rebate_rate: u64, - creation_fee: Coin, - ctx: &mut TxContext, - ) : Pool { - let (pool, pool_owner_cap) = create_pool_with_return_( - taker_fee_rate, - maker_rebate_rate, - tick_size, - lot_size, - coin::into_balance(creation_fee), - ctx - ); - transfer::public_transfer(pool_owner_cap, tx_context::sender(ctx)); - pool - } - - /// A V2 function for creating customized pools for better PTB friendliness/compostability. - /// If a user wants to create a pool and then destroy/lock the pool_owner_cap one can do - /// so with this function. - public fun create_customized_pool_v2( - tick_size: u64, - lot_size: u64, - taker_fee_rate: u64, - maker_rebate_rate: u64, - creation_fee: Coin, - ctx: &mut TxContext, - ) : (Pool, PoolOwnerCap) { - create_pool_with_return_( - taker_fee_rate, - maker_rebate_rate, - tick_size, - lot_size, - coin::into_balance(creation_fee), - ctx - ) - } - - public fun deposit_base( - pool: &mut Pool, - coin: Coin, - account_cap: &AccountCap - ) { - let quantity = coin::value(&coin); - assert!(quantity != 0, EInsufficientBaseCoin); - custodian::increase_user_available_balance( - &mut pool.base_custodian, - account_owner(account_cap), - coin::into_balance(coin) - ); - event::emit(DepositAsset{ - pool_id: *object::uid_as_inner(&pool.id), - quantity, - owner: account_owner(account_cap) - }) - } - - public fun deposit_quote( - pool: &mut Pool, - coin: Coin, - account_cap: &AccountCap - ) { - let quantity = coin::value(&coin); - assert!(quantity != 0, EInsufficientQuoteCoin); - custodian::increase_user_available_balance( - &mut pool.quote_custodian, - account_owner(account_cap), - coin::into_balance(coin) - ); - event::emit(DepositAsset{ - pool_id: *object::uid_as_inner(&pool.id), - quantity, - owner: account_owner(account_cap) - }) - } - - public fun withdraw_base( - pool: &mut Pool, - quantity: u64, - account_cap: &AccountCap, - ctx: &mut TxContext - ): Coin { - assert!(quantity > 0, EInvalidQuantity); - event::emit(WithdrawAsset{ - pool_id: *object::uid_as_inner(&pool.id), - quantity, - owner: account_owner(account_cap) - }); - custodian::withdraw_asset(&mut pool.base_custodian, quantity, account_cap, ctx) - } - - public fun withdraw_quote( - pool: &mut Pool, - quantity: u64, - account_cap: &AccountCap, - ctx: &mut TxContext - ): Coin { - assert!(quantity > 0, EInvalidQuantity); - event::emit(WithdrawAsset{ - pool_id: *object::uid_as_inner(&pool.id), - quantity, - owner: account_owner(account_cap) - }); - custodian::withdraw_asset(&mut pool.quote_custodian, quantity, account_cap, ctx) - } - - // for smart routing - public fun swap_exact_base_for_quote( - pool: &mut Pool, - client_order_id: u64, - account_cap: &AccountCap, - quantity: u64, - base_coin: Coin, - quote_coin: Coin, - clock: &Clock, - ctx: &mut TxContext, - ): (Coin, Coin, u64) { - assert!(quantity > 0, EInvalidQuantity); - assert!(coin::value(&base_coin) >= quantity, EInsufficientBaseCoin); - let original_val = coin::value("e_coin); - let (ret_base_coin, ret_quote_coin) = place_market_order( - pool, - account_cap, - client_order_id, - quantity, - false, - base_coin, - quote_coin, - clock, - ctx - ); - let ret_val = coin::value(&ret_quote_coin); - (ret_base_coin, ret_quote_coin, ret_val - original_val) - } - - // for smart routing - public fun swap_exact_base_for_quote_with_metadata( - pool: &mut Pool, - client_order_id: u64, - account_cap: &AccountCap, - quantity: u64, - base_coin: Coin, - quote_coin: Coin, - clock: &Clock, - ctx: &mut TxContext, - ): (Coin, Coin, u64, vector>) { - let original_val = coin::value("e_coin); - let (ret_base_coin, ret_quote_coin, mut matched_order_metadata) = place_market_order_int( - pool, - account_cap, - client_order_id, - quantity, - false, - base_coin, - quote_coin, - clock, - true, // return metadata - ctx - ); - let ret_val = coin::value(&ret_quote_coin); - (ret_base_coin, ret_quote_coin, ret_val - original_val, option::extract(&mut matched_order_metadata)) - } - - // for smart routing - public fun swap_exact_quote_for_base( - pool: &mut Pool, - client_order_id: u64, - account_cap: &AccountCap, - quantity: u64, - clock: &Clock, - quote_coin: Coin, - ctx: &mut TxContext, - ): (Coin, Coin, u64) { - assert!(quantity > 0, EInvalidQuantity); - assert!(coin::value("e_coin) >= quantity, EInsufficientQuoteCoin); - let (base_asset_balance, quote_asset_balance, _matched_order_metadata) = match_bid_with_quote_quantity( - pool, - account_cap, - client_order_id, - quantity, - MAX_PRICE, - clock::timestamp_ms(clock), - coin::into_balance(quote_coin), - false // don't return metadata - ); - let val = balance::value(&base_asset_balance); - (coin::from_balance(base_asset_balance, ctx), coin::from_balance(quote_asset_balance, ctx), val) - } - - public fun swap_exact_quote_for_base_with_metadata( - pool: &mut Pool, - client_order_id: u64, - account_cap: &AccountCap, - quantity: u64, - clock: &Clock, - quote_coin: Coin, - ctx: &mut TxContext, - ): (Coin, Coin, u64, vector>) { - assert!(quantity > 0, EInvalidQuantity); - assert!(coin::value("e_coin) >= quantity, EInsufficientQuoteCoin); - let (base_asset_balance, quote_asset_balance, mut matched_order_metadata) = match_bid_with_quote_quantity( - pool, - account_cap, - client_order_id, - quantity, - MAX_PRICE, - clock::timestamp_ms(clock), - coin::into_balance(quote_coin), - true // return metadata - ); - let val = balance::value(&base_asset_balance); - (coin::from_balance(base_asset_balance, ctx), coin::from_balance(quote_asset_balance, ctx), val, option::extract(&mut matched_order_metadata)) - } - - fun match_bid_with_quote_quantity( - pool: &mut Pool, - account_cap: &AccountCap, - client_order_id: u64, - quantity: u64, - price_limit: u64, - current_timestamp: u64, - quote_balance: Balance, - compute_metadata: bool, - ): (Balance, Balance, Option>>) { - // Base balance received by taker, taking into account of taker commission. - // Need to individually keep track of the remaining base quantity to be filled to avoid infinite loop. - let pool_id = *object::uid_as_inner(&pool.id); - let mut taker_quote_quantity_remaining = quantity; - let mut base_balance_filled = balance::zero(); - let mut quote_balance_left = quote_balance; - let all_open_orders = &mut pool.asks; - let mut matched_order_metadata = vector::empty>(); - if (critbit::is_empty(all_open_orders)) { - return (base_balance_filled, quote_balance_left, option::none()) - }; - let (mut tick_price, mut tick_index) = min_leaf(all_open_orders); - let mut terminate_loop = false; - let mut canceled_order_events = vector[]; - - while (!is_empty(all_open_orders) && tick_price <= price_limit) { - let tick_level = borrow_mut_leaf_by_index(all_open_orders, tick_index); - let mut order_id = *option::borrow(linked_table::front(&tick_level.open_orders)); - - while (!linked_table::is_empty(&tick_level.open_orders)) { - let maker_order = linked_table::borrow(&tick_level.open_orders, order_id); - let mut maker_base_quantity = maker_order.quantity; - let mut skip_order = false; - - if (maker_order.expire_timestamp <= current_timestamp || account_owner(account_cap) == maker_order.owner) { - skip_order = true; - custodian::unlock_balance(&mut pool.base_custodian, maker_order.owner, maker_order.quantity); - let canceled_order_event = AllOrdersCanceledComponent { - client_order_id: maker_order.client_order_id, - order_id: maker_order.order_id, - is_bid: maker_order.is_bid, - owner: maker_order.owner, - original_quantity: maker_order.original_quantity, - base_asset_quantity_canceled: maker_order.quantity, - price: maker_order.price - }; - - vector::push_back(&mut canceled_order_events, canceled_order_event); - - } else { - // Calculate how much quote asset (maker_quote_quantity) is required, including the commission, to fill the maker order. - let maker_quote_quantity_without_commission = clob_math::mul( - maker_base_quantity, - maker_order.price - ); - let (is_round_down, mut taker_commission) = clob_math::unsafe_mul_round( - maker_quote_quantity_without_commission, - pool.taker_fee_rate - ); - if (is_round_down) taker_commission = taker_commission + 1; - - let maker_quote_quantity = maker_quote_quantity_without_commission + taker_commission; - - // Total base quantity filled. - let mut filled_base_quantity: u64; - // Total quote quantity filled, excluding commission and rebate. - let mut filled_quote_quantity: u64; - // Total quote quantity paid by taker. - // filled_quote_quantity_without_commission * (FLOAT_SCALING + taker_fee_rate) = filled_quote_quantity - let mut filled_quote_quantity_without_commission: u64; - if (taker_quote_quantity_remaining > maker_quote_quantity) { - filled_quote_quantity = maker_quote_quantity; - filled_quote_quantity_without_commission = maker_quote_quantity_without_commission; - filled_base_quantity = maker_base_quantity; - } else { - terminate_loop = true; - // if not enough quote quantity to pay for taker commission, then no quantity will be filled - filled_quote_quantity_without_commission = clob_math::unsafe_div( - taker_quote_quantity_remaining, - FLOAT_SCALING + pool.taker_fee_rate - ); - // filled_base_quantity = 0 is permitted since filled_quote_quantity_without_commission can be 0 - filled_base_quantity = clob_math::unsafe_div( - filled_quote_quantity_without_commission, - maker_order.price - ); - let filled_base_lot = filled_base_quantity / pool.lot_size; - filled_base_quantity = filled_base_lot * pool.lot_size; - // filled_quote_quantity_without_commission = 0 is permitted here since filled_base_quantity could be 0 - filled_quote_quantity_without_commission = clob_math::unsafe_mul( - filled_base_quantity, - maker_order.price - ); - // if taker_commission = 0 due to underflow, round it up to 1 - let (round_down, mut taker_commission) = clob_math::unsafe_mul_round( - filled_quote_quantity_without_commission, - pool.taker_fee_rate - ); - if (round_down) { - taker_commission = taker_commission + 1; - }; - filled_quote_quantity = filled_quote_quantity_without_commission + taker_commission; - }; - // if maker_rebate = 0 due to underflow, maker will not receive a rebate - let maker_rebate = clob_math::unsafe_mul( - filled_quote_quantity_without_commission, - pool.maker_rebate_rate - ); - maker_base_quantity = maker_base_quantity - filled_base_quantity; - - // maker in ask side, decrease maker's locked base asset, increase maker's available quote asset - taker_quote_quantity_remaining = taker_quote_quantity_remaining - filled_quote_quantity; - let locked_base_balance = custodian::decrease_user_locked_balance( - &mut pool.base_custodian, - maker_order.owner, - filled_base_quantity - ); - - let mut quote_balance_filled = balance::split( - &mut quote_balance_left, - filled_quote_quantity, - ); - // Send quote asset including rebate to maker. - custodian::increase_user_available_balance( - &mut pool.quote_custodian, - maker_order.owner, - balance::split( - &mut quote_balance_filled, - maker_rebate + filled_quote_quantity_without_commission, - ), - ); - // Send remaining of commission - rebate to the protocol. - // commission - rebate = filled_quote_quantity_without_commission - filled_quote_quantity - maker_rebate - balance::join(&mut pool.quote_asset_trading_fees, quote_balance_filled); - balance::join(&mut base_balance_filled, locked_base_balance); - - emit_order_filled( - *object::uid_as_inner(&pool.id), - client_order_id, - account_owner(account_cap), - maker_order, - filled_base_quantity, - // taker_commission = filled_quote_quantity - filled_quote_quantity_without_commission - // This guarantees that the subtraction will not underflow - filled_quote_quantity - filled_quote_quantity_without_commission, - maker_rebate - ); - if(compute_metadata) { - vector::push_back( - &mut matched_order_metadata, - matched_order_metadata( - *object::uid_as_inner(&pool.id), - account_owner(account_cap), - maker_order, - filled_base_quantity, - // taker_commission = filled_quote_quantity - filled_quote_quantity_without_commission - // This guarantees that the subtraction will not underflow - filled_quote_quantity - filled_quote_quantity_without_commission, - maker_rebate - ) - ); - }; - }; - - if (skip_order || maker_base_quantity == 0) { - // Remove the maker order. - let old_order_id = order_id; - let maybe_order_id = linked_table::next(&tick_level.open_orders, order_id); - if (!option::is_none(maybe_order_id)) { - order_id = *option::borrow(maybe_order_id); - }; - let usr_open_order_ids = table::borrow_mut(&mut pool.usr_open_orders, maker_order.owner); - linked_table::remove(usr_open_order_ids, old_order_id); - linked_table::remove(&mut tick_level.open_orders, old_order_id); - } else { - // Update the maker order. - let maker_order_mut = linked_table::borrow_mut( - &mut tick_level.open_orders, - order_id); - maker_order_mut.quantity = maker_base_quantity; - }; - if (terminate_loop) { - break - }; - }; - if (linked_table::is_empty(&tick_level.open_orders)) { - (tick_price, _) = next_leaf(all_open_orders, tick_price); - destroy_empty_level(remove_leaf_by_index(all_open_orders, tick_index)); - (_, tick_index) = find_leaf(all_open_orders, tick_price); - }; - if (terminate_loop) { - break - }; - }; - - if (!vector::is_empty(&canceled_order_events)) { - event::emit(AllOrdersCanceled { - pool_id, - orders_canceled: canceled_order_events, - }); - }; - - return (base_balance_filled, quote_balance_left, if(compute_metadata) option::some(matched_order_metadata) else option::none()) - } - - fun match_bid( - pool: &mut Pool, - account_cap: &AccountCap, - client_order_id: u64, - quantity: u64, - price_limit: u64, - current_timestamp: u64, - quote_balance: Balance, - compute_metadata: bool, - ): (Balance, Balance, Option>>) { - let pool_id = *object::uid_as_inner(&pool.id); - // Base balance received by taker. - // Need to individually keep track of the remaining base quantity to be filled to avoid infinite loop. - let mut taker_base_quantity_remaining = quantity; - let mut base_balance_filled = balance::zero(); - let mut quote_balance_left = quote_balance; - let all_open_orders = &mut pool.asks; - let mut matched_order_metadata = vector::empty>(); - if (critbit::is_empty(all_open_orders)) { - return (base_balance_filled, quote_balance_left, option::none()) - }; - let (mut tick_price, mut tick_index) = min_leaf(all_open_orders); - let mut canceled_order_events = vector[]; - - while (!is_empty(all_open_orders) && tick_price <= price_limit) { - let tick_level = borrow_mut_leaf_by_index(all_open_orders, tick_index); - let mut order_id = *option::borrow(linked_table::front(&tick_level.open_orders)); - - while (!linked_table::is_empty(&tick_level.open_orders)) { - let maker_order = linked_table::borrow(&tick_level.open_orders, order_id); - let mut maker_base_quantity = maker_order.quantity; - let mut skip_order = false; - - if (maker_order.expire_timestamp <= current_timestamp || account_owner(account_cap) == maker_order.owner) { - skip_order = true; - custodian::unlock_balance(&mut pool.base_custodian, maker_order.owner, maker_order.quantity); - let canceled_order_event = AllOrdersCanceledComponent { - client_order_id: maker_order.client_order_id, - order_id: maker_order.order_id, - is_bid: maker_order.is_bid, - owner: maker_order.owner, - original_quantity: maker_order.original_quantity, - base_asset_quantity_canceled: maker_order.quantity, - price: maker_order.price - }; - vector::push_back(&mut canceled_order_events, canceled_order_event); - - } else { - let filled_base_quantity = - if (taker_base_quantity_remaining > maker_base_quantity) { maker_base_quantity } - else { taker_base_quantity_remaining }; - // Note that if a user creates a pool that allows orders that are too small, this will fail since we cannot have a filled - // quote quantity of 0. - let filled_quote_quantity = clob_math::mul(filled_base_quantity, maker_order.price); - - // if maker_rebate = 0 due to underflow, maker will not receive a rebate - let maker_rebate = clob_math::unsafe_mul(filled_quote_quantity, pool.maker_rebate_rate); - // if taker_commission = 0 due to underflow, round it up to 1 - let (is_round_down, mut taker_commission) = clob_math::unsafe_mul_round( - filled_quote_quantity, - pool.taker_fee_rate - ); - if (is_round_down) taker_commission = taker_commission + 1; - - maker_base_quantity = maker_base_quantity - filled_base_quantity; - - // maker in ask side, decrease maker's locked base asset, increase maker's available quote asset - taker_base_quantity_remaining = taker_base_quantity_remaining - filled_base_quantity; - let locked_base_balance = custodian::decrease_user_locked_balance( - &mut pool.base_custodian, - maker_order.owner, - filled_base_quantity - ); - let mut taker_commission_balance = balance::split( - &mut quote_balance_left, - taker_commission, - ); - custodian::increase_user_available_balance( - &mut pool.quote_custodian, - maker_order.owner, - balance::split( - &mut taker_commission_balance, - maker_rebate, - ), - ); - balance::join(&mut pool.quote_asset_trading_fees, taker_commission_balance); - balance::join(&mut base_balance_filled, locked_base_balance); - - custodian::increase_user_available_balance( - &mut pool.quote_custodian, - maker_order.owner, - balance::split( - &mut quote_balance_left, - filled_quote_quantity, - ), - ); - - emit_order_filled( - *object::uid_as_inner(&pool.id), - client_order_id, - account_owner(account_cap), - maker_order, - filled_base_quantity, - taker_commission, - maker_rebate - ); - if(compute_metadata){ - vector::push_back( - &mut matched_order_metadata, - matched_order_metadata( - *object::uid_as_inner(&pool.id), - account_owner(account_cap), - maker_order, - filled_base_quantity, - taker_commission, - maker_rebate - ) - ); - }; - }; - - if (skip_order || maker_base_quantity == 0) { - // Remove the maker order. - let old_order_id = order_id; - let maybe_order_id = linked_table::next(&tick_level.open_orders, order_id); - if (!option::is_none(maybe_order_id)) { - order_id = *option::borrow(maybe_order_id); - }; - let usr_open_order_ids = table::borrow_mut(&mut pool.usr_open_orders, maker_order.owner); - linked_table::remove(usr_open_order_ids, old_order_id); - linked_table::remove(&mut tick_level.open_orders, old_order_id); - } else { - // Update the maker order. - let maker_order_mut = linked_table::borrow_mut( - &mut tick_level.open_orders, - order_id); - maker_order_mut.quantity = maker_base_quantity; - }; - if (taker_base_quantity_remaining == 0) { - break - }; - }; - if (linked_table::is_empty(&tick_level.open_orders)) { - (tick_price, _) = next_leaf(all_open_orders, tick_price); - destroy_empty_level(remove_leaf_by_index(all_open_orders, tick_index)); - (_, tick_index) = find_leaf(all_open_orders, tick_price); - }; - if (taker_base_quantity_remaining == 0) { - break - }; - }; - - if (!vector::is_empty(&canceled_order_events)) { - event::emit(AllOrdersCanceled { - pool_id, - orders_canceled: canceled_order_events, - }); - }; - return (base_balance_filled, quote_balance_left, if(compute_metadata) option::some(matched_order_metadata) else option::none()) - } - - fun match_ask( - pool: &mut Pool, - account_cap: &AccountCap, - client_order_id: u64, - price_limit: u64, - current_timestamp: u64, - base_balance: Balance, - compute_metadata: bool, - ): (Balance, Balance, Option>>) { - let pool_id = *object::uid_as_inner(&pool.id); - let mut base_balance_left = base_balance; - // Base balance received by taker, taking into account of taker commission. - let mut quote_balance_filled = balance::zero(); - let all_open_orders = &mut pool.bids; - let mut matched_order_metadata = vector::empty>(); - if (critbit::is_empty(all_open_orders)) { - return (base_balance_left, quote_balance_filled, option::none()) - }; - let (mut tick_price, mut tick_index) = max_leaf(all_open_orders); - let mut canceled_order_events = vector[]; - while (!is_empty(all_open_orders) && tick_price >= price_limit) { - let tick_level = borrow_mut_leaf_by_index(all_open_orders, tick_index); - let mut order_id = *option::borrow(linked_table::front(&tick_level.open_orders)); - while (!linked_table::is_empty(&tick_level.open_orders)) { - let maker_order = linked_table::borrow(&tick_level.open_orders, order_id); - let mut maker_base_quantity = maker_order.quantity; - let mut skip_order = false; - - if (maker_order.expire_timestamp <= current_timestamp || account_owner(account_cap) == maker_order.owner) { - skip_order = true; - let maker_quote_quantity = clob_math::mul(maker_order.quantity, maker_order.price); - custodian::unlock_balance(&mut pool.quote_custodian, maker_order.owner, maker_quote_quantity); - let canceled_order_event = AllOrdersCanceledComponent { - client_order_id: maker_order.client_order_id, - order_id: maker_order.order_id, - is_bid: maker_order.is_bid, - owner: maker_order.owner, - original_quantity: maker_order.original_quantity, - base_asset_quantity_canceled: maker_order.quantity, - price: maker_order.price - }; - vector::push_back(&mut canceled_order_events, canceled_order_event); - } else { - let taker_base_quantity_remaining = balance::value(&base_balance_left); - let filled_base_quantity = - if (taker_base_quantity_remaining >= maker_base_quantity) { maker_base_quantity } - else { taker_base_quantity_remaining }; - // If a bit is rounded down, the pool will take this as a fee. - let (is_round_down, filled_quote_quantity) = clob_math::unsafe_mul_round(filled_base_quantity, maker_order.price); - if (is_round_down) { - let rounded_down_quantity = custodian::decrease_user_locked_balance( - &mut pool.quote_custodian, - maker_order.owner, - 1 - ); - balance::join(&mut pool.quote_asset_trading_fees, rounded_down_quantity); - }; - - // if maker_rebate = 0 due to underflow, maker will not receive a rebate - let maker_rebate = clob_math::unsafe_mul(filled_quote_quantity, pool.maker_rebate_rate); - // if taker_commission = 0 due to underflow, round it up to 1 - let (is_round_down, mut taker_commission) = clob_math::unsafe_mul_round( - filled_quote_quantity, - pool.taker_fee_rate - ); - if (is_round_down) taker_commission = taker_commission + 1; - - maker_base_quantity = maker_base_quantity - filled_base_quantity; - // maker in bid side, decrease maker's locked quote asset, increase maker's available base asset - let mut locked_quote_balance = custodian::decrease_user_locked_balance( - &mut pool.quote_custodian, - maker_order.owner, - filled_quote_quantity - ); - let mut taker_commission_balance = balance::split( - &mut locked_quote_balance, - taker_commission, - ); - custodian::increase_user_available_balance( - &mut pool.quote_custodian, - maker_order.owner, - balance::split( - &mut taker_commission_balance, - maker_rebate, - ), - ); - balance::join(&mut pool.quote_asset_trading_fees, taker_commission_balance); - balance::join(&mut quote_balance_filled, locked_quote_balance); - - custodian::increase_user_available_balance( - &mut pool.base_custodian, - maker_order.owner, - balance::split( - &mut base_balance_left, - filled_base_quantity, - ), - ); - emit_order_filled( - *object::uid_as_inner(&pool.id), - client_order_id, - account_owner(account_cap), - maker_order, - filled_base_quantity, - taker_commission, - maker_rebate - ); - if(compute_metadata) { - vector::push_back( - &mut matched_order_metadata, - matched_order_metadata( - *object::uid_as_inner(&pool.id), - account_owner(account_cap), - maker_order, - filled_base_quantity, - taker_commission, - maker_rebate - ) - ); - } - }; - - if (skip_order || maker_base_quantity == 0) { - // Remove the maker order. - let old_order_id = order_id; - let maybe_order_id = linked_table::next(&tick_level.open_orders, order_id); - if (!option::is_none(maybe_order_id)) { - order_id = *option::borrow(maybe_order_id); - }; - let usr_open_order_ids = table::borrow_mut(&mut pool.usr_open_orders, maker_order.owner); - linked_table::remove(usr_open_order_ids, old_order_id); - linked_table::remove(&mut tick_level.open_orders, old_order_id); - } else { - // Update the maker order. - let maker_order_mut = linked_table::borrow_mut( - &mut tick_level.open_orders, - order_id); - maker_order_mut.quantity = maker_base_quantity; - }; - if (balance::value(&base_balance_left) == 0) { - break - }; - }; - if (linked_table::is_empty(&tick_level.open_orders)) { - (tick_price, _) = previous_leaf(all_open_orders, tick_price); - destroy_empty_level(remove_leaf_by_index(all_open_orders, tick_index)); - (_, tick_index) = find_leaf(all_open_orders, tick_price); - }; - if (balance::value(&base_balance_left) == 0) { - break - }; - }; - - if (!vector::is_empty(&canceled_order_events)) { - event::emit(AllOrdersCanceled { - pool_id, - orders_canceled: canceled_order_events, - }); - }; - - return (base_balance_left, quote_balance_filled, if(compute_metadata) option::some(matched_order_metadata) else option::none()) - } - - /// Place a market order to the order book. - public fun place_market_order( - pool: &mut Pool, - account_cap: &AccountCap, - client_order_id: u64, - quantity: u64, - is_bid: bool, - base_coin: Coin, - quote_coin: Coin, - clock: &Clock, - ctx: &mut TxContext, - ): (Coin, Coin) { - let (base_coin, quote_coin, _metadata) = place_market_order_int( - pool, - account_cap, - client_order_id, - quantity, - is_bid, - base_coin, - quote_coin, - clock, - false, // don't return metadata - ctx - ); - (base_coin, quote_coin) - } - - public fun place_market_order_with_metadata( - pool: &mut Pool, - account_cap: &AccountCap, - client_order_id: u64, - quantity: u64, - is_bid: bool, - base_coin: Coin, - quote_coin: Coin, - clock: &Clock, - ctx: &mut TxContext, - ): (Coin, Coin, vector>) { - let (base_coin, quote_coin, mut metadata) = place_market_order_int( - pool, - account_cap, - client_order_id, - quantity, - is_bid, - base_coin, - quote_coin, - clock, - true, // return metadata - ctx - ); - (base_coin, quote_coin, option::extract(&mut metadata)) - } - - /// Place a market order to the order book. - fun place_market_order_int( - pool: &mut Pool, - account_cap: &AccountCap, - client_order_id: u64, - quantity: u64, - is_bid: bool, - mut base_coin: Coin, - mut quote_coin: Coin, - clock: &Clock, - compute_metadata: bool, - ctx: &mut TxContext, - ): (Coin, Coin, Option>>) { - // If market bid order, match against the open ask orders. Otherwise, match against the open bid orders. - // Take market bid order for example. - // We first retrieve the PriceLevel with the lowest price by calling min_leaf on the asks Critbit Tree. - // We then match the market order by iterating through open orders on that price level in ascending order of the order id. - // Open orders that are being filled are removed from the order book. - // We stop the iteration until all quantities are filled. - // If the total quantity of open orders at the lowest price level is not large enough to fully fill the market order, - // we move on to the next price level by calling next_leaf on the asks Critbit Tree and repeat the same procedure. - // Continue iterating over the price levels in ascending order until the market order is completely filled. - // If their market order cannot be completely filled even after consuming all the open ask orders, - // the unfilled quantity will be cancelled. - // Market ask order follows similar procedure. - // The difference is that market ask order is matched against the open bid orders. - // We start with the bid PriceLevel with the highest price by calling max_leaf on the bids Critbit Tree. - // The inner loop for iterating over the open orders in ascending orders of order id is the same as above. - // Then iterate over the price levels in descending order until the market order is completely filled. - assert!(quantity % pool.lot_size == 0, EInvalidQuantity); - assert!(quantity != 0, EInvalidQuantity); - let metadata; - if (is_bid) { - let (base_balance_filled, quote_balance_left, matched_order_metadata) = match_bid( - pool, - account_cap, - client_order_id, - quantity, - MAX_PRICE, - clock::timestamp_ms(clock), - coin::into_balance(quote_coin), - compute_metadata - ); - join( - &mut base_coin, - coin::from_balance(base_balance_filled, ctx), - ); - quote_coin = coin::from_balance(quote_balance_left, ctx); - metadata = matched_order_metadata; - } else { - assert!(quantity <= coin::value(&base_coin), EInsufficientBaseCoin); - let base_coin_to_sell = coin::split(&mut base_coin, quantity, ctx); - let (base_balance_left, quote_balance_filled, matched_order_metadata) = match_ask( - pool, - account_cap, - client_order_id, - MIN_PRICE, - clock::timestamp_ms(clock), - coin::into_balance(base_coin_to_sell), - compute_metadata - ); - join( - &mut base_coin, - coin::from_balance(base_balance_left, ctx)); - join( - &mut quote_coin, - coin::from_balance(quote_balance_filled, ctx), - ); - metadata = matched_order_metadata; - }; - (base_coin, quote_coin, metadata) - } - - /// Injects a maker order to the order book. - /// Returns the order id. - fun inject_limit_order( - pool: &mut Pool, - client_order_id: u64, - price: u64, - original_quantity: u64, - quantity: u64, - is_bid: bool, - self_matching_prevention: u8, - expire_timestamp: u64, - account_cap: &AccountCap, - ctx: &mut TxContext - ): u64 { - let owner = account_owner(account_cap); - let order_id: u64; - let open_orders: &mut CritbitTree; - if (is_bid) { - let quote_quantity = clob_math::mul(quantity, price); - custodian::lock_balance(&mut pool.quote_custodian, account_cap, quote_quantity); - order_id = pool.next_bid_order_id; - pool.next_bid_order_id = pool.next_bid_order_id + 1; - open_orders = &mut pool.bids; - } else { - custodian::lock_balance(&mut pool.base_custodian, account_cap, quantity); - order_id = pool.next_ask_order_id; - pool.next_ask_order_id = pool.next_ask_order_id + 1; - open_orders = &mut pool.asks; - }; - let order = Order { - order_id, - client_order_id, - price, - original_quantity, - quantity, - is_bid, - owner, - expire_timestamp, - self_matching_prevention - }; - let (tick_exists, mut tick_index) = find_leaf(open_orders, price); - if (!tick_exists) { - tick_index = insert_leaf( - open_orders, - price, - TickLevel { - price, - open_orders: linked_table::new(ctx), - }); - }; - - let tick_level = borrow_mut_leaf_by_index(open_orders, tick_index); - linked_table::push_back(&mut tick_level.open_orders, order_id, order); - event::emit(OrderPlaced { - pool_id: *object::uid_as_inner(&pool.id), - order_id, - client_order_id, - is_bid, - owner, - original_quantity, - base_asset_quantity_placed: quantity, - price, - expire_timestamp - }); - if (!contains(&pool.usr_open_orders, owner)) { - add(&mut pool.usr_open_orders, owner, linked_table::new(ctx)); - }; - linked_table::push_back(borrow_mut(&mut pool.usr_open_orders, owner), order_id, price); - - return order_id - } - - /// Place a limit order to the order book. - /// Returns (base quantity filled, quote quantity filled, whether a maker order is being placed, order id of the maker order). - /// When the limit order is not successfully placed, we return false to indicate that and also returns a meaningless order_id 0. - /// When the limit order is successfully placed, we return true to indicate that and also the corresponding order_id. - /// So please check that boolean value first before using the order id. - public fun place_limit_order( - pool: &mut Pool, - client_order_id: u64, - price: u64, - quantity: u64, - self_matching_prevention: u8, - is_bid: bool, - expire_timestamp: u64, // Expiration timestamp in ms in absolute value inclusive. - restriction: u8, - clock: &Clock, - account_cap: &AccountCap, - ctx: &mut TxContext - ): (u64, u64, bool, u64) { - let (base_quantity_filled, quote_quantity_filled, is_success, order_id, _meta_data) = place_limit_order_int( - pool, - client_order_id, - price, - quantity, - self_matching_prevention, - is_bid, - expire_timestamp, // Expiration timestamp in ms in absolute value inclusive. - restriction, - clock, - account_cap, - false, // don't compute metadata - ctx - ); - (base_quantity_filled, quote_quantity_filled, is_success, order_id) - } - - /// Place a limit order to the order book. - /// Returns (base quantity filled, quote quantity filled, whether a maker order is being placed, order id of the maker order). - /// When the limit order is not successfully placed, we return false to indicate that and also returns a meaningless order_id 0. - /// When the limit order is successfully placed, we return true to indicate that and also the corresponding order_id. - /// So please check that boolean value first before using the order id. - public fun place_limit_order_with_metadata( - pool: &mut Pool, - client_order_id: u64, - price: u64, - quantity: u64, - self_matching_prevention: u8, - is_bid: bool, - expire_timestamp: u64, // Expiration timestamp in ms in absolute value inclusive. - restriction: u8, - clock: &Clock, - account_cap: &AccountCap, - ctx: &mut TxContext - ): (u64, u64, bool, u64, vector>) { - let (base_quantity_filled, quote_quantity_filled, is_success, order_id, mut meta_data) = place_limit_order_int( - pool, - client_order_id, - price, - quantity, - self_matching_prevention, - is_bid, - expire_timestamp, // Expiration timestamp in ms in absolute value inclusive. - restriction, - clock, - account_cap, - true, // return metadata - ctx - ); - (base_quantity_filled, quote_quantity_filled, is_success, order_id, option::extract(&mut meta_data)) - } - - fun place_limit_order_int( - pool: &mut Pool, - client_order_id: u64, - price: u64, - quantity: u64, - self_matching_prevention: u8, - is_bid: bool, - expire_timestamp: u64, // Expiration timestamp in ms in absolute value inclusive. - restriction: u8, - clock: &Clock, - account_cap: &AccountCap, - compute_metadata: bool, - ctx: &mut TxContext - ): (u64, u64, bool, u64, Option>>) { - // If limit bid order, check whether the price is lower than the lowest ask order by checking the min_leaf of asks Critbit Tree. - // If so, assign the sequence id of the order to be next_bid_order_id and increment next_bid_order_id by 1. - // Inject the new order to the bids Critbit Tree according to the price and order id. - // Otherwise, find the price level from the asks Critbit Tree that is no greater than the input price. - // Match the bid order against the asks Critbit Tree in the same way as a market order but up until the price level found in the previous step. - // If the bid order is not completely filled, inject the remaining quantity to the bids Critbit Tree according to the input price and order id. - // If limit ask order, vice versa. - assert!(self_matching_prevention == CANCEL_OLDEST, EInvalidSelfMatchingPreventionArg); - assert!(quantity > 0, EInvalidQuantity); - assert!(price > 0, EInvalidPrice); - assert!(price % pool.tick_size == 0, EInvalidPrice); - assert!(quantity % pool.lot_size == 0, EInvalidQuantity); - assert!(expire_timestamp > clock::timestamp_ms(clock), EInvalidExpireTimestamp); - let owner = account_owner(account_cap); - let original_quantity = quantity; - let base_quantity_filled; - let quote_quantity_filled; - let meta_data = if (is_bid) { - let quote_quantity_original = custodian::account_available_balance( - &pool.quote_custodian, - owner - ); - let quote_balance = custodian::decrease_user_available_balance( - &mut pool.quote_custodian, - account_cap, - quote_quantity_original, - ); - let (base_balance_filled, quote_balance_left, matched_order_metadata) = match_bid( - pool, - account_cap, - client_order_id, - quantity, - price, - clock::timestamp_ms(clock), - quote_balance, - compute_metadata - ); - base_quantity_filled = balance::value(&base_balance_filled); - quote_quantity_filled = quote_quantity_original - balance::value("e_balance_left); - - custodian::increase_user_available_balance( - &mut pool.base_custodian, - owner, - base_balance_filled, - ); - custodian::increase_user_available_balance( - &mut pool.quote_custodian, - owner, - quote_balance_left, - ); - - matched_order_metadata - } else { - let base_balance = custodian::decrease_user_available_balance( - &mut pool.base_custodian, - account_cap, - quantity, - ); - let (base_balance_left, quote_balance_filled, matched_order_metadata) = match_ask( - pool, - account_cap, - client_order_id, - price, - clock::timestamp_ms(clock), - base_balance, - compute_metadata - ); - - base_quantity_filled = quantity - balance::value(&base_balance_left); - quote_quantity_filled = balance::value("e_balance_filled); - - custodian::increase_user_available_balance( - &mut pool.base_custodian, - owner, - base_balance_left, - ); - custodian::increase_user_available_balance( - &mut pool.quote_custodian, - owner, - quote_balance_filled, - ); - matched_order_metadata - }; - - let order_id; - if (restriction == IMMEDIATE_OR_CANCEL) { - return (base_quantity_filled, quote_quantity_filled, false, 0, meta_data) - }; - if (restriction == FILL_OR_KILL) { - assert!(base_quantity_filled == quantity, EOrderCannotBeFullyFilled); - return (base_quantity_filled, quote_quantity_filled, false, 0, meta_data) - }; - if (restriction == POST_OR_ABORT) { - assert!(base_quantity_filled == 0, EOrderCannotBeFullyPassive); - order_id = inject_limit_order( - pool, - client_order_id, - price, - original_quantity, - quantity, - is_bid, - self_matching_prevention, - expire_timestamp, - account_cap, - ctx - ); - return (base_quantity_filled, quote_quantity_filled, true, order_id, meta_data) - } else { - assert!(restriction == NO_RESTRICTION, EInvalidRestriction); - if (quantity > base_quantity_filled) { - order_id = inject_limit_order( - pool, - client_order_id, - price, - original_quantity, - quantity - base_quantity_filled, - is_bid, - self_matching_prevention, - expire_timestamp, - account_cap, - ctx - ); - return (base_quantity_filled, quote_quantity_filled, true, order_id, meta_data) - }; - return (base_quantity_filled, quote_quantity_filled, false, 0, meta_data) - } - } - - fun order_is_bid(order_id: u64): bool { - return order_id < MIN_ASK_ORDER_ID - } - - fun emit_order_canceled( - pool_id: ID, - order: &Order - ) { - event::emit(OrderCanceled { - pool_id, - client_order_id: order.client_order_id, - order_id: order.order_id, - is_bid: order.is_bid, - owner: order.owner, - original_quantity: order.original_quantity, - base_asset_quantity_canceled: order.quantity, - price: order.price - }) - } - - fun emit_order_filled( - pool_id: ID, - taker_client_id: u64, - taker_address: address, - order: &Order, - base_asset_quantity_filled: u64, - taker_commission: u64, - maker_rebates: u64 - ) { - event::emit(OrderFilled { - pool_id, - order_id: order.order_id, - taker_client_order_id: taker_client_id, - taker_address, - maker_client_order_id: order.client_order_id, - is_bid: order.is_bid, - maker_address: order.owner, - original_quantity: order.original_quantity, - base_asset_quantity_filled, - // order.quantity = base_asset_quantity_filled + base_asset_quantity_remaining - // This guarantees that the subtraction will not underflow - base_asset_quantity_remaining: order.quantity - base_asset_quantity_filled, - price: order.price, - taker_commission, - maker_rebates - }) - } - - /// Cancel and opening order. - /// Abort if order_id is invalid or if the order is not submitted by the transaction sender. - public fun cancel_order( - pool: &mut Pool, - order_id: u64, - account_cap: &AccountCap - ) { - // First check the highest bit of the order id to see whether it's bid or ask. - // Then retrieve the price using the order id. - // Using the price to retrieve the corresponding PriceLevel from the bids / asks Critbit Tree. - // Retrieve and remove the order from open orders of the PriceLevel. - let owner = account_owner(account_cap); - assert!(contains(&pool.usr_open_orders, owner), EInvalidUser); - let usr_open_orders = borrow_mut(&mut pool.usr_open_orders, owner); - assert!(linked_table::contains(usr_open_orders, order_id), EInvalidOrderId); - let tick_price = *linked_table::borrow(usr_open_orders, order_id); - let is_bid = order_is_bid(order_id); - let (tick_exists, tick_index) = find_leaf( - if (is_bid) { &pool.bids } else { &pool.asks }, - tick_price); - assert!(tick_exists, EInvalidOrderId); - let order = remove_order( - if (is_bid) { &mut pool.bids } else { &mut pool.asks }, - usr_open_orders, - tick_index, - order_id, - owner - ); - if (is_bid) { - let (_, balance_locked) = clob_math::unsafe_mul_round(order.quantity, order.price); - custodian::unlock_balance(&mut pool.quote_custodian, owner, balance_locked); - } else { - custodian::unlock_balance(&mut pool.base_custodian, owner, order.quantity); - }; - emit_order_canceled(*object::uid_as_inner(&pool.id), &order); - } - - fun remove_order( - open_orders: &mut CritbitTree, - usr_open_orders: &mut LinkedTable, - tick_index: u64, - order_id: u64, - owner: address, - ): Order { - linked_table::remove(usr_open_orders, order_id); - let tick_level = borrow_leaf_by_index(open_orders, tick_index); - assert!(linked_table::contains(&tick_level.open_orders, order_id), EInvalidOrderId); - let mut_tick_level = borrow_mut_leaf_by_index(open_orders, tick_index); - let order = linked_table::remove(&mut mut_tick_level.open_orders, order_id); - assert!(order.owner == owner, EUnauthorizedCancel); - if (linked_table::is_empty(&mut_tick_level.open_orders)) { - destroy_empty_level(remove_leaf_by_index(open_orders, tick_index)); - }; - order - } - - public fun cancel_all_orders( - pool: &mut Pool, - account_cap: &AccountCap - ) { - let pool_id = *object::uid_as_inner(&pool.id); - let owner = account_owner(account_cap); - assert!(contains(&pool.usr_open_orders, owner), EInvalidUser); - let usr_open_order_ids = table::borrow_mut(&mut pool.usr_open_orders, owner); - let mut canceled_order_events = vector[]; - while (!linked_table::is_empty(usr_open_order_ids)) { - let order_id = *option::borrow(linked_table::back(usr_open_order_ids)); - let order_price = *linked_table::borrow(usr_open_order_ids, order_id); - let is_bid = order_is_bid(order_id); - let open_orders = - if (is_bid) { &mut pool.bids } - else { &mut pool.asks }; - let (_, tick_index) = critbit::find_leaf(open_orders, order_price); - let order = remove_order( - open_orders, - usr_open_order_ids, - tick_index, - order_id, - owner - ); - if (is_bid) { - let (_, balance_locked) = clob_math::unsafe_mul_round(order.quantity, order.price); - custodian::unlock_balance(&mut pool.quote_custodian, owner, balance_locked); - } else { - custodian::unlock_balance(&mut pool.base_custodian, owner, order.quantity); - }; - let canceled_order_event = AllOrdersCanceledComponent { - client_order_id: order.client_order_id, - order_id: order.order_id, - is_bid: order.is_bid, - owner: order.owner, - original_quantity: order.original_quantity, - base_asset_quantity_canceled: order.quantity, - price: order.price - }; - - vector::push_back(&mut canceled_order_events, canceled_order_event); - }; - - if (!vector::is_empty(&canceled_order_events)) { - event::emit(AllOrdersCanceled { - pool_id, - orders_canceled: canceled_order_events, - }); - }; - } - - - /// Batch cancel limit orders to save gas cost. - /// Abort if any of the order_ids are not submitted by the sender. - /// Skip any order_id that is invalid. - /// Note that this function can reduce gas cost even further if caller has multiple orders at the same price level, - /// and if orders with the same price are grouped together in the vector. - /// For example, if we have the following order_id to price mapping, \{0: 100., 1: 200., 2: 100., 3: 200.}. - /// Grouping order_ids like [0, 2, 1, 3] would make it the most gas efficient. - public fun batch_cancel_order( - pool: &mut Pool, - order_ids: vector, - account_cap: &AccountCap - ) { - let pool_id = *object::uid_as_inner(&pool.id); - // First group the order ids according to price level, - // so that we don't have to retrieve the PriceLevel multiple times if there are orders at the same price level. - // Iterate over each price level, retrieve the corresponding PriceLevel. - // Iterate over the order ids that need to be canceled at that price level, - // retrieve and remove the order from open orders of the PriceLevel. - let owner = account_owner(account_cap); - assert!(contains(&pool.usr_open_orders, owner), 0); - let mut tick_index: u64 = 0; - let mut tick_price: u64 = 0; - let n_order = vector::length(&order_ids); - let mut i_order = 0; - let usr_open_orders = borrow_mut(&mut pool.usr_open_orders, owner); - let mut canceled_order_events = vector[]; - - while (i_order < n_order) { - let order_id = *vector::borrow(&order_ids, i_order); - assert!(linked_table::contains(usr_open_orders, order_id), EInvalidOrderId); - let new_tick_price = *linked_table::borrow(usr_open_orders, order_id); - let is_bid = order_is_bid(order_id); - if (new_tick_price != tick_price) { - tick_price = new_tick_price; - let (tick_exists, new_tick_index) = find_leaf( - if (is_bid) { &pool.bids } else { &pool.asks }, - tick_price - ); - assert!(tick_exists, EInvalidTickPrice); - tick_index = new_tick_index; - }; - let order = remove_order( - if (is_bid) { &mut pool.bids } else { &mut pool.asks }, - usr_open_orders, - tick_index, - order_id, - owner - ); - if (is_bid) { - let (_is_round_down, balance_locked) = clob_math::unsafe_mul_round(order.quantity, order.price); - custodian::unlock_balance(&mut pool.quote_custodian, owner, balance_locked); - } else { - custodian::unlock_balance(&mut pool.base_custodian, owner, order.quantity); - }; - let canceled_order_event = AllOrdersCanceledComponent { - client_order_id: order.client_order_id, - order_id: order.order_id, - is_bid: order.is_bid, - owner: order.owner, - original_quantity: order.original_quantity, - base_asset_quantity_canceled: order.quantity, - price: order.price - }; - vector::push_back(&mut canceled_order_events, canceled_order_event); - - i_order = i_order + 1; - }; - - if (!vector::is_empty(&canceled_order_events)) { - event::emit(AllOrdersCanceled { - pool_id, - orders_canceled: canceled_order_events, - }); - }; - } - - /// Clean up expired orders - /// Note that this function can reduce gas cost if orders - /// with the same price are grouped together in the vector because we would not need the computation to find the tick_index. - /// For example, if we have the following order_id to price mapping, \{0: 100., 1: 200., 2: 100., 3: 200.}. - /// Grouping order_ids like [0, 2, 1, 3] would make it the most gas efficient. - /// Order owners should be the owner addresses from the account capacities which placed the orders, - /// and they should correspond to the order IDs one by one. - public fun clean_up_expired_orders( - pool: &mut Pool, - clock: &Clock, - order_ids: vector, - order_owners: vector
- ) { - let pool_id = *object::uid_as_inner(&pool.id); - let now = clock::timestamp_ms(clock); - let n_order = vector::length(&order_ids); - assert!(n_order == vector::length(&order_owners), ENotEqual); - let mut i_order = 0; - let mut tick_index: u64 = 0; - let mut tick_price: u64 = 0; - let mut canceled_order_events = vector[]; - while (i_order < n_order) { - let order_id = *vector::borrow(&order_ids, i_order); - let owner = *vector::borrow(&order_owners, i_order); - if (!table::contains(&pool.usr_open_orders, owner)) { continue }; - let usr_open_orders = borrow_mut(&mut pool.usr_open_orders, owner); - if (!linked_table::contains(usr_open_orders, order_id)) { continue }; - let new_tick_price = *linked_table::borrow(usr_open_orders, order_id); - let is_bid = order_is_bid(order_id); - let open_orders = if (is_bid) { &mut pool.bids } else { &mut pool.asks }; - if (new_tick_price != tick_price) { - tick_price = new_tick_price; - let (tick_exists, new_tick_index) = find_leaf( - open_orders, - tick_price - ); - assert!(tick_exists, EInvalidTickPrice); - tick_index = new_tick_index; - }; - let order = remove_order(open_orders, usr_open_orders, tick_index, order_id, owner); - assert!(order.expire_timestamp < now, EInvalidExpireTimestamp); - if (is_bid) { - let (_is_round_down, balance_locked) = clob_math::unsafe_mul_round(order.quantity, order.price); - custodian::unlock_balance(&mut pool.quote_custodian, owner, balance_locked); - } else { - custodian::unlock_balance(&mut pool.base_custodian, owner, order.quantity); - }; - let canceled_order_event = AllOrdersCanceledComponent { - client_order_id: order.client_order_id, - order_id: order.order_id, - is_bid: order.is_bid, - owner: order.owner, - original_quantity: order.original_quantity, - base_asset_quantity_canceled: order.quantity, - price: order.price - }; - vector::push_back(&mut canceled_order_events, canceled_order_event); - - i_order = i_order + 1; - }; - - if (!vector::is_empty(&canceled_order_events)) { - event::emit(AllOrdersCanceled { - pool_id, - orders_canceled: canceled_order_events, - }); - }; - } - - public fun list_open_orders( - pool: &Pool, - account_cap: &AccountCap - ): vector { - let owner = account_owner(account_cap); - let mut open_orders = vector::empty(); - if (!usr_open_orders_exist(pool, owner)) { - return open_orders - }; - let usr_open_order_ids = table::borrow(&pool.usr_open_orders, owner); - let mut order_id = linked_table::front(usr_open_order_ids); - while (!option::is_none(order_id)) { - let order_price = *linked_table::borrow(usr_open_order_ids, *option::borrow(order_id)); - let tick_level = - if (order_is_bid(*option::borrow(order_id))) borrow_leaf_by_key(&pool.bids, order_price) - else borrow_leaf_by_key(&pool.asks, order_price); - let order = linked_table::borrow(&tick_level.open_orders, *option::borrow(order_id)); - vector::push_back(&mut open_orders, Order { - order_id: order.order_id, - client_order_id: order.client_order_id, - price: order.price, - original_quantity: order.original_quantity, - quantity: order.quantity, - is_bid: order.is_bid, - owner: order.owner, - expire_timestamp: order.expire_timestamp, - self_matching_prevention: order.self_matching_prevention - }); - order_id = linked_table::next(usr_open_order_ids, *option::borrow(order_id)); - }; - open_orders - } - - /// query user balance inside custodian - public fun account_balance( - pool: &Pool, - account_cap: &AccountCap - ): (u64, u64, u64, u64) { - let owner = account_owner(account_cap); - let (base_avail, base_locked) = custodian::account_balance(&pool.base_custodian, owner); - let (quote_avail, quote_locked) = custodian::account_balance(&pool.quote_custodian, owner); - (base_avail, base_locked, quote_avail, quote_locked) - } - - /// Query the market price of order book - /// returns (best_bid_price, best_ask_price) if there exists - /// bid/ask order in the order book, otherwise returns None - public fun get_market_price( - pool: &Pool - ): (Option, Option){ - let bid_price = if (!critbit::is_empty(&pool.bids)) { - let (result, _) = critbit::max_leaf(&pool.bids); - option::some(result) - } else { - option::none() - }; - let ask_price = if (!critbit::is_empty(&pool.asks)) { - let (result, _) = critbit::min_leaf(&pool.asks); - option::some(result) - } else { - option::none() - }; - return (bid_price, ask_price) - } - - /// Enter a price range and return the level2 order depth of all valid prices within this price range in bid side - /// returns two vectors of u64 - /// The previous is a list of all valid prices - /// The latter is the corresponding depth list - public fun get_level2_book_status_bid_side( - pool: &Pool, - mut price_low: u64, - mut price_high: u64, - clock: &Clock - ): (vector, vector) { - let mut price_vec = vector::empty(); - let mut depth_vec = vector::empty(); - if (critbit::is_empty(&pool.bids)) { return (price_vec, depth_vec) }; - let (price_low_, _) = critbit::min_leaf(&pool.bids); - let (price_high_, _) = critbit::max_leaf(&pool.bids); - - // If price_low is greater than the highest element in the tree, we return empty - if (price_low > price_high_) { - return (price_vec, depth_vec) - }; - - if (price_low < price_low_) price_low = price_low_; - if (price_high > price_high_) price_high = price_high_; - price_low = critbit::find_closest_key(&pool.bids, price_low); - price_high = critbit::find_closest_key(&pool.bids, price_high); - while (price_low <= price_high) { - let depth = get_level2_book_status( - &pool.bids, - price_low, - clock::timestamp_ms(clock) - ); - if (depth != 0) { - vector::push_back(&mut price_vec, price_low); - vector::push_back(&mut depth_vec, depth); - }; - let (next_price, _) = critbit::next_leaf(&pool.bids, price_low); - if (next_price == 0) { break } - else { price_low = next_price }; - }; - (price_vec, depth_vec) - } - - /// Enter a price range and return the level2 order depth of all valid prices within this price range in ask side - /// returns two vectors of u64 - /// The previous is a list of all valid prices - /// The latter is the corresponding depth list - public fun get_level2_book_status_ask_side( - pool: &Pool, - mut price_low: u64, - mut price_high: u64, - clock: &Clock - ): (vector, vector) { - let mut price_vec = vector::empty(); - let mut depth_vec = vector::empty(); - if (critbit::is_empty(&pool.asks)) { return (price_vec, depth_vec) }; - let (price_low_, _) = critbit::min_leaf(&pool.asks); - - // Price_high is less than the lowest leaf in the tree then we return an empty array - if (price_high < price_low_) { - return (price_vec, depth_vec) - }; - - if (price_low < price_low_) price_low = price_low_; - let (price_high_, _) = critbit::max_leaf(&pool.asks); - if (price_high > price_high_) price_high = price_high_; - price_low = critbit::find_closest_key(&pool.asks, price_low); - price_high = critbit::find_closest_key(&pool.asks, price_high); - while (price_low <= price_high) { - let depth = get_level2_book_status( - &pool.asks, - price_low, - clock::timestamp_ms(clock) - ); - if (depth != 0) { - vector::push_back(&mut price_vec, price_low); - vector::push_back(&mut depth_vec, depth); - }; - let (next_price, _) = critbit::next_leaf(&pool.asks, price_low); - if (next_price == 0) { break } - else { price_low = next_price }; - }; - (price_vec, depth_vec) - } - - /// internal func to retrieve single depth of a tick price - fun get_level2_book_status( - open_orders: &CritbitTree, - price: u64, - time_stamp: u64 - ): u64 { - let tick_level = critbit::borrow_leaf_by_key(open_orders, price); - let tick_open_orders = &tick_level.open_orders; - let mut depth = 0; - let mut order_id = linked_table::front(tick_open_orders); - let mut order: &Order; - while (!option::is_none(order_id)) { - order = linked_table::borrow(tick_open_orders, *option::borrow(order_id)); - if (order.expire_timestamp > time_stamp) depth = depth + order.quantity; - order_id = linked_table::next(tick_open_orders, *option::borrow(order_id)); - }; - depth - } - - public fun get_order_status( - pool: &Pool, - order_id: u64, - account_cap: &AccountCap - ): &Order { - let owner = account_owner(account_cap); - assert!(table::contains(&pool.usr_open_orders, owner), EInvalidUser); - let usr_open_order_ids = table::borrow(&pool.usr_open_orders, owner); - assert!(linked_table::contains(usr_open_order_ids, order_id), EInvalidOrderId); - let order_price = *linked_table::borrow(usr_open_order_ids, order_id); - let open_orders = - if (order_id < MIN_ASK_ORDER_ID) { &pool.bids } - else { &pool.asks }; - let tick_level = critbit::borrow_leaf_by_key(open_orders, order_price); - let tick_open_orders = &tick_level.open_orders; - let order = linked_table::borrow(tick_open_orders, order_id); - order - } - - fun matched_order_metadata( - pool_id: ID, - taker_address: address, - order: &Order, - base_asset_quantity_filled: u64, - taker_commission: u64, - maker_rebates: u64 - ): MatchedOrderMetadata{ - MatchedOrderMetadata { - pool_id, - order_id: order.order_id, - is_bid: order.is_bid, - taker_address, - maker_address: order.owner, - base_asset_quantity_filled, - price: order.price, - taker_commission, - maker_rebates - } - } - - public fun matched_order_metadata_info( - matched_order_metadata: &MatchedOrderMetadata - ) : ( ID, u64, bool, address, address, u64, u64, u64, u64) { - ( - matched_order_metadata.pool_id, - matched_order_metadata.order_id, - matched_order_metadata.is_bid, - matched_order_metadata.taker_address, - matched_order_metadata.maker_address, - matched_order_metadata.base_asset_quantity_filled, - matched_order_metadata.price, - matched_order_metadata.taker_commission, - matched_order_metadata.maker_rebates - ) - } - - // Methods for accessing pool data, used by the order_query package - public fun asks(pool: &Pool): &CritbitTree { - &pool.asks - } - - public fun bids(pool: &Pool): &CritbitTree { - &pool.bids - } - - public fun tick_size(pool: &Pool): u64 { - pool.tick_size - } - - public fun maker_rebate_rate(pool: &Pool): u64 { - pool.maker_rebate_rate - } - - public fun taker_fee_rate(pool: &Pool): u64 { - pool.taker_fee_rate - } - - public fun pool_size(pool: &Pool): u64 { - critbit::size(&pool.asks) + critbit::size(&pool.bids) - } - - public fun open_orders(tick_level: &TickLevel): &LinkedTable { - &tick_level.open_orders - } - - // Order Accessors - - public fun order_id(order: &Order): u64 { - order.order_id - } - - public fun tick_level(order: &Order): u64 { - order.price - } - - public fun original_quantity(order: &Order): u64 { - order.original_quantity - } - - public fun quantity(order: &Order): u64 { - order.quantity - } - - public fun is_bid(order: &Order): bool { - order.is_bid - } - - public fun owner(order: &Order): address { - order.owner - } - - public fun expire_timestamp(order: &Order): u64 { - order.expire_timestamp - } - - public fun quote_asset_trading_fees_value(pool: &Pool): u64 { - balance::value(&pool.quote_asset_trading_fees) - } - - public(package) fun clone_order(order: &Order): Order { - Order { - order_id: order.order_id, - client_order_id: order.client_order_id, - price: order.price, - original_quantity: order.original_quantity, - quantity: order.quantity, - is_bid: order.is_bid, - owner: order.owner, - expire_timestamp: order.expire_timestamp, - self_matching_prevention: order.self_matching_prevention - } - } - - // Note that open orders and quotes can be directly accessed by loading in the entire Pool. - - #[test_only] use iota::coin::mint_for_testing; - - #[test_only] use iota::test_scenario::{Self, Scenario}; - - #[test_only] const CLIENT_ID_ALICE: u64 = 0; - #[test_only] const CLIENT_ID_BOB: u64 = 1; - - #[test_only] public struct USD {} - - #[test_only] - public fun setup_test_with_tick_lot( - taker_fee_rate: u64, - maker_rebate_rate: u64, - // tick size with scaling - tick_size: u64, - lot_size: u64, - scenario: &mut Scenario, - sender: address, - ) { - test_scenario::next_tx(scenario, sender); - { - clock::share_for_testing(clock::create_for_testing(test_scenario::ctx(scenario))); - }; - - test_scenario::next_tx(scenario, sender); - { - create_pool_( - taker_fee_rate, - maker_rebate_rate, - tick_size, - lot_size, - balance::create_for_testing(FEE_AMOUNT_FOR_CREATE_POOL), - test_scenario::ctx(scenario) - ); - }; - } - - // Test wrapped pool struct - #[test_only] - public struct WrappedPool has key, store { - id: UID, - pool: Pool, - } - - #[test_only] - public fun borrow_mut_pool( - wpool: &mut WrappedPool - ): &mut Pool { - &mut wpool.pool - } - - #[test_only] - public fun setup_test_with_tick_lot_and_wrapped_pool( - taker_fee_rate: u64, - maker_rebate_rate: u64, - // tick size with scaling - tick_size: u64, - lot_size: u64, - scenario: &mut Scenario, - sender: address, - ) { - test_scenario::next_tx(scenario, sender); - { - clock::share_for_testing(clock::create_for_testing(test_scenario::ctx(scenario))); - }; - - test_scenario::next_tx(scenario, sender); - { - let (pool, pool_owner_cap) = create_pool_with_return_( - taker_fee_rate, - maker_rebate_rate, - tick_size, - lot_size, - balance::create_for_testing(FEE_AMOUNT_FOR_CREATE_POOL), - test_scenario::ctx(scenario) - ); - transfer::share_object(WrappedPool { - id: object::new(test_scenario::ctx(scenario)), - pool - }); - delete_pool_owner_cap(pool_owner_cap); - }; - } - - #[test_only] - public fun setup_test( - taker_fee_rate: u64, - maker_rebate_rate: u64, - scenario: &mut Scenario, - sender: address, - ) { - setup_test_with_tick_lot( - taker_fee_rate, - maker_rebate_rate, - 1 * FLOAT_SCALING, - 1, - scenario, - sender, - ); - } - - #[test_only] - public fun setup_test_wrapped_pool( - taker_fee_rate: u64, - maker_rebate_rate: u64, - scenario: &mut Scenario, - sender: address, - ) { - setup_test_with_tick_lot_and_wrapped_pool( - taker_fee_rate, - maker_rebate_rate, - 1 * FLOAT_SCALING, - 1, - scenario, - sender, - ); - } - - #[test_only] - fun order_equal( - order_left: &Order, - order_right: &Order, - ): bool { - return (order_left.order_id == order_right.order_id) && - (order_left.price == order_right.price) && - (order_left.quantity == order_right.quantity) && - (order_left.is_bid == order_right.is_bid) && - (order_left.owner == order_right.owner) - } - - #[test_only] - fun contains_order( - tree: &LinkedTable, - expected_order: &Order, - ): bool { - if (!linked_table::contains(tree, expected_order.order_id)) { - return false - }; - let order = linked_table::borrow(tree, expected_order.order_id); - return order_equal(order, expected_order) - } - - #[test_only] - public fun check_tick_level( - tree: &CritbitTree, - price: u64, - open_orders: &vector, - ) { - let (tick_exists, tick_index) = find_leaf(tree, price); - assert!(tick_exists); - let tick_level = borrow_leaf_by_index(tree, tick_index); - assert!(tick_level.price == price); - let mut total_quote_amount: u64 = 0; - assert!(linked_table::length(&tick_level.open_orders) == vector::length(open_orders)); - let mut i_order = 0; - while (i_order < vector::length(open_orders)) { - let order = vector::borrow(open_orders, i_order); - total_quote_amount = total_quote_amount + order.quantity; - assert!(order.price == price); - assert!(contains_order(&tick_level.open_orders, order)); - i_order = i_order + 1; - }; - } - - #[test_only] - public fun check_empty_tick_level( - tree: &CritbitTree, - price: u64, - ) { - let (tick_exists, _) = find_leaf(tree, price); - assert!(!tick_exists); - } - - - #[test_only] - public fun order_id_for_test( - sequence_id: u64, - is_bid: bool - ): u64 { - return if (is_bid) { MIN_BID_ORDER_ID + sequence_id } else { MIN_ASK_ORDER_ID + sequence_id } - } - - #[test_only] - public fun mint_account_cap_transfer( - user: address, - ctx: &mut TxContext - ) { - transfer::public_transfer(create_account(ctx), user); - } - - #[test_only] - public fun borrow_mut_custodian( - pool: &mut Pool - ): (&mut Custodian, &mut Custodian) { - (&mut pool.base_custodian, &mut pool.quote_custodian) - } - - #[test_only] - public fun borrow_custodian( - pool: &Pool - ): (&Custodian, &Custodian) { - (&pool.base_custodian, &pool.quote_custodian) - } - - #[test_only] - public fun test_match_bid( - pool: &mut Pool, - account_cap: &AccountCap, - client_order_id: u64, - quantity: u64, - price_limit: u64, // upper price limit if bid, lower price limit if ask, inclusive - current_timestamp: u64, - ): (u64, u64) { - let quote_quantity_original = 1 << 63; - let (base_balance_filled, quote_balance_left, _matched_order_metadata) = match_bid( - pool, - account_cap, - client_order_id, - quantity, - price_limit, - current_timestamp, - balance::create_for_testing(quote_quantity_original), - false, - ); - let base_quantity_filled = balance::value(&base_balance_filled); - let quote_quantity_filled = quote_quantity_original - balance::value("e_balance_left); - balance::destroy_for_testing(base_balance_filled); - balance::destroy_for_testing(quote_balance_left); - return (base_quantity_filled, quote_quantity_filled) - } - - #[test_only] - public fun test_match_bid_with_quote_quantity( - pool: &mut Pool, - account_cap: &AccountCap, - client_order_id: u64, - quantity: u64, - price_limit: u64, // upper price limit if bid, lower price limit if ask, inclusive - current_timestamp: u64, - ): (u64, u64) { - let quote_quantity_original = 1 << 63; - let (base_balance_filled, quote_balance_left, _matched_order_metadata) = match_bid_with_quote_quantity( - pool, - account_cap, - client_order_id, - quantity, - price_limit, - current_timestamp, - balance::create_for_testing(quote_quantity_original), - false - ); - let base_quantity_filled = balance::value(&base_balance_filled); - let quote_quantity_filled = quote_quantity_original - balance::value("e_balance_left); - balance::destroy_for_testing(base_balance_filled); - balance::destroy_for_testing(quote_balance_left); - return (base_quantity_filled, quote_quantity_filled) - } - - #[test_only] - public fun test_match_ask( - pool: &mut Pool, - account_cap: &AccountCap, - client_order_id: u64, - quantity: u64, - price_limit: u64, // upper price limit if bid, lower price limit if ask, inclusive - current_timestamp: u64, - ): (u64, u64) { - let (base_balance_left, quote_balance_filled, _matched_order_metadata) = match_ask( - pool, - account_cap, - client_order_id, - price_limit, - current_timestamp, - balance::create_for_testing(quantity), - false - ); - let base_quantity_filled = quantity - balance::value(&base_balance_left); - let quote_quantity_filled = balance::value("e_balance_filled); - balance::destroy_for_testing(base_balance_left); - balance::destroy_for_testing(quote_balance_filled); - return (base_quantity_filled, quote_quantity_filled) - } - - #[test_only] - public fun test_inject_limit_order( - pool: &mut Pool, - client_order_id: u64, - price: u64, - original_quantity: u64, - quantity: u64, - is_bid: bool, - self_matching_prevention: u8, - account_cap: &AccountCap, - ctx: &mut TxContext - ) { - inject_limit_order(pool, - client_order_id, price, original_quantity, quantity, is_bid, self_matching_prevention, TIMESTAMP_INF, account_cap, ctx); - } - - #[test_only] - public fun test_inject_limit_order_with_expiration( - pool: &mut Pool, - client_order_id: u64, - price: u64, - original_quantity: u64, - quantity: u64, - is_bid: bool, - self_matching_prevention: u8, - expire_timestamp: u64, - account_cap: &AccountCap, - ctx: &mut TxContext - ) { - inject_limit_order(pool, - client_order_id, price, original_quantity, quantity, is_bid, self_matching_prevention, expire_timestamp, account_cap, ctx); - } - - #[test_only] - public fun get_pool_stat( - pool: &Pool - ): (u64, u64, &CritbitTree, &CritbitTree) { - ( - pool.next_bid_order_id, - pool.next_ask_order_id, - &pool.bids, - &pool.asks - ) - } - - #[test_only] - public fun get_usr_open_orders( - pool: &Pool, - owner: address - ): &LinkedTable { - assert!(contains(&pool.usr_open_orders, owner), 0); - table::borrow(&pool.usr_open_orders, owner) - } - - #[test_only] - public fun test_construct_order(sequence_id: u64, client_order_id: u64, price: u64, original_quantity: u64, quantity: u64, is_bid: bool, owner: address): Order { - Order { - order_id: order_id_for_test(sequence_id, is_bid), - client_order_id, - price, - original_quantity, - quantity, - is_bid, - owner, - expire_timestamp: TIMESTAMP_INF, - self_matching_prevention: PREVENT_SELF_MATCHING_DEFAULT - } - } - - #[test_only] - public fun test_construct_order_with_expiration( - sequence_id: u64, - client_order_id: u64, - price: u64, - original_quantity: u64, - quantity: u64, - is_bid: bool, - owner: address, - expire_timestamp: u64 - ): Order { - Order { - order_id: order_id_for_test(sequence_id, is_bid), - client_order_id, - price, - original_quantity, - quantity, - is_bid, - owner, - expire_timestamp, - self_matching_prevention: PREVENT_SELF_MATCHING_DEFAULT - } - } - - #[test_only] - public fun check_usr_open_orders( - usr_open_orders: &LinkedTable, - usr_open_orders_cmp: &vector, - ) { - assert!(2 * linked_table::length(usr_open_orders) == vector::length(usr_open_orders_cmp), 0); - let mut i_order = 0; - while (i_order < vector::length(usr_open_orders_cmp)) { - let order_id = *vector::borrow(usr_open_orders_cmp, i_order); - i_order = i_order + 1; - assert!(linked_table::contains(usr_open_orders, order_id), 0); - let price_cmp = *vector::borrow(usr_open_orders_cmp, i_order); - let price = *linked_table::borrow(usr_open_orders, order_id); - assert!(price_cmp == price, ENotEqual); - i_order = i_order + 1; - }; - } - - #[test_only] - public fun test_remove_order( - pool: &mut Pool, - tick_index: u64, - sequence_id: u64, - is_bid: bool, - owner: address, - ): Order { - let order; - if (is_bid) { - order = remove_order( - &mut pool.bids, - borrow_mut(&mut pool.usr_open_orders, owner), - tick_index, - order_id_for_test(sequence_id, is_bid), - owner - ) - } else { - order = remove_order( - &mut pool.asks, - borrow_mut(&mut pool.usr_open_orders, owner), - tick_index, - order_id_for_test(sequence_id, is_bid), - owner - ) - }; - order - } - - #[test] - #[expected_failure(abort_code = EInvalidRestriction)] - fun test_place_limit_order_with_invalid_restrictions_() { - let owner: address = @0xAAAA; - let alice: address = @0xBBBB; - let mut test = test_scenario::begin(owner); - test_scenario::next_tx(&mut test, owner); - { - setup_test(0, 0, &mut test, owner); - }; - test_scenario::next_tx(&mut test, alice); - { - mint_account_cap_transfer( - alice, - test_scenario::ctx(&mut test) - ); - }; - test_scenario::next_tx(&mut test, alice); - { - let mut pool = test_scenario::take_shared>(&test); - let clock = test_scenario::take_shared(&test); - let account_cap = test_scenario::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - custodian::deposit( - &mut pool.base_custodian, - mint_for_testing(1000 * 100000000, test_scenario::ctx(&mut test)), - account_cap_user - ); - custodian::deposit( - &mut pool.quote_custodian, - mint_for_testing(10000 * 100000000, test_scenario::ctx(&mut test)), - account_cap_user - ); - place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 200 * 100000000, - PREVENT_SELF_MATCHING_DEFAULT, - true, - TIMESTAMP_INF, - 5, - &clock, - &account_cap, - test_scenario::ctx(&mut test) - ); - test_scenario::return_shared(pool); - test_scenario::return_shared(clock); - test_scenario::return_to_address(alice, account_cap); - }; - - test_scenario::end(test); - } - - #[test] - #[expected_failure(abort_code = EOrderCannotBeFullyFilled)] - fun test_place_limit_order_with_restrictions_FILL_OR_KILL_() { - let owner: address = @0xAAAA; - let alice: address = @0xBBBB; - let bob: address = @0xCCCC; - let mut test = test_scenario::begin(owner); - test_scenario::next_tx(&mut test, owner); - { - setup_test(0, 0, &mut test, owner); - }; - test_scenario::next_tx(&mut test, alice); - { - mint_account_cap_transfer( - alice, - test_scenario::ctx(&mut test) - ); - }; - test_scenario::next_tx(&mut test, bob); - { - mint_account_cap_transfer( - bob, - test_scenario::ctx(&mut test) - ); - }; - test_scenario::next_tx(&mut test, alice); - { - let mut pool = test_scenario::take_shared>(&test); - let clock = test_scenario::take_shared(&test); - let account_cap = test_scenario::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - custodian::deposit( - &mut pool.base_custodian, - mint_for_testing(1000 * 100000000, test_scenario::ctx(&mut test)), - account_cap_user - ); - custodian::deposit( - &mut pool.quote_custodian, - mint_for_testing(10000 * 100000000, test_scenario::ctx(&mut test)), - account_cap_user - ); - place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 200 * 100000000, - PREVENT_SELF_MATCHING_DEFAULT, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - test_scenario::ctx(&mut test) - ); - place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 4 * FLOAT_SCALING, - 200 * 100000000, - PREVENT_SELF_MATCHING_DEFAULT, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - test_scenario::ctx(&mut test) - ); - place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 4 * FLOAT_SCALING, - 200 * 100000000, - PREVENT_SELF_MATCHING_DEFAULT, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - test_scenario::ctx(&mut test) - ); - place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 10 * FLOAT_SCALING, - 1000 * 100000000, - PREVENT_SELF_MATCHING_DEFAULT, - false, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - test_scenario::ctx(&mut test) - ); - let (next_bid_order_id, next_ask_order_id, _, _) = get_pool_stat(&pool); - assert!(next_bid_order_id == order_id_for_test(3, true), 0); - assert!(next_ask_order_id == order_id_for_test(1, false), 0); - custodian::assert_user_balance( - &pool.quote_custodian, - account_cap_user, - 7400 * 100000000, - 2600 * 100000000 - ); - custodian::assert_user_balance(&pool.base_custodian, account_cap_user, 0, 1000 * 100000000); - test_scenario::return_shared(pool); - test_scenario::return_shared(clock); - test_scenario::return_to_address(alice, account_cap); - }; - - test_scenario::next_tx(&mut test, bob); - { - let mut pool = test_scenario::take_shared>(&test); - let clock = test_scenario::take_shared(&test); - let account_cap = test_scenario::take_from_address(&test, bob); - let account_cap_user = account_owner(&account_cap); - custodian::deposit( - &mut pool.base_custodian, - mint_for_testing(900 * 100000000, test_scenario::ctx(&mut test)), - account_cap_user - ); - custodian::assert_user_balance(&pool.base_custodian, account_cap_user, 900 * 100000000, 0); - place_limit_order( - &mut pool, - CLIENT_ID_BOB, - 4 * FLOAT_SCALING, - 601 * 100000000, - PREVENT_SELF_MATCHING_DEFAULT, - false, - TIMESTAMP_INF, - FILL_OR_KILL, - &clock, - &account_cap, - test_scenario::ctx(&mut test) - ); - custodian::assert_user_balance(&pool.quote_custodian, account_cap_user, 900 * 100000000, 0); - test_scenario::return_shared(pool); - test_scenario::return_shared(clock); - test_scenario::return_to_address(bob, account_cap); - }; - test_scenario::end(test); - } - - #[test] - #[expected_failure(abort_code = EOrderCannotBeFullyPassive)] - fun test_place_limit_order_with_restrictions_E_ORDER_CANNOT_BE_FULLY_PASSIVE_() { - let owner: address = @0xAAAA; - let alice: address = @0xBBBB; - let bob: address = @0xCCCC; - let mut test = test_scenario::begin(owner); - test_scenario::next_tx(&mut test, owner); - { - setup_test(0, 0, &mut test, owner); - }; - test_scenario::next_tx(&mut test, alice); - { - mint_account_cap_transfer( - alice, - test_scenario::ctx(&mut test) - ); - }; - test_scenario::next_tx(&mut test, bob); - { - mint_account_cap_transfer( - bob, - test_scenario::ctx(&mut test) - ); - }; - test_scenario::next_tx(&mut test, alice); - { - let mut pool = test_scenario::take_shared>(&test); - let clock = test_scenario::take_shared(&test); - let account_cap = test_scenario::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - custodian::deposit( - &mut pool.base_custodian, - mint_for_testing(1000 * 100000000, test_scenario::ctx(&mut test)), - account_cap_user - ); - custodian::deposit( - &mut pool.quote_custodian, - mint_for_testing(10000 * 100000000, test_scenario::ctx(&mut test)), - account_cap_user - ); - place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 200 * 100000000, - PREVENT_SELF_MATCHING_DEFAULT, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - test_scenario::ctx(&mut test) - ); - place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 4 * FLOAT_SCALING, - 200 * 100000000, - PREVENT_SELF_MATCHING_DEFAULT, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - test_scenario::ctx(&mut test) - ); - place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 4 * FLOAT_SCALING, - 200 * 100000000, - PREVENT_SELF_MATCHING_DEFAULT, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - test_scenario::ctx(&mut test) - ); - place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 10 * FLOAT_SCALING, - 1000 * 100000000, - PREVENT_SELF_MATCHING_DEFAULT, - false, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - test_scenario::ctx(&mut test) - ); - let (next_bid_order_id, next_ask_order_id, _, _) = get_pool_stat(&pool); - assert!(next_bid_order_id == order_id_for_test(3, true), 0); - assert!(next_ask_order_id == order_id_for_test(1, false), 0); - custodian::assert_user_balance( - &pool.quote_custodian, - account_cap_user, - 7400 * 100000000, - 2600 * 100000000 - ); - custodian::assert_user_balance(&pool.base_custodian, account_cap_user, 0, 1000 * 100000000); - test_scenario::return_shared(pool); - test_scenario::return_shared(clock); - test_scenario::return_to_address(alice, account_cap); - }; - - test_scenario::next_tx(&mut test, bob); - { - let mut pool = test_scenario::take_shared>(&test); - let clock = test_scenario::take_shared(&test); - let account_cap = test_scenario::take_from_address(&test, bob); - let account_cap_user = account_owner(&account_cap); - custodian::deposit( - &mut pool.base_custodian, - mint_for_testing(900 * 100000000, test_scenario::ctx(&mut test)), - account_cap_user - ); - custodian::assert_user_balance(&pool.base_custodian, account_cap_user, 900 * 100000000, 0); - place_limit_order( - &mut pool, - CLIENT_ID_BOB, - 4 * FLOAT_SCALING, - 601 * 100000000, - PREVENT_SELF_MATCHING_DEFAULT, - false, - TIMESTAMP_INF, - POST_OR_ABORT, - &clock, - &account_cap, - test_scenario::ctx(&mut test) - ); - custodian::assert_user_balance(&pool.base_custodian, account_cap_user, 900 * 100000000, 0); - test_scenario::return_shared(pool); - test_scenario::return_shared(clock); - test_scenario::return_to_address(bob, account_cap); - }; - test_scenario::end(test); - } - - #[test] - fun test_place_limit_order_with_restrictions_IMMEDIATE_OR_CANCEL() { - let owner: address = @0xAAAA; - let alice: address = @0xBBBB; - let bob: address = @0xCCCC; - let mut test = test_scenario::begin(owner); - test_scenario::next_tx(&mut test, owner); - { - setup_test(0, 0, &mut test, owner); - }; - test_scenario::next_tx(&mut test, alice); - { - mint_account_cap_transfer( - alice, - test_scenario::ctx(&mut test) - ); - }; - test_scenario::next_tx(&mut test, bob); - { - mint_account_cap_transfer( - bob, - test_scenario::ctx(&mut test) - ); - }; - test_scenario::next_tx(&mut test, alice); - { - let mut pool = test_scenario::take_shared>(&test); - let clock = test_scenario::take_shared(&test); - let account_cap = test_scenario::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - custodian::deposit( - &mut pool.base_custodian, - mint_for_testing(1000 * 100000000, test_scenario::ctx(&mut test)), - account_cap_user - ); - custodian::deposit( - &mut pool.quote_custodian, - mint_for_testing(10000 * 100000000, test_scenario::ctx(&mut test)), - account_cap_user - ); - place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 200 * 100000000, - PREVENT_SELF_MATCHING_DEFAULT, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - test_scenario::ctx(&mut test) - ); - place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 4 * FLOAT_SCALING, - 200 * 100000000, - PREVENT_SELF_MATCHING_DEFAULT, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - test_scenario::ctx(&mut test) - ); - place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 4 * FLOAT_SCALING, - 200 * 100000000, - PREVENT_SELF_MATCHING_DEFAULT, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - test_scenario::ctx(&mut test) - ); - - let (base_filled, quote_filled, maker_injected, maker_order_id) = place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 10 * FLOAT_SCALING, - 1000 * 100000000, - PREVENT_SELF_MATCHING_DEFAULT, - false, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - test_scenario::ctx(&mut test) - ); - assert!(base_filled == 0); - assert!(quote_filled == 0); - assert!(maker_injected); - assert!(maker_order_id == order_id_for_test(0, false)); - - let (next_bid_order_id, next_ask_order_id, _, _) = get_pool_stat(&pool); - assert!(next_bid_order_id == order_id_for_test(3, true), 0); - assert!(next_ask_order_id == order_id_for_test(1, false), 0); - custodian::assert_user_balance( - &pool.quote_custodian, - account_cap_user, - 7400 * 100000000, - 2600 * 100000000 - ); - custodian::assert_user_balance(&pool.base_custodian, account_cap_user, 0, 1000 * 100000000); - test_scenario::return_shared(pool); - test_scenario::return_shared(clock); - test_scenario::return_to_address(alice, account_cap); - }; - - test_scenario::next_tx(&mut test, bob); - { - let mut pool = test_scenario::take_shared>(&test); - let clock = test_scenario::take_shared(&test); - let account_cap = test_scenario::take_from_address(&test, bob); - let account_cap_user = account_owner(&account_cap); - custodian::deposit( - &mut pool.base_custodian, - mint_for_testing(900 * 100000000, test_scenario::ctx(&mut test)), - account_cap_user - ); - custodian::assert_user_balance(&pool.base_custodian, account_cap_user, 900 * 100000000, 0); - - let (base_filled, quote_filled, maker_injected, _) = place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 4 * FLOAT_SCALING, - 800 * 100000000, - PREVENT_SELF_MATCHING_DEFAULT, - false, - TIMESTAMP_INF, - IMMEDIATE_OR_CANCEL, - &clock, - &account_cap, - test_scenario::ctx(&mut test) - ); - assert!(base_filled == 600 * 100000000); - assert!(quote_filled == 2600 * 100000000); - assert!(!maker_injected); - - custodian::assert_user_balance(&pool.base_custodian, account_cap_user, 300 * 100000000, 0); - { - let (_, _, bids, _) = get_pool_stat(&pool); - check_empty_tick_level(bids, 4 * FLOAT_SCALING); - }; - test_scenario::return_shared(pool); - test_scenario::return_shared(clock); - test_scenario::return_to_address(bob, account_cap); - }; - test_scenario::end(test); - } - - #[test] - #[expected_failure(abort_code = EInvalidPair)] - fun test_create_pool_invalid_pair() { - let owner: address = @0xAAAA; - let mut test = test_scenario::begin(owner); - test_scenario::next_tx(&mut test, owner); - { - setup_test(0, 0, &mut test, owner); - }; - // create pool which is already exist fail - test_scenario::next_tx(&mut test, owner); - { - create_pool_( - REFERENCE_TAKER_FEE_RATE, - REFERENCE_MAKER_REBATE_RATE, - 1 * FLOAT_SCALING, - 1, - balance::create_for_testing(FEE_AMOUNT_FOR_CREATE_POOL), - test_scenario::ctx(&mut test) - ); - }; - test_scenario::end(test); - } - - #[test] - #[expected_failure(abort_code = EInvalidTickSizeLotSize)] - fun test_create_pool_invalid_tick_size_lot_size() { - let owner: address = @0xAAAA; - let mut test = test_scenario::begin(owner); - test_scenario::next_tx(&mut test, owner); - { - setup_test(0, 0, &mut test, owner); - }; - // create pool which is already exist fail - test_scenario::next_tx(&mut test, owner); - { - create_pool_( - REFERENCE_TAKER_FEE_RATE, - REFERENCE_MAKER_REBATE_RATE, - 100_000, - 5, - balance::create_for_testing(FEE_AMOUNT_FOR_CREATE_POOL), - test_scenario::ctx(&mut test) - ); - }; - test_scenario::end(test); - } - - // Ensure that the custodian's locked balance matches the sum of all values for a given account - // Assumption: custodian has only placed orders in the given pool--if they have orders in other pools, the locked balance will be too small - #[test_only] - public fun check_balance_invariants_for_account( - account_cap: &AccountCap, - quote_custodian: &Custodian, - base_custodian: &Custodian, - pool: &Pool - ) { - let account_cap_user = custodian::account_owner(account_cap); - let quote_account_locked_balance = custodian::account_locked_balance(quote_custodian, account_cap_user); - let base_account_locked_balance = custodian::account_locked_balance(base_custodian, account_cap_user); - let usr_open_order_ids = table::borrow(&pool.usr_open_orders, account_cap_user); - - let mut quote_asset_amount = 0; - let mut base_asset_amount = 0; - let mut curr = linked_table::front(usr_open_order_ids); - - while (option::is_some(curr)) { - let order_id = *option::borrow(curr); - let order = get_order_status(pool, order_id, account_cap); - let (_is_round_down, total_balance) = clob_math::unsafe_mul_round(order.price, order.quantity); - if (order.is_bid) { - quote_asset_amount = quote_asset_amount + total_balance; - } else { - // For base swaps we actually only need the order quantity - base_asset_amount = base_asset_amount + order.quantity; - }; - curr = linked_table::next(usr_open_order_ids, order_id); - }; - assert!(quote_asset_amount == quote_account_locked_balance, 0); - assert!(base_asset_amount == base_account_locked_balance, 0); - } -} diff --git a/crates/iota-framework/packages/deepbook/sources/critbit.move b/crates/iota-framework/packages/deepbook/sources/critbit.move deleted file mode 100644 index 060cc688816..00000000000 --- a/crates/iota-framework/packages/deepbook/sources/critbit.move +++ /dev/null @@ -1,453 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -module deepbook::critbit { - use iota::table::{Self, Table}; - use deepbook::math::{count_leading_zeros}; - - // <<<<<<<<<<<<<<<<<<<<<<<< Error codes <<<<<<<<<<<<<<<<<<<<<<<< - const EExceedCapacity: u64 = 2; - const ETreeNotEmpty: u64 = 3; - const EKeyAlreadyExist: u64 = 4; - const ELeafNotExist: u64 = 5; - const EIndexOutOfRange: u64 = 7; - const ENullParent: u64 = 8; - // <<<<<<<<<<<<<<<<<<<<<<<< Error codes <<<<<<<<<<<<<<<<<<<<<<<< - - - // <<<<<<<<<<<<<<<<<<<<<<<< Constants <<<<<<<<<<<<<<<<<<<<<<<< - const PARTITION_INDEX: u64 = 0x8000000000000000; // 9223372036854775808 - const MAX_U64: u64 = 0xFFFFFFFFFFFFFFFF; // 18446744073709551615 - const MAX_CAPACITY: u64 = 0x7FFFFFFFFFFFFFFF; - // <<<<<<<<<<<<<<<<<<<<<<<< Constants <<<<<<<<<<<<<<<<<<<<<<<< - - public struct Leaf has store, drop { - key: u64, - value: V, - parent: u64, - } - - public struct InternalNode has store, drop { - mask: u64, - left_child: u64, - right_child: u64, - // We keep track of the parent node to make it easier to traverse the tree to retrieve the previous or the next leaf. - parent: u64, - } - - // Leaves of the Critbit Tree are sorted in ascending order. - public struct CritbitTree has store { - root: u64, - internal_nodes: Table, - // A leaf contains orders at that price level. - leaves: Table>, - min_leaf: u64, - max_leaf: u64, - next_internal_node_index: u64, - next_leaf_index: u64 - } - - public(package) fun new(ctx: &mut TxContext): CritbitTree { - CritbitTree { - root: PARTITION_INDEX, - internal_nodes: table::new(ctx), - leaves: table::new(ctx), - min_leaf: PARTITION_INDEX, - max_leaf: PARTITION_INDEX, - next_internal_node_index: 0, - next_leaf_index: 0 - } - } - - public(package) fun size(tree: &CritbitTree): u64 { - table::length(&tree.leaves) - } - - public(package) fun is_empty(tree: &CritbitTree): bool { - table::is_empty(&tree.leaves) - } - - // Return (key, index) the leaf with minimum value. - // A market buy order will start consuming liquidty from the min leaf. - public fun min_leaf(tree: &CritbitTree): (u64, u64) { - assert!(!is_empty(tree), ELeafNotExist); - let min_leaf = table::borrow(&tree.leaves, tree.min_leaf); - return (min_leaf.key, tree.min_leaf) - } - - // Return (key, index) the leaf with maximum value. - // A market sell order will start consuming liquidity from the max leaf. - public fun max_leaf(tree: &CritbitTree): (u64, u64) { - assert!(!is_empty(tree), ELeafNotExist); - let max_leaf = table::borrow(&tree.leaves, tree.max_leaf); - return (max_leaf.key, tree.max_leaf) - } - - // Return the previous leaf (key, index) of the input leaf. - // Market sell orders consume liquidities by iterating through the leaves in descending order starting from the max leaf of the asks Critbit Tree. - // This function provides the iterator for this procedure. - public fun previous_leaf(tree: &CritbitTree, key: u64): (u64, u64) { - let (_, mut index) = find_leaf(tree, key); - assert!(index != PARTITION_INDEX, ELeafNotExist); - let mut ptr = MAX_U64 - index; - let mut parent = table::borrow(&tree.leaves, index).parent; - while (parent != PARTITION_INDEX && is_left_child(tree, parent, ptr)){ - ptr = parent; - parent = table::borrow(&tree.internal_nodes, ptr).parent; - }; - if(parent == PARTITION_INDEX) { - return (0, PARTITION_INDEX) - }; - index = MAX_U64 - right_most_leaf(tree, table::borrow(&tree.internal_nodes, parent).left_child); - let key = table::borrow(&tree.leaves, index).key; - return (key, index) - } - - // Return the next leaf (key, index) of the input leaf. - // Market buy orders consume liquidities by iterating through the leaves in ascending order starting from the min leaf of the asks Critbit Tree. - // This function provides the iterator for this procedure. - public fun next_leaf(tree: &CritbitTree, key: u64): (u64, u64) { - let (_, mut index) = find_leaf(tree, key); - assert!(index != PARTITION_INDEX, ELeafNotExist); - let mut ptr = MAX_U64 - index; - let mut parent = table::borrow(&tree.leaves, index).parent; - while (parent != PARTITION_INDEX && !is_left_child(tree, parent, ptr)){ - ptr = parent; - parent = table::borrow(&tree.internal_nodes, ptr).parent; - }; - if(parent == PARTITION_INDEX) { - return (0, PARTITION_INDEX) - }; - index = MAX_U64 - left_most_leaf(tree, table::borrow(&tree.internal_nodes, parent).right_child); - let key = table::borrow(&tree.leaves, index).key; - return (key, index) - } - - fun left_most_leaf(tree: &CritbitTree, root: u64): u64 { - let mut ptr = root; - while (ptr < PARTITION_INDEX){ - ptr = table::borrow(& tree.internal_nodes, ptr).left_child; - }; - ptr - } - - fun right_most_leaf(tree: &CritbitTree, root: u64): u64 { - let mut ptr = root; - while (ptr < PARTITION_INDEX){ - ptr = table::borrow(& tree.internal_nodes, ptr).right_child; - }; - ptr - } - - // Insert new leaf to the tree. - // Returns the index of the leaf. - // Called when a new order is being injected to the order book. - public(package) fun insert_leaf(tree: &mut CritbitTree, key: u64, value: V): u64 { - let new_leaf = Leaf{ - key, - value, - parent: PARTITION_INDEX, - }; - let new_leaf_index = tree.next_leaf_index; - tree.next_leaf_index = tree.next_leaf_index + 1; - assert!(new_leaf_index < MAX_CAPACITY - 1, EExceedCapacity); - table::add(&mut tree.leaves, new_leaf_index, new_leaf); - - let closest_leaf_index = get_closest_leaf_index_by_key(tree, key); - - // Handle the first insertion - if (closest_leaf_index == PARTITION_INDEX) { - assert!(new_leaf_index == 0, ETreeNotEmpty); - tree.root = MAX_U64 - new_leaf_index; - tree.min_leaf = new_leaf_index; - tree.max_leaf = new_leaf_index; - return 0 - }; - - let closest_key = table::borrow(&tree.leaves, closest_leaf_index).key; - assert!(closest_key != key, EKeyAlreadyExist); - - // Note that we reserve count_leading_zeros of form u128 for future use - let critbit = 64 - (count_leading_zeros((closest_key ^ key) as u128) - 64); - let new_mask = 1u64 << (critbit - 1); - - let new_internal_node= InternalNode { - mask: new_mask, - left_child: PARTITION_INDEX, - right_child: PARTITION_INDEX, - parent: PARTITION_INDEX, - }; - let new_internal_node_index = tree.next_internal_node_index; - tree.next_internal_node_index = tree.next_internal_node_index + 1; - table::add(&mut tree.internal_nodes, new_internal_node_index, new_internal_node); - - let mut ptr = tree.root; - let mut new_internal_node_parent_index = PARTITION_INDEX; - // Search position of the new internal node - while (ptr < PARTITION_INDEX) { - let internal_node = table::borrow(&tree.internal_nodes, ptr); - if (new_mask > internal_node.mask) { - break - }; - new_internal_node_parent_index = ptr; - if (key & internal_node.mask == 0) { - ptr = internal_node.left_child; - } else { - ptr = internal_node.right_child; - }; - }; - - // Update the child info of new internal node's parent - if (new_internal_node_parent_index == PARTITION_INDEX){ - // if the new internal node is root - tree.root = new_internal_node_index; - } else{ - // In another case, we update the child field of the new internal node's parent - // And the parent field of the new internal node - let is_left_child = is_left_child(tree, new_internal_node_parent_index, ptr); - update_child(tree, new_internal_node_parent_index, new_internal_node_index, is_left_child); - }; - - // Finally, update the child field of the new internal node - let is_left_child = new_mask & key == 0; - update_child(tree, new_internal_node_index, MAX_U64 - new_leaf_index, is_left_child); - update_child(tree, new_internal_node_index, ptr, !is_left_child); - - if (table::borrow(&tree.leaves, tree.min_leaf).key > key) { - tree.min_leaf = new_leaf_index; - }; - if (table::borrow(&tree.leaves, tree.max_leaf).key < key) { - tree.max_leaf = new_leaf_index; - }; - new_leaf_index - } - - // Find the leaf from the tree. - // Returns true and the index of the leaf if exists. - public fun find_leaf(tree: & CritbitTree, key: u64): (bool, u64) { - if (is_empty(tree)) { - return (false, PARTITION_INDEX) - }; - let closest_leaf_index = get_closest_leaf_index_by_key(tree, key); - let closeset_leaf = table::borrow(&tree.leaves, closest_leaf_index); - if (closeset_leaf.key != key){ - return (false, PARTITION_INDEX) - } else{ - return (true, closest_leaf_index) - } - } - - public(package) fun find_closest_key(tree: & CritbitTree, key: u64): u64 { - if (is_empty(tree)) { - return 0 - }; - let closest_leaf_index = get_closest_leaf_index_by_key(tree, key); - let closeset_leaf = table::borrow(&tree.leaves, closest_leaf_index); - closeset_leaf.key - } - - public(package) fun remove_leaf_by_index(tree: &mut CritbitTree, index: u64): V { - let key = table::borrow(& tree.leaves, index).key; - if (tree.min_leaf == index) { - let (_, index) = next_leaf(tree, key); - tree.min_leaf = index; - }; - if (tree.max_leaf == index) { - let (_, index) = previous_leaf(tree, key); - tree.max_leaf = index; - }; - - let mut is_left_child_; - let Leaf {key: _, value, parent: removed_leaf_parent_index} = table::remove(&mut tree.leaves, index); - - if (size(tree) == 0) { - tree.root = PARTITION_INDEX; - tree.min_leaf = PARTITION_INDEX; - tree.max_leaf = PARTITION_INDEX; - tree.next_internal_node_index = 0; - tree.next_leaf_index = 0; - } else { - assert!(removed_leaf_parent_index != PARTITION_INDEX, EIndexOutOfRange); - let removed_leaf_parent = table::borrow(&tree.internal_nodes, removed_leaf_parent_index); - let removed_leaf_grand_parent_index = removed_leaf_parent.parent; - - // Note that sibling of the removed leaf can be a leaf or an internal node - is_left_child_ = is_left_child(tree, removed_leaf_parent_index, MAX_U64 - index); - let sibling_index = if (is_left_child_) { removed_leaf_parent.right_child } - else { removed_leaf_parent.left_child }; - - if (removed_leaf_grand_parent_index == PARTITION_INDEX) { - // Parent of the removed leaf is the tree root - // Update the parent of the sibling node and set sibling as the tree root - if (sibling_index < PARTITION_INDEX) { - // sibling is an internal node - table::borrow_mut(&mut tree.internal_nodes, sibling_index).parent = PARTITION_INDEX; - } else{ - // sibling is a leaf - table::borrow_mut(&mut tree.leaves, MAX_U64 - sibling_index).parent = PARTITION_INDEX; - }; - tree.root = sibling_index; - } else { - // grand parent of the removed leaf is a internal node - // set sibling as the child of the grand parent of the removed leaf - is_left_child_ = is_left_child(tree, removed_leaf_grand_parent_index, removed_leaf_parent_index); - update_child(tree, removed_leaf_grand_parent_index, sibling_index, is_left_child_); - }; - table::remove(&mut tree.internal_nodes, removed_leaf_parent_index); - }; - value - } - - public(package) fun borrow_mut_leaf_by_index(tree: &mut CritbitTree, index: u64): &mut V { - let entry = table::borrow_mut(&mut tree.leaves, index); - &mut entry.value - } - - public fun borrow_leaf_by_index(tree: & CritbitTree, index: u64): &V { - let entry = table::borrow(&tree.leaves, index); - &entry.value - } - - public fun borrow_leaf_by_key(tree: & CritbitTree, key: u64): &V { - let (is_exist, index) = find_leaf(tree, key); - assert!(is_exist, ELeafNotExist); - borrow_leaf_by_index(tree, index) - } - - public(package) fun drop(tree: CritbitTree) { - let CritbitTree { - root: _, - internal_nodes, - leaves, - min_leaf: _, - max_leaf: _, - next_internal_node_index: _, - next_leaf_index: _, - - } = tree; - table::drop(internal_nodes); - table::drop(leaves); - } - - public(package) fun destroy_empty(tree: CritbitTree) { - assert!(table::length(&tree.leaves) == 0, 0); - - let CritbitTree { - root: _, - leaves, - internal_nodes, - min_leaf: _, - max_leaf: _, - next_internal_node_index: _, - next_leaf_index: _ - } = tree; - - table::destroy_empty(leaves); - table::destroy_empty(internal_nodes); - } - - // function for internal usage - fun get_closest_leaf_index_by_key(tree: &CritbitTree, key: u64): u64 { - let mut ptr = tree.root; - // if tree is empty, return the patrition index - if(ptr == PARTITION_INDEX) return PARTITION_INDEX; - while (ptr < PARTITION_INDEX){ - let node = table::borrow(&tree.internal_nodes, ptr); - if (key & node.mask == 0){ - ptr = node.left_child; - } else { - ptr = node.right_child; - } - }; - return (MAX_U64 - ptr) - } - - // new_child can be either internal node or leaf - fun update_child(tree: &mut CritbitTree, parent_index: u64, new_child: u64, is_left_child: bool) { - assert!(parent_index != PARTITION_INDEX, ENullParent); - if (is_left_child) { - table::borrow_mut(&mut tree.internal_nodes, parent_index).left_child = new_child; - } else{ - table::borrow_mut(&mut tree.internal_nodes, parent_index).right_child = new_child; - }; - if (new_child > PARTITION_INDEX) { - table::borrow_mut(&mut tree.leaves, MAX_U64 - new_child).parent = parent_index; - } else { - table::borrow_mut(&mut tree.internal_nodes, new_child).parent = parent_index; - } - } - - fun is_left_child(tree: &CritbitTree, parent_index: u64, index: u64): bool { - table::borrow(&tree.internal_nodes, parent_index).left_child == index - } - - #[test_only] - public fun new_leaf_for_test(key: u64, value: V, parent: u64): Leaf { - Leaf { - key, - value, - parent, - } - } - - #[test_only] - public fun new_internal_node_for_test(mask: u64, parent: u64, left_child: u64, right_child: u64): InternalNode { - InternalNode { - mask, - left_child, - right_child, - parent, - } - } - - #[test_only] - public fun check_tree_struct ( - tree: &CritbitTree, - internal_node_keys: &vector, - internal_node: &vector, - leaves_keys: &vector, - leaves: &vector>, - root: u64, - min_leaf: u64, - max_leaf: u64 - ): bool { - assert!(vector::length(internal_node_keys) == vector::length(internal_node)); - assert!(vector::length(leaves_keys) == vector::length(leaves)); - if (tree.root != root || tree.min_leaf != min_leaf || tree.max_leaf != max_leaf) { - return false - }; - let internal_node_from_tree = &tree.internal_nodes; - let leaves_from_tree = &tree.leaves; - let mut i = 0; - let mut is_equal = true; - while (i < vector::length(internal_node_keys)) { - let key = *vector::borrow(internal_node_keys, i); - if (table::borrow(internal_node_from_tree, key) != vector::borrow(internal_node, i)) { - is_equal = false; - break - }; - i = i + 1; - }; - i = 0; - while (i < vector::length(leaves_keys)) { - let key = *vector::borrow(leaves_keys, i); - if (table::borrow(leaves_from_tree, key) != vector::borrow(leaves, i)) { - is_equal = false; - break - }; - i = i + 1; - }; - is_equal - } - - #[test_only] - public fun check_empty_tree(tree: &CritbitTree) { - assert!(table::is_empty(&tree.leaves)); - assert!(table::is_empty(&tree.internal_nodes)); - assert!(tree.root == PARTITION_INDEX); - assert!(tree.min_leaf == PARTITION_INDEX); - assert!(tree.max_leaf == PARTITION_INDEX); - } - -} diff --git a/crates/iota-framework/packages/deepbook/sources/custodian.move b/crates/iota-framework/packages/deepbook/sources/custodian.move deleted file mode 100644 index cceeae9693a..00000000000 --- a/crates/iota-framework/packages/deepbook/sources/custodian.move +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -module deepbook::custodian { - use iota::balance::{Self, Balance, split}; - use iota::coin::{Self, Coin}; - use iota::table::{Self, Table}; - - // <<<<<<<<<<<<<<<<<<<<<<<< Error codes <<<<<<<<<<<<<<<<<<<<<<<< - #[test_only] - const EUserBalanceDoesNotExist: u64 = 1; - // <<<<<<<<<<<<<<<<<<<<<<<< Error codes <<<<<<<<<<<<<<<<<<<<<<<< - - public struct Account has store { - available_balance: Balance, - locked_balance: Balance, - } - - public struct AccountCap has key, store { id: UID } - - // Custodian for limit orders. - public struct Custodian has key, store { - id: UID, - /// Map from an AccountCap object ID to an Account object - account_balances: Table>, - } - - /// Create an `AccountCap` that can be used across all DeepBook pool - public fun mint_account_cap(ctx: &mut TxContext): AccountCap { - AccountCap { id: object::new(ctx) } - } - - public(package) fun account_balance( - custodian: &Custodian, - user: ID - ): (u64, u64) { - // if custodian account is not created yet, directly return (0, 0) rather than abort - if (!table::contains(&custodian.account_balances, user)) { - return (0, 0) - }; - let account_balances = table::borrow(&custodian.account_balances, user); - let avail_balance = balance::value(&account_balances.available_balance); - let locked_balance = balance::value(&account_balances.locked_balance); - (avail_balance, locked_balance) - } - - public(package) fun new(ctx: &mut TxContext): Custodian { - Custodian { - id: object::new(ctx), - account_balances: table::new(ctx), - } - } - - public(package) fun withdraw_asset( - custodian: &mut Custodian, - quantity: u64, - account_cap: &AccountCap, - ctx: &mut TxContext - ): Coin { - coin::from_balance(decrease_user_available_balance(custodian, account_cap, quantity), ctx) - } - - public(package) fun increase_user_available_balance( - custodian: &mut Custodian, - user: ID, - quantity: Balance, - ) { - let account = borrow_mut_account_balance(custodian, user); - balance::join(&mut account.available_balance, quantity); - } - - public(package) fun decrease_user_available_balance( - custodian: &mut Custodian, - account_cap: &AccountCap, - quantity: u64, - ): Balance { - let account = borrow_mut_account_balance(custodian, object::uid_to_inner(&account_cap.id)); - balance::split(&mut account.available_balance, quantity) - } - - public(package) fun increase_user_locked_balance( - custodian: &mut Custodian, - account_cap: &AccountCap, - quantity: Balance, - ) { - let account = borrow_mut_account_balance(custodian, object::uid_to_inner(&account_cap.id)); - balance::join(&mut account.locked_balance, quantity); - } - - public(package) fun decrease_user_locked_balance( - custodian: &mut Custodian, - user: ID, - quantity: u64, - ): Balance { - let account = borrow_mut_account_balance(custodian, user); - split(&mut account.locked_balance, quantity) - } - - /// Move `quantity` from the unlocked balance of `user` to the locked balance of `user` - public(package) fun lock_balance( - custodian: &mut Custodian, - account_cap: &AccountCap, - quantity: u64, - ) { - let to_lock = decrease_user_available_balance(custodian, account_cap, quantity); - increase_user_locked_balance(custodian, account_cap, to_lock); - } - - /// Move `quantity` from the locked balance of `user` to the unlocked balacne of `user` - public(package) fun unlock_balance( - custodian: &mut Custodian, - user: ID, - quantity: u64, - ) { - let locked_balance = decrease_user_locked_balance(custodian, user, quantity); - increase_user_available_balance(custodian, user, locked_balance) - } - - public(package) fun account_available_balance( - custodian: &Custodian, - user: ID, - ): u64 { - balance::value(&table::borrow(&custodian.account_balances, user).available_balance) - } - - public(package) fun account_locked_balance( - custodian: &Custodian, - user: ID, - ): u64 { - balance::value(&table::borrow(&custodian.account_balances, user).locked_balance) - } - - fun borrow_mut_account_balance( - custodian: &mut Custodian, - user: ID, - ): &mut Account { - if (!table::contains(&custodian.account_balances, user)) { - table::add( - &mut custodian.account_balances, - user, - Account { available_balance: balance::zero(), locked_balance: balance::zero() } - ); - }; - table::borrow_mut(&mut custodian.account_balances, user) - } - - #[test_only] - fun borrow_account_balance( - custodian: &Custodian, - user: ID, - ): &Account { - assert!( - table::contains(&custodian.account_balances, user), - EUserBalanceDoesNotExist - ); - table::borrow(&custodian.account_balances, user) - } - - #[test_only] - use iota::test_scenario::{Self, Scenario, take_shared, take_from_sender, ctx}; - #[test_only] - use iota::coin::{mint_for_testing}; - #[test_only] - use iota::test_utils::assert_eq; - #[test_only] - const ENull: u64 = 0; - - #[test_only] - public struct USD {} - - #[test_only] - public(package) fun assert_user_balance( - custodian: &Custodian, - user: ID, - available_balance: u64, - locked_balance: u64, - ) { - let user_balance = borrow_account_balance(custodian, user); - assert!(balance::value(&user_balance.available_balance) == available_balance, ENull); - assert!(balance::value(&user_balance.locked_balance) == locked_balance, ENull) - } - - #[test_only] - fun setup_test( - scenario: &mut Scenario, - ) { - transfer::share_object>(new(test_scenario::ctx(scenario))); - } - - #[test_only] - public(package) fun test_increase_user_available_balance( - custodian: &mut Custodian, - user: ID, - quantity: u64, - ) { - increase_user_available_balance(custodian, user, balance::create_for_testing(quantity)); - } - - #[test_only] - public(package) fun deposit( - custodian: &mut Custodian, - coin: Coin, - user: ID - ) { - increase_user_available_balance(custodian, user, coin::into_balance(coin)); - } - - #[test] - #[expected_failure(abort_code = EUserBalanceDoesNotExist)] - fun test_user_balance_does_not_exist(){ - let owner: address = @0xAAAA; - let bob: address = @0xBBBB; - let mut test = test_scenario::begin(owner); - test_scenario::next_tx(&mut test, owner); - { - setup_test(&mut test); - transfer::public_transfer(mint_account_cap(ctx(&mut test)), bob); - }; - test_scenario::next_tx(&mut test, bob); - { - let custodian = take_shared>(&test); - let account_cap = take_from_sender(&test); - let account_cap_user = object::id(&account_cap); - let _ = borrow_account_balance(&custodian, account_cap_user); - test_scenario::return_to_sender(&test, account_cap); - test_scenario::return_shared(custodian); - - }; - test_scenario::end(test); - } - - #[test] - fun test_account_balance() { - let owner: address = @0xAAAA; - let bob: address = @0xBBBB; - let mut test = test_scenario::begin(owner); - test_scenario::next_tx(&mut test, owner); - { - setup_test(&mut test); - transfer::public_transfer(mint_account_cap(ctx(&mut test)), bob); - }; - test_scenario::next_tx(&mut test, bob); - { - let custodian = take_shared>(&test); - let account_cap = take_from_sender(&test); - let account_cap_user = object::id(&account_cap); - let (asset_available, asset_locked) = account_balance(&custodian, account_cap_user); - assert_eq(asset_available, 0); - assert_eq(asset_locked, 0); - test_scenario::return_to_sender(&test, account_cap); - test_scenario::return_shared(custodian); - - }; - test_scenario::next_tx(&mut test, bob); - { - let mut custodian = take_shared>(&test); - let account_cap = take_from_sender(&test); - let account_cap_user = object::id(&account_cap); - deposit(&mut custodian, mint_for_testing(10000, ctx(&mut test)), account_cap_user); - let (asset_available, mut asset_locked) = account_balance(&custodian, account_cap_user); - assert_eq(asset_available, 10000); - assert_eq(asset_locked, 0); - asset_locked = account_locked_balance(&custodian, account_cap_user); - assert_eq(asset_locked, 0); - test_scenario::return_to_sender(&test, account_cap); - test_scenario::return_shared(custodian); - }; - test_scenario::end(test); - } -} diff --git a/crates/iota-framework/packages/deepbook/sources/custodian_v2.move b/crates/iota-framework/packages/deepbook/sources/custodian_v2.move deleted file mode 100644 index b17953f0e48..00000000000 --- a/crates/iota-framework/packages/deepbook/sources/custodian_v2.move +++ /dev/null @@ -1,338 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -module deepbook::custodian_v2 { - use iota::balance::{Self, Balance, split}; - use iota::coin::{Self, Coin}; - use iota::table::{Self, Table}; - - // <<<<<<<<<<<<<<<<<<<<<<<< Error codes <<<<<<<<<<<<<<<<<<<<<<<< - #[test_only] - const EUserBalanceDoesNotExist: u64 = 1; - const EAdminAccountCapRequired: u64 = 2; - // <<<<<<<<<<<<<<<<<<<<<<<< Error codes <<<<<<<<<<<<<<<<<<<<<<<< - - public struct Account has store { - available_balance: Balance, - locked_balance: Balance, - } - - /// Capability granting permission to access an entry in `Custodian.account_balances`. - /// Calling `mint_account_cap` creates an "admin account cap" such that id == owner with - /// the permission to both access funds and create new `AccountCap`s. - /// Calling `create_child_account_cap` creates a "child account cap" such that id != owner - /// that can access funds, but cannot create new `AccountCap`s. - public struct AccountCap has key, store { - id: UID, - /// The owner of this AccountCap. Note: this is - /// derived from an object ID, not a user address - owner: address - } - - // Custodian for limit orders. - public struct Custodian has key, store { - id: UID, - /// Map from the owner address of AccountCap object to an Account object - account_balances: Table>, - } - - /// Create an admin `AccountCap` that can be used across all DeepBook pools, and has - /// the permission to create new `AccountCap`s that can access the same source of funds - public(package) fun mint_account_cap(ctx: &mut TxContext): AccountCap { - let id = object::new(ctx); - let owner = object::uid_to_address(&id); - AccountCap { id, owner } - } - - /// Create a "child account cap" such that id != owner - /// that can access funds, but cannot create new `AccountCap`s. - public fun create_child_account_cap(admin_account_cap: &AccountCap, ctx: &mut TxContext): AccountCap { - // Only the admin account cap can create new account caps - assert!(object::uid_to_address(&admin_account_cap.id) == admin_account_cap.owner, EAdminAccountCapRequired); - - AccountCap { - id: object::new(ctx), - owner: admin_account_cap.owner - } - } - - /// Destroy the given `account_cap` object - public fun delete_account_cap(account_cap: AccountCap) { - let AccountCap { id, owner: _ } = account_cap; - object::delete(id) - } - - /// Return the owner of an AccountCap - public fun account_owner(account_cap: &AccountCap): address { - account_cap.owner - } - - public(package) fun account_balance( - custodian: &Custodian, - owner: address - ): (u64, u64) { - // if custodian account is not created yet, directly return (0, 0) rather than abort - if (!table::contains(&custodian.account_balances, owner)) { - return (0, 0) - }; - let account_balances = table::borrow(&custodian.account_balances, owner); - let avail_balance = balance::value(&account_balances.available_balance); - let locked_balance = balance::value(&account_balances.locked_balance); - (avail_balance, locked_balance) - } - - public(package) fun new(ctx: &mut TxContext): Custodian { - Custodian { - id: object::new(ctx), - account_balances: table::new(ctx), - } - } - - public(package) fun withdraw_asset( - custodian: &mut Custodian, - quantity: u64, - account_cap: &AccountCap, - ctx: &mut TxContext - ): Coin { - coin::from_balance(decrease_user_available_balance(custodian, account_cap, quantity), ctx) - } - - public(package) fun increase_user_available_balance( - custodian: &mut Custodian, - owner: address, - quantity: Balance, - ) { - let account = borrow_mut_account_balance(custodian, owner); - balance::join(&mut account.available_balance, quantity); - } - - public(package) fun decrease_user_available_balance( - custodian: &mut Custodian, - account_cap: &AccountCap, - quantity: u64, - ): Balance { - let account = borrow_mut_account_balance(custodian, account_cap.owner); - balance::split(&mut account.available_balance, quantity) - } - - public(package) fun increase_user_locked_balance( - custodian: &mut Custodian, - account_cap: &AccountCap, - quantity: Balance, - ) { - let account = borrow_mut_account_balance(custodian, account_cap.owner); - balance::join(&mut account.locked_balance, quantity); - } - - public(package) fun decrease_user_locked_balance( - custodian: &mut Custodian, - owner: address, - quantity: u64, - ): Balance { - let account = borrow_mut_account_balance(custodian, owner); - split(&mut account.locked_balance, quantity) - } - - /// Move `quantity` from the unlocked balance of `user` to the locked balance of `user` - public(package) fun lock_balance( - custodian: &mut Custodian, - account_cap: &AccountCap, - quantity: u64, - ) { - let to_lock = decrease_user_available_balance(custodian, account_cap, quantity); - increase_user_locked_balance(custodian, account_cap, to_lock); - } - - /// Move `quantity` from the locked balance of `user` to the unlocked balance of `user` - public(package) fun unlock_balance( - custodian: &mut Custodian, - owner: address, - quantity: u64, - ) { - let locked_balance = decrease_user_locked_balance(custodian, owner, quantity); - increase_user_available_balance(custodian, owner, locked_balance) - } - - public(package) fun account_available_balance( - custodian: &Custodian, - owner: address, - ): u64 { - balance::value(&table::borrow(&custodian.account_balances, owner).available_balance) - } - - public(package) fun account_locked_balance( - custodian: &Custodian, - owner: address, - ): u64 { - balance::value(&table::borrow(&custodian.account_balances, owner).locked_balance) - } - - fun borrow_mut_account_balance( - custodian: &mut Custodian, - owner: address, - ): &mut Account { - if (!table::contains(&custodian.account_balances, owner)) { - table::add( - &mut custodian.account_balances, - owner, - Account { available_balance: balance::zero(), locked_balance: balance::zero() } - ); - }; - table::borrow_mut(&mut custodian.account_balances, owner) - } - - #[test_only] - fun borrow_account_balance( - custodian: &Custodian, - owner: address, - ): &Account { - assert!( - table::contains(&custodian.account_balances, owner), - EUserBalanceDoesNotExist - ); - table::borrow(&custodian.account_balances, owner) - } - - #[test_only] - use iota::test_scenario::{Self, Scenario, take_shared, take_from_sender, ctx}; - #[test_only] - use iota::coin::{mint_for_testing}; - #[test_only] - use iota::test_utils::{assert_eq, destroy}; - - #[test_only] - public struct USD {} - - #[test_only] - public(package) fun assert_user_balance( - custodian: &Custodian, - owner: address, - available_balance: u64, - locked_balance: u64, - ) { - let user_balance = borrow_account_balance(custodian, owner); - assert!(balance::value(&user_balance.available_balance) == available_balance); - assert!(balance::value(&user_balance.locked_balance) == locked_balance) - } - - #[test_only] - fun setup_test( - scenario: &mut Scenario, - ) { - transfer::share_object>(new(test_scenario::ctx(scenario))); - } - - #[test_only] - public(package) fun test_increase_user_available_balance( - custodian: &mut Custodian, - owner: address, - quantity: u64, - ) { - increase_user_available_balance(custodian, owner, balance::create_for_testing(quantity)); - } - - #[test_only] - public(package) fun deposit( - custodian: &mut Custodian, - coin: Coin, - owner: address, - ) { - increase_user_available_balance(custodian, owner, coin::into_balance(coin)); - } - - #[test] - #[expected_failure(abort_code = EUserBalanceDoesNotExist)] - fun test_user_balance_does_not_exist(){ - let owner: address = @0xAAAA; - let bob: address = @0xBBBB; - let mut test = test_scenario::begin(owner); - test_scenario::next_tx(&mut test, owner); - { - setup_test(&mut test); - transfer::public_transfer(mint_account_cap(ctx(&mut test)), bob); - }; - test_scenario::next_tx(&mut test, bob); - { - let custodian = take_shared>(&test); - let account_cap = take_from_sender(&test); - let _ = borrow_account_balance(&custodian, bob); - test_scenario::return_to_sender(&test, account_cap); - test_scenario::return_shared(custodian); - - }; - test_scenario::end(test); - } - - #[test] - fun test_account_balance() { - let owner: address = @0xAAAA; - let bob: address = @0xBBBB; - let mut test = test_scenario::begin(owner); - test_scenario::next_tx(&mut test, owner); - { - setup_test(&mut test); - transfer::public_transfer(mint_account_cap(ctx(&mut test)), bob); - }; - test_scenario::next_tx(&mut test, bob); - { - let custodian = take_shared>(&test); - let account_cap = take_from_sender(&test); - let (asset_available, asset_locked) = account_balance(&custodian, bob); - assert_eq(asset_available, 0); - assert_eq(asset_locked, 0); - test_scenario::return_to_sender(&test, account_cap); - test_scenario::return_shared(custodian); - - }; - test_scenario::next_tx(&mut test, bob); - { - let mut custodian = take_shared>(&test); - let account_cap = take_from_sender(&test); - deposit(&mut custodian, mint_for_testing(10000, ctx(&mut test)), bob); - let (asset_available, mut asset_locked) = account_balance(&custodian, bob); - assert_eq(asset_available, 10000); - assert_eq(asset_locked, 0); - asset_locked = account_locked_balance(&custodian, bob); - assert_eq(asset_locked, 0); - test_scenario::return_to_sender(&test, account_cap); - test_scenario::return_shared(custodian); - }; - test_scenario::end(test); - } - - #[test] - fun test_create_child_account_cap() { - let mut ctx = tx_context::dummy(); - let admin_cap = mint_account_cap(&mut ctx); - // check that we can duplicate child cap, and don't get another admin cap - let child_cap = create_child_account_cap(&admin_cap, &mut ctx); - assert_eq(child_cap.owner, admin_cap.owner); - assert!(&child_cap.id != &admin_cap.id); - - // check that both child and admin cap can access the funds - let mut custodian = new(&mut ctx); - increase_user_available_balance(&mut custodian, account_owner(&admin_cap), balance::create_for_testing(10000)); - let coin = decrease_user_available_balance(&mut custodian, &child_cap, 10000); - - destroy(admin_cap); - destroy(child_cap); - destroy(custodian); - destroy(coin); - } - - #[expected_failure(abort_code = EAdminAccountCapRequired)] - #[test] - fun test_cant_create_with_child() { - // a child cap cannot create an account cap - let mut ctx = tx_context::dummy(); - let admin_cap = mint_account_cap(&mut ctx); - // check that we can duplicate child cap, and don't get another admin cap - let child_cap1 = create_child_account_cap(&admin_cap, &mut ctx); - let child_cap2 = create_child_account_cap(&child_cap1, &mut ctx); // should abort - - destroy(admin_cap); - destroy(child_cap1); - destroy(child_cap2); - } -} diff --git a/crates/iota-framework/packages/deepbook/sources/math.move b/crates/iota-framework/packages/deepbook/sources/math.move deleted file mode 100644 index 7c334c468a0..00000000000 --- a/crates/iota-framework/packages/deepbook/sources/math.move +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -module deepbook::math { - /// scaling setting for float - const FLOAT_SCALING: u64 = 1_000_000_000; - const FLOAT_SCALING_U128: u128 = 1_000_000_000; - - // <<<<<<<<<<<<<<<<<<<<<<<< Error codes <<<<<<<<<<<<<<<<<<<<<<<< - const EUnderflow: u64 = 1; - // <<<<<<<<<<<<<<<<<<<<<<<< Error codes <<<<<<<<<<<<<<<<<<<<<<<< - - // multiply two floating numbers - public(package) fun unsafe_mul(x: u64, y: u64): u64 { - let (_, result) = unsafe_mul_round(x, y); - result - } - - // multiply two floating numbers - // also returns whether the result is rounded down - public(package) fun unsafe_mul_round(x: u64, y: u64): (bool, u64) { - let x = x as u128; - let y = y as u128; - let mut is_round_down = true; - if ((x * y) % FLOAT_SCALING_U128 == 0) is_round_down = false; - (is_round_down, (x * y / FLOAT_SCALING_U128) as u64) - } - - // multiply two floating numbers and assert the result is non zero - // Note that this function will still round down - public fun mul(x: u64, y: u64): u64 { - let (_, result) = unsafe_mul_round(x, y); - assert!(result > 0, EUnderflow); - result - } - - // multiply two floating numbers and assert the result is non zero - // also returns whether the result is rounded down - public fun mul_round(x: u64, y: u64): (bool, u64) { - let (is_round_down, result) = unsafe_mul_round(x, y); - assert!(result > 0, EUnderflow); - (is_round_down, result) - } - - // divide two floating numbers - public(package) fun unsafe_div(x: u64, y: u64): u64 { - let (_, result) = unsafe_div_round(x, y); - result - } - - // divide two floating numbers - // also returns whether the result is rounded down - public(package) fun unsafe_div_round(x: u64, y: u64): (bool, u64) { - let x = x as u128; - let y = y as u128; - let mut is_round_down = true; - if ((x * (FLOAT_SCALING as u128) % y) == 0) is_round_down = false; - (is_round_down, (x * (FLOAT_SCALING as u128) / y) as u64) - } - - // divide two floating numbers and assert the result is non zero - // also returns whether the result is rounded down - public fun div_round(x: u64, y: u64): (bool, u64) { - let (is_round_down, result) = unsafe_div_round(x, y); - assert!(result > 0, EUnderflow); - (is_round_down, result) - } - - public(package) fun count_leading_zeros(mut x: u128): u8 { - if (x == 0) { - 128 - } else { - let mut n: u8 = 0; - if (x & 0xFFFFFFFFFFFFFFFF0000000000000000 == 0) { - // x's higher 64 is all zero, shift the lower part over - x = x << 64; - n = n + 64; - }; - if (x & 0xFFFFFFFF000000000000000000000000 == 0) { - // x's higher 32 is all zero, shift the lower part over - x = x << 32; - n = n + 32; - }; - if (x & 0xFFFF0000000000000000000000000000 == 0) { - // x's higher 16 is all zero, shift the lower part over - x = x << 16; - n = n + 16; - }; - if (x & 0xFF000000000000000000000000000000 == 0) { - // x's higher 8 is all zero, shift the lower part over - x = x << 8; - n = n + 8; - }; - if (x & 0xF0000000000000000000000000000000 == 0) { - // x's higher 4 is all zero, shift the lower part over - x = x << 4; - n = n + 4; - }; - if (x & 0xC0000000000000000000000000000000 == 0) { - // x's higher 2 is all zero, shift the lower part over - x = x << 2; - n = n + 2; - }; - if (x & 0x80000000000000000000000000000000 == 0) { - n = n + 1; - }; - - n - } - } - - #[test_only] use iota::test_utils::assert_eq; - - #[test_only] - fun pow(mut base: u128, mut exponent: u8): u128 { - let mut res: u128 = 1; - while (exponent >= 1) { - if (exponent % 2 == 0) { - base = base * base; - exponent = exponent / 2; - } else { - res = res * base; - exponent = exponent - 1; - } - }; - res - } - - #[test] - fun test_count_leading_zeros() { - let mut i: u8 = 0; - while (i <= 127) { - assert_eq(count_leading_zeros(pow(2, i) as u128), 128 - i - 1); - i = i + 1; - }; - - while (i <= 127) { - assert_eq(count_leading_zeros(pow(2, i) as u128 + 1), 128 - i - 1); - i = i + 1; - }; - assert_eq(count_leading_zeros(0), 128); - } - - #[test] - fun test_mul() { - assert_eq(unsafe_mul(1_000_000_000, 1), 1); - assert_eq(unsafe_mul(9_999_999_999, 1), 9); - assert_eq(unsafe_mul(9_000_000_000, 1), 9); - } - - #[test] - #[expected_failure(abort_code = EUnderflow)] - fun test_mul_underflow() { - mul(999_999_999, 1); - } - - #[test] - #[expected_failure(abort_code = EUnderflow)] - fun test_mul_round_check_underflow() { - mul_round(999_999_999, 1); - } - - #[test] - fun test_mul_round() { - let (mut is_round, mut result) = unsafe_mul_round(1_000_000_000, 1); - assert_eq(is_round, false); - assert_eq(result, 1); - (is_round, result) = unsafe_mul_round(9_999_999_999, 1); - assert_eq(is_round, true); - assert_eq(result, 9); - (is_round, result) = mul_round(9_999_999_999, 1); - assert_eq(is_round, true); - assert_eq(result, 9); - } - - #[test] - fun test_div() { - let (mut is_round, mut result) = unsafe_div_round(1, 1_000_000_000); - assert_eq(is_round, false); - assert_eq(result, 1); - (is_round, result) = unsafe_div_round(1, 9_999_999_999); - assert_eq(is_round, true); - assert_eq(result, 0); - (is_round, result) = unsafe_div_round(1, 999_999_999); - assert_eq(is_round, true); - assert_eq(result, 1); - } - - #[test] - fun test_div_round() { - let (mut is_round, mut result) = unsafe_div_round(1, 1_000_000_000); - assert_eq(is_round, false); - assert_eq(result, 1); - (is_round, result) = unsafe_div_round(1, 9_999_999_999); - assert_eq(is_round, true); - assert_eq(result, 0); - (is_round, result) = unsafe_div_round(1, 999_999_999); - assert_eq(is_round, true); - assert_eq(result, 1); - (is_round, result) = div_round(1, 999_999_999); - assert_eq(is_round, true); - assert_eq(result, 1); - } - - #[test] - #[expected_failure(abort_code = EUnderflow)] - fun test_div_round_check_underflow() { - div_round(1, 1_000_000_001); - } -} diff --git a/crates/iota-framework/packages/deepbook/sources/order_query.move b/crates/iota-framework/packages/deepbook/sources/order_query.move deleted file mode 100644 index 9f08a206420..00000000000 --- a/crates/iota-framework/packages/deepbook/sources/order_query.move +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -module deepbook::order_query { - use std::option::{some, none}; - use deepbook::critbit::CritbitTree; - use iota::linked_table; - use deepbook::critbit; - use deepbook::clob_v2; - use deepbook::clob_v2::{Order, Pool, TickLevel}; - - const PAGE_LIMIT: u64 = 100; - - public struct OrderPage has drop { - orders: vector, - // false if this is the last page - has_next_page: bool, - // tick level where the next page begins (if any) - next_tick_level: Option, - // order id where the next page begins (if any) - next_order_id: Option - } - - // return an OrderPage starting from start_tick_level + start_order_id - // containing as many orders as possible without going over the - // dynamic fields accessed/tx limit - public fun iter_bids( - pool: &Pool, - // tick level to start from - start_tick_level: Option, - // order id within that tick level to start from - start_order_id: Option, - // if provided, do not include orders with an expire timestamp less than the provided value (expired order), - // value is in microseconds - min_expire_timestamp: Option, - // do not show orders with an ID larger than max_id-- - // i.e., orders added later than this one - max_id: Option, - // if true, the orders are returned in ascending tick level. - ascending: bool, - ): OrderPage { - let bids = clob_v2::bids(pool); - let mut orders = iter_ticks_internal( - bids, - start_tick_level, - start_order_id, - min_expire_timestamp, - max_id, - ascending - ); - let (orders, has_next_page, next_tick_level, next_order_id) = if (vector::length(&orders) > PAGE_LIMIT) { - let last_order = vector::pop_back(&mut orders); - (orders, true, some(clob_v2::tick_level(&last_order)), some(clob_v2::order_id(&last_order))) - } else { - (orders, false, none(), none()) - }; - - OrderPage { - orders, - has_next_page, - next_tick_level, - next_order_id - } - } - - public fun iter_asks( - pool: &Pool, - // tick level to start from - start_tick_level: Option, - // order id within that tick level to start from - start_order_id: Option, - // if provided, do not include orders with an expire timestamp less than the provided value (expired order), - // value is in microseconds - min_expire_timestamp: Option, - // do not show orders with an ID larger than max_id-- - // i.e., orders added later than this one - max_id: Option, - // if true, the orders are returned in ascending tick level. - ascending: bool, - ): OrderPage { - let asks = clob_v2::asks(pool); - let mut orders = iter_ticks_internal( - asks, - start_tick_level, - start_order_id, - min_expire_timestamp, - max_id, - ascending - ); - let (orders, has_next_page, next_tick_level, next_order_id) = if (vector::length(&orders) > PAGE_LIMIT) { - let last_order = vector::pop_back(&mut orders); - (orders, true, some(clob_v2::tick_level(&last_order)), some(clob_v2::order_id(&last_order))) - } else { - (orders, false, none(), none()) - }; - - OrderPage { - orders, - has_next_page, - next_tick_level, - next_order_id - } - } - - fun iter_ticks_internal( - ticks: &CritbitTree, - // tick level to start from - start_tick_level: Option, - // order id within that tick level to start from - mut start_order_id: Option, - // if provided, do not include orders with an expire timestamp less than the provided value (expired order), - // value is in microseconds - min_expire_timestamp: Option, - // do not show orders with an ID larger than max_id-- - // i.e., orders added later than this one - max_id: Option, - // if true, the orders are returned in ascending tick level. - ascending: bool, - ): vector { - let mut tick_level_key = if (option::is_some(&start_tick_level)) { - option::destroy_some(start_tick_level) - } else { - let (key, _) = if (ascending) { - critbit::min_leaf(ticks) - }else { - critbit::max_leaf(ticks) - }; - key - }; - - let mut orders = vector[]; - - while (tick_level_key != 0 && vector::length(&orders) < PAGE_LIMIT + 1) { - let tick_level = critbit::borrow_leaf_by_key(ticks, tick_level_key); - let open_orders = clob_v2::open_orders(tick_level); - - let mut next_order_key = if (option::is_some(&start_order_id)) { - let key = option::destroy_some(start_order_id); - if (!linked_table::contains(open_orders, key)) { - let (next_leaf, _) = if (ascending) { - critbit::next_leaf(ticks, tick_level_key) - }else { - critbit::previous_leaf(ticks, tick_level_key) - }; - tick_level_key = next_leaf; - continue - }; - start_order_id = option::none(); - some(key) - }else { - *linked_table::front(open_orders) - }; - - while (option::is_some(&next_order_key) && vector::length(&orders) < PAGE_LIMIT + 1) { - let key = option::destroy_some(next_order_key); - let order = linked_table::borrow(open_orders, key); - - // if the order id is greater than max_id, we end the iteration for this tick level. - if (option::is_some(&max_id) && key > option::destroy_some(max_id)) { - break - }; - - next_order_key = *linked_table::next(open_orders, key); - - // if expire timestamp is set, and if the order is expired, we skip it. - if (option::is_none(&min_expire_timestamp) || - clob_v2::expire_timestamp(order) > option::destroy_some(min_expire_timestamp)) { - vector::push_back(&mut orders, clob_v2::clone_order(order)); - }; - }; - let (next_leaf, _) = if (ascending) { - critbit::next_leaf(ticks, tick_level_key) - }else { - critbit::previous_leaf(ticks, tick_level_key) - }; - tick_level_key = next_leaf; - }; - orders - } - - public fun orders(page: &OrderPage): &vector { - &page.orders - } - - public fun has_next_page(page: &OrderPage): bool { - page.has_next_page - } - - public fun next_tick_level(page: &OrderPage): Option { - page.next_tick_level - } - - public fun next_order_id(page: &OrderPage): Option { - page.next_order_id - } - - public fun order_id(order: &Order): u64 { - clob_v2::order_id(order) - } - - public fun tick_level(order: &Order): u64 { - clob_v2::tick_level(order) - } -} diff --git a/crates/iota-framework/packages/deepbook/tests/clob_tests.move b/crates/iota-framework/packages/deepbook/tests/clob_tests.move deleted file mode 100644 index ee606ecf686..00000000000 --- a/crates/iota-framework/packages/deepbook/tests/clob_tests.move +++ /dev/null @@ -1,6189 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -#[test_only] -/// Tests for the pool module. -/// They are sequential and based on top of each other. -module deepbook::clob_test { - use iota::clock::{Self, Clock}; - use iota::coin::{Self, mint_for_testing, burn_for_testing}; - use iota::iota::IOTA; - use iota::test_scenario::{Self as test, Scenario, next_tx, ctx, end, TransactionEffects}; - use iota::test_utils::assert_eq; - use deepbook::clob_v2::{Self as clob, Pool, PoolOwnerCap, WrappedPool, Order, USD, account_balance, get_pool_stat, - order_id_for_test, list_open_orders, mint_account_cap_transfer, borrow_mut_pool}; - use deepbook::custodian_v2::{Self as custodian, AccountCap, account_owner}; - - const MIN_PRICE: u64 = 0; - const MAX_PRICE: u64 = (1u128 << 64 - 1) as u64; - const MIN_ASK_ORDER_ID: u64 = 1 << 63; - const FLOAT_SCALING: u64 = 1000000000; - const TIMESTAMP_INF: u64 = (1u128 << 64 - 1) as u64; - const FILL_OR_KILL: u8 = 2; - const POST_OR_ABORT: u8 = 3; - const CLIENT_ID_ALICE: u64 = 0; - const CLIENT_ID_BOB: u64 = 1; - const CANCEL_OLDEST: u8 = 0; - - #[test] fun test_full_transaction() { let _ = test_full_transaction_(scenario()); } - - #[test] fun test_place_market_buy_order_with_skipping_self_matching() { let _ = test_place_market_buy_order_with_skipping_self_matching_(scenario()); } - - #[test] fun test_place_market_sell_order_with_skipping_self_matching() { let _ = test_place_market_sell_order_with_skipping_self_matching_(scenario()); } - - #[test] fun test_place_limit_order_fill_or_kill() { let _ = test_place_limit_order_fill_or_kill_(scenario()); } - - #[test] fun test_place_limit_order_post_or_abort() { let _ = test_place_limit_order_post_or_abort_(scenario()); } - - #[test] fun test_place_limit_order_with_skipping_self_matching() { let _ = test_place_limit_order_with_skipping_self_matching_(scenario()); } - - #[test] fun test_absorb_all_liquidity_bid_side_with_customized_tick( - ) { let _ = test_absorb_all_liquidity_bid_side_with_customized_tick_(scenario()); } - - #[test] fun test_absorb_all_liquidity_ask_side_with_customized_tick( - ) { let _ = test_absorb_all_liquidity_ask_side_with_customized_tick_(scenario()); } - - #[test] fun test_swap_exact_quote_for_base( - ) { let _ = test_swap_exact_quote_for_base_(scenario()); } - - #[test] fun test_pool_with_small_fee_example() { let _ = test_pool_with_small_fee_example_(scenario()); } - - #[test] fun test_swap_exact_quote_for_base_with_skipping_self_matching( - ) { let _ = test_swap_exact_quote_for_base_with_skipping_self_matching_(scenario()); } - - #[test] fun test_swap_exact_base_for_quote( - ) { let _ = test_swap_exact_base_for_quote_(scenario()); } - - #[test] fun test_deposit_withdraw() { let _ = test_deposit_withdraw_(scenario()); } - - #[test] fun test_inject_and_match_taker_bid_with_quote_quantity( - ) { let _ = test_inject_and_match_taker_bid_with_quote_quantity_(scenario()); } - - #[test] fun test_inject_and_match_taker_bid_with_quote_quantity_zero_lot( - ) { let _ = test_inject_and_match_taker_bid_with_quote_quantity_zero_lot_(scenario()); } - - #[test] fun test_inject_and_match_taker_bid_with_quote_quantity_partial_lot( - ) { let _ = test_inject_and_match_taker_bid_with_quote_quantity_partial_lot_(scenario()); } - - #[test] fun test_inject_and_match_taker_bid() { let _ = test_inject_and_match_taker_bid_(scenario()); } - - #[test] fun test_inject_and_match_taker_bid_with_skip_self_matching() { let _ = test_inject_and_match_taker_bid_with_skipping_self_matching_(scenario()); } - - #[test] fun test_inject_and_match_taker_bid_with_maker_order_not_fully_filled( - ) { let _ = test_inject_and_match_taker_bid_with_maker_order_not_fully_filled_(scenario()); } - - #[test] fun test_inject_and_match_taker_ask() { let _ = test_inject_and_match_taker_ask_(scenario()); } - - #[test] fun test_inject_and_match_taker_ask_with_skipping_self_matching() { let _ = test_inject_and_match_taker_ask_with_skipping_self_matching_(scenario()); } - - #[test] fun test_inject_and_match_taker_bid_with_expiration( - ) { let _ = test_inject_and_match_taker_bid_with_expiration_(scenario()); } - - #[test] fun test_inject_and_match_taker_bid_with_quote_quantity_and_expiration( - ) { let _ = test_inject_and_match_taker_bid_with_quote_quantity_and_expiration_(scenario()); } - - #[test] fun test_inject_and_match_taker_ask_with_expiration() { - let _ = test_inject_and_match_taker_ask_with_expiration_(scenario()); - } - - #[test] fun test_withdraw_fees() { - let _ = test_withdraw_fees_(scenario()); - } - - #[test, expected_failure(abort_code = clob::EIncorrectPoolOwner)] fun test_withdraw_fees_with_incorrect_pool_owner() { - let _ = test_withdraw_fees_with_incorrect_pool_owner_(scenario()); - } - - #[test] fun test_inject_and_price_limit_affected_match_taker_bid() { - let _ = test_inject_and_price_limit_affected_match_taker_bid_( - scenario() - ); - } - - #[test] fun test_inject_and_price_limit_affected_match_taker_ask() { - let _ = test_inject_and_price_limit_affected_match_taker_ask_( - scenario() - ); - } - - #[test] fun test_remove_order() { let _ = test_remove_order_(scenario()); } - - #[test] fun test_remove_all_orders() { let _ = test_remove_all_orders_(scenario()); } - - #[test] fun test_cancel_and_remove() { let _ = test_cancel_and_remove_(scenario()); } - - #[test] fun test_batch_cancel() { let _ = test_batch_cancel_(scenario()); } - - #[test] fun test_clean_up_expired_orders() { let _ = test_clean_up_expired_orders_(scenario()); } - - #[test] fun test_partial_fill_and_cancel() { let _ = test_partial_fill_and_cancel_(scenario()); } - - #[test] fun test_list_open_orders() { - let _ = test_list_open_orders_( - scenario() - ); - } - - #[test] fun test_list_open_orders_empty() { - let _ = test_list_open_orders_empty_( - scenario() - ); - } - - #[test] fun get_best_price() { - let _ = get_market_price_( - scenario() - ); - } - - #[test] fun get_level2_book_status_bid_side() { - let _ = get_level2_book_status_bid_side_( - scenario() - ); - } - - #[test] fun get_level2_book_status_ask_side() { - let _ = get_level2_book_status_ask_side_( - scenario() - ); - } - - #[test] - fun test_inject_and_price_limit_affected_match_taker_ask_returned_pool() { - test_inject_and_price_limit_affected_match_taker_ask_returned_pool_( - scenario() - ); - } - - #[test] - fun test_swap_exact_quote_for_base_with_metadata() { - test_swap_exact_quote_for_base_with_metadata_( - scenario() - ); - } - - #[test] - fun test_swap_exact_base_for_quote_with_metadata() { - test_swap_exact_base_for_quote_with_metadata_( - scenario() - ); - } - - #[test] - fun test_place_market_order_with_metadata() { - test_place_market_order_with_metadata_( - scenario() - ); - } - - #[test] - fun test_place_limit_order_with_metadata() { - test_place_limit_order_with_metadata_( - scenario() - ); - } - - fun get_market_price_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice);{ - let pool = test::take_shared>(&test); - let (bid_price, ask_price) = clob::get_market_price(&pool); - assert_eq(option::is_none(&bid_price), true); - assert_eq(option::is_none(&ask_price), true); - test::return_shared(pool); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 100000; - let alice_deposit_USDC: u64 = 100000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 4 * FLOAT_SCALING, 500, 500, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 4 * FLOAT_SCALING, 500, 500, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 3 * FLOAT_SCALING, 1000, 1000, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 100000; - let alice_deposit_USDC: u64 = 100000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 15 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 15 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 14 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 14 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 13 * FLOAT_SCALING, 1000, 1000, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 12 * FLOAT_SCALING, 1000, 1000, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 12 * FLOAT_SCALING, 1000, 1000, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - next_tx(&mut test, alice);{ - let pool = test::take_shared>(&test); - let (bid_price, ask_price) = clob::get_market_price(&pool); - assert_eq(*option::borrow(&bid_price), 5 * FLOAT_SCALING); - assert_eq(*option::borrow(&ask_price), 12 * FLOAT_SCALING); - test::return_shared(pool); - }; - - end(test) - } - - fun get_level2_book_status_bid_side_(mut test: Scenario): TransactionEffects { - let (alice, _) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let clock = test::take_shared(&test); - let (prices, depth) = clob::get_level2_book_status_bid_side( - &pool, - 1 * FLOAT_SCALING, - 15 * FLOAT_SCALING, - &clock - ); - let prices_cmp = vector::empty(); - let depth_cmp = vector::empty(); - assert!(prices == prices_cmp); - assert!(depth == depth_cmp); - test::return_shared(clock); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 100000; - let alice_deposit_USDC: u64 = 100000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 4 * FLOAT_SCALING, 500, 500, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 4 * FLOAT_SCALING, 500, 500, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order_with_expiration(&mut pool, CLIENT_ID_ALICE, 3_500_000_000, 1000, 1000, true, - CANCEL_OLDEST, 0, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 3 * FLOAT_SCALING, 1000, 1000, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order_with_expiration(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, true, - CANCEL_OLDEST, 0, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - // test get_level2_book_status_bid_side - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let clock = test::take_shared(&test); - let order = clob::get_order_status(&pool, order_id_for_test(0, true), &account_cap); - let order_cmp = clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, account_cap_user); - assert!(order == &order_cmp); - let (prices, depth) = clob::get_level2_book_status_bid_side( - &pool, - 1 * FLOAT_SCALING, - 15 * FLOAT_SCALING, - &clock - ); - let prices_cmp = vector[2 * FLOAT_SCALING, 3 * FLOAT_SCALING, 4 * FLOAT_SCALING, 5 * FLOAT_SCALING]; - let depth_cmp = vector[1000, 1000, 1000, 1000]; - assert!(prices == prices_cmp); - assert!(depth == depth_cmp); - test::return_shared(clock); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - end(test) - } - - fun get_level2_book_status_ask_side_(mut test: Scenario): TransactionEffects { - let (alice, _) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let clock = test::take_shared(&test); - let (prices, depth) = clob::get_level2_book_status_ask_side( - &pool, - 1 * FLOAT_SCALING, - 10 * FLOAT_SCALING, - &clock - ); - let prices_cmp = vector::empty(); - let depth_cmp = vector::empty(); - assert!(prices == prices_cmp); - assert!(depth == depth_cmp); - test::return_shared(clock); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 100000; - let alice_deposit_USDC: u64 = 100000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 4 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 4 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order_with_expiration(&mut pool, CLIENT_ID_ALICE, 3_500_000_000, 1000, 1000, false, - CANCEL_OLDEST, 0, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 3 * FLOAT_SCALING, 1000, 1000, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order_with_expiration(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, false, - CANCEL_OLDEST, 0, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - // test get_level2_book_status_ask_side - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let clock = test::take_shared(&test); - let order = clob::get_order_status(&pool, order_id_for_test(0, false), &account_cap); - let order_cmp = clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, account_cap_user); - assert!(order == &order_cmp); - let (prices, depth) = clob::get_level2_book_status_ask_side( - &pool, - 1 * FLOAT_SCALING, - 10 * FLOAT_SCALING, - &clock - ); - let prices_cmp = vector[2 * FLOAT_SCALING, 3 * FLOAT_SCALING, 4 * FLOAT_SCALING, 5 * FLOAT_SCALING]; - let depth_cmp = vector[1000, 1000, 1000, 1000]; - assert!(prices == prices_cmp); - assert!(depth == depth_cmp); - test::return_shared(clock); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - end(test) - } - - fun test_list_open_orders_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10000; - let alice_deposit_USDC: u64 = 10000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10000, 10000, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - // test list_open_orders - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let open_orders = list_open_orders(&pool, &account_cap); - let mut open_orders_cmp = vector::empty(); - vector::push_back( - &mut open_orders_cmp, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, account_cap_user) - ); - vector::push_back( - &mut open_orders_cmp, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, account_cap_user) - ); - vector::push_back( - &mut open_orders_cmp, - clob::test_construct_order(2, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, false, account_cap_user) - ); - vector::push_back( - &mut open_orders_cmp, - clob::test_construct_order(0, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10000, 10000, true, account_cap_user) - ); - assert!(open_orders == open_orders_cmp); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - // test match (bid side) - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let (base_quantity_filled, quote_quantity_filled) = clob::test_match_bid( - &mut pool, - &account_cap, - CLIENT_ID_BOB, - 1500, - MAX_PRICE, - 0, - ); - assert!(base_quantity_filled == 1500); - assert!(quote_quantity_filled == 4500 + 10 + 13); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - let alice_account_cap = test::take_from_address(&test, alice); - clob::check_balance_invariants_for_account(&alice_account_cap, quote_custodian, base_custodian, &pool); - test::return_shared(pool); - test::return_to_address(bob, account_cap); - test::return_to_address(alice, alice_account_cap); - }; - - // test list_open_orders after match - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let open_orders = list_open_orders(&pool, &account_cap); - let mut open_orders_cmp = vector::empty(); - vector::push_back( - &mut open_orders_cmp, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, account_cap_user) - ); - vector::push_back( - &mut open_orders_cmp, - clob::test_construct_order(0, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10000, 10000, true, account_cap_user) - ); - assert!(open_orders == open_orders_cmp); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - // reset pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10000; - let alice_deposit_USDC: u64 = 10000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 10 * FLOAT_SCALING, 10000, 10000, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - // test list_open_orders before match - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let open_orders = list_open_orders(&pool, &account_cap); - let mut open_orders_cmp = vector::empty(); - vector::push_back( - &mut open_orders_cmp, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, account_cap_user) - ); - vector::push_back( - &mut open_orders_cmp, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, account_cap_user) - ); - vector::push_back( - &mut open_orders_cmp, - clob::test_construct_order(2, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, true, account_cap_user) - ); - vector::push_back( - &mut open_orders_cmp, - clob::test_construct_order(0, CLIENT_ID_ALICE, 10 * FLOAT_SCALING, 10000, 10000, false, account_cap_user) - ); - assert!(open_orders == open_orders_cmp); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - // test match (ask side) - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let (base_quantity_filled, quote_quantity_filled) = clob::test_match_ask( - &mut pool, - &account_cap, - CLIENT_ID_BOB, - 1500, - MIN_PRICE, - 0, - ); - assert!(base_quantity_filled == 1500); - assert!(quote_quantity_filled == 6000 - 13 - 13 - 5); - test::return_shared(pool); - test::return_to_address(bob, account_cap); - }; - - // test list_open_orders after match - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let open_orders = list_open_orders(&pool, &account_cap); - let mut open_orders_cmp = vector::empty(); - vector::push_back( - &mut open_orders_cmp, - clob::test_construct_order(2, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 500, true, account_cap_user) - ); - vector::push_back( - &mut open_orders_cmp, - clob::test_construct_order(0, CLIENT_ID_ALICE, 10 * FLOAT_SCALING, 10000, 10000, false, account_cap_user) - ); - assert!(open_orders == open_orders_cmp); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - end(test) - } - - fun test_list_open_orders_empty_(mut test: Scenario): TransactionEffects { - let (alice, _) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10000; - let alice_deposit_USDC: u64 = 10000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - // test list_open_orders - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let open_orders = list_open_orders(&pool, &account_cap); - let open_orders_cmp = vector::empty(); - assert!(open_orders == open_orders_cmp); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - end(test) - } - - fun test_deposit_withdraw_(mut test: Scenario): TransactionEffects { - let (alice, _) = people(); - let owner: address = @0xF; - next_tx(&mut test, owner); - { - clob::setup_test(0, 0, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let alice_deposit_WIOTA: u64 = 10000; - let alice_withdraw_WIOTA: u64 = 5000; - let alice_deposit_USDC: u64 = 10000; - let alice_withdraw_USDC: u64 = 1000; - clob::deposit_base(&mut pool, mint_for_testing(alice_deposit_WIOTA, ctx(&mut test)), &account_cap); - clob::deposit_quote(&mut pool, mint_for_testing(alice_deposit_USDC, ctx(&mut test)), &account_cap); - burn_for_testing(clob::withdraw_base(&mut pool, alice_withdraw_WIOTA, &account_cap, ctx(&mut test))); - burn_for_testing(clob::withdraw_quote(&mut pool, alice_withdraw_USDC, &account_cap, ctx(&mut test))); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance( - base_custodian, - account_cap_user, - alice_deposit_WIOTA - alice_withdraw_WIOTA, - 0 - ); - custodian::assert_user_balance( - quote_custodian, - account_cap_user, - alice_deposit_USDC - alice_withdraw_USDC, - 0 - ); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - end(test) - } - - fun test_batch_cancel_(mut test: Scenario): TransactionEffects { - let (alice, _) = people(); - // setup pool and custodian - let owner: address = @0xF; - next_tx(&mut test, owner); - { - clob::setup_test(0, 0, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10000; - let alice_deposit_USDC: u64 = 10000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 10 * FLOAT_SCALING, 10000, 10000, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (next_bid_order_id, next_ask_order_id, _, _) = clob::get_pool_stat(&pool); - assert!(next_bid_order_id == clob::order_id_for_test(3, true)); - assert!(next_ask_order_id == clob::order_id_for_test(1, false)); - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, account_cap_user) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 5 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(2, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 2 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 10 * FLOAT_SCALING, 10000, 10000, false, account_cap_user) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 10 * FLOAT_SCALING, &open_orders); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let mut orders = vector::empty(); - vector::push_back(&mut orders, 1); - vector::push_back(&mut orders, 2); - vector::push_back(&mut orders, MIN_ASK_ORDER_ID); - clob::batch_cancel_order(&mut pool, orders, &account_cap); - { - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_empty_tick_level(bids, 5 * FLOAT_SCALING); - }; - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(2, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 2 * FLOAT_SCALING, &open_orders); - }; - { - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_empty_tick_level(asks, 10 * FLOAT_SCALING); - }; - - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - end(test) - } - - fun test_clean_up_expired_orders_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - - // setup pool and custodian - let owner: address = @0xF; - next_tx(&mut test, owner); - { - clob::setup_test(0, 0, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10000; - let alice_deposit_USDC: u64 = 110000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - - clob::test_inject_limit_order_with_expiration(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, - CANCEL_OLDEST, 0, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order_with_expiration(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, - CANCEL_OLDEST, 0, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order_with_expiration(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, true, - CANCEL_OLDEST, 0, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order_with_expiration(&mut pool, CLIENT_ID_ALICE, 10 * FLOAT_SCALING, 10000, 10000, true, - CANCEL_OLDEST, 0, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order_with_expiration(&mut pool, CLIENT_ID_ALICE, 11 * FLOAT_SCALING, 10000, 10000, false, - CANCEL_OLDEST, 0, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - clob::check_balance_invariants_for_account(&account_cap, quote_custodian, base_custodian, &pool); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let bob_deposit_WIOTA: u64 = 20000; - let bob_deposit_USDC: u64 = 35000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, bob_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, bob_deposit_USDC); - - clob::test_inject_limit_order_with_expiration(&mut pool, CLIENT_ID_BOB, 11 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, 0, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order_with_expiration(&mut pool, CLIENT_ID_BOB, 12 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, 0, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order_with_expiration(&mut pool, CLIENT_ID_BOB, 13 * FLOAT_SCALING, 1000, 1000, false, - CANCEL_OLDEST, 0, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order_with_expiration(&mut pool, CLIENT_ID_BOB, 14 * FLOAT_SCALING, 5000, 5000, false, - CANCEL_OLDEST, 0, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order_with_expiration(&mut pool, CLIENT_ID_BOB, 5 * FLOAT_SCALING, 5000, 5000, true, - CANCEL_OLDEST, 0, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(bob, account_cap); - }; - next_tx(&mut test, bob); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - clob::check_balance_invariants_for_account(&account_cap, quote_custodian, base_custodian, &pool); - test::return_shared(pool); - test::return_to_address(bob, account_cap); - }; - next_tx(&mut test, owner); - { - let mut pool = test::take_shared>(&test); - let account_cap_alice = test::take_from_address(&test, alice); - let account_cap_owner_alice = account_owner(&account_cap_alice); - let account_cap_bob = test::take_from_address(&test, bob); - let account_cap_owner_bob = account_owner(&account_cap_bob); - let mut clock = test::take_shared(&test); - clock::increment_for_testing(&mut clock, 1); - let order_ids = vector[order_id_for_test(0, true), order_id_for_test(1, true), order_id_for_test(2, true), order_id_for_test(3, true), order_id_for_test(0, false)]; - let order_owners = vector
[account_cap_owner_alice, account_cap_owner_alice, account_cap_owner_alice, account_cap_owner_alice, account_cap_owner_alice]; - clob::clean_up_expired_orders(&mut pool, &clock, order_ids, order_owners); - let (_, _, bids, _) = get_pool_stat(&pool); - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(4, CLIENT_ID_BOB, 5 * FLOAT_SCALING, 5000, 5000, true, account_cap_owner_bob) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 5 * FLOAT_SCALING, &open_orders); - }; - clob::check_empty_tick_level(bids, 2 * FLOAT_SCALING); - clob::check_empty_tick_level(bids, 10 * FLOAT_SCALING); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - custodian::assert_user_balance(base_custodian, account_cap_owner_alice, 10000, 0); - custodian::assert_user_balance(quote_custodian, account_cap_owner_alice, 110000, 0); - - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(alice, account_cap_alice); - test::return_to_address(bob, account_cap_bob); - }; - next_tx(&mut test, owner); - { - let mut pool = test::take_shared>(&test); - let clock = test::take_shared(&test); - let account_cap_bob = test::take_from_address(&test, bob); - let account_cap_owner_bob = account_owner(&account_cap_bob); - let order_ids = vector[order_id_for_test(1, false), order_id_for_test(2, false), order_id_for_test(3, false), order_id_for_test(4, false), order_id_for_test(4, true)]; - let order_owners = vector
[account_cap_owner_bob, account_cap_owner_bob, account_cap_owner_bob, account_cap_owner_bob, account_cap_owner_bob]; - clob::clean_up_expired_orders(&mut pool, &clock, order_ids, order_owners); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_empty_tick_level(asks, 11 * FLOAT_SCALING); - clob::check_empty_tick_level(asks, 12 * FLOAT_SCALING); - clob::check_empty_tick_level(asks, 13 * FLOAT_SCALING); - clob::check_empty_tick_level(asks, 14 * FLOAT_SCALING); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - custodian::assert_user_balance(base_custodian, account_cap_owner_bob, 20000, 0); - custodian::assert_user_balance(quote_custodian, account_cap_owner_bob, 35000, 0); - - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(bob, account_cap_bob); - }; - end(test) - } - - fun test_partial_fill_and_cancel_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner: address = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(0, 0, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_sender(&test); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - custodian::deposit( - base_custodian, - mint_for_testing(1000 * 100000000, ctx(&mut test)), - account_cap_user - ); - custodian::deposit( - quote_custodian, - mint_for_testing(10000 * 100000000, ctx(&mut test)), - account_cap_user - ); - test::return_shared(pool); - test::return_to_sender(&test, account_cap); - }; - - // alice places limit orders - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_sender(&test); - let clock = test::take_shared(&test); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 200 * 100000000, - CANCEL_OLDEST, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 4 * FLOAT_SCALING, - 200 * 100000000, - CANCEL_OLDEST, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 4 * FLOAT_SCALING, - 200 * 100000000, - CANCEL_OLDEST, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 10 * FLOAT_SCALING, - 1000 * 100000000, - CANCEL_OLDEST, - false, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - let (next_bid_order_id, next_ask_order_id, _, _) = clob::get_pool_stat(&pool); - assert!(next_bid_order_id == clob::order_id_for_test(3, true)); - assert!(next_ask_order_id == clob::order_id_for_test(1, false)); - test::return_shared(clock); - test::return_shared(pool); - test::return_to_sender(&test, account_cap); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - clob::check_balance_invariants_for_account(&account_cap, quote_custodian, base_custodian, &pool); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_sender(&test); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(quote_custodian, account_cap_user, 7400 * 100000000, 2600 * 100000000); - custodian::assert_user_balance(base_custodian, account_cap_user, 0, 1000 * 100000000); - test::return_shared(pool); - test::return_to_sender(&test, account_cap); - }; - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, _) = clob::borrow_mut_custodian(&mut pool); - custodian::deposit( - base_custodian, - mint_for_testing(300 * 100000000, ctx(&mut test)), - account_cap_user - ); - custodian::assert_user_balance(base_custodian, account_cap_user, 300 * 100000000, 0); - test::return_shared(pool); - test::return_to_address(bob, account_cap); - }; - - // bob places market order - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_sender(&test); - let clock = test::take_shared(&test); - clob::place_limit_order( - &mut pool, - CLIENT_ID_BOB, - 4 * FLOAT_SCALING, - 300 * 100000000, - CANCEL_OLDEST, - false, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - test::return_shared(clock); - test::return_shared(pool); - test::return_to_sender(&test, account_cap); - }; - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - custodian::assert_user_balance(base_custodian, account_cap_user, 0, 0); - custodian::assert_user_balance(quote_custodian, account_cap_user, 1400 * 100000000, 0); - test::return_shared(pool); - test::return_to_address(bob, account_cap); - }; - - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - { - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_empty_tick_level(bids, 5 * FLOAT_SCALING); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(1, CLIENT_ID_ALICE, 4 * FLOAT_SCALING, 100 * 100000000, 100 * 100000000, true, account_cap_user) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order(2, CLIENT_ID_ALICE, 4 * FLOAT_SCALING, 200 * 100000000, 200 * 100000000, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 4 * FLOAT_SCALING, &open_orders); - }; - - clob::cancel_order(&mut pool, 2, &account_cap); - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(2, CLIENT_ID_ALICE, 4 * FLOAT_SCALING, 200 * 100000000, 200 * 100000000, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 4 * FLOAT_SCALING, &open_orders); - }; - - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - end(test) - } - - fun test_full_transaction_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner: address = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_sender(&test); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - custodian::deposit(base_custodian, mint_for_testing(1000, ctx(&mut test)), account_cap_user); - custodian::deposit(quote_custodian, mint_for_testing(10000, ctx(&mut test)), account_cap_user); - test::return_shared(pool); - test::return_to_sender(&test, account_cap); - }; - - // alice places limit orders - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_sender(&test); - let clock = test::take_shared(&test); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 200, - CANCEL_OLDEST, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 300, - CANCEL_OLDEST, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 2 * FLOAT_SCALING, - 1000, - CANCEL_OLDEST, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 20 * FLOAT_SCALING, - 1000, - CANCEL_OLDEST, - false, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - let (next_bid_order_id, next_ask_order_id, _, _) = clob::get_pool_stat(&pool); - assert!(next_bid_order_id == clob::order_id_for_test(3, true)); - assert!(next_ask_order_id == clob::order_id_for_test(1, false)); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(base_custodian, account_cap_user, 0, 1000); - custodian::assert_user_balance(quote_custodian, account_cap_user, 5500, 4500); - let (base_avail, base_locked, quote_avail, quote_locked) = account_balance(&pool, &account_cap); - assert!(base_avail == 0); - assert!(base_locked == 1000); - assert!(quote_avail == 5500); - assert!(quote_locked == 4500); - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - clob::check_balance_invariants_for_account(&account_cap, quote_custodian, base_custodian, &pool); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - // bob places market order - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let clock = test::take_shared(&test); - let account_cap = test::take_from_address(&test, bob); - let (coin1, coin2) = clob::place_market_order(&mut pool, &account_cap, CLIENT_ID_BOB, 600, - false, - mint_for_testing(600, ctx(&mut test)), - mint_for_testing(0, ctx(&mut test)), - &clock, - ctx(&mut test)); - assert!(coin::value(&coin1) == 0); - assert!(coin::value(&coin2) == 2700 - 14); - burn_for_testing(coin1); - burn_for_testing(coin2); - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(bob, account_cap); - }; - - // bob passes in 600iota, and sells 100iota of it through market ask order - // Bob should receive the remaining 500iota, - // and 199 usdt (excluding handling fee) for selling 100iota at a unit price of 2 - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let clock = test::take_shared(&test); - let account_cap = test::take_from_address(&test, bob); - let (coin1, coin2) =clob::place_market_order(&mut pool, &account_cap, CLIENT_ID_BOB, 100, - false, - mint_for_testing(600, ctx(&mut test)), - mint_for_testing(0, ctx(&mut test)), - &clock, - ctx(&mut test)); - assert!(coin::value(&coin1) == 500); - assert!(coin::value(&coin2) == 199); - burn_for_testing(coin1); - burn_for_testing(coin2); - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(bob, account_cap); - }; - end(test) - } - - fun test_place_limit_order_fill_or_kill_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner: address = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_sender(&test); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - custodian::deposit(base_custodian, mint_for_testing(1000, ctx(&mut test)), account_cap_user); - custodian::deposit(quote_custodian, mint_for_testing(10000, ctx(&mut test)), account_cap_user); - test::return_shared(pool); - test::return_to_sender(&test, account_cap); - }; - - // alice places limit orders - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let clock = test::take_shared(&test); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 200, - CANCEL_OLDEST, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 300, - CANCEL_OLDEST, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 2 * FLOAT_SCALING, - 1000, - CANCEL_OLDEST, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 20 * FLOAT_SCALING, - 1000, - CANCEL_OLDEST, - false, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - let (next_bid_order_id, next_ask_order_id, _, _) = clob::get_pool_stat(&pool); - assert!(next_bid_order_id == clob::order_id_for_test(3, true)); - assert!(next_ask_order_id == clob::order_id_for_test(1, false)); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(base_custodian, account_cap_user, 0, 1000); - custodian::assert_user_balance(quote_custodian, account_cap_user, 5500, 4500); - let (base_avail, base_locked, quote_avail, quote_locked) = account_balance(&pool, &account_cap); - assert!(base_avail == 0); - assert!(base_locked == 1000); - assert!(quote_avail == 5500); - assert!(quote_locked == 4500); - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(alice, account_cap); - }; - - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_sender(&test); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - custodian::deposit(base_custodian, mint_for_testing(1000, ctx(&mut test)), account_cap_user); - custodian::deposit(quote_custodian, mint_for_testing(10000, ctx(&mut test)), account_cap_user); - test::return_shared(pool); - test::return_to_sender(&test, account_cap); - }; - - // bob places limit order of FILL_OR_KILL - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_sender(&test); - let clock = test::take_shared(&test); - let (base_quantity_filled, quote_quantity_filled, is_placed, order_id) = clob::place_limit_order( - &mut pool, - CLIENT_ID_BOB, - 4 * FLOAT_SCALING, - 400, - CANCEL_OLDEST, - false, - TIMESTAMP_INF, - FILL_OR_KILL, - &clock, - &account_cap, - ctx(&mut test) - ); - assert!(base_quantity_filled == 400); - assert!(quote_quantity_filled == 1990); - assert!(is_placed == false); - assert!(order_id == 0); - - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(bob, account_cap); - }; - - // check bob's balance after the limit order is matched - next_tx(&mut test, bob); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_sender(&test); - let clock = test::take_shared(&test); - - let (base_avail, base_locked, quote_avail, quote_locked) = account_balance(&pool, &account_cap); - assert!(base_avail == 600); - assert!(base_locked == 0); - assert!(quote_avail == 11990); - assert!(quote_locked == 0); - - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(bob, account_cap); - }; - end(test) - } - - fun test_place_limit_order_post_or_abort_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner: address = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_sender(&test); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - custodian::deposit(base_custodian, mint_for_testing(1000, ctx(&mut test)), account_cap_user); - custodian::deposit(quote_custodian, mint_for_testing(10000, ctx(&mut test)), account_cap_user); - test::return_shared(pool); - test::return_to_sender(&test, account_cap); - }; - - // alice places limit orders - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let clock = test::take_shared(&test); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 200, - CANCEL_OLDEST, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 300, - CANCEL_OLDEST, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 2 * FLOAT_SCALING, - 1000, - CANCEL_OLDEST, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 20 * FLOAT_SCALING, - 1000, - CANCEL_OLDEST, - false, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - let (next_bid_order_id, next_ask_order_id, _, _) = clob::get_pool_stat(&pool); - assert!(next_bid_order_id == clob::order_id_for_test(3, true)); - assert!(next_ask_order_id == clob::order_id_for_test(1, false)); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(base_custodian, account_cap_user, 0, 1000); - custodian::assert_user_balance(quote_custodian, account_cap_user, 5500, 4500); - let (base_avail, base_locked, quote_avail, quote_locked) = account_balance(&pool, &account_cap); - assert!(base_avail == 0); - assert!(base_locked == 1000); - assert!(quote_avail == 5500); - assert!(quote_locked == 4500); - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(alice, account_cap); - }; - - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_sender(&test); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - custodian::deposit(base_custodian, mint_for_testing(1000, ctx(&mut test)), account_cap_user); - custodian::deposit(quote_custodian, mint_for_testing(10000, ctx(&mut test)), account_cap_user); - test::return_shared(pool); - test::return_to_sender(&test, account_cap); - }; - - // bob places limit order of POST OR ABORT - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_sender(&test); - let clock = test::take_shared(&test); - let (base_quantity_filled, quote_quantity_filled, is_placed, order_id) = clob::place_limit_order( - &mut pool, - CLIENT_ID_BOB, - 6 * FLOAT_SCALING, - 400, - CANCEL_OLDEST, - false, - TIMESTAMP_INF, - POST_OR_ABORT, - &clock, - &account_cap, - ctx(&mut test) - ); - assert!(base_quantity_filled == 0); - assert!(quote_quantity_filled == 0); - assert!(is_placed == true); - assert!(order_id == MIN_ASK_ORDER_ID + 1); - - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(bob, account_cap); - }; - - // check bob's balance - next_tx(&mut test, bob); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_sender(&test); - let clock = test::take_shared(&test); - - let (base_avail, base_locked, quote_avail, quote_locked) = account_balance(&pool, &account_cap); - assert!(base_avail == 600); - assert!(base_locked == 400); - assert!(quote_avail == 10000); - assert!(quote_locked == 0); - - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(bob, account_cap); - }; - end(test) - } - - fun test_absorb_all_liquidity_bid_side_with_customized_tick_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - // setup pool and custodian - let owner: address = @0xF; - next_tx(&mut test, owner); - { - clob::setup_test_with_tick_lot(5000000, 2500000, 1_00_000_000, 10, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_sender(&test); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - custodian::deposit(base_custodian, mint_for_testing(1000, ctx(&mut test)), account_cap_user); - custodian::deposit(quote_custodian, mint_for_testing(10000, ctx(&mut test)), account_cap_user); - test::return_shared(pool); - test::return_to_sender(&test, account_cap); - }; - - // alice places limit orders - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let clock = test::take_shared(&test); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 200, - CANCEL_OLDEST, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 300, - CANCEL_OLDEST, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 2 * FLOAT_SCALING, - 1000, - CANCEL_OLDEST, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 20 * FLOAT_SCALING, - 1000, - CANCEL_OLDEST, - false, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - let (next_bid_order_id, next_ask_order_id, _, _) = clob::get_pool_stat(&pool); - assert!(next_bid_order_id == clob::order_id_for_test(3, true), 0); - assert!(next_ask_order_id == clob::order_id_for_test(1, false), 0); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(base_custodian, account_cap_user, 0, 1000); - custodian::assert_user_balance(quote_custodian, account_cap_user, 5500, 4500); - let (base_avail, base_locked, quote_avail, quote_locked) = account_balance(&pool, &account_cap); - assert!(base_avail == 0, 0); - assert!(base_locked == 1000, 0); - assert!(quote_avail == 5500, 0); - assert!(quote_locked == 4500, 0); - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(alice, account_cap); - }; - - // bob places market order - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let clock = test::take_shared(&test); - let account_cap = test::take_from_address(&test, bob); - let (coin1, coin2) = clob::place_market_order(&mut pool, &account_cap, CLIENT_ID_BOB, 2000, false, - mint_for_testing(2000, ctx(&mut test)), - mint_for_testing(0, ctx(&mut test)), - &clock, - ctx(&mut test)); - assert!(coin::value(&coin1) == 500, 0); - assert!(coin::value(&coin2) == 4477, 0); - burn_for_testing(coin1); - burn_for_testing(coin2); - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(bob, account_cap); - }; - end(test) - } - - fun test_absorb_all_liquidity_ask_side_with_customized_tick_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner: address = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test_with_tick_lot(5000000, 2500000, 1_00_000_000, 10, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_sender(&test); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - custodian::deposit(base_custodian, mint_for_testing(10000, ctx(&mut test)), account_cap_user); - custodian::deposit(quote_custodian, mint_for_testing(10000, ctx(&mut test)), account_cap_user); - test::return_shared(pool); - test::return_to_sender(&test, account_cap); - }; - - // alice places limit orders - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let clock = test::take_shared(&test); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 500, - CANCEL_OLDEST, - false, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 500, - CANCEL_OLDEST, - false, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 2 * FLOAT_SCALING, - 1000, - CANCEL_OLDEST, - false, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 1 * FLOAT_SCALING, - 1000, - CANCEL_OLDEST, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - let (next_bid_order_id, next_ask_order_id, _, _) = clob::get_pool_stat(&pool); - assert!(next_bid_order_id == clob::order_id_for_test(1, true)); - assert!(next_ask_order_id == clob::order_id_for_test(3, false)); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(base_custodian, account_cap_user, 8000, 2000); - custodian::assert_user_balance(quote_custodian, account_cap_user, 9000, 1000); - let (base_avail, base_locked, quote_avail, quote_locked) = account_balance(&pool, &account_cap); - assert!(base_avail == 8000); - assert!(base_locked == 2000); - assert!(quote_avail == 9000); - assert!(quote_locked == 1000); - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(alice, account_cap); - }; - - // bob places market order - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let clock = test::take_shared(&test); - let account_cap = test::take_from_address(&test, bob); - let (coin1, coin2) = clob::place_market_order(&mut pool, &account_cap, CLIENT_ID_BOB, 5000, true, - mint_for_testing(10000, ctx(&mut test)), - mint_for_testing(10000, ctx(&mut test)), - &clock, - ctx(&mut test)); - assert!(coin::value(&coin1) == 12000); - assert!(coin::value(&coin2) == 10000 - (7000 + 36)); - burn_for_testing(coin1); - burn_for_testing(coin2); - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(bob, account_cap); - }; - end(test) - } - - fun test_swap_exact_quote_for_base_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10000; - let alice_deposit_USDC: u64 = 10000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE,1 * FLOAT_SCALING, 10000, 10000, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let clock = test::take_shared(&test); - let account_cap = test::take_from_address(&test, bob); - let (base_coin, quote_coin, _) = clob::swap_exact_quote_for_base( - &mut pool, - CLIENT_ID_BOB, - &account_cap, - 4500, - &clock, - mint_for_testing(4500, ctx(&mut test)), - ctx(&mut test) - ); - assert!(coin::value(&base_coin) == 1000 + 495); - assert!(coin::value("e_coin) == 2); - burn_for_testing(base_coin); - burn_for_testing(quote_coin); - - // Check Alice for invariants - let alice_account_cap = test::take_from_address(&test, alice); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - clob::check_balance_invariants_for_account(&alice_account_cap, quote_custodian, base_custodian, &pool); - test::return_shared(clock); - test::return_shared(pool); - test::return_to_address(bob, account_cap); - test::return_to_address(alice, alice_account_cap); - }; - end(test) - } - - fun test_swap_exact_base_for_quote_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10000; - let alice_deposit_USDC: u64 = 10000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE,5 * FLOAT_SCALING, 500, 500, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE,5 * FLOAT_SCALING, 500, 500, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE,2 * FLOAT_SCALING, 1000, 1000, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE,10 * FLOAT_SCALING, 10000, 10000, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let clock = test::take_shared(&test); - let account_cap = test::take_from_address(&test, bob); - let (base_coin, quote_coin, _) = clob::swap_exact_base_for_quote( - &mut pool, - CLIENT_ID_BOB, - &account_cap, - 1500, - mint_for_testing(1500, ctx(&mut test)), - mint_for_testing(0, ctx(&mut test)), - &clock, - ctx(&mut test) - ); - let alice_account_cap = test::take_from_address(&test, alice); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - clob::check_balance_invariants_for_account(&alice_account_cap, quote_custodian, base_custodian, &pool); - - assert!(coin::value(&base_coin) == 0); - assert!(coin::value("e_coin) == 5969); - burn_for_testing(base_coin); - burn_for_testing(quote_coin); - - test::return_shared(clock); - test::return_shared(pool); - test::return_to_address(alice, alice_account_cap); - test::return_to_address(bob, account_cap); - }; - end(test) - } - - fun test_withdraw_fees_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(250000, 150000, &mut test, owner); - }; - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 1000000000; - let alice_deposit_USDC: u64 = 1000000000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - // Example selling 0.1 iota, for the price of .719 - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 719000, 1000000000, 1000000000, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - clob::check_balance_invariants_for_account(&account_cap, quote_custodian, base_custodian, &pool); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, bob); - // Buys some iota from alice - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let clock = test::take_shared(&test); - - let (base_coin, quote_coin, _) = clob::swap_exact_base_for_quote( - &mut pool, - CLIENT_ID_BOB, - &account_cap, - 100000, - mint_for_testing(100000000, ctx(&mut test)), - mint_for_testing(0, ctx(&mut test)), - &clock, - ctx(&mut test) - ); - - burn_for_testing(base_coin); - burn_for_testing(quote_coin); - - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(bob, account_cap); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - clob::check_balance_invariants_for_account(&account_cap, quote_custodian, base_custodian, &pool); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - // Alice cancels orders - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (_, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let(asset_avail, asset_locked) = custodian::account_balance(quote_custodian, account_cap_user); - clob::cancel_order(&mut pool, 1, &account_cap); - - let (_, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let(asset_avail_after, asset_locked_after) = custodian::account_balance(quote_custodian, account_cap_user); - - // Assert locked balance is 0 and the new balance is equal to the sum - assert!(asset_locked_after == 0); - assert!(asset_avail_after == (asset_avail + asset_locked)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - next_tx(&mut test, owner); - { - let mut pool = test::take_shared>(&test); - let pool_cap = test::take_from_address(&test, owner); - let fees = clob::withdraw_fees(&pool_cap, &mut pool, test::ctx(&mut test)); - let amount = coin::burn_for_testing(fees); - - assert!(amount > 0); - - test::return_shared(pool); - test::return_to_address(owner, pool_cap); - }; - - end(test) - } - - fun test_withdraw_fees_with_incorrect_pool_owner_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner = @0xF; - // setup pool and custodian - - next_tx(&mut test, owner); - clob::setup_test(250000, 150000, &mut test, alice); - - next_tx(&mut test, owner); - clob::setup_test(250000, 150000, &mut test, owner); - - mint_account_cap_transfer(alice, test::ctx(&mut test)); - - next_tx(&mut test, bob); - mint_account_cap_transfer(bob, test::ctx(&mut test)); - - next_tx(&mut test, alice); { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 1000000000; - let alice_deposit_USDC: u64 = 1000000000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - // Example selling 0.1 iota, for the price of .719 - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 719000, 1000000000, 1000000000, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - next_tx(&mut test, alice); { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - clob::check_balance_invariants_for_account(&account_cap, quote_custodian, base_custodian, &pool); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - // Buys some iota from alice - next_tx(&mut test, bob); { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let clock = test::take_shared(&test); - - let (base_coin, quote_coin, _) = clob::swap_exact_base_for_quote( - &mut pool, - CLIENT_ID_BOB, - &account_cap, - 100000, - mint_for_testing(100000000, ctx(&mut test)), - mint_for_testing(0, ctx(&mut test)), - &clock, - ctx(&mut test) - ); - - burn_for_testing(base_coin); - burn_for_testing(quote_coin); - - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(bob, account_cap); - }; - - next_tx(&mut test, alice); { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - clob::check_balance_invariants_for_account(&account_cap, quote_custodian, base_custodian, &pool); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - // Alice cancels orders - next_tx(&mut test, alice); { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (_, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let(asset_avail, asset_locked) = custodian::account_balance(quote_custodian, account_cap_user); - clob::cancel_order(&mut pool, 1, &account_cap); - - let (_, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let(asset_avail_after, asset_locked_after) = custodian::account_balance(quote_custodian, account_cap_user); - - // Assert locked balance is 0 and the new balance is equal to the sum - assert!(asset_locked_after == 0); - assert!(asset_avail_after == (asset_avail + asset_locked)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - next_tx(&mut test, owner); { - let mut pool = test::take_shared>(&test); - let pool_cap = test::take_from_address(&test, alice); - let fees = clob::withdraw_fees(&pool_cap, &mut pool, test::ctx(&mut test)); - let _ = coin::burn_for_testing(fees); - - abort 1337 - } - } - - fun test_pool_with_small_fee_example_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(250000, 150000, &mut test, owner); - }; - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 1000000000; - let alice_deposit_USDC: u64 = 1000000000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - // Example selling 0.1 iota, for the price of .719 - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 719000, 1000000000, 1000000000, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - clob::check_balance_invariants_for_account(&account_cap, quote_custodian, base_custodian, &pool); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, bob); - // Buys some iota from alice - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let clock = test::take_shared(&test); - - let (base_coin, quote_coin, _) = clob::swap_exact_base_for_quote( - &mut pool, - CLIENT_ID_BOB, - &account_cap, - 100000, - mint_for_testing(100000000, ctx(&mut test)), - mint_for_testing(0, ctx(&mut test)), - &clock, - ctx(&mut test) - ); - - burn_for_testing(base_coin); - burn_for_testing(quote_coin); - - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(bob, account_cap); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - clob::check_balance_invariants_for_account(&account_cap, quote_custodian, base_custodian, &pool); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - // Alice cancels orders - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (_, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let(asset_avail, asset_locked) = custodian::account_balance(quote_custodian, account_cap_user); - clob::cancel_order(&mut pool, 1, &account_cap); - - let (_, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let(asset_avail_after, asset_locked_after) = custodian::account_balance(quote_custodian, account_cap_user); - - // Assert locked balance is 0 and the new balance is equal to the sum - assert!(asset_locked_after == 0); - assert!(asset_avail_after == (asset_avail + asset_locked)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - next_tx(&mut test, owner); - { - let mut pool = test::take_shared>(&test); - let pool_cap = test::take_from_address(&test, owner); - let fees = clob::withdraw_fees(&pool_cap, &mut pool, test::ctx(&mut test)); - let amount = coin::burn_for_testing(fees); - - assert!(amount > 0); - - test::return_shared(pool); - test::return_to_address(owner, pool_cap); - }; - - end(test) - } - - fun test_cancel_and_remove_(mut test: Scenario): TransactionEffects { - let (alice, _) = people(); - let owner: address = @0xF; - next_tx(&mut test, owner); - { - clob::setup_test(0, 0, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10; - let alice_deposit_USDC: u64 = 100; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 2, 2, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 3, 3, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 10, 10, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 10, 10, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 20 * FLOAT_SCALING, 10, 10, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 2, 2, true, account_cap_user) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order(1, CLIENT_ID_ALICE,5 * FLOAT_SCALING, 3, 3, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 5 * FLOAT_SCALING, &open_orders); - }; - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(2, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 10, 10, true, account_cap_user) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order(3, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 10, 10, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 2 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 20 * FLOAT_SCALING, 10, 10, false, account_cap_user) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 20 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 2, 2, true, account_cap_user) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 3, 3, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 5 * FLOAT_SCALING, &open_orders); - }; - - custodian::assert_user_balance(quote_custodian, account_cap_user, 35, 65); - custodian::assert_user_balance(base_custodian, account_cap_user, 0, 10); - - // check usr open orders before cancel - { - let mut usr_open_orders_cmp = vector::empty(); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(0, true)); - vector::push_back(&mut usr_open_orders_cmp, 5 * FLOAT_SCALING); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(1, true)); - vector::push_back(&mut usr_open_orders_cmp, 5 * FLOAT_SCALING); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(2, true)); - vector::push_back(&mut usr_open_orders_cmp, 2 * FLOAT_SCALING); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(3, true)); - vector::push_back(&mut usr_open_orders_cmp, 2 * FLOAT_SCALING); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(0, false)); - vector::push_back(&mut usr_open_orders_cmp, 20 * FLOAT_SCALING); - clob::check_usr_open_orders(clob::get_usr_open_orders(&pool, account_cap_user), &usr_open_orders_cmp); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - clob::cancel_order(&mut pool, 1, &account_cap); - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 3, 3, true, account_cap_user) - ); - // check tick level from pool after remove order - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 5 * FLOAT_SCALING, &open_orders); - // check usr open orders after remove order bid order of sequence_id 0 - let mut usr_open_orders_cmp = vector::empty(); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(0, false)); - vector::push_back(&mut usr_open_orders_cmp, 20 * FLOAT_SCALING); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(1, true)); - vector::push_back(&mut usr_open_orders_cmp, 5 * FLOAT_SCALING); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(2, true)); - vector::push_back(&mut usr_open_orders_cmp, 2 * FLOAT_SCALING); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(3, true)); - vector::push_back(&mut usr_open_orders_cmp, 2 * FLOAT_SCALING); - clob::check_usr_open_orders(clob::get_usr_open_orders(&pool, account_cap_user), &usr_open_orders_cmp); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - next_tx(&mut test, alice); - { - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let pool = test::take_shared>(&test); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(quote_custodian, account_cap_user, 35 + 10, 65 - 10); - custodian::assert_user_balance(base_custodian, account_cap_user, 0, 10); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - clob::cancel_order(&mut pool, 2, &account_cap); - { - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_empty_tick_level(bids, 5 * FLOAT_SCALING); - let mut usr_open_orders_cmp = vector::empty(); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(0, false)); - vector::push_back(&mut usr_open_orders_cmp, 20 * FLOAT_SCALING); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(3, true)); - vector::push_back(&mut usr_open_orders_cmp, 2 * FLOAT_SCALING); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(2, true)); - vector::push_back(&mut usr_open_orders_cmp, 2 * FLOAT_SCALING); - clob::check_usr_open_orders(clob::get_usr_open_orders(&pool, account_cap_user), &usr_open_orders_cmp); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(quote_custodian, account_cap_user, 35 + 10 + 15, 65 - 10 - 15); - custodian::assert_user_balance(base_custodian, account_cap_user, 0, 10); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - clob::cancel_order(&mut pool, MIN_ASK_ORDER_ID, &account_cap); - { - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_empty_tick_level(asks, 20 * FLOAT_SCALING); - let mut usr_open_orders_cmp = vector::empty(); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(3, true)); - vector::push_back(&mut usr_open_orders_cmp, 2 * FLOAT_SCALING); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(2, true)); - vector::push_back(&mut usr_open_orders_cmp, 2 * FLOAT_SCALING); - clob::check_usr_open_orders(clob::get_usr_open_orders(&pool, account_cap_user), &usr_open_orders_cmp); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(quote_custodian, account_cap_user, 35 + 10 + 15, 65 - 10 - 15); - custodian::assert_user_balance(base_custodian, account_cap_user, 10, 0); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - end(test) - } - - fun test_inject_and_match_taker_bid_with_quote_quantity_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let (base_quantity_filled, quote_quantity_filled) = clob::test_match_bid_with_quote_quantity(&mut pool, &account_cap, CLIENT_ID_BOB, 500, MAX_PRICE, 0); - assert_eq(base_quantity_filled, 0); - assert_eq(quote_quantity_filled, 0); - test::return_to_address(bob, account_cap); - test::return_shared(pool); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10000; - let alice_deposit_USDC: u64 = 10000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10000, 10000, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - // test inject limit order and match (bid side) - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - - custodian::assert_user_balance(quote_custodian, account_cap_user, 0, 10000); - custodian::assert_user_balance(base_custodian, account_cap_user, 8000, 2000); - let (next_bid_order_id, next_ask_order_id, _, _) = clob::get_pool_stat(&pool); - assert!(next_bid_order_id == clob::order_id_for_test(1, true)); - assert!(next_ask_order_id == clob::order_id_for_test(3, false)); - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, account_cap_user) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, account_cap_user) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 5 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(2, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, false, account_cap_user) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 2 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10000, 10000, true, account_cap_user) - ); - let (_, _, bid, _) = get_pool_stat(&pool); - clob::check_tick_level(bid, 1 * FLOAT_SCALING, &open_orders); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - // test match (bid side) - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let (base_quantity_filled, quote_quantity_filled) = clob::test_match_bid_with_quote_quantity( - &mut pool, - &account_cap, - CLIENT_ID_BOB, - 4500, - MAX_PRICE, - 0, - ); - assert!(base_quantity_filled == 1000 + 495); - assert!(quote_quantity_filled == 4498); - let (base_quantity_filled, quote_quantity_filled) = clob::test_match_bid_with_quote_quantity( - &mut pool, - &account_cap, - CLIENT_ID_BOB, - 500, - 0, - 0, - ); - assert_eq(base_quantity_filled, 0); - assert_eq(quote_quantity_filled, 0); - test::return_shared(pool); - test::return_to_address(bob, account_cap); - }; - next_tx(&mut test, bob); - { - let pool = test::take_shared>(&test); - let account_cap_alice = test::take_from_address(&test, alice); - let account_cap_user_alice = account_owner(&account_cap_alice); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - - custodian::assert_user_balance(quote_custodian, account_cap_user_alice, 4498 - 10 - 13 + 5 + 6, 10000); - custodian::assert_user_balance(base_custodian, account_cap_user_alice, 8000, 500 + 5); - { - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_empty_tick_level(asks, 2 * FLOAT_SCALING); - }; - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 5, 5, false, account_cap_user_alice) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, account_cap_user_alice) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 5 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10000, 10000, true, account_cap_user_alice) - ); - let (_, _, bid, _) = get_pool_stat(&pool); - clob::check_tick_level(bid, 1 * FLOAT_SCALING, &open_orders); - }; - - let open_orders = list_open_orders(&pool, &account_cap_alice); - let mut open_orders_cmp = vector::empty(); - vector::push_back( - &mut open_orders_cmp, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 5, false, account_cap_user_alice) - ); - vector::push_back( - &mut open_orders_cmp, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, account_cap_user_alice) - ); - vector::push_back( - &mut open_orders_cmp, - clob::test_construct_order(0, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10000, 10000, true, account_cap_user_alice) - ); - assert!(open_orders == open_orders_cmp); - test::return_shared(pool); - test::return_to_address(alice, account_cap_alice); - }; - - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - - let (base_quantity_filled, quote_quantity_filled) = clob::test_match_bid_with_quote_quantity( - &mut pool, - &account_cap, - CLIENT_ID_BOB, - 3000, - MAX_PRICE, - 0, - ); - assert_eq(base_quantity_filled, 505); - assert_eq(quote_quantity_filled, 2539); - test::return_shared(pool); - test::return_to_address(bob, account_cap); - }; - - next_tx(&mut test, bob); - { - let pool = test::take_shared>(&test); - { - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_empty_tick_level(asks, 2 * FLOAT_SCALING); - }; - { - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_empty_tick_level(asks, 5 * FLOAT_SCALING); - }; - - test::return_shared(pool); - }; - - end(test) - } - - fun test_inject_and_match_taker_bid_with_quote_quantity_zero_lot_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test_with_tick_lot(5000000, 2500000, 1 * FLOAT_SCALING, 100, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10000; - let alice_deposit_USDC: u64 = 10000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10000, 10000, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let (base_quantity_filled, quote_quantity_filled) = clob::test_match_bid_with_quote_quantity( - &mut pool, - &account_cap, - CLIENT_ID_BOB, - // needs 201 to fill 1 lot - 200, - MAX_PRICE, - 0, - ); - assert!(base_quantity_filled == 0); - assert!(quote_quantity_filled == 0); - test::return_shared(pool); - test::return_to_address(bob, account_cap); - }; - next_tx(&mut test, bob); - { - let pool = test::take_shared>(&test); - let account_cap_alice = test::take_from_address(&test, alice); - let account_cap_user_alice = account_owner(&account_cap_alice); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - - custodian::assert_user_balance(quote_custodian, account_cap_user_alice, 0, 10000); - custodian::assert_user_balance(base_custodian, account_cap_user_alice, 8000, 2000); - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, account_cap_user_alice) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, account_cap_user_alice) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 5 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(2, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, false, account_cap_user_alice) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 2 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10000, 10000, true, account_cap_user_alice) - ); - let (_, _, bid, _) = get_pool_stat(&pool); - clob::check_tick_level(bid, 1 * FLOAT_SCALING, &open_orders); - }; - - let open_orders = list_open_orders(&pool, &account_cap_alice); - let mut open_orders_cmp = vector::empty(); - vector::push_back( - &mut open_orders_cmp, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, account_cap_user_alice) - ); - vector::push_back( - &mut open_orders_cmp, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, account_cap_user_alice) - ); - vector::push_back( - &mut open_orders_cmp, - clob::test_construct_order(2, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, false, account_cap_user_alice) - ); - vector::push_back( - &mut open_orders_cmp, - clob::test_construct_order(0, CLIENT_ID_ALICE,1 * FLOAT_SCALING, 10000, 10000, true, account_cap_user_alice) - ); - assert!(open_orders == open_orders_cmp); - test::return_shared(pool); - test::return_to_address(alice, account_cap_alice); - }; - end(test) - } - - fun test_inject_and_match_taker_bid_with_quote_quantity_partial_lot_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test_with_tick_lot(5000000, 2500000, 1 * FLOAT_SCALING, 10, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10000; - let alice_deposit_USDC: u64 = 10000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10000, 10000, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let (base_quantity_filled, quote_quantity_filled) = clob::test_match_bid_with_quote_quantity( - &mut pool, - &account_cap, - CLIENT_ID_BOB, - 4500, - MAX_PRICE, - 0, - ); - assert!(base_quantity_filled == 1000 + 490); - assert!(quote_quantity_filled == 4473); - test::return_shared(pool); - test::return_to_address(bob, account_cap); - }; - next_tx(&mut test, bob); - { - let pool = test::take_shared>(&test); - let account_cap_alice = test::take_from_address(&test, alice); - let account_cap_user_alice = account_owner(&account_cap_alice); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - - custodian::assert_user_balance(quote_custodian, account_cap_user_alice, 4473 - 10 - 13 + 5 + 6, 10000); - custodian::assert_user_balance(base_custodian, account_cap_user_alice, 8000, 500 + 10); - { - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_empty_tick_level(asks, 2 * FLOAT_SCALING); - }; - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 10, 10, false, account_cap_user_alice) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, account_cap_user_alice) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 5 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10000, 10000, true, account_cap_user_alice) - ); - let (_, _, bid, _) = get_pool_stat(&pool); - clob::check_tick_level(bid, 1 * FLOAT_SCALING, &open_orders); - }; - - let open_orders = list_open_orders(&pool, &account_cap_alice); - let mut open_orders_cmp = vector::empty(); - vector::push_back( - &mut open_orders_cmp, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 10, false, account_cap_user_alice) - ); - vector::push_back( - &mut open_orders_cmp, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING,500, 500, false, account_cap_user_alice) - ); - vector::push_back( - &mut open_orders_cmp, - clob::test_construct_order(0, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10000, 10000, true, account_cap_user_alice) - ); - assert!(open_orders == open_orders_cmp); - test::return_shared(pool); - test::return_to_address(alice, account_cap_alice); - }; - end(test) - } - - fun test_inject_and_match_taker_bid_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10000; - let alice_deposit_USDC: u64 = 10000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10000, 10000, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(quote_custodian, account_cap_user, 0, 10000); - custodian::assert_user_balance(base_custodian, account_cap_user, 8000, 2000); - let (next_bid_order_id, next_ask_order_id, _, _) = clob::get_pool_stat(&pool); - assert!(next_bid_order_id == clob::order_id_for_test(1, true)); - assert!(next_ask_order_id == clob::order_id_for_test(3, false)); - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, account_cap_user) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, account_cap_user) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 5 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(2, CLIENT_ID_ALICE,2 * FLOAT_SCALING, 1000, 1000, false, account_cap_user) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 2 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE,1 * FLOAT_SCALING, 10000, 10000, true, account_cap_user) - ); - let (_, _, bid, _) = get_pool_stat(&pool); - clob::check_tick_level(bid, 1 * FLOAT_SCALING, &open_orders); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - // test match (bid side) - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let (base_quantity_filled, quote_quantity_filled) = clob::test_match_bid( - &mut pool, - &account_cap, - CLIENT_ID_BOB, - 1500, - MAX_PRICE, - 0, - ); - assert!(base_quantity_filled == 1500); - assert!(quote_quantity_filled == 4500 + 10 + 13); - test::return_shared(pool); - test::return_to_address(bob, account_cap); - }; - next_tx(&mut test, bob); - { - let pool = test::take_shared>(&test); - let account_cap_alice = test::take_from_address(&test, alice); - let account_cap_user_alice = account_owner(&account_cap_alice); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - - custodian::assert_user_balance(quote_custodian, account_cap_user_alice, 4500 + 5 + 6, 10000); - custodian::assert_user_balance(base_custodian, account_cap_user_alice, 8000, 500); - { - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_empty_tick_level(asks, 2 * FLOAT_SCALING); - }; - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, account_cap_user_alice) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 5 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10000, 10000, true, account_cap_user_alice) - ); - let (_, _, bid, _) = get_pool_stat(&pool); - clob::check_tick_level(bid, 1 * FLOAT_SCALING, &open_orders); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap_alice); - }; - end(test) - } - - fun test_inject_and_match_taker_bid_with_maker_order_not_fully_filled_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10000; - let alice_deposit_USDC: u64 = 10000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10000, 10000, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(quote_custodian, account_cap_user, 0, 10000); - custodian::assert_user_balance(base_custodian, account_cap_user, 8000, 2000); - let (next_bid_order_id, next_ask_order_id, _, _) = clob::get_pool_stat(&pool); - assert!(next_bid_order_id == clob::order_id_for_test(1, true)); - assert!(next_ask_order_id == clob::order_id_for_test(3, false)); - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, account_cap_user) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, account_cap_user) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 5 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(2, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, false, account_cap_user) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 2 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10000, 10000, true, account_cap_user) - ); - let (_, _, bid, _) = get_pool_stat(&pool); - clob::check_tick_level(bid, 1 * FLOAT_SCALING, &open_orders); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - // test match (bid side) - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let (base_quantity_filled, quote_quantity_filled) = clob::test_match_bid( - &mut pool, - &account_cap, - CLIENT_ID_BOB, - 1250, - MAX_PRICE, - 0, - ); - assert!(base_quantity_filled == 1250); - assert!(quote_quantity_filled == 3267); - test::return_shared(pool); - test::return_to_address(bob, account_cap); - }; - next_tx(&mut test, bob); - { - let pool = test::take_shared>(&test); - let account_cap_alice = test::take_from_address(&test, alice); - let account_cap_user_alice = account_owner(&account_cap_alice); - - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(base_custodian, account_cap_user_alice, 8000, 750); - custodian::assert_user_balance(quote_custodian, account_cap_user_alice, 3258, 10000); - - { - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_empty_tick_level(asks, 2 * FLOAT_SCALING); - }; - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 250, 250, false, account_cap_user_alice) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, account_cap_user_alice) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 5 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10000, 10000, true, account_cap_user_alice) - ); - let (_, _, bid, _) = get_pool_stat(&pool); - clob::check_tick_level(bid, 1 * FLOAT_SCALING, &open_orders); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap_alice); - }; - end(test) - } - - fun test_inject_and_match_taker_ask_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10000; - let alice_deposit_USDC: u64 = 10000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - // test inject limit order and match (ask side) - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 10 * FLOAT_SCALING, 10000, 10000, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(quote_custodian, account_cap_user, 3000, 7000); - custodian::assert_user_balance(base_custodian, account_cap_user, 0, 10000); - let (next_bid_order_id, next_ask_order_id, _, _) = clob::get_pool_stat(&pool); - assert!(next_bid_order_id == clob::order_id_for_test(3, true)); - assert!(next_ask_order_id == clob::order_id_for_test(1, false)); - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, account_cap_user) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 5 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(2, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 2 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 10 * FLOAT_SCALING, 10000, 10000, false, account_cap_user) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 10 * FLOAT_SCALING, &open_orders); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - // test match (ask side) - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let (base_quantity_filled, quote_quantity_filled) = clob::test_match_ask( - &mut pool, - &account_cap, - CLIENT_ID_BOB, - 1500, - MIN_PRICE, - 0, - ); - assert!(base_quantity_filled == 1500); - assert!(quote_quantity_filled == 6000 - 13 - 13 - 5); - test::return_shared(pool); - test::return_to_address(bob, account_cap); - }; - next_tx(&mut test, bob); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance( - quote_custodian, - account_cap_user, - 3000 + 6 + 6 + 2, - 7000 - 2500 - 2500 - 1000 - ); - custodian::assert_user_balance(base_custodian, account_cap_user, 1500, 10000); - { - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_empty_tick_level(bids, 5 * FLOAT_SCALING); - }; - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(2, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 500, 500, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 2 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 10 * FLOAT_SCALING, 10000, 10000, false, account_cap_user) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 10 * FLOAT_SCALING, &open_orders); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - end(test) - } - - fun test_inject_and_match_taker_bid_with_quote_quantity_and_expiration_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - // test inject limit order and match (bid side) - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10000; - let alice_deposit_USDC: u64 = 10000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - clob::test_inject_limit_order_with_expiration( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 500, - 500, - false, - CANCEL_OLDEST, - TIMESTAMP_INF, - &account_cap, - ctx(&mut test) - ); - clob::test_inject_limit_order_with_expiration( - &mut pool, - CLIENT_ID_ALICE, - 2 * FLOAT_SCALING, - 500, - 500, - false, - CANCEL_OLDEST, - 0, - &account_cap, - ctx(&mut test) - ); - clob::test_inject_limit_order_with_expiration( - &mut pool, - CLIENT_ID_ALICE, - 2 * FLOAT_SCALING, - 1000, - 1000, - false, - CANCEL_OLDEST, - TIMESTAMP_INF, - &account_cap, - ctx(&mut test) - ); - clob::test_inject_limit_order_with_expiration( - &mut pool, - CLIENT_ID_ALICE, - 1 * FLOAT_SCALING, - 10000, - 10000, - true, - CANCEL_OLDEST, - 0, - &account_cap, - ctx(&mut test) - ); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - - custodian::assert_user_balance(quote_custodian, account_cap_user, 0, 10000); - custodian::assert_user_balance(base_custodian, account_cap_user, 8000, 2000); - let (next_bid_order_id, next_ask_order_id, _, _) = clob::get_pool_stat(&pool); - assert!(next_bid_order_id == clob::order_id_for_test(1, true)); - assert!(next_ask_order_id == clob::order_id_for_test(3, false)); - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order_with_expiration( - 0, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 500, - 500, - false, - account_cap_user, - TIMESTAMP_INF - ) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 5 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order_with_expiration(1, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 500, 500, false, account_cap_user, 0) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order_with_expiration( - 2, - CLIENT_ID_ALICE, - 2 * FLOAT_SCALING, - 1000, - 1000, - false, - account_cap_user, - TIMESTAMP_INF - ) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 2 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10000, 10000, true, account_cap_user) - ); - let (_, _, bid, _) = get_pool_stat(&pool); - clob::check_tick_level(bid, 1 * FLOAT_SCALING, &open_orders); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - // test match (bid side) - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let (base_quantity_filled, quote_quantity_filled) = clob::test_match_bid_with_quote_quantity( - &mut pool, - &account_cap, - CLIENT_ID_BOB, - 4500, - MAX_PRICE, - 1, - ); - assert!(base_quantity_filled == 1000 + 495); - assert!(quote_quantity_filled == 4498); - test::return_shared(pool); - test::return_to_address(bob, account_cap); - }; - next_tx(&mut test, bob); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - // rebate fee in base asset 3 - custodian::assert_user_balance(quote_custodian, account_cap_user, 4498 - 10 - 13 + 5 + 6, 10000); - custodian::assert_user_balance(base_custodian, account_cap_user, 8500, 5); - { - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_empty_tick_level(asks, 2 * FLOAT_SCALING); - }; - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 5, 5, false, account_cap_user) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 5 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10000, 10000, true, account_cap_user) - ); - let (_, _, bid, _) = get_pool_stat(&pool); - clob::check_tick_level(bid, 1 * FLOAT_SCALING, &open_orders); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - end(test) - } - - fun test_inject_and_match_taker_bid_with_expiration_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - // test inject limit order and match (bid side) - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10000; - let alice_deposit_USDC: u64 = 10000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - clob::test_inject_limit_order_with_expiration( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 500, - 500, - false, - CANCEL_OLDEST, - TIMESTAMP_INF, - &account_cap, - ctx(&mut test) - ); - clob::test_inject_limit_order_with_expiration( - &mut pool, - CLIENT_ID_ALICE, - 2 * FLOAT_SCALING, - 500, - 500, - false, - CANCEL_OLDEST, - 0, - &account_cap, - ctx(&mut test) - ); - clob::test_inject_limit_order_with_expiration( - &mut pool, - CLIENT_ID_ALICE, - 2 * FLOAT_SCALING, - 1000, - 1000, - false, - CANCEL_OLDEST, - TIMESTAMP_INF, - &account_cap, - ctx(&mut test) - ); - clob::test_inject_limit_order_with_expiration( - &mut pool, - CLIENT_ID_ALICE, - 1 * FLOAT_SCALING, - 10000, - 10000, - true, - CANCEL_OLDEST, - 0, - &account_cap, - ctx(&mut test) - ); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let clock = test::take_shared(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - - custodian::assert_user_balance(quote_custodian, account_cap_user, 0, 10000); - custodian::assert_user_balance(base_custodian, account_cap_user, 8000, 2000); - let (next_bid_order_id, next_ask_order_id, _, _) = clob::get_pool_stat(&pool); - assert!(next_bid_order_id == clob::order_id_for_test(1, true)); - assert!(next_ask_order_id == clob::order_id_for_test(3, false)); - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order_with_expiration( - 0, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 500, - 500, - false, - account_cap_user, - TIMESTAMP_INF - ) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 5 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order_with_expiration(1, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 500, 500, false, account_cap_user, 0) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order_with_expiration( - 2, - CLIENT_ID_ALICE, - 2 * FLOAT_SCALING, - 1000, - 1000, - false, - account_cap_user, - TIMESTAMP_INF - ) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 2 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10000, 10000, true, account_cap_user) - ); - let (_, _, bid, _) = get_pool_stat(&pool); - clob::check_tick_level(bid, 1 * FLOAT_SCALING, &open_orders); - }; - test::return_shared(clock); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - // test match (bid side) - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let (base_quantity_filled, quote_quantity_filled) = clob::test_match_bid( - &mut pool, - &account_cap, - CLIENT_ID_BOB, - 1500, - MAX_PRICE, - 1, - ); - assert!(base_quantity_filled == 1500); - assert!(quote_quantity_filled == 4500 + 10 + 13); - test::return_shared(pool); - test::return_to_address(bob, account_cap); - }; - next_tx(&mut test, bob); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - // rebate fee in base asset 3 - custodian::assert_user_balance(quote_custodian, account_cap_user, 4500 + 5 + 6, 10000); - custodian::assert_user_balance(base_custodian, account_cap_user, 8500, 0); - { - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_empty_tick_level(asks, 2 * FLOAT_SCALING); - }; - { - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_empty_tick_level(asks, 5 * FLOAT_SCALING); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10000, 10000, true, account_cap_user) - ); - let (_, _, bid, _) = get_pool_stat(&pool); - clob::check_tick_level(bid, 1 * FLOAT_SCALING, &open_orders); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - end(test) - } - - fun test_inject_and_match_taker_ask_with_expiration_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10000; - let alice_deposit_USDC: u64 = 10000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - // test inject limit order and match (ask side) - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - clob::test_inject_limit_order_with_expiration( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 500, - 500, - true, - CANCEL_OLDEST, - TIMESTAMP_INF, - &account_cap, - ctx(&mut test) - ); - clob::test_inject_limit_order_with_expiration( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 1000, - 1000, - true, - CANCEL_OLDEST, - 0, - &account_cap, - ctx(&mut test) - ); - clob::test_inject_limit_order_with_expiration( - &mut pool, - CLIENT_ID_ALICE, - 2 * FLOAT_SCALING, - 1000, - 1000, - true, - CANCEL_OLDEST, - TIMESTAMP_INF, - &account_cap, - ctx(&mut test) - ); - clob::test_inject_limit_order_with_expiration( - &mut pool, - CLIENT_ID_ALICE, - 10 * FLOAT_SCALING, - 10000, - 10000, - false, - CANCEL_OLDEST, - TIMESTAMP_INF, - &account_cap, - ctx(&mut test) - ); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(quote_custodian, account_cap_user, 500, 9500); - custodian::assert_user_balance(base_custodian, account_cap_user, 0, 10000); - let (next_bid_order_id, next_ask_order_id, _, _) = clob::get_pool_stat(&pool); - assert!(next_bid_order_id == clob::order_id_for_test(3, true)); - assert!(next_ask_order_id == clob::order_id_for_test(1, false)); - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order_with_expiration( - 0, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 500, - 500, - true, - account_cap_user, - TIMESTAMP_INF - ) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order_with_expiration( - 1, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 1000, - 1000, - true, - account_cap_user, - 0, - ) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 5 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order_with_expiration( - 2, - CLIENT_ID_ALICE, - 2 * FLOAT_SCALING, - 1000, - 1000, - true, - account_cap_user, - TIMESTAMP_INF - ) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 2 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order_with_expiration( - 0, - CLIENT_ID_ALICE, - 10 * FLOAT_SCALING, - 10000, - 10000, - false, - account_cap_user, - TIMESTAMP_INF - ) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 10 * FLOAT_SCALING, &open_orders); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - // test match (ask side) - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let (base_quantity_filled, quote_quantity_filled) = clob::test_match_ask( - &mut pool, - &account_cap, - CLIENT_ID_BOB, - 1500, - MIN_PRICE, - 1, - ); - assert!(base_quantity_filled == 1500); - assert!(quote_quantity_filled == 4500 - 13 - 10); - test::return_shared(pool); - test::return_to_address(bob, account_cap); - }; - next_tx(&mut test, bob); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance( - quote_custodian, - account_cap_user, - 5500 + 6 + 5, - 9500 - 2500 - 5000 - 2000 - ); - custodian::assert_user_balance(base_custodian, account_cap_user, 1500, 10000); - { - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_empty_tick_level(bids, 5 * FLOAT_SCALING); - }; - { - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_empty_tick_level(bids, 2 * FLOAT_SCALING); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 10 * FLOAT_SCALING, 10000, 10000, false, account_cap_user) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 10 * FLOAT_SCALING, &open_orders); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - end(test) - } - - fun test_inject_and_price_limit_affected_match_taker_bid_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner = @0xFF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(0, 0, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 100; - let alice_deposit_USDC: u64 = 10; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 2, 2, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 3, 3, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 10, 10, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10, 10, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(quote_custodian, account_cap_user, 0, 10); - custodian::assert_user_balance(base_custodian, account_cap_user, 85, 15); - let (next_bid_order_id, next_ask_order_id, _, _) = clob::get_pool_stat(&pool); - assert!(next_bid_order_id == clob::order_id_for_test(1, true)); - assert!(next_ask_order_id == clob::order_id_for_test(3, false)); - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 2, 2, false, account_cap_user) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 3, 3, false, account_cap_user) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 5 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(2, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 10, 10, false, account_cap_user) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 2 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10, 10, true, account_cap_user) - ); - let (_, _, bid, _) = get_pool_stat(&pool); - clob::check_tick_level(bid, 1 * FLOAT_SCALING, &open_orders); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - // test match with price limit (bid side) - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let (base_quantity_filled, quote_quantity_filled) = clob::test_match_bid( - &mut pool, - &account_cap, - CLIENT_ID_BOB, - 20, - 5 * FLOAT_SCALING, - 0 - ); - assert!(base_quantity_filled == 15); - assert!(quote_quantity_filled == 45); - test::return_shared(pool); - test::return_to_address(bob, account_cap); - }; - next_tx(&mut test, bob); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(quote_custodian, account_cap_user, 45, 10); - custodian::assert_user_balance(base_custodian, account_cap_user, 85, 0); - { - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_empty_tick_level(asks, 2 * FLOAT_SCALING); - }; - { - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_empty_tick_level(asks, 5 * FLOAT_SCALING); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10, 10, true, account_cap_user) - ); - let (_, _, bid, _) = get_pool_stat(&pool); - clob::check_tick_level(bid, 1 * FLOAT_SCALING, &open_orders); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - end(test) - } - - fun test_inject_and_price_limit_affected_match_taker_ask_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner = @0xFF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(0, 0, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10; - let alice_deposit_USDC: u64 = 100; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - // test inject limit order and match (ask side) - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - // let account_cap_user = get_account_cap_user(&account_cap); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 2, 2, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 3, 3, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 10, 10, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 20 * FLOAT_SCALING, 10, 10, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(quote_custodian, account_cap_user, 55, 45); - custodian::assert_user_balance(base_custodian, account_cap_user, 0, 10); - let (next_bid_order_id, next_ask_order_id, _, _) = clob::get_pool_stat(&pool); - assert!(next_bid_order_id == clob::order_id_for_test(3, true)); - assert!(next_ask_order_id == clob::order_id_for_test(1, false)); - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 2, 2, true, account_cap_user) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 3, 3, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 5 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(2, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 10, 10, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 2 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 20 * FLOAT_SCALING, 10, 10, false, account_cap_user) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 20 * FLOAT_SCALING, &open_orders); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - // test match with price limit (ask side) - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let (base_quantity_filled, quote_quantity_filled) = clob::test_match_ask( - &mut pool, - &account_cap, - CLIENT_ID_BOB, - 10, - 3 * FLOAT_SCALING, - 0, - ); - assert!(base_quantity_filled == 5); - assert!(quote_quantity_filled == 25); - test::return_shared(pool); - test::return_to_address(bob, account_cap); - }; - next_tx(&mut test, bob); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(quote_custodian, account_cap_user, 55, 20); - custodian::assert_user_balance(base_custodian, account_cap_user, 5, 10); - { - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_empty_tick_level(bids, 5 * FLOAT_SCALING); - }; - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(2, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 10, 10, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 2 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 20 * FLOAT_SCALING, 10, 10, false, account_cap_user) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 20 * FLOAT_SCALING, &open_orders); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - end(test) - } - - fun test_inject_and_price_limit_affected_match_taker_ask_returned_pool_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner = @0xFF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test_wrapped_pool(0, 0, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut wrapped_pool = test::take_shared>(&test); - let pool = borrow_mut_pool(&mut wrapped_pool); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(pool); - let alice_deposit_WIOTA: u64 = 10; - let alice_deposit_USDC: u64 = 100; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - test::return_shared(wrapped_pool); - test::return_to_address(alice, account_cap); - }; - // test inject limit order and match (ask side) - next_tx(&mut test, alice); - { - let mut wrapped_pool = test::take_shared>(&test); - let pool = borrow_mut_pool(&mut wrapped_pool); - let account_cap = test::take_from_address(&test, alice); - // let account_cap_user = get_account_cap_user(&account_cap); - clob::test_inject_limit_order( - pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 2, - 2, - true, - CANCEL_OLDEST, - &account_cap, - ctx(&mut test) - ); - clob::test_inject_limit_order( - pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 3, - 3, - true, - CANCEL_OLDEST, - &account_cap, - ctx(&mut test) - ); - clob::test_inject_limit_order( - pool, - CLIENT_ID_ALICE, - 2 * FLOAT_SCALING, - 10, - 10, - true, - CANCEL_OLDEST, - &account_cap, - ctx(&mut test) - ); - clob::test_inject_limit_order( - pool, - CLIENT_ID_ALICE, - 20 * FLOAT_SCALING, - 10, - 10, - false, - CANCEL_OLDEST, - &account_cap, - ctx(&mut test) - ); - test::return_shared(wrapped_pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let mut wrapped_pool = test::take_shared>(&test); - let pool = borrow_mut_pool(&mut wrapped_pool); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(pool); - custodian::assert_user_balance(quote_custodian, account_cap_user, 55, 45); - custodian::assert_user_balance(base_custodian, account_cap_user, 0, 10); - let (next_bid_order_id, next_ask_order_id, _, _) = clob::get_pool_stat(pool); - assert!(next_bid_order_id == clob::order_id_for_test(3, true)); - assert!(next_ask_order_id == clob::order_id_for_test(1, false)); - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 2, 2, true, account_cap_user) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 3, 3, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(pool); - clob::check_tick_level(bids, 5 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(2, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 10, 10, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(pool); - clob::check_tick_level(bids, 2 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 20 * FLOAT_SCALING, 10, 10, false, account_cap_user) - ); - let (_, _, _, asks) = get_pool_stat(pool); - clob::check_tick_level(asks, 20 * FLOAT_SCALING, &open_orders); - }; - test::return_shared(wrapped_pool); - test::return_to_address(alice, account_cap); - }; - - // test match with price limit (ask side) - next_tx(&mut test, bob); - { - let mut wrapped_pool = test::take_shared>(&test); - let pool = borrow_mut_pool(&mut wrapped_pool); - let account_cap = test::take_from_address(&test, bob); - let (base_quantity_filled, quote_quantity_filled) = clob::test_match_ask( - pool, - &account_cap, - CLIENT_ID_BOB, - 10, - 3 * FLOAT_SCALING, - 0, - ); - assert!(base_quantity_filled == 5); - assert!(quote_quantity_filled == 25); - test::return_shared(wrapped_pool); - test::return_to_address(bob, account_cap); - }; - next_tx(&mut test, bob); - { - let mut wrapped_pool = test::take_shared>(&test); - let pool = borrow_mut_pool(&mut wrapped_pool); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(pool); - custodian::assert_user_balance(quote_custodian, account_cap_user, 55, 20); - custodian::assert_user_balance(base_custodian, account_cap_user, 5, 10); - { - let (_, _, bids, _) = get_pool_stat(pool); - clob::check_empty_tick_level(bids, 5 * FLOAT_SCALING); - }; - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(2, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 10, 10, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(pool); - clob::check_tick_level(bids, 2 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 20 * FLOAT_SCALING, 10, 10, false, account_cap_user) - ); - let (_, _, _, asks) = get_pool_stat(pool); - clob::check_tick_level(asks, 20 * FLOAT_SCALING, &open_orders); - }; - test::return_shared(wrapped_pool); - test::return_to_address(alice, account_cap); - }; - end(test) - } - - fun test_remove_order_(mut test: Scenario): TransactionEffects { - let (alice, _) = people(); - let owner: address = @0xF; - next_tx(&mut test, owner); - { - clob::setup_test(0, 0, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10; - let alice_deposit_USDC: u64 = 100; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 2, 2, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 3, 3, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 10, 10, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 10, 10, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 20 * FLOAT_SCALING, 10, 10, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 2, 2, true, account_cap_user) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 3, 3, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 5 * FLOAT_SCALING, &open_orders); - }; - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(2, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 10, 10, true, account_cap_user) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order(3, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 10, 10, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 2 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 20 * FLOAT_SCALING, 10, 10, false, account_cap_user) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 20 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 2, 2, true, account_cap_user) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 2, 3, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 5 * FLOAT_SCALING, &open_orders); - }; - - // check usr open orders before cancel - { - let mut usr_open_orders_cmp = vector::empty(); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(0, true)); - vector::push_back(&mut usr_open_orders_cmp, 5 * FLOAT_SCALING); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(1, true)); - vector::push_back(&mut usr_open_orders_cmp, 5 * FLOAT_SCALING); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(2, true)); - vector::push_back(&mut usr_open_orders_cmp, 2 * FLOAT_SCALING); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(3, true)); - vector::push_back(&mut usr_open_orders_cmp, 2 * FLOAT_SCALING); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(0, false)); - vector::push_back(&mut usr_open_orders_cmp, 20 * FLOAT_SCALING); - clob::check_usr_open_orders(clob::get_usr_open_orders(&pool, account_cap_user), &usr_open_orders_cmp); - let user_open_orders = clob::get_usr_open_orders(&pool, account_cap_user); - clob::check_usr_open_orders(user_open_orders, &usr_open_orders_cmp); - }; - - clob::test_remove_order(&mut pool, 0, 0, true, account_cap_user); - { - // check tick level from pool after remove order - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 3, 3, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 5 * FLOAT_SCALING, &open_orders); - // check usr open orders after remove order - let mut usr_open_orders_cmp = vector::empty(); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(0, false)); - vector::push_back(&mut usr_open_orders_cmp, 20 * FLOAT_SCALING); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(1, true)); - vector::push_back(&mut usr_open_orders_cmp, 5 * FLOAT_SCALING); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(2, true)); - vector::push_back(&mut usr_open_orders_cmp, 2 * FLOAT_SCALING); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(3, true)); - vector::push_back(&mut usr_open_orders_cmp, 2 * FLOAT_SCALING); - let user_open_orders = clob::get_usr_open_orders(&pool, account_cap_user); - clob::check_usr_open_orders(user_open_orders, &usr_open_orders_cmp); - }; - - clob::test_remove_order(&mut pool, 0, 1, true, account_cap_user); - { - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_empty_tick_level(bids, 5 * FLOAT_SCALING); - let mut usr_open_orders_cmp = vector::empty(); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(0, false)); - vector::push_back(&mut usr_open_orders_cmp, 20 * FLOAT_SCALING); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(3, true)); - vector::push_back(&mut usr_open_orders_cmp, 2 * FLOAT_SCALING); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(2, true)); - vector::push_back(&mut usr_open_orders_cmp, 2 * FLOAT_SCALING); - clob::check_usr_open_orders( - clob::get_usr_open_orders(&pool, account_cap_user), - &usr_open_orders_cmp - ); - }; - - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - end(test) - } - - fun test_remove_all_orders_(mut test: Scenario): TransactionEffects { - let (alice, _) = people(); - let owner: address = @0xF; - next_tx(&mut test, owner); - { - clob::setup_test(0, 0, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10; - let alice_deposit_USDC: u64 = 100; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 2, 2, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 3, 3, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 10, 10, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 10, 10, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 20 * FLOAT_SCALING, 10, 10, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 2, 2, true, account_cap_user) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 3, 3, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 5 * FLOAT_SCALING, &open_orders); - }; - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(2, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 10, 10, true, account_cap_user) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order(3, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 10, 10, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 2 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 20 * FLOAT_SCALING, 10, 10, false, account_cap_user) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 20 * FLOAT_SCALING, &open_orders); - }; - - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 2, 2, true, account_cap_user) - ); - vector::push_back( - &mut open_orders, - clob::test_construct_order(1, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 3, 3, true, account_cap_user) - ); - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_tick_level(bids, 5 * FLOAT_SCALING, &open_orders); - }; - - // check usr open orders before cancel - { - let mut usr_open_orders_cmp = vector::empty(); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(0, true)); - vector::push_back(&mut usr_open_orders_cmp, 5 * FLOAT_SCALING); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(1, true)); - vector::push_back(&mut usr_open_orders_cmp, 5 * FLOAT_SCALING); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(2, true)); - vector::push_back(&mut usr_open_orders_cmp, 2 * FLOAT_SCALING); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(3, true)); - vector::push_back(&mut usr_open_orders_cmp, 2 * FLOAT_SCALING); - vector::push_back(&mut usr_open_orders_cmp, order_id_for_test(0, false)); - vector::push_back(&mut usr_open_orders_cmp, 20 * FLOAT_SCALING); - clob::check_usr_open_orders(clob::get_usr_open_orders(&pool, account_cap_user), &usr_open_orders_cmp); - let user_open_orders = clob::get_usr_open_orders(&pool, account_cap_user); - clob::check_usr_open_orders(user_open_orders, &usr_open_orders_cmp); - }; - - clob::cancel_all_orders(&mut pool, &account_cap); - { - let usr_open_orders_cmp = vector::empty(); - let user_open_orders = clob::get_usr_open_orders(&pool, account_cap_user); - clob::check_usr_open_orders(user_open_orders, &usr_open_orders_cmp); - - // check tick level after remove - let (_, _, bids, asks) = get_pool_stat(&pool); - clob::check_empty_tick_level(bids, 5 * FLOAT_SCALING); - clob::check_empty_tick_level(bids, 2 * FLOAT_SCALING); - clob::check_empty_tick_level(asks, 20 * FLOAT_SCALING); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(base_custodian, account_cap_user, 10, 0); - custodian::assert_user_balance(quote_custodian, account_cap_user, 100, 0); - let (base_avail, base_locked, quote_avail, quote_locked) = account_balance(&pool, &account_cap); - assert!(base_avail == 10); - assert!(base_locked == 0); - assert!(quote_avail == 100); - assert!(quote_locked == 0); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - end(test) - } - - // This test covers the following scenario: - // In an order book, there are only some limit buy orders placed by Alice. - // When Alice uses a market sell order to consume liquidity from the order book - // and matches her own limit buy orders, - // we needs to cancel all the previous limit buy orders - // and correctly refunding to her custodian account - fun test_place_market_sell_order_with_skipping_self_matching_(mut test: Scenario): TransactionEffects { - let (alice, _) = people(); - let owner: address = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_sender(&test); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - custodian::deposit(base_custodian, mint_for_testing(1000, ctx(&mut test)), account_cap_user); - custodian::deposit(quote_custodian, mint_for_testing(10000, ctx(&mut test)), account_cap_user); - test::return_shared(pool); - test::return_to_sender(&test, account_cap); - }; - - // alice places limit orders - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let clock = test::take_shared(&test); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 200, - CANCEL_OLDEST, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 300, - CANCEL_OLDEST, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 2 * FLOAT_SCALING, - 1000, - CANCEL_OLDEST, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 20 * FLOAT_SCALING, - 1000, - CANCEL_OLDEST, - false, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - let (next_bid_order_id, next_ask_order_id, _, _) = clob::get_pool_stat(&pool); - assert!(next_bid_order_id == clob::order_id_for_test(3, true)); - assert!(next_ask_order_id == clob::order_id_for_test(1, false)); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(base_custodian, account_cap_user, 0, 1000); - custodian::assert_user_balance(quote_custodian, account_cap_user, 5500, 4500); - let (base_avail, base_locked, quote_avail, quote_locked) = account_balance(&pool, &account_cap); - assert!(base_avail == 0); - assert!(base_locked == 1000); - assert!(quote_avail == 5500); - assert!(quote_locked == 4500); - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(alice, account_cap); - }; - - // alice places market order - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let clock = test::take_shared(&test); - let account_cap = test::take_from_address(&test, alice); - let (coin1, coin2) =clob::place_market_order(&mut pool, &account_cap, CLIENT_ID_ALICE, 600, - false, - mint_for_testing(600, ctx(&mut test)), - mint_for_testing(0, ctx(&mut test)), - &clock, - ctx(&mut test)); - assert!(coin::value(&coin1) == 600); - assert!(coin::value(&coin2) == 0); - burn_for_testing(coin1); - burn_for_testing(coin2); - - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(base_custodian, account_cap_user, 0, 1000); - custodian::assert_user_balance(quote_custodian, account_cap_user, 10000, 0); - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(alice, account_cap); - }; - end(test) - } - - // This test covers the following scenario: - // In an order book, there are only some limit sell orders placed by Alice. - // When Alice uses a market buy order to consume liquidity from the order book - // and matches her own limit sell orders, - // we needs to cancel all the previous limit sell orders - // and correctly refunding to her custodian account - fun test_place_market_buy_order_with_skipping_self_matching_(mut test: Scenario): TransactionEffects { - let (alice, _) = people(); - let owner: address = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_sender(&test); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - custodian::deposit(base_custodian, mint_for_testing(1500, ctx(&mut test)), account_cap_user); - custodian::deposit(quote_custodian, mint_for_testing(10000, ctx(&mut test)), account_cap_user); - test::return_shared(pool); - test::return_to_sender(&test, account_cap); - }; - - // alice places limit orders - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let clock = test::take_shared(&test); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 200, - CANCEL_OLDEST, - false, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 300, - CANCEL_OLDEST, - false, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 2 * FLOAT_SCALING, - 1000, - CANCEL_OLDEST, - false, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 1 * FLOAT_SCALING, - 1000, - CANCEL_OLDEST, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - let (next_bid_order_id, next_ask_order_id, _, _) = clob::get_pool_stat(&pool); - assert!(next_bid_order_id == clob::order_id_for_test(1, true)); - assert!(next_ask_order_id == clob::order_id_for_test(3, false)); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(base_custodian, account_cap_user, 0, 1500); - custodian::assert_user_balance(quote_custodian, account_cap_user, 9000, 1000); - let (base_avail, base_locked, quote_avail, quote_locked) = account_balance(&pool, &account_cap); - assert!(base_avail == 0); - assert!(base_locked == 1500); - assert!(quote_avail == 9000); - assert!(quote_locked == 1000); - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(alice, account_cap); - }; - - // alice places market buy order - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let clock = test::take_shared(&test); - let account_cap = test::take_from_address(&test, alice); - let (coin1, coin2) =clob::place_market_order(&mut pool, &account_cap, CLIENT_ID_ALICE, 1, - true, - mint_for_testing(0, ctx(&mut test)), - mint_for_testing(1, ctx(&mut test)), - &clock, - ctx(&mut test)); - assert!(coin::value(&coin1) == 0); - assert!(coin::value(&coin2) == 1); - burn_for_testing(coin1); - burn_for_testing(coin2); - - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(base_custodian, account_cap_user, 1500, 0); - custodian::assert_user_balance(quote_custodian, account_cap_user, 9000, 1000); - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(alice, account_cap); - }; - end(test) - } - - // This test covers the following scenario: - // there are some limit buy orders placed by Alice. - // When Alice continue to place a limit sell order - // and it can be matched with her own previous limit buy order - // We need to cancel all limit buy orders within the range of matching with the limit sell order. - // and correctly refunding to her custodian account - fun test_place_limit_order_with_skipping_self_matching_(mut test: Scenario): TransactionEffects { - let (alice, _) = people(); - let owner: address = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_sender(&test); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - custodian::deposit(base_custodian, mint_for_testing(1000, ctx(&mut test)), account_cap_user); - custodian::deposit(quote_custodian, mint_for_testing(10000, ctx(&mut test)), account_cap_user); - test::return_shared(pool); - test::return_to_sender(&test, account_cap); - }; - // alice places limit orders - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let clock = test::take_shared(&test); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 200, - CANCEL_OLDEST, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 5 * FLOAT_SCALING, - 300, - CANCEL_OLDEST, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 2 * FLOAT_SCALING, - 1000, - CANCEL_OLDEST, - true, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 20 * FLOAT_SCALING, - 1000, - CANCEL_OLDEST, - false, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - let (next_bid_order_id, next_ask_order_id, _, _) = clob::get_pool_stat(&pool); - assert!(next_bid_order_id == clob::order_id_for_test(3, true)); - assert!(next_ask_order_id == clob::order_id_for_test(1, false)); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(base_custodian, account_cap_user, 0, 1000); - custodian::assert_user_balance(quote_custodian, account_cap_user, 5500, 4500); - let (base_avail, base_locked, quote_avail, quote_locked) = account_balance(&pool, &account_cap); - assert!(base_avail == 0); - assert!(base_locked == 1000); - assert!(quote_avail == 5500); - assert!(quote_locked == 4500); - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_sender(&test); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, _) = clob::borrow_mut_custodian(&mut pool); - custodian::deposit(base_custodian, mint_for_testing(400, ctx(&mut test)), account_cap_user); - test::return_shared(pool); - test::return_to_sender(&test, account_cap); - }; - // alice places limit order - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_sender(&test); - let clock = test::take_shared(&test); - let (base_quantity_filled, quote_quantity_filled, is_placed, order_id) = clob::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - 4 * FLOAT_SCALING, - 400, - CANCEL_OLDEST, - false, - TIMESTAMP_INF, - POST_OR_ABORT, - &clock, - &account_cap, - ctx(&mut test) - ); - assert!(base_quantity_filled == 0); - assert!(quote_quantity_filled == 0); - assert!(is_placed == true); - assert!(order_id == MIN_ASK_ORDER_ID + 1); - - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(alice, account_cap); - }; - - // check alice's balance - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_sender(&test); - let clock = test::take_shared(&test); - - let (base_avail, base_locked, quote_avail, quote_locked) = account_balance(&pool, &account_cap); - assert!(base_avail == 0); - assert!(base_locked == 1000 + 400); - assert!(quote_avail == 8000); - assert!(quote_locked == 2000); - - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(alice, account_cap); - }; - end(test) - } - - // This test scenario is similar to "test_place_market_order_with_skipping_self_matching_", - // but it verifies the logic when we want to swap the exact quote asset for the base asset. - fun test_swap_exact_quote_for_base_with_skipping_self_matching_(mut test: Scenario): TransactionEffects { - let (alice, _) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10000; - let alice_deposit_USDC: u64 = 10000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE,1 * FLOAT_SCALING, 10000, 10000, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let clock = test::take_shared(&test); - let account_cap = test::take_from_address(&test, alice); - let (base_coin, quote_coin, _) = clob::swap_exact_quote_for_base( - &mut pool, - CLIENT_ID_ALICE, - &account_cap, - 4500, - &clock, - mint_for_testing(4500, ctx(&mut test)), - ctx(&mut test) - ); - assert!(coin::value(&base_coin) == 0); - assert!(coin::value("e_coin) == 4500); - burn_for_testing(base_coin); - burn_for_testing(quote_coin); - - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(base_custodian, account_cap_user, 10000, 0); - custodian::assert_user_balance(quote_custodian, account_cap_user, 0, 10000); - - test::return_shared(clock); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - end(test) - } - - // This test covers the following scenario: - // there are some limit sell orders placed by invoking inject_limit_order - // And directly perform the matching using the match_bid method. - // When encountering self-matching, we should cancel all the oldest sell orders - // and check if the order status in the order book and the user balance in the custodian account are correct. - fun test_inject_and_match_taker_bid_with_skipping_self_matching_(mut test: Scenario): TransactionEffects { - let (alice, _) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10000; - let alice_deposit_USDC: u64 = 10000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 1 * FLOAT_SCALING, 10000, 10000, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - // test match (bid side) - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let (base_quantity_filled, quote_quantity_filled) = clob::test_match_bid( - &mut pool, - &account_cap, - CLIENT_ID_ALICE, - 1, - MAX_PRICE, - 0, - ); - assert!(base_quantity_filled == 0); - assert!(quote_quantity_filled == 0); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance(base_custodian, account_cap_user, 10000, 0); - custodian::assert_user_balance(quote_custodian, account_cap_user, 0, 10000); - let (next_bid_order_id, next_ask_order_id, _, _) = clob::get_pool_stat(&pool); - assert!(next_bid_order_id == clob::order_id_for_test(1, true)); - assert!(next_ask_order_id == clob::order_id_for_test(3, false)); - { - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_empty_tick_level(asks, 2 * FLOAT_SCALING); - }; - { - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_empty_tick_level(asks, 5 * FLOAT_SCALING); - }; - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE,1 * FLOAT_SCALING, 10000, 10000, true, account_cap_user) - ); - let (_, _, bid, _) = get_pool_stat(&pool); - clob::check_tick_level(bid, 1 * FLOAT_SCALING, &open_orders); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - end(test) - } - - // This test covers the following scenario: - // there are some limit buy orders placed by invoking inject_limit_order - // And directly perform the matching using the match_ask method. - // When encountering self-matching, we should cancel all the oldest buy orders - // and check if the order status in the order book and the user balance in the custodian account are correct. - fun test_inject_and_match_taker_ask_with_skipping_self_matching_(mut test: Scenario): TransactionEffects { - let (alice, _) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10000; - let alice_deposit_USDC: u64 = 10000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - // test inject limit order and match (ask side) - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 2 * FLOAT_SCALING, 1000, 1000, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 10 * FLOAT_SCALING, 10000, 10000, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - // test match (ask side) - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let (base_quantity_filled, quote_quantity_filled) = clob::test_match_ask( - &mut pool, - &account_cap, - CLIENT_ID_ALICE, - 1500, - MIN_PRICE, - 0, - ); - assert!(base_quantity_filled == 0); - assert!(quote_quantity_filled == 0); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - custodian::assert_user_balance( - quote_custodian, - account_cap_user, - 10000, - 0 - ); - custodian::assert_user_balance( - base_custodian, - account_cap_user, - 0, - 10000 - ); - { - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_empty_tick_level(bids, 5 * FLOAT_SCALING); - }; - { - let (_, _, bids, _) = get_pool_stat(&pool); - clob::check_empty_tick_level(bids, 2 * FLOAT_SCALING); - }; - { - let mut open_orders = vector::empty(); - vector::push_back( - &mut open_orders, - clob::test_construct_order(0, CLIENT_ID_ALICE, 10 * FLOAT_SCALING, 10000, 10000, false, account_cap_user) - ); - let (_, _, _, asks) = get_pool_stat(&pool); - clob::check_tick_level(asks, 10 * FLOAT_SCALING, &open_orders); - }; - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - end(test) - } - - #[test] - fun test_cancel_order_no_rounding(): TransactionEffects { - let mut test = scenario(); - let (alice, bob) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(0, 0, &mut test, owner); - }; - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let clock = test::take_shared(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 1000000000; - let alice_deposit_USDC: u64 = 1000000000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - let(_, _) = custodian::account_balance(quote_custodian, account_cap_user); - // Example buying 0.1 iota, for the price of .719 - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 719000, 1000000000, 1000000000, true, - CANCEL_OLDEST, &account_cap,ctx(&mut test)); - - // Example selling 0.1 iota for the price of .519 - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 519000, 1000000000, 1000000000, false, - CANCEL_OLDEST, &account_cap,ctx(&mut test)); - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(alice, account_cap); - }; - - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - clob::check_balance_invariants_for_account(&account_cap, quote_custodian, base_custodian, &pool); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, bob); - // Buys some iota from alice - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let clock = test::take_shared(&test); - - let (mut base_coin, mut quote_coin, _) = clob::swap_exact_base_for_quote( - &mut pool, - CLIENT_ID_BOB, - &account_cap, - 100000, - mint_for_testing(100000000, ctx(&mut test)), - mint_for_testing(0, ctx(&mut test)), - &clock, - ctx(&mut test) - ); - - burn_for_testing(base_coin); - burn_for_testing(quote_coin); - - // buy second time - (base_coin, quote_coin, _) = clob::swap_exact_base_for_quote( - &mut pool, - CLIENT_ID_BOB, - &account_cap, - 100000, - mint_for_testing(100000000, ctx(&mut test)), - mint_for_testing(0, ctx(&mut test)), - &clock, - ctx(&mut test) - ); - - burn_for_testing(base_coin); - burn_for_testing(quote_coin); - - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(bob, account_cap); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - // cancel all order - // clob::cancel_order(&mut pool, 1, &account_cap); - // clob::cancel_all_orders(&mut pool, &account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - clob::check_balance_invariants_for_account(&account_cap, quote_custodian, base_custodian, &pool); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, bob); - // Sells some USDC to alice - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let clock = test::take_shared(&test); - - let (base_coin, quote_coin) = clob::place_market_order( - &mut pool, - &account_cap, - CLIENT_ID_BOB, - 100000, - true, - mint_for_testing(0, ctx(&mut test)), - mint_for_testing(100000, ctx(&mut test)), - &clock, - ctx(&mut test) - ); - - burn_for_testing(base_coin); - burn_for_testing(quote_coin); - - // buy second time - let (base_coin, quote_coin) = clob::place_market_order( - &mut pool, - &account_cap, - CLIENT_ID_BOB, - 100000, - true, - mint_for_testing(0, ctx(&mut test)), - mint_for_testing(100000, ctx(&mut test)), - &clock, - ctx(&mut test) - ); - - burn_for_testing(base_coin); - burn_for_testing(quote_coin); - - - // Buys but this time utilizes a different code path - let (base_coin, quote_coin) = clob::place_market_order( - &mut pool, - &account_cap, - CLIENT_ID_BOB, - 100000, - false, - mint_for_testing(100000, ctx(&mut test)), - mint_for_testing(0, ctx(&mut test)), - &clock, - ctx(&mut test) - ); - - burn_for_testing(base_coin); - burn_for_testing(quote_coin); - - // buy second time - let (base_coin, quote_coin) = clob::place_market_order( - &mut pool, - &account_cap, - CLIENT_ID_BOB, - 100000, - false, - mint_for_testing(100000, ctx(&mut test)), - mint_for_testing(0, ctx(&mut test)), - &clock, - ctx(&mut test) - ); - - burn_for_testing(base_coin); - burn_for_testing(quote_coin); - - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(bob, account_cap); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - clob::check_balance_invariants_for_account(&account_cap, quote_custodian, base_custodian, &pool); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - // Check cancel all orders returns all funds - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - // cancel all order - clob::cancel_all_orders(&mut pool, &account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - clob::check_balance_invariants_for_account(&account_cap, quote_custodian, base_custodian, &pool); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - end(test) - } - - #[test] - fun test_rounding_lock_order(): TransactionEffects { - let mut test = scenario(); - let (alice, bob) = people(); - let alice2 = @0xCAFE; - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(0, 0, &mut test, owner); - }; - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - mint_account_cap_transfer(alice2, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let clock = test::take_shared(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 2000000000; - let alice_deposit_USDC: u64 = 2000000000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - let(_, _) = custodian::account_balance(quote_custodian, account_cap_user); - // Example buying 0.1 iota, for the price of .719 - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 719000, 1000000000, 1000000000, true, - CANCEL_OLDEST, &account_cap,ctx(&mut test)); - - // alice's second bid order, which will be locked - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 718000, 1000000000, 1000000000, true, - CANCEL_OLDEST, &account_cap,ctx(&mut test)); - - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(alice, account_cap); - }; - - next_tx(&mut test, bob); - // Sell iota to alice, first rounding token cut in match_ask else clause - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, bob); - let clock = test::take_shared(&test); - - let (base_coin, quote_coin, _) = clob::swap_exact_base_for_quote( - &mut pool, - CLIENT_ID_BOB, - &account_cap, - 100000, - mint_for_testing(100000000, ctx(&mut test)), - mint_for_testing(0, ctx(&mut test)), - &clock, - ctx(&mut test) - ); - - burn_for_testing(base_coin); - burn_for_testing(quote_coin); - - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(bob, account_cap); - }; - next_tx(&mut test, alice); - // alice self matching, second rounding token cut in match_ask if clause - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let clock = test::take_shared(&test); - - let (base_coin, quote_coin, _) = clob::swap_exact_base_for_quote( - &mut pool, - CLIENT_ID_ALICE, - &account_cap, - 100000, - mint_for_testing(100000000, ctx(&mut test)), - mint_for_testing(0, ctx(&mut test)), - &clock, - ctx(&mut test) - ); - - burn_for_testing(base_coin); - burn_for_testing(quote_coin); - - test::return_shared(pool); - test::return_shared(clock); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - { - let pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - clob::check_balance_invariants_for_account(&account_cap, quote_custodian, base_custodian, &pool); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - next_tx(&mut test, alice); - // Check cancel all orders returns all funds - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - // cancel all order - clob::cancel_all_orders(&mut pool, &account_cap); - let (base_custodian, quote_custodian) = clob::borrow_custodian(&pool); - clob::check_balance_invariants_for_account(&account_cap, quote_custodian, base_custodian, &pool); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - end(test) - } - - fun test_swap_exact_quote_for_base_with_metadata_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10000; - let alice_deposit_USDC: u64 = 10000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, false, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let clock = test::take_shared(&test); - let account_cap = test::take_from_address(&test, bob); - let (base_coin, quote_coin, _, of_events) = clob::swap_exact_quote_for_base_with_metadata( - &mut pool, - CLIENT_ID_BOB, - &account_cap, - 5000, - &clock, - mint_for_testing(5000, ctx(&mut test)), - ctx(&mut test) - ); - - let of_event = vector::borrow(&of_events, 0); - let (_, _, is_bid, _, _, base_asset_quantity_filled, price, _ , _) = clob::matched_order_metadata_info(of_event); - assert!(is_bid == false); - assert!(base_asset_quantity_filled == 500); - assert!(price == 5 * FLOAT_SCALING); - - burn_for_testing(base_coin); - burn_for_testing(quote_coin); - test::return_shared(clock); - test::return_shared(pool); - test::return_to_address(bob, account_cap); - }; - end(test) - } - - fun test_swap_exact_base_for_quote_with_metadata_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10000; - let alice_deposit_USDC: u64 = 10000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let clock = test::take_shared(&test); - let account_cap = test::take_from_address(&test, bob); - let (base_coin, quote_coin, _, of_events) = clob::swap_exact_base_for_quote_with_metadata( - &mut pool, - CLIENT_ID_BOB, - &account_cap, - 500, - mint_for_testing(500, ctx(&mut test)), - mint_for_testing(0, ctx(&mut test)), - &clock, - ctx(&mut test) - ); - - let of_event = vector::borrow(&of_events, 0); - let (_, _, is_bid, _, _, base_asset_quantity_filled, price, _ , _) = clob::matched_order_metadata_info(of_event); - assert!(is_bid == true); - assert!(base_asset_quantity_filled == 500); - assert!(price == 5 * FLOAT_SCALING); - - burn_for_testing(base_coin); - burn_for_testing(quote_coin); - test::return_shared(clock); - test::return_shared(pool); - test::return_to_address(bob, account_cap); - }; - end(test) - } - - fun test_place_market_order_with_metadata_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10000; - let alice_deposit_USDC: u64 = 10000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let clock = test::take_shared(&test); - let account_cap = test::take_from_address(&test, bob); - let (base_coin, quote_coin, of_events) = clob::place_market_order_with_metadata( - &mut pool, - &account_cap, - CLIENT_ID_BOB, - 500, - false, - mint_for_testing(500, ctx(&mut test)), - mint_for_testing(0, ctx(&mut test)), - &clock, - ctx(&mut test) - ); - - let of_event = vector::borrow(&of_events, 0); - let (_, _, is_bid, _, _, base_asset_quantity_filled, price, _ , _) = clob::matched_order_metadata_info(of_event); - assert!(is_bid == true); - assert!(base_asset_quantity_filled == 500); - assert!(price == 5 * FLOAT_SCALING); - - burn_for_testing(base_coin); - burn_for_testing(quote_coin); - test::return_shared(clock); - test::return_shared(pool); - test::return_to_address(bob, account_cap); - }; - end(test) - } - - fun test_place_limit_order_with_metadata_(mut test: Scenario): TransactionEffects { - let (alice, bob) = people(); - let owner = @0xF; - // setup pool and custodian - next_tx(&mut test, owner); - { - clob::setup_test(5000000, 2500000, &mut test, owner); - }; - next_tx(&mut test, alice); - { - mint_account_cap_transfer(alice, test::ctx(&mut test)); - }; - next_tx(&mut test, bob); - { - mint_account_cap_transfer(bob, test::ctx(&mut test)); - }; - next_tx(&mut test, alice); - { - let mut pool = test::take_shared>(&test); - let account_cap = test::take_from_address(&test, alice); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob::borrow_mut_custodian(&mut pool); - let alice_deposit_WIOTA: u64 = 10000; - let alice_deposit_USDC: u64 = 10000; - custodian::test_increase_user_available_balance(base_custodian, account_cap_user, alice_deposit_WIOTA); - custodian::test_increase_user_available_balance(quote_custodian, account_cap_user, alice_deposit_USDC); - clob::test_inject_limit_order(&mut pool, CLIENT_ID_ALICE, 5 * FLOAT_SCALING, 500, 500, true, - CANCEL_OLDEST, &account_cap, ctx(&mut test)); - test::return_shared(pool); - test::return_to_address(alice, account_cap); - }; - - next_tx(&mut test, bob); - { - let mut pool = test::take_shared>(&test); - let clock = test::take_shared(&test); - let account_cap = test::take_from_address(&test, bob); - let bob_deposit_WIOTA: u64 = 10000; - let (base_custodian, _) = clob::borrow_mut_custodian(&mut pool); - custodian::test_increase_user_available_balance(base_custodian, account_owner(&account_cap), bob_deposit_WIOTA); - let (_, _, _, _, of_events) = clob::place_limit_order_with_metadata( - &mut pool, - CLIENT_ID_BOB, - 5 * FLOAT_SCALING, - 500, - CANCEL_OLDEST, - false, - TIMESTAMP_INF, - 0, - &clock, - &account_cap, - ctx(&mut test) - ); - - let of_event = vector::borrow(&of_events, 0); - let (_, _, is_bid, _, _, base_asset_quantity_filled, price, _ , _) = clob::matched_order_metadata_info(of_event); - assert!(is_bid == true); - assert!(base_asset_quantity_filled == 500); - assert!(price == 5 * FLOAT_SCALING); - - test::return_shared(clock); - test::return_shared(pool); - test::return_to_address(bob, account_cap); - }; - end(test) - } - - fun scenario(): Scenario { test::begin(@0x1) } - - fun people(): (address, address) { (@0xBEEF, @0x1337) } -} diff --git a/crates/iota-framework/packages/deepbook/tests/critbit_tests.move b/crates/iota-framework/packages/deepbook/tests/critbit_tests.move deleted file mode 100644 index c9ff8a6b370..00000000000 --- a/crates/iota-framework/packages/deepbook/tests/critbit_tests.move +++ /dev/null @@ -1,511 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -#[test_only] -module deepbook::critbit_test { - use deepbook::critbit::{Self, InternalNode, Leaf, check_tree_struct}; - use iota::test_scenario::{Self as test, ctx, Scenario, next_tx, end, TransactionEffects}; - use iota::test_utils::assert_eq; - - const PARTITION_INDEX: u64 = 1 << 63; // 9223372036854775808 - const MAX_U64: u64 = 0xFFFFFFFFFFFFFFFF; // 18446744073709551615 - - #[test] fun test_insert() { let _ = test_insert_(scenario());} - - #[test] fun test_next_leaf() { let _ = test_next_leaf_(scenario());} - - #[test] fun test_previous_leaf() { let _ = test_previous_leaf_(scenario());} - - #[test] fun test_min_max_leaf() { let _ = test_min_max_leaf_(scenario());} - - #[test] fun test_remove() { let _ = test_remove_(scenario());} - - #[test] fun test_find_closest_key() { let _ = test_find_closest_key_(scenario());} - - - fun test_insert_(mut test: Scenario): TransactionEffects{ - let (owner, _) = people(); - - next_tx(&mut test, owner); { - let mut t1 = critbit::new(ctx(&mut test)); - critbit::insert_leaf(&mut t1, 48, 48); - critbit::insert_leaf(&mut t1, 16, 16); - critbit::insert_leaf(&mut t1, 1, 1); - critbit::insert_leaf(&mut t1, 3, 3); - - let internal_nodes_keys = vector[0, 1, 2]; - let internal_nodes = vector [ - critbit::new_internal_node_for_test(32, PARTITION_INDEX, 1, MAX_U64 - 0), - critbit::new_internal_node_for_test(16, 0, 2, MAX_U64 - 1), - critbit::new_internal_node_for_test(2, 1, MAX_U64 - 2, MAX_U64 - 3), - ]; - let leaves_keys = vector[0, 1, 2, 3]; - let leaves = vector>[ - critbit::new_leaf_for_test(48, 48, 0), - critbit::new_leaf_for_test(16, 16, 1), - critbit::new_leaf_for_test(1, 1, 2), - critbit::new_leaf_for_test(3, 3, 2) - ]; - let is_equal = check_tree_struct( - &t1, - &internal_nodes_keys, - &internal_nodes, - &leaves_keys, - &leaves, - 0, - 2, - 0 - ); - assert_eq(is_equal, true); - - critbit::drop(t1) - }; - - next_tx(&mut test, owner); { - let mut t1 = critbit::new(ctx(&mut test)); - critbit::insert_leaf(&mut t1, 1, 1); - critbit::insert_leaf(&mut t1, 3, 3); - critbit::insert_leaf(&mut t1, 16, 16); - critbit::insert_leaf(&mut t1, 48, 48); - - - let internal_nodes_keys = vector[0, 1 , 2]; - let internal_nodes = vector [ - critbit::new_internal_node_for_test(2, 1, MAX_U64, MAX_U64 - 1), - critbit::new_internal_node_for_test(16, 2, 0, MAX_U64 - 2), - critbit::new_internal_node_for_test(32, PARTITION_INDEX, 1, MAX_U64 - 3), - ]; - let leaves_keys = vector[0, 1, 2, 3]; - let leaves = vector>[ - critbit::new_leaf_for_test(1, 1, 0), - critbit::new_leaf_for_test(3, 3, 0), - critbit::new_leaf_for_test(16, 16, 1), - critbit::new_leaf_for_test(48, 48, 2) - ]; - let is_equal = check_tree_struct( - &t1, - &internal_nodes_keys, - &internal_nodes, - &leaves_keys, - &leaves, - 2, - 0, - 3, - ); - assert!(is_equal); - let (res, index) = critbit::find_leaf(&t1 , 48); - assert!(res == true); - assert!(index == 3); - - let (min_leaf_key, min_leaf_index) = critbit::min_leaf(&t1); - assert!(min_leaf_key == 1); - assert!(min_leaf_index == 0); - - let (max_leaf_key, max_leaf_index) = critbit::max_leaf(&t1); - assert!(max_leaf_key == 48); - assert!(max_leaf_index == 3); - - let (mut key, mut index) = critbit::next_leaf(&t1, 1); - assert!(key == 3); - assert!(index == 1); - (key, index) = critbit::next_leaf(&t1, 3); - assert!(key == 16); - assert!(index == 2); - (key, index) = critbit::next_leaf(&t1, 16); - assert!(key == 48); - assert!(index == 3); - (key, index) = critbit::next_leaf(&t1, 48); - assert!(key == 0); - assert!(index == PARTITION_INDEX); - - (key, index) = critbit::previous_leaf(&t1, 1); - assert!(key == 0); - assert!(index == PARTITION_INDEX); - (key, index) = critbit::previous_leaf(&t1, 3); - assert!(key == 1); - assert!(index == 0); - (key, index) = critbit::previous_leaf(&t1, 16); - assert!(key == 3); - assert!(index == 1); - (key, index) = critbit::previous_leaf(&t1, 48); - assert!(key == 16); - assert!(index == 2); - critbit::drop(t1) - }; - - next_tx(&mut test, owner); { - let mut t1 = critbit::new(ctx(&mut test)); - - critbit::insert_leaf(&mut t1, 128, 128); - critbit::insert_leaf(&mut t1, 160, 160); - critbit::insert_leaf(&mut t1, 240, 240); - critbit::insert_leaf(&mut t1, 161, 161); - - let internal_nodes_keys = vector[0, 1 , 2]; - let internal_nodes = vector [ - critbit::new_internal_node_for_test(32, 1, MAX_U64, 2), - critbit::new_internal_node_for_test(64, PARTITION_INDEX, 0, MAX_U64 - 2), - critbit::new_internal_node_for_test(1, 0, MAX_U64 - 1, MAX_U64 - 3), - ]; - - let leaves_keys = vector[0, 1, 2, 3]; - let leaves = vector>[ - critbit::new_leaf_for_test(128, 128, 0), - critbit::new_leaf_for_test(160, 160, 2), - critbit::new_leaf_for_test(240, 240, 1), - critbit::new_leaf_for_test(161, 161, 2) - ]; - - let is_equal = check_tree_struct( - &t1, - &internal_nodes_keys, - &internal_nodes, - &leaves_keys, - &leaves, - 1, - 0, - 2, - ); - assert!(is_equal); - - critbit::drop(t1) - }; - - end(test) - } - - fun test_next_leaf_(mut test: Scenario): TransactionEffects{ - let (owner, _) = people(); - - next_tx(&mut test, owner); { - let mut t1 = critbit::new(ctx(&mut test)); - critbit::insert_leaf(&mut t1, 48, 48); - critbit::insert_leaf(&mut t1, 16, 16); - critbit::insert_leaf(&mut t1, 1, 1); - critbit::insert_leaf(&mut t1, 3, 3); - - let (mut key, mut index) = critbit::next_leaf(&t1, 1); - assert_eq(key,3); - assert_eq(index,3); - (key, index) = critbit::next_leaf(&t1, 3); - assert_eq(key,16); - assert_eq(index,1); - (key, index) = critbit::next_leaf(&t1, 16); - assert_eq(key,48); - assert_eq(index,0); - (key, index) = critbit::next_leaf(&t1, 48); - assert_eq(key,0); - assert_eq(index,PARTITION_INDEX); - - critbit::drop(t1) - }; - - next_tx(&mut test, owner); { - let mut t1 = critbit::new(ctx(&mut test)); - critbit::insert_leaf(&mut t1, 1, 1); - critbit::insert_leaf(&mut t1, 3, 3); - critbit::insert_leaf(&mut t1, 16, 16); - critbit::insert_leaf(&mut t1, 48, 48); - - let (mut key, mut index) = critbit::next_leaf(&t1, 1); - assert_eq(key,3); - assert_eq(index,1); - (key, index) = critbit::next_leaf(&t1, 3); - assert_eq(key,16); - assert_eq(index,2); - (key, index) = critbit::next_leaf(&t1, 16); - assert_eq(key,48); - assert_eq(index,3); - (key, index) = critbit::next_leaf(&t1, 48); - assert_eq(key,0); - assert_eq(index, PARTITION_INDEX); - - critbit::drop(t1) - }; - - end(test) - } - - fun test_previous_leaf_(mut test: Scenario): TransactionEffects{ - let (owner, _) = people(); - - next_tx(&mut test, owner); { - let mut t1 = critbit::new(ctx(&mut test)); - critbit::insert_leaf(&mut t1, 48, 48); - critbit::insert_leaf(&mut t1, 16, 16); - critbit::insert_leaf(&mut t1, 1, 1); - critbit::insert_leaf(&mut t1, 3, 3); - - let (mut key, mut index) = critbit::previous_leaf(&t1, 1); - assert_eq(key,0); - assert_eq(index,PARTITION_INDEX); - (key, index) = critbit::previous_leaf(&t1, 3); - assert_eq(key,1); - assert_eq(index,2); - (key, index) = critbit::previous_leaf(&t1, 16); - assert_eq(key,3); - assert_eq(index,3); - (key, index) = critbit::previous_leaf(&t1, 48); - assert_eq(key,16); - assert_eq(index,1); - - critbit::drop(t1) - }; - - next_tx(&mut test, owner); { - let mut t1 = critbit::new(ctx(&mut test)); - critbit::insert_leaf(&mut t1, 1, 1); - critbit::insert_leaf(&mut t1, 3, 3); - critbit::insert_leaf(&mut t1, 16, 16); - critbit::insert_leaf(&mut t1, 48, 48); - - let (mut key, mut index) = critbit::previous_leaf(&t1, 1); - assert_eq(key,0); - assert_eq(index, PARTITION_INDEX); - (key, index) = critbit::previous_leaf(&t1, 3); - assert_eq(key,1); - assert_eq(index,0); - (key, index) = critbit::previous_leaf(&t1, 16); - assert_eq(key,3); - assert_eq(index,1); - (key, index) = critbit::previous_leaf(&t1, 48); - assert_eq(key,16); - assert_eq(index,2); - - critbit::drop(t1) - }; - - end(test) - } - - fun test_min_max_leaf_(mut test: Scenario): TransactionEffects{ - let (owner, _) = people(); - - next_tx(&mut test, owner); { - let mut t1 = critbit::new(ctx(&mut test)); - critbit::insert_leaf(&mut t1, 48, 48); - critbit::insert_leaf(&mut t1, 16, 16); - critbit::insert_leaf(&mut t1, 1, 1); - critbit::insert_leaf(&mut t1, 3, 3); - - let (min_leaf_key, min_leaf_index) = critbit::min_leaf(&t1); - assert_eq(min_leaf_key, 1); - assert_eq(min_leaf_index, 2); - - let (max_leaf_key, max_leaf_index) = critbit::max_leaf(&t1); - assert_eq(max_leaf_key, 48); - assert_eq(max_leaf_index, 0); - - critbit::drop(t1) - }; - - next_tx(&mut test, owner); { - let mut t1 = critbit::new(ctx(&mut test)); - critbit::insert_leaf(&mut t1, 1, 1); - critbit::insert_leaf(&mut t1, 3, 3); - critbit::insert_leaf(&mut t1, 16, 16); - critbit::insert_leaf(&mut t1, 48, 48); - - let (min_leaf_key, min_leaf_index) = critbit::min_leaf(&t1); - assert_eq(min_leaf_key, 1); - assert_eq(min_leaf_index, 0); - - let (max_leaf_key, max_leaf_index) = critbit::max_leaf(&t1); - assert_eq(max_leaf_key, 48); - assert_eq(max_leaf_index, 3); - - critbit::drop(t1) - }; - - end(test) - } - - fun test_remove_(mut test: Scenario): TransactionEffects{ - let (owner, _) = people(); - - next_tx(&mut test, owner); { - let mut t1 = critbit::new(ctx(&mut test)); - critbit::insert_leaf(&mut t1, 48, 48); - critbit::remove_leaf_by_index(&mut t1, 0); - critbit::check_empty_tree(&t1); - critbit::destroy_empty(t1); - }; - - next_tx(&mut test, owner); { - let mut t1 = critbit::new(ctx(&mut test)); - critbit::insert_leaf(&mut t1, 48, 48); - critbit::insert_leaf(&mut t1, 16, 16); - - critbit::remove_leaf_by_index(&mut t1, 0); - let internal_nodes_keys = vector[]; - let internal_nodes = vector []; - let leaves_keys = vector[1]; - let leaves = vector>[ - critbit::new_leaf_for_test(16, 16, PARTITION_INDEX), - ]; - let is_equal = check_tree_struct( - &t1, - &internal_nodes_keys, - &internal_nodes, - &leaves_keys, - &leaves, - MAX_U64 - 1, - 1, - 1 - ); - assert_eq(is_equal,true); - - critbit::remove_leaf_by_index(&mut t1, 1); - critbit::check_empty_tree(&t1); - critbit::destroy_empty(t1); - }; - - next_tx(&mut test, owner); { - let mut t1 = critbit::new(ctx(&mut test)); - critbit::insert_leaf(&mut t1, 48, 48); - critbit::insert_leaf(&mut t1, 16, 16); - critbit::insert_leaf(&mut t1, 3, 3); - - critbit::remove_leaf_by_index(&mut t1, 0); - let internal_nodes_keys = vector[1]; - let internal_nodes = vector [ - critbit::new_internal_node_for_test(16, PARTITION_INDEX, MAX_U64 - 2, MAX_U64 - 1) - ]; - let leaves_keys = vector[1, 2]; - let leaves = vector>[ - critbit::new_leaf_for_test(16, 16, 1), - critbit::new_leaf_for_test(3, 3, 1) - ]; - let is_equal = check_tree_struct( - &t1, - &internal_nodes_keys, - &internal_nodes, - &leaves_keys, - &leaves, - 1, - 2, - 1 - ); - assert_eq(is_equal,true); - - critbit::remove_leaf_by_index(&mut t1, 1); - let internal_nodes_keys = vector[]; - let internal_nodes = vector []; - let leaves_keys = vector[2]; - let leaves = vector>[ - critbit::new_leaf_for_test(3, 3, PARTITION_INDEX) - ]; - let is_equal = check_tree_struct( - &t1, - &internal_nodes_keys, - &internal_nodes, - &leaves_keys, - &leaves, - MAX_U64 - 2, - 2, - 2 - ); - assert_eq(is_equal,true); - - critbit::remove_leaf_by_index(&mut t1, 2); - critbit::check_empty_tree(&t1); - critbit::destroy_empty(t1); - }; - - next_tx(&mut test, owner); { - let mut t1 = critbit::new(ctx(&mut test)); - critbit::insert_leaf(&mut t1, 128, 128); - critbit::insert_leaf(&mut t1, 160, 160); - critbit::insert_leaf(&mut t1, 240, 240); - critbit::insert_leaf(&mut t1, 161, 161); - - critbit::remove_leaf_by_index(&mut t1, 3); - - let internal_nodes_keys = vector[0, 1]; - let internal_nodes = vector [ - critbit::new_internal_node_for_test(32, 1, MAX_U64, MAX_U64 - 1), - critbit::new_internal_node_for_test(64, PARTITION_INDEX, 0, MAX_U64 - 2) - ]; - let leaves_keys = vector[0, 1, 2]; - let leaves = vector>[ - critbit::new_leaf_for_test(128, 128, 0), - critbit::new_leaf_for_test(160, 160, 0), - critbit::new_leaf_for_test(240, 240, 1) - - ]; - let is_equal = check_tree_struct( - &t1, - &internal_nodes_keys, - &internal_nodes, - &leaves_keys, - &leaves, - 1, - 0, - 2 - ); - assert_eq(is_equal,true); - - critbit::insert_leaf(&mut t1, 161, 161); - let internal_nodes_keys = vector[0, 1, 3]; - let internal_nodes = vector [ - critbit::new_internal_node_for_test(32, 1, MAX_U64, 3), - critbit::new_internal_node_for_test(64, PARTITION_INDEX, 0, MAX_U64 - 2), - critbit::new_internal_node_for_test(1, 0, MAX_U64 - 1, MAX_U64 - 4) - ]; - let leaves_keys = vector[0, 1, 2, 4]; - let leaves = vector>[ - critbit::new_leaf_for_test(128, 128, 0), - critbit::new_leaf_for_test(160, 160, 3), - critbit::new_leaf_for_test(240, 240, 1), - critbit::new_leaf_for_test(161, 161, 3) - ]; - let is_equal = check_tree_struct( - &t1, - &internal_nodes_keys, - &internal_nodes, - &leaves_keys, - &leaves, - 1, - 0, - 2 - ); - assert_eq(is_equal,true); - - critbit::drop(t1); - }; - - end(test) - } - - - fun test_find_closest_key_(mut test: Scenario): TransactionEffects{ - let (owner, _) = people(); - - next_tx(&mut test, owner); { - let mut t1 = critbit::new(ctx(&mut test)); - - assert_eq(critbit::find_closest_key(&t1, 1), 0); - - critbit::insert_leaf(&mut t1, 48, 48); - critbit::insert_leaf(&mut t1, 16, 16); - critbit::insert_leaf(&mut t1, 1, 1); - critbit::insert_leaf(&mut t1, 3, 3); - - assert_eq(critbit::find_closest_key(&t1, 1), 1); - assert_eq(critbit::find_closest_key(&t1, 3), 3); - assert_eq(critbit::find_closest_key(&t1, 16), 16); - assert_eq(critbit::find_closest_key(&t1, 48), 48); - assert_eq(critbit::find_closest_key(&t1, 2), 3); - assert_eq(critbit::find_closest_key(&t1, 47), 48); - - critbit::drop(t1) - }; - - end(test) - } - - - fun scenario(): Scenario { test::begin(@0x1) } - fun people(): (address, address) { (@0xBEEF, @0x1337) } -} diff --git a/crates/iota-framework/packages/deepbook/tests/order_query_tests.move b/crates/iota-framework/packages/deepbook/tests/order_query_tests.move deleted file mode 100644 index 651ad62b863..00000000000 --- a/crates/iota-framework/packages/deepbook/tests/order_query_tests.move +++ /dev/null @@ -1,354 +0,0 @@ -// Copyright (c) Mysten Labs, Inc. -// Modifications Copyright (c) 2024 IOTA Stiftung -// SPDX-License-Identifier: Apache-2.0 - -#[test_only] -module deepbook::order_query_tests { - use std::option::{none, some}; - use iota::clock; - use deepbook::order_query; - use deepbook::order_query::iter_bids; - use deepbook::custodian_v2; - use deepbook::custodian_v2::{AccountCap, account_owner}; - use iota::clock::Clock; - use iota::coin::mint_for_testing; - use deepbook::clob_v2; - use iota::iota::IOTA; - use deepbook::clob_v2::{setup_test, USD, mint_account_cap_transfer, Pool}; - use iota::test_scenario; - use iota::test_scenario::{next_tx, end, ctx, Scenario}; - - const CLIENT_ID_ALICE: u64 = 0; - const FLOAT_SCALING: u64 = 1000000000; - const CANCEL_OLDEST: u8 = 0; - const TIMESTAMP_INF: u64 = (1u128 << 64 - 1) as u64; - - const OWNER: address = @0xf; - const ALICE: address = @0xBEEF; - const BOB: address = @0x1337; - - #[test] - fun test_order_query_pagination() { - let mut scenario = prepare_scenario(); - add_orders(200, TIMESTAMP_INF, none(), &mut scenario); - let pool = test_scenario::take_shared>(&scenario); - let page1 = iter_bids(&pool, none(), none(), none(), none(), true); - assert!(vector::length(order_query::orders(&page1)) == 100); - assert!(order_query::has_next_page(&page1)); - - let orders = order_query::orders(&page1); - let first_order = vector::borrow(orders, 0); - assert!(order_query::order_id(first_order) == 1); - let last_order = vector::borrow(orders, vector::length(orders) - 1); - - assert!(order_query::order_id(last_order) == 100); - - let page2 = iter_bids( - &pool, - order_query::next_tick_level(&page1), - order_query::next_order_id(&page1), - none(), - none(), - true - ); - assert!(vector::length(order_query::orders(&page2)) == 100); - assert!(!order_query::has_next_page(&page2)); - - let orders = order_query::orders(&page2); - let first_order = vector::borrow(orders, 0); - assert!(order_query::order_id(first_order) == 101); - let last_order = vector::borrow(orders, vector::length(orders) - 1); - assert!(order_query::order_id(last_order) == 200); - - test_scenario::return_shared(pool); - end(scenario); - } - - #[test] - fun test_order_query_pagination_decending() { - let mut scenario = prepare_scenario(); - add_orders(200, TIMESTAMP_INF, none(), &mut scenario); - let pool = test_scenario::take_shared>(&scenario); - let page1 = iter_bids(&pool, none(), none(), none(), none(), false); - - assert!(vector::length(order_query::orders(&page1)) == 100); - assert!(order_query::has_next_page(&page1)); - - let orders = order_query::orders(&page1); - let first_order = vector::borrow(orders, 0); - assert!(order_query::order_id(first_order) == 200); - let last_order = vector::borrow(orders, vector::length(orders) - 1); - - assert!(order_query::order_id(last_order) == 101); - - let page2 = iter_bids( - &pool, - order_query::next_tick_level(&page1), - order_query::next_order_id(&page1), - none(), - none(), - false - ); - assert!(vector::length(order_query::orders(&page2)) == 100); - assert!(!order_query::has_next_page(&page2)); - - let orders = order_query::orders(&page2); - let first_order = vector::borrow(orders, 0); - assert!(order_query::order_id(first_order) == 100); - let last_order = vector::borrow(orders, vector::length(orders) - 1); - assert!(order_query::order_id(last_order) == 1); - - test_scenario::return_shared(pool); - end(scenario); - } - - #[test] - fun test_order_query_start_order_id() { - let mut scenario = prepare_scenario(); - add_orders(200, TIMESTAMP_INF, none(), &mut scenario); - let pool = test_scenario::take_shared>(&scenario); - // test start order id - let page = iter_bids(&pool, none(), some(51), none(), none(), true); - assert!(vector::length(order_query::orders(&page)) == 100); - assert!(order_query::has_next_page(&page)); - - let orders = order_query::orders(&page); - let first_order = vector::borrow(orders, 0); - assert!(order_query::order_id(first_order) == 51); - let last_order = vector::borrow(orders, vector::length(orders) - 1); - assert!(order_query::order_id(last_order) == 150); - - let page2 = iter_bids( - &pool, - order_query::next_tick_level(&page), - order_query::next_order_id(&page), - none(), - none(), - true - ); - assert!(vector::length(order_query::orders(&page2)) == 50); - assert!(!order_query::has_next_page(&page2)); - - let orders = order_query::orders(&page2); - - let first_order = vector::borrow(orders, 0); - assert!(order_query::order_id(first_order) == 151); - let last_order = vector::borrow(orders, vector::length(orders) - 1); - assert!(order_query::order_id(last_order) == 200); - - test_scenario::return_shared(pool); - end(scenario); - } - - #[test] - fun test_order_query_with_expiry() { - let mut scenario = prepare_scenario(); - add_orders(20, TIMESTAMP_INF, none(), &mut scenario); - - let clock = test_scenario::take_shared(&scenario); - let expired_timestamp = clock::timestamp_ms(&clock) + 10000; - test_scenario::return_shared(clock); - next_tx(&mut scenario, ALICE); - - add_orders(50, expired_timestamp, none(), &mut scenario); - - let pool = test_scenario::take_shared>(&scenario); - - // test get all order excluding expired orders - let page = iter_bids(&pool, none(), none(), some(expired_timestamp + 1), none(), true); - assert!(vector::length(order_query::orders(&page)) == 20); - assert!(!order_query::has_next_page(&page)); - - let orders = order_query::orders(&page); - let first_order = vector::borrow(orders, 0); - assert!(order_query::order_id(first_order) == 1); - let last_order = vector::borrow(orders, vector::length(orders) - 1); - assert!(order_query::order_id(last_order) == 20); - - test_scenario::return_shared(pool); - end(scenario); - } - - #[test] - fun test_order_query_with_max_id() { - let mut scenario = prepare_scenario(); - add_orders(70, TIMESTAMP_INF, none(), &mut scenario); - - let pool = test_scenario::take_shared>(&scenario); - - // test get all order with id < 50 - let page = iter_bids(&pool, none(), none(), none(), some(50), true); - assert!(vector::length(order_query::orders(&page)) == 50); - assert!(!order_query::has_next_page(&page)); - - let orders = order_query::orders(&page); - let first_order = vector::borrow(orders, 0); - assert!(order_query::order_id(first_order) == 1); - let last_order = vector::borrow(orders, vector::length(orders) - 1); - assert!(order_query::order_id(last_order) == 50); - - // test get all order with id between 20 and 50 - let page = iter_bids(&pool, none(), some(20), none(), some(50), true); - - assert!(vector::length(order_query::orders(&page)) == 31); - assert!(!order_query::has_next_page(&page)); - - let orders = order_query::orders(&page); - let first_order = vector::borrow(orders, 0); - assert!(order_query::order_id(first_order) == 20); - let last_order = vector::borrow(orders, vector::length(orders) - 1); - assert!(order_query::order_id(last_order) == 50); - - test_scenario::return_shared(pool); - end(scenario); - } - - #[test] - fun test_order_query_pagination_multiple_orders_same_tick_level() { - let mut scenario = prepare_scenario(); - // orders with same tick level repeated 4 times - add_orders(50, TIMESTAMP_INF, none(), &mut scenario); - add_orders(50, TIMESTAMP_INF, none(), &mut scenario); - add_orders(50, TIMESTAMP_INF, none(), &mut scenario); - add_orders(50, TIMESTAMP_INF, none(), &mut scenario); - - let pool = test_scenario::take_shared>(&scenario); - let page1 = iter_bids(&pool, none(), none(), none(), none(), true); - assert!(vector::length(order_query::orders(&page1)) == 100); - assert!(order_query::has_next_page(&page1)); - - let orders = order_query::orders(&page1); - let first_order = vector::borrow(orders, 0); - assert!(order_query::order_id(first_order) == 1); - let last_order = vector::borrow(orders, vector::length(orders) - 1); - assert!(order_query::order_id(last_order) == 175); - - let page2 = iter_bids( - &pool, - order_query::next_tick_level(&page1), - order_query::next_order_id(&page1), - none(), - none(), - true - ); - assert!(vector::length(order_query::orders(&page2)) == 100); - assert!(!order_query::has_next_page(&page2)); - - let orders = order_query::orders(&page2); - let first_order = vector::borrow(orders, 0); - assert!(order_query::order_id(first_order) == 26); - let last_order = vector::borrow(orders, vector::length(orders) - 1); - assert!(order_query::order_id(last_order) == 200); - - // Query order with tick level > 40 * FLOAT_SCALING - let page = iter_bids(&pool, some(40 * FLOAT_SCALING), none(), none(), none(), true); - - // should only contain orders with tick level > 40 - 50, 44 orders in total - assert!(vector::length(order_query::orders(&page)) == 44); - assert!(!order_query::has_next_page(&page)); - - let orders = order_query::orders(&page); - let first_order = vector::borrow(orders, 0); - assert!(order_query::order_id(first_order) == 40); - let last_order = vector::borrow(orders, vector::length(orders) - 1); - assert!(order_query::order_id(last_order) == 200); - - test_scenario::return_shared(pool); - end(scenario); - } - - #[test] - fun test_query_after_insert() { - let mut scenario = prepare_scenario(); - add_orders(200, TIMESTAMP_INF, none(), &mut scenario); - - // insert a new order at tick level 10 - add_orders(1, TIMESTAMP_INF, some(10), &mut scenario); - - let pool = test_scenario::take_shared>(&scenario); - let page = iter_bids(&pool, some(11 * FLOAT_SCALING), none(), none(), none(), true); - - // this page should start from order id 11 and end at order id 110, contains 100 orders - assert!(vector::length(order_query::orders(&page)) == 100); - assert!(order_query::has_next_page(&page)); - - let orders = order_query::orders(&page); - let first_order = vector::borrow(orders, 0); - assert!(order_query::order_id(first_order) == 11); - let last_order = vector::borrow(orders, vector::length(orders) - 1); - assert!(order_query::order_id(last_order) == 110); - - // tick 10 should contain 2 orders - let page2 = iter_bids(&pool, some(10 * FLOAT_SCALING), none(), none(), none(), true); - let orders = order_query::orders(&page2); - let first_order = vector::borrow(orders, 0); - assert!(order_query::tick_level(first_order) == 10 * FLOAT_SCALING); - let second_order = vector::borrow(orders, 1); - assert!(order_query::tick_level(second_order) == 10 * FLOAT_SCALING); - let third_order = vector::borrow(orders, 2); - assert!(order_query::tick_level(third_order) == 11 * FLOAT_SCALING); - - test_scenario::return_shared(pool); - end(scenario); - } - - fun prepare_scenario(): Scenario { - let mut scenario = test_scenario::begin(@0x1); - next_tx(&mut scenario, OWNER); - setup_test(5000000, 2500000, &mut scenario, OWNER); - - next_tx(&mut scenario, ALICE); - mint_account_cap_transfer(ALICE, test_scenario::ctx(&mut scenario)); - next_tx(&mut scenario, BOB); - mint_account_cap_transfer(BOB, test_scenario::ctx(&mut scenario)); - next_tx(&mut scenario, ALICE); - - let mut pool = test_scenario::take_shared>(&scenario); - let account_cap = test_scenario::take_from_sender(&scenario); - let account_cap_user = account_owner(&account_cap); - let (base_custodian, quote_custodian) = clob_v2::borrow_mut_custodian(&mut pool); - custodian_v2::deposit(base_custodian, mint_for_testing(1000000, ctx(&mut scenario)), account_cap_user); - custodian_v2::deposit( - quote_custodian, - mint_for_testing(10000000, ctx(&mut scenario)), - account_cap_user - ); - test_scenario::return_shared(pool); - test_scenario::return_to_sender(&scenario, account_cap); - next_tx(&mut scenario, ALICE); - scenario - } - - fun add_orders(order_count: u64, timestamp: u64, price: Option, scenario: &mut Scenario) { - let mut n = 1; - while (n <= order_count) { - let price = if (option::is_some(&price)) { - option::destroy_some(price) * FLOAT_SCALING - } else { - n * FLOAT_SCALING - }; - - let account_cap = test_scenario::take_from_sender(scenario); - let mut pool = test_scenario::take_shared>(scenario); - let clock = test_scenario::take_shared(scenario); - clob_v2::place_limit_order( - &mut pool, - CLIENT_ID_ALICE, - price, - 200, - CANCEL_OLDEST, - true, - timestamp, - 0, - &clock, - &account_cap, - ctx(scenario) - ); - n = n + 1; - test_scenario::return_shared(clock); - test_scenario::return_shared(pool); - test_scenario::return_to_address(ALICE, account_cap); - next_tx(scenario, ALICE); - }; - } -} diff --git a/crates/iota-framework/packages_compiled/deepbook b/crates/iota-framework/packages_compiled/deepbook deleted file mode 100644 index e9388a2fdf8e5aa9bd79b6bdc321c692fc17cfa3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33255 zcmeIbd3avgecyM_z30AnefJmd`(h;kf&@Vj;4(Ah<*WqB;cT24%tDPuni&iTyc}W( z0vrIGP1{(TWyzAfNtP{dauYd=YpHSMO}3NA&yzf9Qa5$$rfr(KQQJ6n9Vb$nCVi48 zbw9sz-}^2kI2v1u(?9Z(xaZunpY!{j-`RfObG_g9zBKYjQO>d~Us<+eA8-%Wyn8?B z|GFB_{UfzM{;>VaZt+*WoaI`fr7SD5Y|F}t%@dn1wm@uJ9=3zwILfh=qqMRup4zr; zy|TV}(UZs0tH-Jl@q4ms(4NDRr&=egw|^I`OF7+x&j-4;|n7yFY%H1kt6;mPK%AmiEuF zEagR3q{=F`Rb*2~nqnxj?uea8-4Sa)wnHb>O-~IT%OYjwgsud!9odl+Nr0i-iB5Wj zPI{p&L@>W89lEh+Pm_g1AiLNO$8FBR3Szv+ihydbiS5+oh8b zk*0XLZq9D}HaUCb<6Q}@U25zdeJfV(+EI&gcm4mQ{TtaOMkBJ0o;n;`k$v=3y)TwD zj6~cm);?m5r?JLwjwSJSi**~ZN@=XpZn3OgV=WNNPhGP z#d@Atb{fkjR@807luxX;c8m2Aji)5I9jk~g2$xxo^{=C>pXU|yh>tjTe?jTrRb%eI zRR2PG-*7&w{cn1w!ms-KqkrJ*_#gVeZRdY3@(W*ya>cJjwpCX}Ra28{O6{YcC=yjM zmKamn@@_j~cU;eMd~NAmY&No3KjklA!`EKO!mc0^!IO5Xw$D#MtcSTfYQAM~ARQWk4XKZAMXeCW?rW~Ff zSb>C4Di`o)l2UDFBnw`Yne@b#dglC`qUfoULn*Q}0)=DtqP#$P3oAx0hi&uB@-^@D z^7`_|N=u*FT-ylFT;JZ=TwPnKD~T#y%jwD`kBp*o!09+&V`504lbt&EG@sf zytXd>OBd7l#muMuUb^9ZyPi3$Z?0Tvt!D9@<<-^lO{sb9RB{(Lx3)H43sYn1>h+zW zu5~F(u^re9KzfCG_$w57d2M4mSjj51XSKDm)mq+eEnVMkZQWe{k$(UFLdKW2Hm_zS zw%1notZlq~V*UR8iRqUqVJvQ0iiQ3FrK@WUomu5pmajP*t=Dp!7hi6z?6}+4*4K92 z9clV-=k+D2D71;MudOcaY%Z;BY_zrt*Ef1ocVAszzuqdmwzhM5b!+*xrRDAI){d4D zxh-LCVf@}7-ohhuwk_K(7#7@H9LWCb{Eu?8H;HjG2BQZY8H&ZM*w+PMpIYXJo4cm!Z$3DoKc&Z~HifVMytD z)f9`g$S$yhUXQTj5iz2tiKG>h%FvVhoT!(LsI~k`w_Wm~bzGV#PU4d)$w$0Vk%F02 zARmyGs$y5Hs`UrWOzszyMfpaYsozri_tkOtC+z=KdH>G&vi85^pUQp1e^2=J;I`qZwDh|@>VPx$C4O1yI$4eI8sIIYJ0*ei!nViiZNOm zt&CKLD|XnZgkddgl>E>O>y=7aFIB@_=!Rnz6*f!F%2=ro4wZ%~gO$M&Lx4_)1>~^| z6i9rALZ>}!h{zRJ2Lav@^&*}Txiln0MK+o+5~K+bmq{mFW2C(e3rTQkWyO0 zMGO(GEwfCyR6yvOnlEio^=*G`JIx`FWxaKYR4%WruR6rak&F$E{j?M4b+LpH*KU-RKY#%~KHJu}Ywa;Oa zI_eBLGtNH8w!K+rAZ7Q#4!@5(dz?vU%3-Y%GGVszk;f2{u;NXWm-BL+(Whf!V38$Y zp26#cg^-qEr~N`FLR97lNI;Kk*JV&qo-=I(xOGC+68D5%Bbuto-1(LPolZcfh8(r5 z`lF#4v0_Jsj+dKcrN|OelJ>mNX~eGNAmiH!U5j<7CCFYXq$4-+V%yzkmU;SUq)kva zbQ8anBd9wlfhY8xq}Hh*0+VEEjuURA3Fy_5pdn)y!?WZ;6_7kqtjGTJ#hS{BHBPzq zr{y|!%W~cIcIEPGNqAGagjJksWabE7Zm%x7RE3H#Oj8l^WEO$swuO;y70&MoCnI>{ zn@UD@FLzSKF{#mVjKmmbU=&8IGce}{!o0`CTi*FK_Ufj~N?dss48X9RkK!Z>t$7*0 zQzA|1Ghx2d>=XL1%j#5lN~oG|5XmD+3^fqRSnmvU!osZ(TpMD<4%-iEQa|oKC9&=4 zqo*PqM(-#O96i;5IXXp(+@q>-I4*<*;cPEgQE@;*RF}C6Mkk5)gA-{*&|kt^NKka&5*xXS zEu_Cq=&vZ5K2cxy*GPFjBpVnP%0&?+@RCAQ2vtvFu@4)CX*2mrfpB3|jQnx2!lj+Q z7OE-zk5s!6+g@4kQhW73!^uBos5V&(Kc!pXP3g zpARR=yv<>fMig1fb!tpRCTH!4@Sk)XrmQT0e_C2kQWYl}P>LI>2@T2T!(39Nn?pgN zJ6?|Qf`#UzTvCdec4)jDp^hX`z7rzGk+fP;>Eu139~Lo2gBnAnMh^qw=XcqOHpmUQ zKdD0M)L|q|p3pde#(rqT1@xFFh!?3w;_0=>7b4p3RV>oA*m@9}K+aD?PGOS|ncQKb zq*^3{PasjH*w8I(B(>vu0O}g5f5A}QBQsAVROCTV7plX7@ZW%nB0Dc)mKCy@^45+A zHZxn}V5ZRSiNI!?z;c8an3%`5&bdt9MMg3kx0AYEB7r?5c_&j=g?xyaZK0x6%8QIcwjvHg4F~ve;W@!z(O3L{oAxTYULy0>bIl3CcS@cXrqtao9dS2TgiM@*>;WLbc3Bi4)TDY5MXbEIazZHADj%B-QpbVB?KZFlxk<(;i))(bX8wO!e&l68Zn zTn2!g*}C!x7C;@3Evhi*Sz%pUQ6*jC#5J2{@@Rm<042DK^w^uDk&ekOw`C=+F;3=; z@%^j{#P!q6tHpdXWCP8z-Un?lp34`+cyDUFr)b`;mdfIIzETxqoh1y$%hkGN-P15> z-rF?Bp+RH3J~V7uvm?enHEN6tV|ye{b8K9U2PY=Qcwq0880S*s{(Z30L;I(3Qqzyj zQ~v|zdGMZlu`fJQ<$3y%vpgStQtVIMUFZ42-IF|*%(L}~*f-7dwR>ijwj1xRvia70 z_ax8bPaNTS;*2~WIm$BBe%BN7{Fpi;#;4S6Z0R{KPF5}F<4T_2Yo4D_lV>gc)HxE; zZ`@C0{YiB~UOuA~Z|+;_c-6|CNr;?#%*Q47)Z?U=`=mNVDDUoBm^2u^?-Yx;VE@8t zF=ifqNQ@&3viTR>d631r4$h`Qp199AF53si@#2Ds_sUZy$g2+@!!dk#{;=}HkE%QG zvZBFviBGiuf+QTxJSYiAM=nSj`TeKnm6d<;R9#tTX6~7N*tu(VZuXvIcO9EMc4YR* zv3M?+J289b?48Gw*}c|2YmaqyX0dwz%&D2fv!%I1v&WC!aqN!S^4tS6PgEa!;GxNf zW)^1lTL-KOD>*i09X@vG*zwtEE1bJ~Hk!Np*!;2i*>f|K)`K(mKK=Lu=O)iT@ZjXk zvDsrMj?K>I=k9&>-uIlIJT*CLou0XW^1jJOA2>TXW<4-@aQ5Ia_FsJ$Y2w$Ym1d1t zP=1j&)`&T?s>C6%az28p$3fx1K$eDJ-55%I6Vg0YuH$DMquc@g4y!4jJ2Dk@nVd~5=b-e$;a;I(+wpH>9nj)(1|MhtduSFpask--7n{S z?V4x0VD46x0tU317nNAcJC0vgJ{t$^f{;q5p*WE7IlAfksLu=^3 zj1R2#B?kg_{78ugWLzgxvg1#zX8mq<0HjgVS2hk5WipLMQ6fD2vU#H|X+Uvkw}S2^ zM%tpLnJJ&oj*5wtwmx(jVJE;8D@{2ij-;g7<}gJakPU}4FOxl8Pg>KHt?Zm%;jc`h zvP(^KiQ%L>9a%+k(SZ2n+VANuMyCpLZb&@gh0II~NRC1Y{Hmq}h$mYXLZ5U`oD@xN zO(@$}g*35t4J7w&`LT*`TKd7=A_^;|Rezh9J&kITqf{CDTl5j3vS~cO+^(na4^~rN zD%!0C8!?>NNQJ0QR#E&jYrym;>nEnOSnV2^eABu>93rP2AO|N0c2n_kz6<};XlZ-Vw+!8c%?X$jzIS+NX;%}( z_|s$3q$P}ru*)fgdq#Gy%~?e6u2kQ-gnsDprx&90Ya5&*m?MhZ)j&}|LHfbwH{l(+WOO-jmVjYW^ZU)UtC_flAU#g7v*%q?9PvLtxK<5U*6bR z+j(PYrCq0?-8?UuD(>oa&D3#pw^-~LaZ17geWS;BXDdCkztn1N7mR!75T$Z)d1vKv zyCh4S(%$;w+UoXyfc?O7THU4P_4PEP?YQldW-EFIE)Te+@5HAd2Q%zkwU1At_Ukps z85=vCvP9K7$_SmxeP<^`tF3FB+iN=<>1?;yqD)_2xxTq0Z#^59)xI}2>tHC|y1KSg zl}B3D4ynsMZYhOb!f))9TCZPQ+iETCtX(DT<*RSE1KM|X<#Ld@S*+Dgkf7;?39cn3#km9-5y=UQ4{ z>oiC2E^W+q>1K9rrq?!imUHaSQi9HYt;hSu=0>Z1%x1*Ik~uFct*@~`yLqj(k#SV- zF`2)`Lj=T992ZLoJ z3VNHilDf2sW@32KRhHIP`}de#L(t&b_3g{F{>l|U6H8HARU@{VJ@%zuF;YxDI$iDU zcC6#}Hnu5DdfYj<{o3-irPk}q@P!dbmo~T3Chqk~^AIlylWu93b_^|7Hm_b?+uo+@ z7g7fVfT3)#gHShAk2`&7>FRc22gX|O(68s9HP}JoFKr<5&5`T!Hv957AG!7@F=f`> zbe4+Ox3_xvao3aDeCOa+s?|NlHP!uY9OJUeecK;%)Xe|e?c8VECyu|{9zF+Q=I5}T zm)W9@O-?`M=lF%xf=xC>7wm+s`Te@;4ojw~vpZejm?CDckXBB0@7PQXV?Xu^ zJ{|${T|Wwd6md6pQK{BB#LvfTX5O!^&&Ua z9L?w0oi7+w8_PQRE3#j2mmjIcbxtNm*x~g#@@TS+=dj7`%_k*2DCPGQ1#8;kQjW*s z@gN>GzT^5}I3C*jV%I$s#BSv3uMsF5ODgf6a8F4m)udL72aI)KTz}CPTR4!^Wv{>F za$FI_gV=Jl(AlS7a3A-1h4MIgH4`Ffg!QnHG~NGAcFPOwMV61o<*-b-b*+4RJft_H zq3-!WJQS9rp?X{jN5ayS{$Ny!!>G)*e?AV}zpQ-9J>to+fv(ld$I|qU@#@xw%(KbC zLy$V(Ml6m+(rkwHUsTa>Pd>w86b;weSC$~TTKTrP66HgVqw>)Ro5=AL^2`@AW3-AKjG@?o}8V%}yO7U~< zAJGmSu9$$Ca{4oNI1ty`O*!)mf;T>pD|xoLg(Pq2~baX*rblku>YOsH^AQAf38 zQn^1S`xf#FVfMyFj&zDecOV?qNhBm3&|eY4N8`zqipN7Q8cX(-EnLF!WPd!S2sqx$ zBlQ0BKhWW;8hq7&uLAf=js_grv+wW~=lel4V2evR9-`62Yg`|IdWNYErcCu|LWDyw z)o?hRF;&%AVXAK_u~Fw-H+6d$Q z`sFZ2(yd3FT}Fs&Bt<)}a7i7ha6Jqn&iR`d zL>OXNsK;@w1n@bLnoT%xOBp0jH_8~~H;tJ1EfvOHIv6qWPj+RH-|aBSKj<)sWPzCI zXOM4l4B2InLKH^@#Dp|YHy?d_n?=6Qh>Vfskg$l?W)Vb2$|5&JlEdh9h#BDU%d#H3 zz@d)F4#@U64_z;aTu9JwAewL!k3825u?|ahoKjD&{?n{siVg@ zh*FGBa&$;3qcAy2Ey9{P%MSYwu|tuC6v<`qVWQ)5ek;RJlm?Fa14pUga+x8%+!J=S~%!QMTGlsOe(0Mo&V;N3u%DP2qHLjO;_ z(Kr#p#(jjHc8~U@K_HP4{nWqHJ=+%u2GC)yd~!-Z>^|M+6HkX81gSz04)Hm`MxNb; zT$C>7!P0j#^+5TXCLnrLfHRmP6hbo265 z(7&nNzsbq#^v$8m6Z-$?>*o5uRxZ6br3mEk&2+Fm(`0U$+{YM2ralSP9btp zX!UC-ik`B|5{fDEZlQ!o64-8-@KTVIcCuhs5E1WvStk3^)!^VTIiUkHyZ1tL17PGZ z8JD43y2oj>UB+0}&?+dfq;6-Vo2haU6^ERbGxC4~?jx8E+C&Zq`}<>GA9wHWM$75b zB+R(u-jC_X_!C741M~^XRp!MXkBL{#uF+V}uTnKL%a^`v(=yU(5v^8mQAt)=t3|Y09LDp>xpBQD<^wWw z@UYRPXfp&3ZH5|`KIYDw=CEBv3(X-a7L;%vHrWqm0(mCQ?=khRGW2NuG-al7M7ah5 zX;es<*g7=Md!=#0$oMnY4+=R(-3E(J%4H8w_!mAaz1WmKZ)jdJr7v|#-x(vOJGQvc zwH6C%p&I*L2hsHKnShPcOLL*Wm(yJ)KDpCXrU+qq9(i~gg{M21EJ@Qq0OLmW!!V}$ zsECBcN&Vg^jEkYCAEq?IJ&$40IOq>-W?4hl<#gFc*!o{|YbE9H?j%_!G11I@YPX?8Yezt+;zhR!T3PWUJ( zJsA6^IG;~{w7#D_B-E1W;d!^h)Y^s4LSVFtv6YK@N@~Sm@Gx35Gg7nEjxGp#781A~ z>pV&q(zP|^<-tTsODETcIhkfv^x0u%hbH(VOq=pD4>at`@lS(NzK9%v8%52?V&FP2 zur7KBT$?-^yL2(u=5#aHZW4G>7HvUt0R0%kI0>LPS&b`u5YOcc#uGP=EQO?W%~;sR zL_lJP-juFKXdH?gxjvTq!cULI_Ni>|#)^X;JFDvs)1U$;MQ86IpgiQk6!J+)3#(H; zSstc2u%E5w(M&vBZRf)L7y;9h2)HXrgjokVAjIS!P**q zrOIA?5ayBYIwwqIguRwxQ~0_~bdaYx_Kw(Zay9BXxm+$l9kGx@RS^`F93)ym8|Tt} zu3#>li{|3F{9IwKI9Hl0&sks3XG%vXfuYHD$Vq-)F-VWOAGZG=<^5adf7bqg54_=X zs4D$5g5hriZ}_{xPdNGCXAbhsI9L4Fv28UBv~8a{pl03{+U8Lh(3Kt>GJu;>9ZR)JT`$zIizplPi+I21G+3@FGpL9p#9h<&gq_6d~xENiwXPd``Ui7q5h zz-Xu?jqky(rpE=}c4$QG^A2`7W7K!|bLb!@BHM0vl7`g~*g_Ru*K$2(idAkfbTeiPtPZ*2 zuqRit%50XERBeL!dokj)fEkxH9jS6X5@&*nICDs{s#JNvpcot$82A~)T>U%7<_X5m zVG1HS8f>1R>*%Dt*gOH&IX7VQ1Q_C^*gW79DP+$#usVktvtTiEH4HNV&fr{%*UVv~~nG8u}t z>aQ@)iTO*)APcSENQYbN0gqF?M*2I^w|tQw$Lmi3>hrg{Ghs%hS@F`nYQnHn3z z=IxUT>>#e+uRt4OeoBEe$9y4Gzx`g7D&Bsd+PhDjKcS5Bt@U9wNu?h>U<&fsj4_TL zG{%ps*+Z6fWX`PdoIYvKtJvIJv`}H$z^F#OEXIbB)l1a<@E9Utz^Za4+yqHk- zkF%M;W}Jlhd^^(d*0H_{x!8DE?-y6EX za}WDg_ky&gV`5&xii+y|rd zlZtZr`JYgaow5qEuWX?d|HP$5o~y4gCKNv4uk-wAwTMxCm;W@qf8~96yzlfIr|(-> zI=6D}>iKZt1KtNq!NTej-olGdd`vBVOr5*@%)`O^Pd~Hx%(>;o<#X}EON*x4cubn>^Y@NUSz3SS9*H3R<*t78XxhK!Pc<#x?k%i0OuP%Q^tzUTg z!oV->dgEQf(*Ed#%aW^8d$v^qQMq<(@^<789oaU? zh+EE-$R#&Ib^J&c76@|wK)ZOH78r`d%&8@y=*l%JxwuJuBJd|g_5&7v!XIt6r$i0& zo+@e+unr4QBVh+td1Bb+DGiQinutjVtE5DnCKi{Frauh%b=MyNN>=xW$W&5L{*dW* z{(#~_DT;(sJ6|w_@|H8KLQ>K@#Klb`vh5&Yc`}#vu+vw>J7WQHQ>egqJAm6m%3k*l zQ?n!;loU(`@?bSfd+YSQ%lxU=LGr!9%>+aRNl6o@?2yJym9WFMGB%#ZnWDl?!blk} z=7id)Fb$Y2%tPKqPdyajl(vr)l4W*EEy+d*Vr~`aG`y*Z+%f74NI}?zN`ErsAf~2fowHM2|mhVb-t=J@si)q%TZL;(TC{4$deZV@r$$X+0n+cFddefhvclVjT?k^xl(oOGc8UtX zJEKvcN;forN=8#k5f@oScegq$@j8VxHUv#B?O8tZA!S~cN`}~ZagiTeHzE$%MU|c% zq|zg;3vhw}zf|ynCZKY)wojTE2R$ZM#{cxQb{jazgLcGbUy{2=Oo0b9os=rgZ}4q% zG7$)wHF-B4c!iLHioB$qs9!n(pdS3!;?(=s2VY2Iw1p<3SrX6U_n;Tb3+wBTi!%K7 znM_CjCYLjtSFfR!ys_h*PA^RQwor%oY^p`RAoulfAJa{^huWi}h}>E=SwGs^S?0=y z<#z~%=!HMr1bB!A{P4JF44+xPmhFmt8}vi|nfCocrnv9?o~WC*!~PR8;x)PG>XtX9 zd>dp$V}(0GHkPi7!nA+{+Un!m#g+9n*sr5Zo^2PVAc_bm#YQXj?B77V0Z>uT_7mk| zt*fZZuP%wg_~7o&Y%NaS!pG>zZ?$%=Z*ANR(rB4Pmm2N3MkT!`Lbj=Sqx;gX5RdQr zPUk>-r_*F_HWtl>YKHpwj{^bm01<4VA^$d);p_qhalmZ+Cpd_~8f^F7$<~2`w80E7@_3I(~LFManRBXt8P$vW@S)wXmW-rX4x!llhypiFMQP43SQJJABH`O{)gBGbBn zDOy`^6w{XO0-QFvlW2|WraD-QTOm~jZo;lm>76|{yBaZ(wbw5Amio<*7fES+7w5jD zGF(hxdc6RJc0HWcLD%PFJNq!=!PSt3;Ap z?bt8=?_Bo558pp{^}&W%ZST{{ADHxqeuNzo_UP9g_U+f$;R?hZP||JAMYfFHk11|7 z`vK)F0%P)T^4cq2CCRDP7oYR% z2hDP7k9oe&dDHnN*$zrKV!O?7z${mP)a($c1s1V>b=oX{KbNk(W7{Sv$`~!=7IWvk zMem%mpcmAFz2GkR3mjl^t8e>wPsr5ss?0H{Z*Dp>XP}c@^UVoks7|QzYn{VWfKy!Q zrRGtpLVbrTKv7sz&+?j>oqA%gP}nMk zt|bE}(bnXs`lc$@jdnV%Lw!vPQAJ|j*gocR=$jfMXYPfX+ymx~yWx5+PM_4ixin93 zZ#hw4l?HhNjie?wIiU_m1<4L46lRCaT~a2I;aeu+Ng}$P$Oxd3zC`R~%oe>KpBt-t zTD=b)=aPcSSlW(^on#N{;P8~8^tfIAQ^wcH1o6?bGVv#k2Jgy=o;K)clB36is<=S_ z!ZD4|*$+RExxojdKDlY|Y{Ssm9MMM{!lNSysXbsTVH}{!J&Zb~K~6t%8I_3_qcrFnrU@k`K^SB!ioVt@B<`?e`2j-I*ZGaZsd&VYUJ(@`l z0zI2gX5+*0(IB2bb+r?`X@ZaIqv6p|?~8r+wg8g(`Xdg|hr`LC_(*u9-d@bH@ ztcS<-Kefdc?oW=yW8oNjrSWJGAH){aLU*5j)_s>B=iL`k-F^bcur`4@dtQH@bFYJ@ z--w%u2l8U91el_L5p$m(M!p6pPy(R#%Z<4;AOR+aDn_vu1NuRjlp+qE(D$#MbmK<8 z88yycb$`JQM@^XWd*X?3g4O~K_Iy06e@;cSJu0}f;Y2iB2O&2Xj!$WZi1BzRngFsk z8V|bPpp5h3oF}TGIiQE{O;besnfuuUdg#@fAjAe!=jR0ImSuEEb1~VWo{SEK!_lES zNJj~RLiKa;WHcHMHsaA}E*xsaD6}I(Oj`^l$KsLv3@9llK47GRIOh+9li_e3WXmXS zc61=QP37wVx^5SpSrIs*dM|BEfyky2P68qE^e@=?y;%U`9Suf9(QqT0Opc$uGdie$ z(T3sNU#7u2l4Sx$5A;8@!~OBTHgQkHQ{hySjO+i>j;0L#-M@#8yit>v@+Bw3eaW3F zJW}+ceaT(Q{U>$=&X8AFrr<`ayYM#s`3sIeZKVuZIKj%bylhbkN{-^^iD?}17 zV%ReE`M|eCb68p?-bXJvKrd;~OZHP_H?H^el8Lb1=_Q;#(MuZ9e(5DR&&IRyTu&Dn zG-1c}VK~Ng5xS6ck^hO%;VfO`P5@W7AN9Kx(FQoMVr2WM4NJd5?dcf?-hBkxIKnTBt*0)Ig6_q z4@T4RU^E>M#220)O~(V1S=GdUoAKZW?LwXLdj<{~*{^?Ag(Hk^e*rd@&TC}2DZukU z)8)=s7*TTR@OW~+>4|nU4ZG4m+9G`1Sk1_CQ2#v@9qdG?#|MFwBi;p4o+bvK^8R=@ zKO7#UH_UdN^Rqp@VODyBa6h?7FOov!>)~K>E&++$+Zz}=Lg`0$0EYU(8+rq{^XOo^ zHyqHPH}d_*?Xc&nP$S=eBkc_--8#MD=R3XO7dpK`ih+DLycSVLlU}}-|fRhv>>OgcTllAlThePUyNPBOP`~OOML|5*Eodmk||E4`6 zbl>Wg`vNTSxiTW1wPuq{fm2Q?gWC8I*vEcP7=Q_7kPnz#2`=I-b&chX4DS6%R$y@; zNz9y<8}68GcR!=V{k<%B`n>^A-J4~_Y|>*knM?RW4UmU?T#iFPCn0#?1Ia^3=Ya1# zaQw#|#_OTO?6k2@pLHMWOEEW142KvGBM?j#yg`#{464Xa9*GNJA|t{?X{y|ATat8> z^HG8O0c5gWv`47lN7NgkUw(p1r(MvmvgCM=pevc_bJaj1kSMwrOE8QsJLBI*zlH|= z>O|b@m^?-(I;aHR4gKm0`YK(?nX6v&sI=txgcTJR)ZBe>5iAqPESrBp@^~do7AYxr zFDD{np>pyBDH|croy6eN@&Y_zmFJ!G5<&8StCkOZY*0G65j#kpN}hJF36W%0l80ph zVep=Uv_$>64Wy-L z0+t7=(#sPaAZ^DRmg$Az?iD->3S3!i(6KUK>Brd~cTe3I=w{x0$lTT4O^J-a$dxZn zG5KEUi(Z-z14v&F9T5Dk{!ygN2_4pxXBg^5P6gp`@@}~c!Jw8|(?%r2Y$$|l%kf}b zC=`&QrD&L;>e&WU1rbtp*hcP2&@3(nS-Fq{O;LKYQ;`!O;Tf5Ac~pPc;3K-{`&@uMw5wZL^RaJ;c_<)A?g!+m84za zK!L+^CiL$q_aCEz#jeiH;Tsd0Swg8tUi}N@{+n(J9%!FbT5!`pT}ac30@(7sj5H+Y zM>X<|JmH1U*zV^6xfy!G3VB#T?lM7!b`l6nja#OXMZBq$<8YjO*~V+`wI{HDO3iRl zGBbS{89{={$OueIMnJ!2!R}g9EnPIN&7#b*l2X zAjkS}z45W}wGG%bU&l?CZ4<;ec$F7+H&`NG{HU)n2 z4Ku+ACqU+mJYseJqCG|H{eVi5z)TYj5_p+Okds`@kicXvNZ>;PsAJr80JRGenAuGq z64((WuuL0MBrxls3<Q$b{d`nqmRVxBOQDR9V;X*CZg*c?VS@bLb_(G%BCko%6$&BP^-GwBXPIm^ zxmBVL6`+RxV4)^dsHId8Y%El$bNjii<8c}$dS3{kKp-xFd3e(O^DAIO@uG~{Jsjon@Vd*ZzhD6Km z8cB$V9}w_8R2qr~nB)&}flw2g)C+Z4?bP<_H{1_M)k=&xTtAL8WUBX)iECekOrJAk zikc<_WU8lRs;6YCr(~+9WU8lRlC&U`r1p-<#9p#WY4l&Ak=Ulu0ci9i>XH#B-YL)` z>5n0WTcVQIxaQjiq8Td9%8sjmwEg6g0S2>Ve!<|+=W8NI1Ry+LE060rvjZ)Al`kPm zjtPgScKIxU3B>+Kia=*~LQ`2DMR^qDVF2lQv9TYhX-Y80janr*d&mIN$?P)t;(9M2 zeTGVWPJu|L&vWa?3Bc{iS{sp$kWXHgi_{qT%(!PCB=qOiKEegb%(#|WYXIOOxdN=a zkgTIjuS_aj|1d5~e@b!h zFX%4r-JUkMce<3|-kbfn_jGcjrQDSMh<%v4_;OQ=d<29?o?d{#%z|SldKGNyo(%0H zl*VTd;shPbIzd0PPSE456D4_+<-uhT)(NhFuujzEV^RY(zWhoY&dN@>_OZ+w*tdz5 zi6{#c`}WN4*X%nod#+|57rSt{n`{s=NH*$xS}{!xNT6W8Bne7vpUmvVntf+xFVyV2 zGCN7%o!Rp>`<~1m*6e#Tdr-6QYuov9w1v>BoK8}idvKu&oZ6^J+IxWi@Iq-de`SO)UpEE!|=kvK# zi{oH97IqhM3#EnfLS>=4P+J&Ss4p}Z1{a0^FpVsXE{rYgSr}hn{cZhX=f(jJEa?vi zoMT^A+yyu8e%R(iy5Dj>>-cYZFXsL+_m=#hUN!#r-oMfLe--=O77$qluGW~a_*^0i z>3n)5MNxvF4T_;BD7cJHixR3L7L?ywL1mgpTO|lpq;Nu?lka>b93v6BxGP!Q&n&Q7nsCTlNl3$6-kvu1Ylu6CBE3?jsyAbKx)H}s9mxHI5e&;W9S+Tif`Whw4Zpju?A_Z%Fg;4Ia-cD^?JH1^sZlWb6 zw;ZQmDU8>9F4Xp~-uPKVEg5vLsm`1HQvJWR)uMTm^xD^+i#FlgU18m;Ihac|2m5vI zjBZ+w9vA)TZGPYO8->yz-|hz|tY-c;*ZKIWqQ->DFLN(c zAzCPUbn3BubbpaWIBV6gTucU^u zG9tvP{B;&g=5uCzqKp%aIvY>yH==>TWry5kWbu_QY?LQd%xR;zc}no`=Eqi4cbztg z9?70ULu%VyhU{gtX(o_8BK=jS(@gsPay}m5DqpQHu=I9WEDvylTrjR5XW~xY_lH*0 zx-S-D^IV$Uqn8Tg{#TTtuR#y{NUo~zsEV5FNJ3?9N z*V!HBo?zLT@Hn00bgW*E&K6lA))iN8x#oL$rV5bK{j1cPmq_R;D>hRHnb#rf;g|vg udC4-$L" + "repr": "u64" }, "data": { - "Vector": [] + "Number": "0" }, - "bcs": "AA==" + "bcs": "AAAAAAAAAAA=" }, "value": { - "__typename": "MoveValue" + "__typename": "MoveObject" } }, { "name": { "type": { - "repr": "u64" + "repr": "vector" }, "data": { - "Number": "0" + "Vector": [] }, - "bcs": "AAAAAAAAAAA=" + "bcs": "AA==" }, "value": { "__typename": "MoveValue" @@ -83,15 +83,15 @@ Response: { { "name": { "type": { - "repr": "u64" + "repr": "bool" }, "data": { - "Number": "0" + "Bool": false }, - "bcs": "AAAAAAAAAAA=" + "bcs": "AA==" }, "value": { - "__typename": "MoveObject" + "__typename": "MoveValue" } } ] @@ -121,12 +121,12 @@ Response: { { "name": { "type": { - "repr": "bool" + "repr": "u64" }, "data": { - "Bool": false + "Number": "0" }, - "bcs": "AA==" + "bcs": "AAAAAAAAAAA=" }, "value": { "__typename": "MoveValue" @@ -135,26 +135,26 @@ Response: { { "name": { "type": { - "repr": "vector" + "repr": "u64" }, "data": { - "Vector": [] + "Number": "0" }, - "bcs": "AA==" + "bcs": "AAAAAAAAAAA=" }, "value": { - "__typename": "MoveValue" + "__typename": "MoveObject" } }, { "name": { "type": { - "repr": "u64" + "repr": "vector" }, "data": { - "Number": "0" + "Vector": [] }, - "bcs": "AAAAAAAAAAA=" + "bcs": "AA==" }, "value": { "__typename": "MoveValue" @@ -163,15 +163,15 @@ Response: { { "name": { "type": { - "repr": "u64" + "repr": "bool" }, "data": { - "Number": "0" + "Bool": false }, - "bcs": "AAAAAAAAAAA=" + "bcs": "AA==" }, "value": { - "__typename": "MoveObject" + "__typename": "MoveValue" } } ] @@ -190,17 +190,17 @@ Response: { { "name": { "type": { - "repr": "bool" + "repr": "u64" }, "data": { - "Bool": false + "Number": "0" }, - "bcs": "AA==" + "bcs": "AAAAAAAAAAA=" }, "value": { - "bcs": "AgAAAAAAAAA=", + "bcs": "AAAAAAAAAAA=", "data": { - "Number": "2" + "Number": "0" }, "__typename": "MoveValue" } @@ -208,35 +208,31 @@ Response: { { "name": { "type": { - "repr": "vector" + "repr": "u64" }, "data": { - "Vector": [] + "Number": "0" }, - "bcs": "AA==" + "bcs": "AAAAAAAAAAA=" }, "value": { - "bcs": "AQAAAAAAAAA=", - "data": { - "Number": "1" - }, - "__typename": "MoveValue" + "__typename": "MoveObject" } }, { "name": { "type": { - "repr": "u64" + "repr": "vector" }, "data": { - "Number": "0" + "Vector": [] }, - "bcs": "AAAAAAAAAAA=" + "bcs": "AA==" }, "value": { - "bcs": "AAAAAAAAAAA=", + "bcs": "AQAAAAAAAAA=", "data": { - "Number": "0" + "Number": "1" }, "__typename": "MoveValue" } @@ -244,15 +240,19 @@ Response: { { "name": { "type": { - "repr": "u64" + "repr": "bool" }, "data": { - "Number": "0" + "Bool": false }, - "bcs": "AAAAAAAAAAA=" + "bcs": "AA==" }, "value": { - "__typename": "MoveObject" + "bcs": "AgAAAAAAAAA=", + "data": { + "Number": "2" + }, + "__typename": "MoveValue" } } ] diff --git a/crates/iota-graphql-e2e-tests/tests/call/simple.exp b/crates/iota-graphql-e2e-tests/tests/call/simple.exp index b021531a44d..7e772c87857 100644 --- a/crates/iota-graphql-e2e-tests/tests/call/simple.exp +++ b/crates/iota-graphql-e2e-tests/tests/call/simple.exp @@ -25,19 +25,13 @@ task 4, line 32: //# view-object 0,0 Owner: Account Address ( validator_0 ) Version: 1 -Contents: iota_system::staking_pool::StakedIota { +Contents: iota_system::validator_cap::UnverifiedValidatorOperationCap { id: iota::object::UID { id: iota::object::ID { bytes: fake(0,0), }, }, - pool_id: iota::object::ID { - bytes: _, - }, - stake_activation_epoch: 0u64, - principal: iota::balance::Balance { - value: 1500000000000000u64, - }, + authorizer_validator_address: validator_0, } task 5, line 34: @@ -81,7 +75,7 @@ Epoch advanced: 5 task 10, line 44: //# view-checkpoint -CheckpointSummary { epoch: 5, seq: 10, content_digest: 2eR3Fe6fAfkyCHD3Ts38QN4wihweGB1TsuWdQTyUjhqw, +CheckpointSummary { epoch: 5, seq: 10, content_digest: 9X2eEhaTREKQbXGbHrnnmvTm4TZfhhY5H6rUcecft8bX, epoch_rolling_gas_cost_summary: GasCostSummary { computation_cost: 0, storage_cost: 0, storage_rebate: 0, non_refundable_storage_fee: 0 }} task 11, lines 46-51: @@ -159,8 +153,8 @@ Response: { "edges": [ { "node": { - "address": "0x5d742b4abf184b84114a2c388102331916350820d8d09d27fc9c928285fbc45c", - "digest": "smTS4BaZ82dqRsgcYP1mx2NmgBi93WNU5S97qrje46K", + "address": "0x6273faa79d73a191d238a3bdcc2b3c11eb976980b296d22d410f95c0f61d2fde", + "digest": "121p5YAKxtozkekSFdYPAoFpViqUnAztxspya851dx9M", "owner": { "__typename": "AddressOwner" } @@ -186,8 +180,8 @@ Response: { "edges": [ { "node": { - "address": "0x5d742b4abf184b84114a2c388102331916350820d8d09d27fc9c928285fbc45c", - "digest": "smTS4BaZ82dqRsgcYP1mx2NmgBi93WNU5S97qrje46K", + "address": "0x6273faa79d73a191d238a3bdcc2b3c11eb976980b296d22d410f95c0f61d2fde", + "digest": "121p5YAKxtozkekSFdYPAoFpViqUnAztxspya851dx9M", "owner": { "__typename": "AddressOwner" } @@ -201,8 +195,8 @@ Response: { "edges": [ { "node": { - "address": "0x26bf0f03edd09bb3f862e13cec014d17c26dd739d2563d9c704aa8d206301df2", - "digest": "8pafH5S16jKMuaYN7EuvhdPCBTe73C1WAACmtBJg135Q", + "address": "0x0aa69d72003801ab057e567938016c0f832f1516937fc84a8b5c11ba06c06815", + "digest": "8NvJsVTkKKDJgavep2F65Aff6gJmdWpxJJ7Hpe1dTZ7e", "owner": { "__typename": "AddressOwner" } @@ -210,8 +204,8 @@ Response: { }, { "node": { - "address": "0x3442446f02377d1025b211e51564e4f1c9a46845ccad733beeb06180d3f66c31", - "digest": "HMMWrCzpq5MonXNzB1d2KMMAHGR4W33KuoHhF5QRS4HK", + "address": "0x26bf0f03edd09bb3f862e13cec014d17c26dd739d2563d9c704aa8d206301df2", + "digest": "qm9zxqHuMpn3adTZR7Hw4kx2E5cAApBrNZcCYMTj4q4", "owner": { "__typename": "AddressOwner" } @@ -219,8 +213,8 @@ Response: { }, { "node": { - "address": "0x3c88cad5799a8da0467b8456a7429a97e7c141cfcf25f02faf51aa8cb4840461", - "digest": "5UNMNaEFYvE8iuCLCY173awgnNNfM78XdhtRB1PUUkAN", + "address": "0x31e3256cfe19704fd29c7e8a8d0030b2d6101b8c04668ead7bf7d38257d9e002", + "digest": "FXQKdY2oYvWnDGs3L2EuPYSYupHC8yhcsWBTtGP12DBr", "owner": { "__typename": "AddressOwner" } @@ -228,8 +222,8 @@ Response: { }, { "node": { - "address": "0x4662cd0a74f2ee630e0bc4fe9863357169bff8490e00a0c8de72eedbfc9e192f", - "digest": "GmSnCj3RVGsmpc1YjesyZinrb98Y7fok4vaWz3nY1a6Y", + "address": "0x3442446f02377d1025b211e51564e4f1c9a46845ccad733beeb06180d3f66c31", + "digest": "GuVwJJNsKJwzmufHJCmPMW27fYZf2JNS2SNT3gi1XSgj", "owner": { "__typename": "AddressOwner" } @@ -237,8 +231,8 @@ Response: { }, { "node": { - "address": "0x4cfad1d6cc89d28c112a64096b16fe3e8fbc819d714871ed452dbb44d45f5cb2", - "digest": "CL76PYiRKRjj2ZkBdhwiv5c1ZakaR5QnnW5nLWxD71ob", + "address": "0x3c88cad5799a8da0467b8456a7429a97e7c141cfcf25f02faf51aa8cb4840461", + "digest": "abMq2H3FqVggiupt3CknW1YNEKFZdYGTZNu7XpU7YsX", "owner": { "__typename": "AddressOwner" } @@ -247,7 +241,7 @@ Response: { { "node": { "address": "0x847c914d647e7387d7cea4db5ad8fefeffe66773635804a991dfd4385fab6a97", - "digest": "J8LZZaGPdwT1MRFnVnireQVuFYgK19BT5uA5TL8P4Mnn", + "digest": "HpzDcE6Fz6Nbk1KNhY1c1qU5QxCAaHXzFA1hfYfhFMHz", "owner": { "__typename": "AddressOwner" } @@ -255,8 +249,8 @@ Response: { }, { "node": { - "address": "0xa79cc544021a721176cdc4497728ec35a5311b8ff0aa293a5d29c0d32cb56056", - "digest": "EG6Y3C4mPjnMR3SGFT2XsUBXTPTCsXNPw7PBAjdepjHb", + "address": "0x892836945e37c3a48c0dde074d3a079a50dfc47c1fbde03d7409064340b1f743", + "digest": "6saYWQXDNUMksgPTxBkir1ZHoh6L6A1sXJ14CTTTPLkx", "owner": { "__typename": "AddressOwner" } @@ -264,8 +258,8 @@ Response: { }, { "node": { - "address": "0xac9c2e11aebecd35b4cb15802ca6ad5e64d320204149187ba646a16d07a4934d", - "digest": "34Rc7MLpTWfvfV1YeqkyEn9U8Ziure8F1KVjmCh3p6iS", + "address": "0xa79cc544021a721176cdc4497728ec35a5311b8ff0aa293a5d29c0d32cb56056", + "digest": "844BRJc3iC63fki2xFCUuVwTJead6GqviJHFvgGmxyj5", "owner": { "__typename": "AddressOwner" } @@ -273,8 +267,8 @@ Response: { }, { "node": { - "address": "0xb21c0b03871456040643740e238d03bde38de240d7b17055f4670777a19f07b8", - "digest": "DocRSiZHWBGiB4CMRKaHxa4XPfP3ybrEmxSEp7Go6bwN", + "address": "0xab2415a43bf8f72193ec765f63af9cf7705bb3a312b0a14f1332be3f74d81c58", + "digest": "6p1wpzeYh47gcC9FC22Po8N1wCHMEyaZJwB4QzLRdcFo", "owner": { "__typename": "AddressOwner" } @@ -282,8 +276,8 @@ Response: { }, { "node": { - "address": "0xc7b2651a24c952eb731baf4ee7e08376947833231e12d4e09d77b35a284be94f", - "digest": "DSsjw9qvjE9XSapmykPoC9Z1pUhbFENBtL7RDSpTZAr3", + "address": "0xac9c2e11aebecd35b4cb15802ca6ad5e64d320204149187ba646a16d07a4934d", + "digest": "35hWuW17ahJAyBFSWHZH2f8LNNDTF4mVT362X7FSyhJ6", "owner": { "__typename": "AddressOwner" } @@ -291,8 +285,8 @@ Response: { }, { "node": { - "address": "0xd7c33508b56f0c054c2972007d6fad114c6efaa456fee246126e77024e7cf91e", - "digest": "CANDDJmtqBRSGQqVdmE6RAUkjqdf8omiXUrqFUbhbuGn", + "address": "0xb21c0b03871456040643740e238d03bde38de240d7b17055f4670777a19f07b8", + "digest": "HRC6wHwgsx4WmFhWVAJSDAMMAFoVZtGKSWrv78QDrzxn", "owner": { "__typename": "AddressOwner" } @@ -300,8 +294,8 @@ Response: { }, { "node": { - "address": "0xe43d31e12a1be924164da5a406481018dda424b9000990d589861175f64b815d", - "digest": "GV9ef2MUhiv4UaT2Xch812ECifidWvTBdtETfvHfTBUq", + "address": "0xfb29acaee47f4cf6dfd7d21773f74fb65f842e9483b194b06bf83f91c0460bf3", + "digest": "CsCUE4uQeGjvUMAAFkh1sh2rfLfLdBXJHy7aBv1TfuPo", "owner": { "__typename": "AddressOwner" } diff --git a/crates/iota-graphql-e2e-tests/tests/consistency/balances.exp b/crates/iota-graphql-e2e-tests/tests/consistency/balances.exp index eaac69057ca..cd7e0694d83 100644 --- a/crates/iota-graphql-e2e-tests/tests/consistency/balances.exp +++ b/crates/iota-graphql-e2e-tests/tests/consistency/balances.exp @@ -80,7 +80,7 @@ Response: { }, { "coinType": { - "repr": "0x72b0096564296b83ded200a9cef7f4aa3257b9f63d2cb41305171e2cc3758afd::fake::FAKE" + "repr": "0xe8ee7be6dbe0973ef635dc6515beaa862a9597be976c26dbaf1034e593b3c85f::fake::FAKE" }, "coinObjectCount": 3, "totalBalance": "700" @@ -103,7 +103,7 @@ Response: { { "sender": { "fakeCoinBalance": { - "totalBalance": "600" + "totalBalance": "500" }, "allBalances": { "nodes": [ @@ -116,10 +116,10 @@ Response: { }, { "coinType": { - "repr": "0x72b0096564296b83ded200a9cef7f4aa3257b9f63d2cb41305171e2cc3758afd::fake::FAKE" + "repr": "0xe8ee7be6dbe0973ef635dc6515beaa862a9597be976c26dbaf1034e593b3c85f::fake::FAKE" }, "coinObjectCount": 2, - "totalBalance": "600" + "totalBalance": "500" } ] } @@ -139,7 +139,7 @@ Response: { { "sender": { "fakeCoinBalance": { - "totalBalance": "300" + "totalBalance": "200" }, "allBalances": { "nodes": [ @@ -152,10 +152,10 @@ Response: { }, { "coinType": { - "repr": "0x72b0096564296b83ded200a9cef7f4aa3257b9f63d2cb41305171e2cc3758afd::fake::FAKE" + "repr": "0xe8ee7be6dbe0973ef635dc6515beaa862a9597be976c26dbaf1034e593b3c85f::fake::FAKE" }, "coinObjectCount": 1, - "totalBalance": "300" + "totalBalance": "200" } ] } @@ -196,7 +196,7 @@ Response: { }, { "coinType": { - "repr": "0x72b0096564296b83ded200a9cef7f4aa3257b9f63d2cb41305171e2cc3758afd::fake::FAKE" + "repr": "0xe8ee7be6dbe0973ef635dc6515beaa862a9597be976c26dbaf1034e593b3c85f::fake::FAKE" }, "coinObjectCount": 3, "totalBalance": "700" @@ -219,7 +219,7 @@ Response: { { "sender": { "fakeCoinBalance": { - "totalBalance": "600" + "totalBalance": "500" }, "allBalances": { "nodes": [ @@ -232,10 +232,10 @@ Response: { }, { "coinType": { - "repr": "0x72b0096564296b83ded200a9cef7f4aa3257b9f63d2cb41305171e2cc3758afd::fake::FAKE" + "repr": "0xe8ee7be6dbe0973ef635dc6515beaa862a9597be976c26dbaf1034e593b3c85f::fake::FAKE" }, "coinObjectCount": 2, - "totalBalance": "600" + "totalBalance": "500" } ] } @@ -255,7 +255,7 @@ Response: { { "sender": { "fakeCoinBalance": { - "totalBalance": "300" + "totalBalance": "200" }, "allBalances": { "nodes": [ @@ -268,10 +268,10 @@ Response: { }, { "coinType": { - "repr": "0x72b0096564296b83ded200a9cef7f4aa3257b9f63d2cb41305171e2cc3758afd::fake::FAKE" + "repr": "0xe8ee7be6dbe0973ef635dc6515beaa862a9597be976c26dbaf1034e593b3c85f::fake::FAKE" }, "coinObjectCount": 1, - "totalBalance": "300" + "totalBalance": "200" } ] } @@ -334,7 +334,7 @@ Response: { { "sender": { "fakeCoinBalance": { - "totalBalance": "600" + "totalBalance": "500" }, "allBalances": { "nodes": [ @@ -347,10 +347,10 @@ Response: { }, { "coinType": { - "repr": "0x72b0096564296b83ded200a9cef7f4aa3257b9f63d2cb41305171e2cc3758afd::fake::FAKE" + "repr": "0xe8ee7be6dbe0973ef635dc6515beaa862a9597be976c26dbaf1034e593b3c85f::fake::FAKE" }, "coinObjectCount": 2, - "totalBalance": "600" + "totalBalance": "500" } ] } @@ -370,7 +370,7 @@ Response: { { "sender": { "fakeCoinBalance": { - "totalBalance": "300" + "totalBalance": "200" }, "allBalances": { "nodes": [ @@ -383,10 +383,10 @@ Response: { }, { "coinType": { - "repr": "0x72b0096564296b83ded200a9cef7f4aa3257b9f63d2cb41305171e2cc3758afd::fake::FAKE" + "repr": "0xe8ee7be6dbe0973ef635dc6515beaa862a9597be976c26dbaf1034e593b3c85f::fake::FAKE" }, "coinObjectCount": 1, - "totalBalance": "300" + "totalBalance": "200" } ] } diff --git a/crates/iota-graphql-e2e-tests/tests/consistency/checkpoints/transaction_blocks.exp b/crates/iota-graphql-e2e-tests/tests/consistency/checkpoints/transaction_blocks.exp index 254edce1ead..f652aea58ac 100644 --- a/crates/iota-graphql-e2e-tests/tests/consistency/checkpoints/transaction_blocks.exp +++ b/crates/iota-graphql-e2e-tests/tests/consistency/checkpoints/transaction_blocks.exp @@ -94,12 +94,12 @@ Response: { { "cursor": "eyJjIjozLCJ0IjoyLCJpIjpmYWxzZX0", "node": { - "digest": "EwmT47jKmNQDvxQgzwMCzjU7YbDD1aB7XAqDLXFCVk8S", + "digest": "3Wu2rNcM39pocoovpHUXZrWtwQXn8ZXAGpwrU7GthLLD", "sender": { "objects": { "edges": [ { - "cursor": "IP/YY3sBms9tv6LOECqfoZ9YYyMPFwAH+CT+ReeP7XwTAwAAAAAAAAA=" + "cursor": "IOuXfIr/MFNZLw/UcBw1yb4Asy3a7l9mjzGLhiX0TNM2AwAAAAAAAAA=" } ] } @@ -109,12 +109,12 @@ Response: { { "cursor": "eyJjIjozLCJ0IjozLCJpIjpmYWxzZX0", "node": { - "digest": "A3BxB2KqSbEY5rzGjhm1FBLmRvVRG9pK8QEuaYnnvMZz", + "digest": "5Fx8EKmMoiHb59rVr2ch64EgLyvs9SWhuUHq6x3HAx3T", "sender": { "objects": { "edges": [ { - "cursor": "IP/YY3sBms9tv6LOECqfoZ9YYyMPFwAH+CT+ReeP7XwTAwAAAAAAAAA=" + "cursor": "IOuXfIr/MFNZLw/UcBw1yb4Asy3a7l9mjzGLhiX0TNM2AwAAAAAAAAA=" } ] } @@ -124,12 +124,12 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo0LCJpIjpmYWxzZX0", "node": { - "digest": "3q3x6TLWzA6VGc3uRsxbB3P3pPfeD3W9XwaqbYbE9xac", + "digest": "DvNBuuqGugb9p76oMb1jLa6MdAv7mT184x69bGKC2rQw", "sender": { "objects": { "edges": [ { - "cursor": "IP/YY3sBms9tv6LOECqfoZ9YYyMPFwAH+CT+ReeP7XwTAwAAAAAAAAA=" + "cursor": "IOuXfIr/MFNZLw/UcBw1yb4Asy3a7l9mjzGLhiX0TNM2AwAAAAAAAAA=" } ] } @@ -139,12 +139,12 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo1LCJpIjpmYWxzZX0", "node": { - "digest": "9iWLh5uU71BUZapSEAR7K7LN8LCMow3V6TTjtLUn3XmL", + "digest": "ERSRy9F3o39NCDRWeDVz5AgBGZPmaCdXzzJ6tjd8eY7k", "sender": { "objects": { "edges": [ { - "cursor": "IP/YY3sBms9tv6LOECqfoZ9YYyMPFwAH+CT+ReeP7XwTAwAAAAAAAAA=" + "cursor": "IOuXfIr/MFNZLw/UcBw1yb4Asy3a7l9mjzGLhiX0TNM2AwAAAAAAAAA=" } ] } @@ -161,12 +161,12 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo2LCJpIjpmYWxzZX0", "node": { - "digest": "2WNkedo9ryA7XgpBREdQah76c8yu5h7KmUjD3MGJdsiC", + "digest": "2uLirA5sxREeS1UHEKCJWeoMv2R1MKCUiiep9Q6s7WA6", "sender": { "objects": { "edges": [ { - "cursor": "IP/YY3sBms9tv6LOECqfoZ9YYyMPFwAH+CT+ReeP7XwTAwAAAAAAAAA=" + "cursor": "IOuXfIr/MFNZLw/UcBw1yb4Asy3a7l9mjzGLhiX0TNM2AwAAAAAAAAA=" } ] } @@ -176,12 +176,12 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo3LCJpIjpmYWxzZX0", "node": { - "digest": "3Hnz1hLa3UGLRvyophw12hwhfmwnYpJM75fDuT6bWBEB", + "digest": "4HgxdMoiQdZbLrd7ycQ3csPtccNPvr9BZW67ykV7NRk6", "sender": { "objects": { "edges": [ { - "cursor": "IP/YY3sBms9tv6LOECqfoZ9YYyMPFwAH+CT+ReeP7XwTAwAAAAAAAAA=" + "cursor": "IOuXfIr/MFNZLw/UcBw1yb4Asy3a7l9mjzGLhiX0TNM2AwAAAAAAAAA=" } ] } @@ -191,12 +191,12 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo4LCJpIjpmYWxzZX0", "node": { - "digest": "Bwx7M14Z3TTQ8HjJan4NpfTp9uab6zGZ1t3VyHexrkjY", + "digest": "d9yohmp3svrBRKZjbfv7Gn5TbCrmspbqis2wy76ES1M", "sender": { "objects": { "edges": [ { - "cursor": "IP/YY3sBms9tv6LOECqfoZ9YYyMPFwAH+CT+ReeP7XwTAwAAAAAAAAA=" + "cursor": "IOuXfIr/MFNZLw/UcBw1yb4Asy3a7l9mjzGLhiX0TNM2AwAAAAAAAAA=" } ] } @@ -213,12 +213,12 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo5LCJpIjpmYWxzZX0", "node": { - "digest": "GB8JFDwwGHRQrDMrbHqHMY5ZtWnWyfk9bzPQCfwQUq1h", + "digest": "ExuPheKtkWpsGKjy7HuYFUWjsGqftVXNXyyu8XQUjro5", "sender": { "objects": { "edges": [ { - "cursor": "IP/YY3sBms9tv6LOECqfoZ9YYyMPFwAH+CT+ReeP7XwTAwAAAAAAAAA=" + "cursor": "IOuXfIr/MFNZLw/UcBw1yb4Asy3a7l9mjzGLhiX0TNM2AwAAAAAAAAA=" } ] } @@ -228,12 +228,12 @@ Response: { { "cursor": "eyJjIjozLCJ0IjoxMCwiaSI6ZmFsc2V9", "node": { - "digest": "EqU64iWmUFhMRufjdcNtVKiBkVaGUfHE5b8GGmBvyXaj", + "digest": "GFdCwVbseLpFVe3sX91EkkAHJm2hXXVM3LH4FZu1gn9K", "sender": { "objects": { "edges": [ { - "cursor": "IP/YY3sBms9tv6LOECqfoZ9YYyMPFwAH+CT+ReeP7XwTAwAAAAAAAAA=" + "cursor": "IOuXfIr/MFNZLw/UcBw1yb4Asy3a7l9mjzGLhiX0TNM2AwAAAAAAAAA=" } ] } diff --git a/crates/iota-graphql-e2e-tests/tests/consistency/coins.exp b/crates/iota-graphql-e2e-tests/tests/consistency/coins.exp index 7bd89173acd..3c22209efb3 100644 --- a/crates/iota-graphql-e2e-tests/tests/consistency/coins.exp +++ b/crates/iota-graphql-e2e-tests/tests/consistency/coins.exp @@ -33,7 +33,7 @@ Response: { "queryCoinsAtLatest": { "edges": [ { - "cursor": "IDsIlA02kXloawgaHM7wOcNLPsj7qZUP7GJU5kplSemHAgAAAAAAAAA=", + "cursor": "ICiav5I6Mkx08X0VmoZKIJ0awF2KpVcGFefQ4GWueq9jAgAAAAAAAAA=", "node": { "consistentStateForEachCoin": { "owner": { @@ -41,37 +41,37 @@ Response: { "coins": { "edges": [ { - "cursor": "IDsIlA02kXloawgaHM7wOcNLPsj7qZUP7GJU5kplSemHAgAAAAAAAAA=", + "cursor": "ICiav5I6Mkx08X0VmoZKIJ0awF2KpVcGFefQ4GWueq9jAgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x3b08940d369179686b081a1ccef039c34b3ec8fba9950fec6254e64a6549e987", + "id": "0x289abf923a324c74f17d159a864a209d1ac05d8aa5570615e7d0e065ae7aaf63", "balance": { - "value": "100200" + "value": "100100" } } } } }, { - "cursor": "IFYBv/phSqHbWCaiuqdXOLTSGywnKgV6jTvBvpkKEm9pAgAAAAAAAAA=", + "cursor": "IKQYR4gBIlqmEkXHMhZsUUbfKoX8aufbPgILwCO/Sly9AgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x5601bffa614aa1db5826a2baa75738b4d21b2c272a057a8d3bc1be990a126f69", + "id": "0xa418478801225aa61245c732166c5146df2a85fc6ae7db3e020bc023bf4a5cbd", "balance": { - "value": "100" + "value": "200" } } } } }, { - "cursor": "IMacInfJfaowDpNNBdkoSgALQyU0WPWhzB0x66+oRDH9AgAAAAAAAAA=", + "cursor": "IOtyLmahCDl5xXyOjB0WMqX9cUF4/ZkicypBnpx9OxxlAgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc69c2277c97daa300e934d05d9284a000b43253458f5a1cc1d31ebafa84431fd", + "id": "0xeb722e66a1083979c57c8e8c1d1632a5fd714178fd9922732a419e9c7d3b1c65", "balance": { "value": "300" } @@ -85,16 +85,16 @@ Response: { }, "contents": { "json": { - "id": "0x3b08940d369179686b081a1ccef039c34b3ec8fba9950fec6254e64a6549e987", + "id": "0x289abf923a324c74f17d159a864a209d1ac05d8aa5570615e7d0e065ae7aaf63", "balance": { - "value": "100200" + "value": "100100" } } } } }, { - "cursor": "IFYBv/phSqHbWCaiuqdXOLTSGywnKgV6jTvBvpkKEm9pAgAAAAAAAAA=", + "cursor": "IKQYR4gBIlqmEkXHMhZsUUbfKoX8aufbPgILwCO/Sly9AgAAAAAAAAA=", "node": { "consistentStateForEachCoin": { "owner": { @@ -102,37 +102,37 @@ Response: { "coins": { "edges": [ { - "cursor": "IDsIlA02kXloawgaHM7wOcNLPsj7qZUP7GJU5kplSemHAgAAAAAAAAA=", + "cursor": "ICiav5I6Mkx08X0VmoZKIJ0awF2KpVcGFefQ4GWueq9jAgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x3b08940d369179686b081a1ccef039c34b3ec8fba9950fec6254e64a6549e987", + "id": "0x289abf923a324c74f17d159a864a209d1ac05d8aa5570615e7d0e065ae7aaf63", "balance": { - "value": "100200" + "value": "100100" } } } } }, { - "cursor": "IFYBv/phSqHbWCaiuqdXOLTSGywnKgV6jTvBvpkKEm9pAgAAAAAAAAA=", + "cursor": "IKQYR4gBIlqmEkXHMhZsUUbfKoX8aufbPgILwCO/Sly9AgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x5601bffa614aa1db5826a2baa75738b4d21b2c272a057a8d3bc1be990a126f69", + "id": "0xa418478801225aa61245c732166c5146df2a85fc6ae7db3e020bc023bf4a5cbd", "balance": { - "value": "100" + "value": "200" } } } } }, { - "cursor": "IMacInfJfaowDpNNBdkoSgALQyU0WPWhzB0x66+oRDH9AgAAAAAAAAA=", + "cursor": "IOtyLmahCDl5xXyOjB0WMqX9cUF4/ZkicypBnpx9OxxlAgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc69c2277c97daa300e934d05d9284a000b43253458f5a1cc1d31ebafa84431fd", + "id": "0xeb722e66a1083979c57c8e8c1d1632a5fd714178fd9922732a419e9c7d3b1c65", "balance": { "value": "300" } @@ -146,16 +146,16 @@ Response: { }, "contents": { "json": { - "id": "0x5601bffa614aa1db5826a2baa75738b4d21b2c272a057a8d3bc1be990a126f69", + "id": "0xa418478801225aa61245c732166c5146df2a85fc6ae7db3e020bc023bf4a5cbd", "balance": { - "value": "100" + "value": "200" } } } } }, { - "cursor": "IMacInfJfaowDpNNBdkoSgALQyU0WPWhzB0x66+oRDH9AgAAAAAAAAA=", + "cursor": "IOtyLmahCDl5xXyOjB0WMqX9cUF4/ZkicypBnpx9OxxlAgAAAAAAAAA=", "node": { "consistentStateForEachCoin": { "owner": { @@ -163,37 +163,37 @@ Response: { "coins": { "edges": [ { - "cursor": "IDsIlA02kXloawgaHM7wOcNLPsj7qZUP7GJU5kplSemHAgAAAAAAAAA=", + "cursor": "ICiav5I6Mkx08X0VmoZKIJ0awF2KpVcGFefQ4GWueq9jAgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x3b08940d369179686b081a1ccef039c34b3ec8fba9950fec6254e64a6549e987", + "id": "0x289abf923a324c74f17d159a864a209d1ac05d8aa5570615e7d0e065ae7aaf63", "balance": { - "value": "100200" + "value": "100100" } } } } }, { - "cursor": "IFYBv/phSqHbWCaiuqdXOLTSGywnKgV6jTvBvpkKEm9pAgAAAAAAAAA=", + "cursor": "IKQYR4gBIlqmEkXHMhZsUUbfKoX8aufbPgILwCO/Sly9AgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x5601bffa614aa1db5826a2baa75738b4d21b2c272a057a8d3bc1be990a126f69", + "id": "0xa418478801225aa61245c732166c5146df2a85fc6ae7db3e020bc023bf4a5cbd", "balance": { - "value": "100" + "value": "200" } } } } }, { - "cursor": "IMacInfJfaowDpNNBdkoSgALQyU0WPWhzB0x66+oRDH9AgAAAAAAAAA=", + "cursor": "IOtyLmahCDl5xXyOjB0WMqX9cUF4/ZkicypBnpx9OxxlAgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc69c2277c97daa300e934d05d9284a000b43253458f5a1cc1d31ebafa84431fd", + "id": "0xeb722e66a1083979c57c8e8c1d1632a5fd714178fd9922732a419e9c7d3b1c65", "balance": { "value": "300" } @@ -207,7 +207,7 @@ Response: { }, "contents": { "json": { - "id": "0xc69c2277c97daa300e934d05d9284a000b43253458f5a1cc1d31ebafa84431fd", + "id": "0xeb722e66a1083979c57c8e8c1d1632a5fd714178fd9922732a419e9c7d3b1c65", "balance": { "value": "300" } @@ -221,37 +221,37 @@ Response: { "coins": { "edges": [ { - "cursor": "IDsIlA02kXloawgaHM7wOcNLPsj7qZUP7GJU5kplSemHAgAAAAAAAAA=", + "cursor": "ICiav5I6Mkx08X0VmoZKIJ0awF2KpVcGFefQ4GWueq9jAgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x3b08940d369179686b081a1ccef039c34b3ec8fba9950fec6254e64a6549e987", + "id": "0x289abf923a324c74f17d159a864a209d1ac05d8aa5570615e7d0e065ae7aaf63", "balance": { - "value": "100200" + "value": "100100" } } } } }, { - "cursor": "IFYBv/phSqHbWCaiuqdXOLTSGywnKgV6jTvBvpkKEm9pAgAAAAAAAAA=", + "cursor": "IKQYR4gBIlqmEkXHMhZsUUbfKoX8aufbPgILwCO/Sly9AgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x5601bffa614aa1db5826a2baa75738b4d21b2c272a057a8d3bc1be990a126f69", + "id": "0xa418478801225aa61245c732166c5146df2a85fc6ae7db3e020bc023bf4a5cbd", "balance": { - "value": "100" + "value": "200" } } } } }, { - "cursor": "IMacInfJfaowDpNNBdkoSgALQyU0WPWhzB0x66+oRDH9AgAAAAAAAAA=", + "cursor": "IOtyLmahCDl5xXyOjB0WMqX9cUF4/ZkicypBnpx9OxxlAgAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc69c2277c97daa300e934d05d9284a000b43253458f5a1cc1d31ebafa84431fd", + "id": "0xeb722e66a1083979c57c8e8c1d1632a5fd714178fd9922732a419e9c7d3b1c65", "balance": { "value": "300" } @@ -272,7 +272,7 @@ Response: { "queryCoinsAtChkpt1": { "edges": [ { - "cursor": "IDsIlA02kXloawgaHM7wOcNLPsj7qZUP7GJU5kplSemHAQAAAAAAAAA=", + "cursor": "ICiav5I6Mkx08X0VmoZKIJ0awF2KpVcGFefQ4GWueq9jAQAAAAAAAAA=", "node": { "consistentStateForEachCoin": { "owner": { @@ -280,37 +280,37 @@ Response: { "coins": { "edges": [ { - "cursor": "IDsIlA02kXloawgaHM7wOcNLPsj7qZUP7GJU5kplSemHAQAAAAAAAAA=", + "cursor": "ICiav5I6Mkx08X0VmoZKIJ0awF2KpVcGFefQ4GWueq9jAQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x3b08940d369179686b081a1ccef039c34b3ec8fba9950fec6254e64a6549e987", + "id": "0x289abf923a324c74f17d159a864a209d1ac05d8aa5570615e7d0e065ae7aaf63", "balance": { - "value": "200" + "value": "100" } } } } }, { - "cursor": "IFYBv/phSqHbWCaiuqdXOLTSGywnKgV6jTvBvpkKEm9pAQAAAAAAAAA=", + "cursor": "IKQYR4gBIlqmEkXHMhZsUUbfKoX8aufbPgILwCO/Sly9AQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x5601bffa614aa1db5826a2baa75738b4d21b2c272a057a8d3bc1be990a126f69", + "id": "0xa418478801225aa61245c732166c5146df2a85fc6ae7db3e020bc023bf4a5cbd", "balance": { - "value": "100" + "value": "200" } } } } }, { - "cursor": "IMacInfJfaowDpNNBdkoSgALQyU0WPWhzB0x66+oRDH9AQAAAAAAAAA=", + "cursor": "IOtyLmahCDl5xXyOjB0WMqX9cUF4/ZkicypBnpx9OxxlAQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc69c2277c97daa300e934d05d9284a000b43253458f5a1cc1d31ebafa84431fd", + "id": "0xeb722e66a1083979c57c8e8c1d1632a5fd714178fd9922732a419e9c7d3b1c65", "balance": { "value": "300" } @@ -324,16 +324,16 @@ Response: { }, "contents": { "json": { - "id": "0x3b08940d369179686b081a1ccef039c34b3ec8fba9950fec6254e64a6549e987", + "id": "0x289abf923a324c74f17d159a864a209d1ac05d8aa5570615e7d0e065ae7aaf63", "balance": { - "value": "200" + "value": "100" } } } } }, { - "cursor": "IFYBv/phSqHbWCaiuqdXOLTSGywnKgV6jTvBvpkKEm9pAQAAAAAAAAA=", + "cursor": "IKQYR4gBIlqmEkXHMhZsUUbfKoX8aufbPgILwCO/Sly9AQAAAAAAAAA=", "node": { "consistentStateForEachCoin": { "owner": { @@ -341,37 +341,37 @@ Response: { "coins": { "edges": [ { - "cursor": "IDsIlA02kXloawgaHM7wOcNLPsj7qZUP7GJU5kplSemHAQAAAAAAAAA=", + "cursor": "ICiav5I6Mkx08X0VmoZKIJ0awF2KpVcGFefQ4GWueq9jAQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x3b08940d369179686b081a1ccef039c34b3ec8fba9950fec6254e64a6549e987", + "id": "0x289abf923a324c74f17d159a864a209d1ac05d8aa5570615e7d0e065ae7aaf63", "balance": { - "value": "200" + "value": "100" } } } } }, { - "cursor": "IFYBv/phSqHbWCaiuqdXOLTSGywnKgV6jTvBvpkKEm9pAQAAAAAAAAA=", + "cursor": "IKQYR4gBIlqmEkXHMhZsUUbfKoX8aufbPgILwCO/Sly9AQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x5601bffa614aa1db5826a2baa75738b4d21b2c272a057a8d3bc1be990a126f69", + "id": "0xa418478801225aa61245c732166c5146df2a85fc6ae7db3e020bc023bf4a5cbd", "balance": { - "value": "100" + "value": "200" } } } } }, { - "cursor": "IMacInfJfaowDpNNBdkoSgALQyU0WPWhzB0x66+oRDH9AQAAAAAAAAA=", + "cursor": "IOtyLmahCDl5xXyOjB0WMqX9cUF4/ZkicypBnpx9OxxlAQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc69c2277c97daa300e934d05d9284a000b43253458f5a1cc1d31ebafa84431fd", + "id": "0xeb722e66a1083979c57c8e8c1d1632a5fd714178fd9922732a419e9c7d3b1c65", "balance": { "value": "300" } @@ -385,9 +385,9 @@ Response: { }, "contents": { "json": { - "id": "0x5601bffa614aa1db5826a2baa75738b4d21b2c272a057a8d3bc1be990a126f69", + "id": "0xa418478801225aa61245c732166c5146df2a85fc6ae7db3e020bc023bf4a5cbd", "balance": { - "value": "100" + "value": "200" } } } @@ -399,26 +399,26 @@ Response: { "coins": { "edges": [ { - "cursor": "IDsIlA02kXloawgaHM7wOcNLPsj7qZUP7GJU5kplSemHAQAAAAAAAAA=", + "cursor": "ICiav5I6Mkx08X0VmoZKIJ0awF2KpVcGFefQ4GWueq9jAQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x3b08940d369179686b081a1ccef039c34b3ec8fba9950fec6254e64a6549e987", + "id": "0x289abf923a324c74f17d159a864a209d1ac05d8aa5570615e7d0e065ae7aaf63", "balance": { - "value": "200" + "value": "100" } } } } }, { - "cursor": "IFYBv/phSqHbWCaiuqdXOLTSGywnKgV6jTvBvpkKEm9pAQAAAAAAAAA=", + "cursor": "IKQYR4gBIlqmEkXHMhZsUUbfKoX8aufbPgILwCO/Sly9AQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x5601bffa614aa1db5826a2baa75738b4d21b2c272a057a8d3bc1be990a126f69", + "id": "0xa418478801225aa61245c732166c5146df2a85fc6ae7db3e020bc023bf4a5cbd", "balance": { - "value": "100" + "value": "200" } } } @@ -453,7 +453,7 @@ Response: { "queryCoins": { "edges": [ { - "cursor": "IDsIlA02kXloawgaHM7wOcNLPsj7qZUP7GJU5kplSemHAwAAAAAAAAA=", + "cursor": "ICiav5I6Mkx08X0VmoZKIJ0awF2KpVcGFefQ4GWueq9jAwAAAAAAAAA=", "node": { "owner": { "owner": { @@ -461,13 +461,13 @@ Response: { "coins": { "edges": [ { - "cursor": "IDsIlA02kXloawgaHM7wOcNLPsj7qZUP7GJU5kplSemHAwAAAAAAAAA=", + "cursor": "ICiav5I6Mkx08X0VmoZKIJ0awF2KpVcGFefQ4GWueq9jAwAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x3b08940d369179686b081a1ccef039c34b3ec8fba9950fec6254e64a6549e987", + "id": "0x289abf923a324c74f17d159a864a209d1ac05d8aa5570615e7d0e065ae7aaf63", "balance": { - "value": "100200" + "value": "100100" } } } @@ -479,16 +479,16 @@ Response: { }, "contents": { "json": { - "id": "0x3b08940d369179686b081a1ccef039c34b3ec8fba9950fec6254e64a6549e987", + "id": "0x289abf923a324c74f17d159a864a209d1ac05d8aa5570615e7d0e065ae7aaf63", "balance": { - "value": "100200" + "value": "100100" } } } } }, { - "cursor": "IFYBv/phSqHbWCaiuqdXOLTSGywnKgV6jTvBvpkKEm9pAwAAAAAAAAA=", + "cursor": "IKQYR4gBIlqmEkXHMhZsUUbfKoX8aufbPgILwCO/Sly9AwAAAAAAAAA=", "node": { "owner": { "owner": { @@ -496,24 +496,24 @@ Response: { "coins": { "edges": [ { - "cursor": "IFYBv/phSqHbWCaiuqdXOLTSGywnKgV6jTvBvpkKEm9pAwAAAAAAAAA=", + "cursor": "IKQYR4gBIlqmEkXHMhZsUUbfKoX8aufbPgILwCO/Sly9AwAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x5601bffa614aa1db5826a2baa75738b4d21b2c272a057a8d3bc1be990a126f69", + "id": "0xa418478801225aa61245c732166c5146df2a85fc6ae7db3e020bc023bf4a5cbd", "balance": { - "value": "100" + "value": "200" } } } } }, { - "cursor": "IMacInfJfaowDpNNBdkoSgALQyU0WPWhzB0x66+oRDH9AwAAAAAAAAA=", + "cursor": "IOtyLmahCDl5xXyOjB0WMqX9cUF4/ZkicypBnpx9OxxlAwAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc69c2277c97daa300e934d05d9284a000b43253458f5a1cc1d31ebafa84431fd", + "id": "0xeb722e66a1083979c57c8e8c1d1632a5fd714178fd9922732a419e9c7d3b1c65", "balance": { "value": "300" } @@ -527,16 +527,16 @@ Response: { }, "contents": { "json": { - "id": "0x5601bffa614aa1db5826a2baa75738b4d21b2c272a057a8d3bc1be990a126f69", + "id": "0xa418478801225aa61245c732166c5146df2a85fc6ae7db3e020bc023bf4a5cbd", "balance": { - "value": "100" + "value": "200" } } } } }, { - "cursor": "IMacInfJfaowDpNNBdkoSgALQyU0WPWhzB0x66+oRDH9AwAAAAAAAAA=", + "cursor": "IOtyLmahCDl5xXyOjB0WMqX9cUF4/ZkicypBnpx9OxxlAwAAAAAAAAA=", "node": { "owner": { "owner": { @@ -544,24 +544,24 @@ Response: { "coins": { "edges": [ { - "cursor": "IFYBv/phSqHbWCaiuqdXOLTSGywnKgV6jTvBvpkKEm9pAwAAAAAAAAA=", + "cursor": "IKQYR4gBIlqmEkXHMhZsUUbfKoX8aufbPgILwCO/Sly9AwAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x5601bffa614aa1db5826a2baa75738b4d21b2c272a057a8d3bc1be990a126f69", + "id": "0xa418478801225aa61245c732166c5146df2a85fc6ae7db3e020bc023bf4a5cbd", "balance": { - "value": "100" + "value": "200" } } } } }, { - "cursor": "IMacInfJfaowDpNNBdkoSgALQyU0WPWhzB0x66+oRDH9AwAAAAAAAAA=", + "cursor": "IOtyLmahCDl5xXyOjB0WMqX9cUF4/ZkicypBnpx9OxxlAwAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc69c2277c97daa300e934d05d9284a000b43253458f5a1cc1d31ebafa84431fd", + "id": "0xeb722e66a1083979c57c8e8c1d1632a5fd714178fd9922732a419e9c7d3b1c65", "balance": { "value": "300" } @@ -575,7 +575,7 @@ Response: { }, "contents": { "json": { - "id": "0xc69c2277c97daa300e934d05d9284a000b43253458f5a1cc1d31ebafa84431fd", + "id": "0xeb722e66a1083979c57c8e8c1d1632a5fd714178fd9922732a419e9c7d3b1c65", "balance": { "value": "300" } @@ -589,13 +589,13 @@ Response: { "coins": { "edges": [ { - "cursor": "IDsIlA02kXloawgaHM7wOcNLPsj7qZUP7GJU5kplSemHAwAAAAAAAAA=", + "cursor": "ICiav5I6Mkx08X0VmoZKIJ0awF2KpVcGFefQ4GWueq9jAwAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x3b08940d369179686b081a1ccef039c34b3ec8fba9950fec6254e64a6549e987", + "id": "0x289abf923a324c74f17d159a864a209d1ac05d8aa5570615e7d0e065ae7aaf63", "balance": { - "value": "100200" + "value": "100100" } } } @@ -608,24 +608,24 @@ Response: { "coins": { "edges": [ { - "cursor": "IFYBv/phSqHbWCaiuqdXOLTSGywnKgV6jTvBvpkKEm9pAwAAAAAAAAA=", + "cursor": "IKQYR4gBIlqmEkXHMhZsUUbfKoX8aufbPgILwCO/Sly9AwAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x5601bffa614aa1db5826a2baa75738b4d21b2c272a057a8d3bc1be990a126f69", + "id": "0xa418478801225aa61245c732166c5146df2a85fc6ae7db3e020bc023bf4a5cbd", "balance": { - "value": "100" + "value": "200" } } } } }, { - "cursor": "IMacInfJfaowDpNNBdkoSgALQyU0WPWhzB0x66+oRDH9AwAAAAAAAAA=", + "cursor": "IOtyLmahCDl5xXyOjB0WMqX9cUF4/ZkicypBnpx9OxxlAwAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc69c2277c97daa300e934d05d9284a000b43253458f5a1cc1d31ebafa84431fd", + "id": "0xeb722e66a1083979c57c8e8c1d1632a5fd714178fd9922732a419e9c7d3b1c65", "balance": { "value": "300" } @@ -658,7 +658,7 @@ Response: { "queryCoinsAtChkpt1BeforeSnapshotCatchup": { "edges": [ { - "cursor": "IDsIlA02kXloawgaHM7wOcNLPsj7qZUP7GJU5kplSemHAQAAAAAAAAA=", + "cursor": "ICiav5I6Mkx08X0VmoZKIJ0awF2KpVcGFefQ4GWueq9jAQAAAAAAAAA=", "node": { "consistentStateForEachCoin": { "owner": { @@ -666,37 +666,37 @@ Response: { "coins": { "edges": [ { - "cursor": "IDsIlA02kXloawgaHM7wOcNLPsj7qZUP7GJU5kplSemHAQAAAAAAAAA=", + "cursor": "ICiav5I6Mkx08X0VmoZKIJ0awF2KpVcGFefQ4GWueq9jAQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x3b08940d369179686b081a1ccef039c34b3ec8fba9950fec6254e64a6549e987", + "id": "0x289abf923a324c74f17d159a864a209d1ac05d8aa5570615e7d0e065ae7aaf63", "balance": { - "value": "200" + "value": "100" } } } } }, { - "cursor": "IFYBv/phSqHbWCaiuqdXOLTSGywnKgV6jTvBvpkKEm9pAQAAAAAAAAA=", + "cursor": "IKQYR4gBIlqmEkXHMhZsUUbfKoX8aufbPgILwCO/Sly9AQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x5601bffa614aa1db5826a2baa75738b4d21b2c272a057a8d3bc1be990a126f69", + "id": "0xa418478801225aa61245c732166c5146df2a85fc6ae7db3e020bc023bf4a5cbd", "balance": { - "value": "100" + "value": "200" } } } } }, { - "cursor": "IMacInfJfaowDpNNBdkoSgALQyU0WPWhzB0x66+oRDH9AQAAAAAAAAA=", + "cursor": "IOtyLmahCDl5xXyOjB0WMqX9cUF4/ZkicypBnpx9OxxlAQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc69c2277c97daa300e934d05d9284a000b43253458f5a1cc1d31ebafa84431fd", + "id": "0xeb722e66a1083979c57c8e8c1d1632a5fd714178fd9922732a419e9c7d3b1c65", "balance": { "value": "300" } @@ -710,16 +710,16 @@ Response: { }, "contents": { "json": { - "id": "0x3b08940d369179686b081a1ccef039c34b3ec8fba9950fec6254e64a6549e987", + "id": "0x289abf923a324c74f17d159a864a209d1ac05d8aa5570615e7d0e065ae7aaf63", "balance": { - "value": "200" + "value": "100" } } } } }, { - "cursor": "IFYBv/phSqHbWCaiuqdXOLTSGywnKgV6jTvBvpkKEm9pAQAAAAAAAAA=", + "cursor": "IKQYR4gBIlqmEkXHMhZsUUbfKoX8aufbPgILwCO/Sly9AQAAAAAAAAA=", "node": { "consistentStateForEachCoin": { "owner": { @@ -727,37 +727,37 @@ Response: { "coins": { "edges": [ { - "cursor": "IDsIlA02kXloawgaHM7wOcNLPsj7qZUP7GJU5kplSemHAQAAAAAAAAA=", + "cursor": "ICiav5I6Mkx08X0VmoZKIJ0awF2KpVcGFefQ4GWueq9jAQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x3b08940d369179686b081a1ccef039c34b3ec8fba9950fec6254e64a6549e987", + "id": "0x289abf923a324c74f17d159a864a209d1ac05d8aa5570615e7d0e065ae7aaf63", "balance": { - "value": "200" + "value": "100" } } } } }, { - "cursor": "IFYBv/phSqHbWCaiuqdXOLTSGywnKgV6jTvBvpkKEm9pAQAAAAAAAAA=", + "cursor": "IKQYR4gBIlqmEkXHMhZsUUbfKoX8aufbPgILwCO/Sly9AQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x5601bffa614aa1db5826a2baa75738b4d21b2c272a057a8d3bc1be990a126f69", + "id": "0xa418478801225aa61245c732166c5146df2a85fc6ae7db3e020bc023bf4a5cbd", "balance": { - "value": "100" + "value": "200" } } } } }, { - "cursor": "IMacInfJfaowDpNNBdkoSgALQyU0WPWhzB0x66+oRDH9AQAAAAAAAAA=", + "cursor": "IOtyLmahCDl5xXyOjB0WMqX9cUF4/ZkicypBnpx9OxxlAQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0xc69c2277c97daa300e934d05d9284a000b43253458f5a1cc1d31ebafa84431fd", + "id": "0xeb722e66a1083979c57c8e8c1d1632a5fd714178fd9922732a419e9c7d3b1c65", "balance": { "value": "300" } @@ -771,9 +771,9 @@ Response: { }, "contents": { "json": { - "id": "0x5601bffa614aa1db5826a2baa75738b4d21b2c272a057a8d3bc1be990a126f69", + "id": "0xa418478801225aa61245c732166c5146df2a85fc6ae7db3e020bc023bf4a5cbd", "balance": { - "value": "100" + "value": "200" } } } @@ -785,26 +785,26 @@ Response: { "coins": { "edges": [ { - "cursor": "IDsIlA02kXloawgaHM7wOcNLPsj7qZUP7GJU5kplSemHAQAAAAAAAAA=", + "cursor": "ICiav5I6Mkx08X0VmoZKIJ0awF2KpVcGFefQ4GWueq9jAQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x3b08940d369179686b081a1ccef039c34b3ec8fba9950fec6254e64a6549e987", + "id": "0x289abf923a324c74f17d159a864a209d1ac05d8aa5570615e7d0e065ae7aaf63", "balance": { - "value": "200" + "value": "100" } } } } }, { - "cursor": "IFYBv/phSqHbWCaiuqdXOLTSGywnKgV6jTvBvpkKEm9pAQAAAAAAAAA=", + "cursor": "IKQYR4gBIlqmEkXHMhZsUUbfKoX8aufbPgILwCO/Sly9AQAAAAAAAAA=", "node": { "contents": { "json": { - "id": "0x5601bffa614aa1db5826a2baa75738b4d21b2c272a057a8d3bc1be990a126f69", + "id": "0xa418478801225aa61245c732166c5146df2a85fc6ae7db3e020bc023bf4a5cbd", "balance": { - "value": "100" + "value": "200" } } } diff --git a/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_df.exp b/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_df.exp index a13bd8d86b6..8f2b41dd9d8 100644 --- a/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_df.exp +++ b/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_df.exp @@ -90,29 +90,29 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IAlxFqpw4mr33+eCNTC2+MjuleY7rA2fiDMEuaT9vQ7VAQAAAAAAAAA=", + "cursor": "ILE7Qmd7Si0bo8DRAwOOkkUjscgq8eMVSXbKUzme5ggeAQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNQ==" + "bcs": "A2RmNA==" }, "value": { - "json": "df5" + "json": "df4" } } }, { - "cursor": "IJnnpAXHeWHn0RxdjnH4UpFwee+KNap3cYsMCArOK0QRAQAAAAAAAAA=", + "cursor": "IMHYTm10WoA1BA2R7UWStxDRk7fLxO3XggS9/gg+DuYyAQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNA==" + "bcs": "A2RmNQ==" }, "value": { - "json": "df4" + "json": "df5" } } }, { - "cursor": "IOIK1Pc7k/v+YR5s6nC80BdguWbuJjbYUTR1KFHnGw5LAQAAAAAAAAA=", + "cursor": "IMJls0MmMIcWpo4E20v0gGl+nU2SuOa7XQC7CUalmNBAAQAAAAAAAAA=", "node": { "name": { "bcs": "A2RmNg==" @@ -139,29 +139,29 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IAlxFqpw4mr33+eCNTC2+MjuleY7rA2fiDMEuaT9vQ7VAQAAAAAAAAA=", + "cursor": "ILE7Qmd7Si0bo8DRAwOOkkUjscgq8eMVSXbKUzme5ggeAQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNQ==" + "bcs": "A2RmNA==" }, "value": { - "json": "df5" + "json": "df4" } } }, { - "cursor": "IJnnpAXHeWHn0RxdjnH4UpFwee+KNap3cYsMCArOK0QRAQAAAAAAAAA=", + "cursor": "IMHYTm10WoA1BA2R7UWStxDRk7fLxO3XggS9/gg+DuYyAQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNA==" + "bcs": "A2RmNQ==" }, "value": { - "json": "df4" + "json": "df5" } } }, { - "cursor": "IOIK1Pc7k/v+YR5s6nC80BdguWbuJjbYUTR1KFHnGw5LAQAAAAAAAAA=", + "cursor": "IMJls0MmMIcWpo4E20v0gGl+nU2SuOa7XQC7CUalmNBAAQAAAAAAAAA=", "node": { "name": { "bcs": "A2RmNg==" @@ -188,68 +188,68 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IAlxFqpw4mr33+eCNTC2+MjuleY7rA2fiDMEuaT9vQ7VAQAAAAAAAAA=", + "cursor": "IBo1+VVeBsyCYwlrL1rN5BnZ7NRXWHrkSr/9qc3pWXB9AQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNQ==" + "bcs": "A2RmMQ==" }, "value": { - "json": "df5" + "json": "df1" } } }, { - "cursor": "IB88rfczUpq6fYbbbtRTLaR+Ut+jA2cnNvJuZoUJuaY/AQAAAAAAAAA=", + "cursor": "IGcVjRUu7AcPIf24HKtfNKvbs8lG09f8hVDphXh1jGCBAQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMg==" + "bcs": "A2RmMw==" }, "value": { - "json": "df2" + "json": "df3" } } }, { - "cursor": "IJnnpAXHeWHn0RxdjnH4UpFwee+KNap3cYsMCArOK0QRAQAAAAAAAAA=", + "cursor": "IItF7aouV9DuiVuj+BMc52TG4SkgwY62esLSW5q6c8fWAQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNA==" + "bcs": "A2RmMg==" }, "value": { - "json": "df4" + "json": "df2" } } }, { - "cursor": "ILQp8MKg0+1bN22dk59+rm41rfOY8GqwDRyEx14d6VuHAQAAAAAAAAA=", + "cursor": "ILE7Qmd7Si0bo8DRAwOOkkUjscgq8eMVSXbKUzme5ggeAQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMw==" + "bcs": "A2RmNA==" }, "value": { - "json": "df3" + "json": "df4" } } }, { - "cursor": "IOIK1Pc7k/v+YR5s6nC80BdguWbuJjbYUTR1KFHnGw5LAQAAAAAAAAA=", + "cursor": "IMHYTm10WoA1BA2R7UWStxDRk7fLxO3XggS9/gg+DuYyAQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNg==" + "bcs": "A2RmNQ==" }, "value": { - "json": "df6" + "json": "df5" } } }, { - "cursor": "IPUa99KObozK+eodu97J1FNdwFSMsX8MUw5IP/Sg7Z2aAQAAAAAAAAA=", + "cursor": "IMJls0MmMIcWpo4E20v0gGl+nU2SuOa7XQC7CUalmNBAAQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMQ==" + "bcs": "A2RmNg==" }, "value": { - "json": "df1" + "json": "df6" } } } @@ -283,29 +283,29 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IAlxFqpw4mr33+eCNTC2+MjuleY7rA2fiDMEuaT9vQ7VAQAAAAAAAAA=", + "cursor": "ILE7Qmd7Si0bo8DRAwOOkkUjscgq8eMVSXbKUzme5ggeAQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNQ==" + "bcs": "A2RmNA==" }, "value": { - "json": "df5" + "json": "df4" } } }, { - "cursor": "IJnnpAXHeWHn0RxdjnH4UpFwee+KNap3cYsMCArOK0QRAQAAAAAAAAA=", + "cursor": "IMHYTm10WoA1BA2R7UWStxDRk7fLxO3XggS9/gg+DuYyAQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNA==" + "bcs": "A2RmNQ==" }, "value": { - "json": "df4" + "json": "df5" } } }, { - "cursor": "IOIK1Pc7k/v+YR5s6nC80BdguWbuJjbYUTR1KFHnGw5LAQAAAAAAAAA=", + "cursor": "IMJls0MmMIcWpo4E20v0gGl+nU2SuOa7XQC7CUalmNBAAQAAAAAAAAA=", "node": { "name": { "bcs": "A2RmNg==" diff --git a/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_dof.exp b/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_dof.exp index 25496ba5c36..dd9eaa4fe1a 100644 --- a/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_dof.exp +++ b/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/deleted_dof.exp @@ -41,7 +41,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IIuU/xNbT0zh6LdGe62NTpOV83IJGGj7O3VED+vISDP0AQAAAAAAAAA=", + "cursor": "IOYgMJlQDDjMXCaBVDpLjGXJTNsBdDTHqO6C5QElBkZ8AQAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -49,7 +49,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x73e23175c3ca37e0c7d99110edc73a385b4f313e8f27b35dc8231d938d99bbbc", + "id": "0x8ea9cbcf863a9cd6cc23a403d7de8eca3e72289bae85a75efa7cb1fe8d0bf5cd", "count": "0" } } @@ -65,7 +65,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x73e23175c3ca37e0c7d99110edc73a385b4f313e8f27b35dc8231d938d99bbbc", + "id": "0x8ea9cbcf863a9cd6cc23a403d7de8eca3e72289bae85a75efa7cb1fe8d0bf5cd", "count": "0" } } @@ -77,7 +77,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IIuU/xNbT0zh6LdGe62NTpOV83IJGGj7O3VED+vISDP0AQAAAAAAAAA=", + "cursor": "IOYgMJlQDDjMXCaBVDpLjGXJTNsBdDTHqO6C5QElBkZ8AQAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -85,7 +85,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x73e23175c3ca37e0c7d99110edc73a385b4f313e8f27b35dc8231d938d99bbbc", + "id": "0x8ea9cbcf863a9cd6cc23a403d7de8eca3e72289bae85a75efa7cb1fe8d0bf5cd", "count": "0" } } @@ -101,7 +101,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x73e23175c3ca37e0c7d99110edc73a385b4f313e8f27b35dc8231d938d99bbbc", + "id": "0x8ea9cbcf863a9cd6cc23a403d7de8eca3e72289bae85a75efa7cb1fe8d0bf5cd", "count": "0" } } @@ -117,7 +117,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x73e23175c3ca37e0c7d99110edc73a385b4f313e8f27b35dc8231d938d99bbbc", + "id": "0x8ea9cbcf863a9cd6cc23a403d7de8eca3e72289bae85a75efa7cb1fe8d0bf5cd", "count": "0" } } @@ -168,7 +168,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x73e23175c3ca37e0c7d99110edc73a385b4f313e8f27b35dc8231d938d99bbbc", + "id": "0x8ea9cbcf863a9cd6cc23a403d7de8eca3e72289bae85a75efa7cb1fe8d0bf5cd", "count": "0" } } @@ -222,7 +222,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x73e23175c3ca37e0c7d99110edc73a385b4f313e8f27b35dc8231d938d99bbbc", + "id": "0x8ea9cbcf863a9cd6cc23a403d7de8eca3e72289bae85a75efa7cb1fe8d0bf5cd", "count": "0" } } diff --git a/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer.exp b/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer.exp index ff72e35572f..49ec6c8ff7f 100644 --- a/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer.exp +++ b/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer.exp @@ -36,7 +36,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IB3/+PN7K7rz6NhNeXi6jfD/6T7BDjv7nD6f+cyPBoYQAQAAAAAAAAA=", + "cursor": "IEpbq/BIsDWp1KcUACgk+IAa4fDSSNBFUCIuxhKoAf3SAQAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -44,7 +44,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x80a0dcf98c3730a1ad5065971b9f22db79bd0f03c044b679699f85187072861e", + "id": "0x9afdb581d3012f103c984391f1aa9e6c7bfe996cf8a4736a2f55eea644c3ad8a", "count": "0" } } @@ -60,7 +60,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x80a0dcf98c3730a1ad5065971b9f22db79bd0f03c044b679699f85187072861e", + "id": "0x9afdb581d3012f103c984391f1aa9e6c7bfe996cf8a4736a2f55eea644c3ad8a", "count": "0" } } @@ -71,7 +71,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IB3/+PN7K7rz6NhNeXi6jfD/6T7BDjv7nD6f+cyPBoYQAQAAAAAAAAA=", + "cursor": "IEpbq/BIsDWp1KcUACgk+IAa4fDSSNBFUCIuxhKoAf3SAQAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -79,7 +79,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x80a0dcf98c3730a1ad5065971b9f22db79bd0f03c044b679699f85187072861e", + "id": "0x9afdb581d3012f103c984391f1aa9e6c7bfe996cf8a4736a2f55eea644c3ad8a", "count": "0" } } @@ -95,7 +95,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x80a0dcf98c3730a1ad5065971b9f22db79bd0f03c044b679699f85187072861e", + "id": "0x9afdb581d3012f103c984391f1aa9e6c7bfe996cf8a4736a2f55eea644c3ad8a", "count": "0" } } @@ -107,7 +107,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IB3/+PN7K7rz6NhNeXi6jfD/6T7BDjv7nD6f+cyPBoYQAQAAAAAAAAA=", + "cursor": "IEpbq/BIsDWp1KcUACgk+IAa4fDSSNBFUCIuxhKoAf3SAQAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -115,7 +115,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x80a0dcf98c3730a1ad5065971b9f22db79bd0f03c044b679699f85187072861e", + "id": "0x9afdb581d3012f103c984391f1aa9e6c7bfe996cf8a4736a2f55eea644c3ad8a", "count": "0" } } @@ -131,7 +131,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x80a0dcf98c3730a1ad5065971b9f22db79bd0f03c044b679699f85187072861e", + "id": "0x9afdb581d3012f103c984391f1aa9e6c7bfe996cf8a4736a2f55eea644c3ad8a", "count": "0" } } @@ -184,7 +184,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x80a0dcf98c3730a1ad5065971b9f22db79bd0f03c044b679699f85187072861e", + "id": "0x9afdb581d3012f103c984391f1aa9e6c7bfe996cf8a4736a2f55eea644c3ad8a", "count": "0" } } diff --git a/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer_reclaim_add.exp b/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer_reclaim_add.exp index e97867682c9..1615ab1847f 100644 --- a/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer_reclaim_add.exp +++ b/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/dof_add_reclaim_transfer_reclaim_add.exp @@ -61,7 +61,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IJ3CIWj66wAVzm6IQ8Mb09LdRnQPAwHDGxrei6kiglGTAQAAAAAAAAA=", + "cursor": "IGwYH5v+7AWkcui2XgICiCBJE0IV0cDJpSvHs1P/j6uOAQAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -69,7 +69,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x9ba661467fbe62af4eef8e4cb49aecfcf7cf7d3c7b4604a1acfd978484ac7408", + "id": "0xceba7e0eb5c3dcfa4567dc4c3b19ef8c030e769cfce310fa6178a65bb3938d2e", "count": "0" } } @@ -85,7 +85,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x9ba661467fbe62af4eef8e4cb49aecfcf7cf7d3c7b4604a1acfd978484ac7408", + "id": "0xceba7e0eb5c3dcfa4567dc4c3b19ef8c030e769cfce310fa6178a65bb3938d2e", "count": "0" } } @@ -96,7 +96,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IJ3CIWj66wAVzm6IQ8Mb09LdRnQPAwHDGxrei6kiglGTAQAAAAAAAAA=", + "cursor": "IGwYH5v+7AWkcui2XgICiCBJE0IV0cDJpSvHs1P/j6uOAQAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -104,7 +104,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x9ba661467fbe62af4eef8e4cb49aecfcf7cf7d3c7b4604a1acfd978484ac7408", + "id": "0xceba7e0eb5c3dcfa4567dc4c3b19ef8c030e769cfce310fa6178a65bb3938d2e", "count": "0" } } @@ -120,7 +120,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x9ba661467fbe62af4eef8e4cb49aecfcf7cf7d3c7b4604a1acfd978484ac7408", + "id": "0xceba7e0eb5c3dcfa4567dc4c3b19ef8c030e769cfce310fa6178a65bb3938d2e", "count": "0" } } @@ -139,7 +139,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IJ3CIWj66wAVzm6IQ8Mb09LdRnQPAwHDGxrei6kiglGTAQAAAAAAAAA=", + "cursor": "IGwYH5v+7AWkcui2XgICiCBJE0IV0cDJpSvHs1P/j6uOAQAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -147,7 +147,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x9ba661467fbe62af4eef8e4cb49aecfcf7cf7d3c7b4604a1acfd978484ac7408", + "id": "0xceba7e0eb5c3dcfa4567dc4c3b19ef8c030e769cfce310fa6178a65bb3938d2e", "count": "0" } } @@ -163,7 +163,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x9ba661467fbe62af4eef8e4cb49aecfcf7cf7d3c7b4604a1acfd978484ac7408", + "id": "0xceba7e0eb5c3dcfa4567dc4c3b19ef8c030e769cfce310fa6178a65bb3938d2e", "count": "0" } } @@ -182,7 +182,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IJ3CIWj66wAVzm6IQ8Mb09LdRnQPAwHDGxrei6kiglGTAQAAAAAAAAA=", + "cursor": "IGwYH5v+7AWkcui2XgICiCBJE0IV0cDJpSvHs1P/j6uOAQAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -190,7 +190,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x9ba661467fbe62af4eef8e4cb49aecfcf7cf7d3c7b4604a1acfd978484ac7408", + "id": "0xceba7e0eb5c3dcfa4567dc4c3b19ef8c030e769cfce310fa6178a65bb3938d2e", "count": "0" } } @@ -206,7 +206,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x9ba661467fbe62af4eef8e4cb49aecfcf7cf7d3c7b4604a1acfd978484ac7408", + "id": "0xceba7e0eb5c3dcfa4567dc4c3b19ef8c030e769cfce310fa6178a65bb3938d2e", "count": "0" } } diff --git a/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/dynamic_fields.exp b/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/dynamic_fields.exp index 56056f09dc0..1fb575585d2 100644 --- a/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/dynamic_fields.exp +++ b/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/dynamic_fields.exp @@ -84,7 +84,7 @@ task 9, lines 103-165: Response: { "data": { "parent_version_2_no_dof": { - "address": "0x144f89a25fed0bbcf10d3dc9c9a835c923972f6a652a0e4401c0015c64f2b925", + "address": "0xe81d1d628bb5942e563dc3ca652f41dfbe6a7ad11ca866249bafe4e29609f077", "dynamicFields": { "edges": [] } @@ -93,7 +93,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IGq59R92+WYhAA5OcGSYorEkOqTJakh2jG6IyhnVY/rlAQAAAAAAAAA=", + "cursor": "IBkflpr//S+rLcwsf9BrQULoOCUdF2gzhpDlWnLv9dvJAQAAAAAAAAA=", "node": { "name": { "bcs": "pAEAAAAAAAA=", @@ -104,7 +104,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x0ac7d3caff6fd8543b45b7f49793d0ce33e73d314a90646f2f3abc0dc0f5e7a6", + "id": "0x8e27ff5a173340bddbd8bcf1483a31f4dba5e4387006bf283a9cfdfffebefb60", "count": "1" } } @@ -115,13 +115,13 @@ Response: { } }, "child_version_2_no_parent": { - "address": "0x0ac7d3caff6fd8543b45b7f49793d0ce33e73d314a90646f2f3abc0dc0f5e7a6", + "address": "0x8e27ff5a173340bddbd8bcf1483a31f4dba5e4387006bf283a9cfdfffebefb60", "owner": {} }, "child_version_3_has_parent": { "owner": { "parent": { - "address": "0x6ab9f51f76f96621000e4e706498a2b1243aa4c96a48768c6e88ca19d563fae5" + "address": "0x191f969afffd2fab2dcc2c7fd06b4142e838251d1768338690e55a72eff5dbc9" } } } @@ -173,54 +173,54 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IDdmynPsciuyRWEuGcUCwsXv/s23PYySAE8E6ds44knAAgAAAAAAAAA=", + "cursor": "IALh6Gmj1i0tlaFppLIbcxwvTEoesuYprwx6kb++hQptAgAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMg==", + "bcs": "A2RmMw==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df2" + "json": "df3" } } }, { - "cursor": "IEB3e0osn0vVUIo8hIaYgcZhigq2Wm8ePPv1mdgKFd/5AgAAAAAAAAA=", + "cursor": "IBkflpr//S+rLcwsf9BrQULoOCUdF2gzhpDlWnLv9dvJAgAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMw==", + "bcs": "pAEAAAAAAAA=", "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" + "repr": "u64" } }, "value": { - "json": "df3" + "contents": { + "json": { + "id": "0x8e27ff5a173340bddbd8bcf1483a31f4dba5e4387006bf283a9cfdfffebefb60", + "count": "2" + } + } } } }, { - "cursor": "IGq59R92+WYhAA5OcGSYorEkOqTJakh2jG6IyhnVY/rlAgAAAAAAAAA=", + "cursor": "IDoFKasvO3uRG36i8kDIIFwQcloILQn2wF4PAQIcTwYqAgAAAAAAAAA=", "node": { "name": { - "bcs": "pAEAAAAAAAA=", + "bcs": "A2RmMg==", "type": { - "repr": "u64" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "contents": { - "json": { - "id": "0x0ac7d3caff6fd8543b45b7f49793d0ce33e73d314a90646f2f3abc0dc0f5e7a6", - "count": "2" - } - } + "json": "df2" } } }, { - "cursor": "IMHOuFTfn41iPJnqKDYTTp2Amgl6gV9TCgF5EYXhzDUaAgAAAAAAAAA=", + "cursor": "ILZJDhqQtyqtQ07tnHozoq0BbJmXlZQypzZ+hHp3ZIBiAgAAAAAAAAA=", "node": { "name": { "bcs": "A2RmMQ==", @@ -240,7 +240,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IGq59R92+WYhAA5OcGSYorEkOqTJakh2jG6IyhnVY/rlAgAAAAAAAAA=", + "cursor": "IBkflpr//S+rLcwsf9BrQULoOCUdF2gzhpDlWnLv9dvJAgAAAAAAAAA=", "node": { "name": { "bcs": "pAEAAAAAAAA=", @@ -251,7 +251,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x0ac7d3caff6fd8543b45b7f49793d0ce33e73d314a90646f2f3abc0dc0f5e7a6", + "id": "0x8e27ff5a173340bddbd8bcf1483a31f4dba5e4387006bf283a9cfdfffebefb60", "count": "1" } } @@ -270,7 +270,21 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IMHOuFTfn41iPJnqKDYTTp2Amgl6gV9TCgF5EYXhzDUaAgAAAAAAAAA=", + "cursor": "IDoFKasvO3uRG36i8kDIIFwQcloILQn2wF4PAQIcTwYqAgAAAAAAAAA=", + "node": { + "name": { + "bcs": "A2RmMg==", + "type": { + "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" + } + }, + "value": { + "json": "df2" + } + } + }, + { + "cursor": "ILZJDhqQtyqtQ07tnHozoq0BbJmXlZQypzZ+hHp3ZIBiAgAAAAAAAAA=", "node": { "name": { "bcs": "A2RmMQ==", @@ -314,7 +328,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x0ac7d3caff6fd8543b45b7f49793d0ce33e73d314a90646f2f3abc0dc0f5e7a6", + "id": "0x8e27ff5a173340bddbd8bcf1483a31f4dba5e4387006bf283a9cfdfffebefb60", "count": "1" } } @@ -333,7 +347,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x0ac7d3caff6fd8543b45b7f49793d0ce33e73d314a90646f2f3abc0dc0f5e7a6", + "id": "0x8e27ff5a173340bddbd8bcf1483a31f4dba5e4387006bf283a9cfdfffebefb60", "count": "2" } } @@ -398,54 +412,54 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IDdmynPsciuyRWEuGcUCwsXv/s23PYySAE8E6ds44knAAwAAAAAAAAA=", + "cursor": "IALh6Gmj1i0tlaFppLIbcxwvTEoesuYprwx6kb++hQptAwAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMg==", + "bcs": "A2RmMw==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df2" + "json": "df3" } } }, { - "cursor": "IEB3e0osn0vVUIo8hIaYgcZhigq2Wm8ePPv1mdgKFd/5AwAAAAAAAAA=", + "cursor": "IBkflpr//S+rLcwsf9BrQULoOCUdF2gzhpDlWnLv9dvJAwAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMw==", + "bcs": "pAEAAAAAAAA=", "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" + "repr": "u64" } }, "value": { - "json": "df3" + "contents": { + "json": { + "id": "0x8e27ff5a173340bddbd8bcf1483a31f4dba5e4387006bf283a9cfdfffebefb60", + "count": "2" + } + } } } }, { - "cursor": "IGq59R92+WYhAA5OcGSYorEkOqTJakh2jG6IyhnVY/rlAwAAAAAAAAA=", + "cursor": "IDoFKasvO3uRG36i8kDIIFwQcloILQn2wF4PAQIcTwYqAwAAAAAAAAA=", "node": { "name": { - "bcs": "pAEAAAAAAAA=", + "bcs": "A2RmMg==", "type": { - "repr": "u64" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "contents": { - "json": { - "id": "0x0ac7d3caff6fd8543b45b7f49793d0ce33e73d314a90646f2f3abc0dc0f5e7a6", - "count": "2" - } - } + "json": "df2" } } }, { - "cursor": "IMHOuFTfn41iPJnqKDYTTp2Amgl6gV9TCgF5EYXhzDUaAwAAAAAAAAA=", + "cursor": "ILZJDhqQtyqtQ07tnHozoq0BbJmXlZQypzZ+hHp3ZIBiAwAAAAAAAAA=", "node": { "name": { "bcs": "A2RmMQ==", @@ -465,7 +479,21 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IMHOuFTfn41iPJnqKDYTTp2Amgl6gV9TCgF5EYXhzDUaAgAAAAAAAAA=", + "cursor": "IDoFKasvO3uRG36i8kDIIFwQcloILQn2wF4PAQIcTwYqAgAAAAAAAAA=", + "node": { + "name": { + "bcs": "A2RmMg==", + "type": { + "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" + } + }, + "value": { + "json": "df2" + } + } + }, + { + "cursor": "ILZJDhqQtyqtQ07tnHozoq0BbJmXlZQypzZ+hHp3ZIBiAgAAAAAAAAA=", "node": { "name": { "bcs": "A2RmMQ==", @@ -485,35 +513,40 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IAECR2fOXHFO08vEcUZpNvzgnhTDUZzomslx9qLEZvv8AwAAAAAAAAA=", + "cursor": "IALh6Gmj1i0tlaFppLIbcxwvTEoesuYprwx6kb++hQptAwAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNA==", + "bcs": "A2RmMw==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df4" + "json": "df3" } } }, { - "cursor": "IC70WQdDs6UnCpB5yZ1xZHfSSytat3mLcAW9wyb6gV/YAwAAAAAAAAA=", + "cursor": "IBkflpr//S+rLcwsf9BrQULoOCUdF2gzhpDlWnLv9dvJAwAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNg==", + "bcs": "pAEAAAAAAAA=", "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" + "repr": "u64" } }, "value": { - "json": "df6" + "contents": { + "json": { + "id": "0x8e27ff5a173340bddbd8bcf1483a31f4dba5e4387006bf283a9cfdfffebefb60", + "count": "2" + } + } } } }, { - "cursor": "IDdmynPsciuyRWEuGcUCwsXv/s23PYySAE8E6ds44knAAwAAAAAAAAA=", + "cursor": "IDoFKasvO3uRG36i8kDIIFwQcloILQn2wF4PAQIcTwYqAwAAAAAAAAA=", "node": { "name": { "bcs": "A2RmMg==", @@ -527,54 +560,49 @@ Response: { } }, { - "cursor": "IEB3e0osn0vVUIo8hIaYgcZhigq2Wm8ePPv1mdgKFd/5AwAAAAAAAAA=", + "cursor": "IJj9WTOaH4fXBwaq2+79tcdTWMlsLD90tAA99wRYadaKAwAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMw==", + "bcs": "A2RmNg==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df3" + "json": "df6" } } }, { - "cursor": "IGq59R92+WYhAA5OcGSYorEkOqTJakh2jG6IyhnVY/rlAwAAAAAAAAA=", + "cursor": "ILZJDhqQtyqtQ07tnHozoq0BbJmXlZQypzZ+hHp3ZIBiAwAAAAAAAAA=", "node": { "name": { - "bcs": "pAEAAAAAAAA=", + "bcs": "A2RmMQ==", "type": { - "repr": "u64" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "contents": { - "json": { - "id": "0x0ac7d3caff6fd8543b45b7f49793d0ce33e73d314a90646f2f3abc0dc0f5e7a6", - "count": "2" - } - } + "json": "df1" } } }, { - "cursor": "IMHOuFTfn41iPJnqKDYTTp2Amgl6gV9TCgF5EYXhzDUaAwAAAAAAAAA=", + "cursor": "IMg/FO6gjiPZmCvmjnU/nAaf/yi6/pDjjfvGVfr/lqXOAwAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMQ==", + "bcs": "A2RmNA==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df1" + "json": "df4" } } }, { - "cursor": "IMwQvC/gNVI0QaXqQ85M2/Ld7rFIXUjtdl+l9lZ+S7LFAwAAAAAAAAA=", + "cursor": "IN3UrBmzuomvuVn80suIIpOScrO99xrN0GJX752WrurUAwAAAAAAAAA=", "node": { "name": { "bcs": "A2RmNQ==", @@ -594,7 +622,35 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IMHOuFTfn41iPJnqKDYTTp2Amgl6gV9TCgF5EYXhzDUaAwAAAAAAAAA=", + "cursor": "IDoFKasvO3uRG36i8kDIIFwQcloILQn2wF4PAQIcTwYqAwAAAAAAAAA=", + "node": { + "name": { + "bcs": "A2RmMg==", + "type": { + "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" + } + }, + "value": { + "json": "df2" + } + } + }, + { + "cursor": "IJj9WTOaH4fXBwaq2+79tcdTWMlsLD90tAA99wRYadaKAwAAAAAAAAA=", + "node": { + "name": { + "bcs": "A2RmNg==", + "type": { + "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" + } + }, + "value": { + "json": "df6" + } + } + }, + { + "cursor": "ILZJDhqQtyqtQ07tnHozoq0BbJmXlZQypzZ+hHp3ZIBiAwAAAAAAAAA=", "node": { "name": { "bcs": "A2RmMQ==", @@ -608,7 +664,21 @@ Response: { } }, { - "cursor": "IMwQvC/gNVI0QaXqQ85M2/Ld7rFIXUjtdl+l9lZ+S7LFAwAAAAAAAAA=", + "cursor": "IMg/FO6gjiPZmCvmjnU/nAaf/yi6/pDjjfvGVfr/lqXOAwAAAAAAAAA=", + "node": { + "name": { + "bcs": "A2RmNA==", + "type": { + "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" + } + }, + "value": { + "json": "df4" + } + } + }, + { + "cursor": "IN3UrBmzuomvuVn80suIIpOScrO99xrN0GJX752WrurUAwAAAAAAAAA=", "node": { "name": { "bcs": "A2RmNQ==", @@ -671,54 +741,54 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IDdmynPsciuyRWEuGcUCwsXv/s23PYySAE8E6ds44knABAAAAAAAAAA=", + "cursor": "IALh6Gmj1i0tlaFppLIbcxwvTEoesuYprwx6kb++hQptBAAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMg==", + "bcs": "A2RmMw==", "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "json": "df2" + "json": "df3" } } }, { - "cursor": "IEB3e0osn0vVUIo8hIaYgcZhigq2Wm8ePPv1mdgKFd/5BAAAAAAAAAA=", + "cursor": "IBkflpr//S+rLcwsf9BrQULoOCUdF2gzhpDlWnLv9dvJBAAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMw==", + "bcs": "pAEAAAAAAAA=", "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" + "repr": "u64" } }, "value": { - "json": "df3" + "contents": { + "json": { + "id": "0x8e27ff5a173340bddbd8bcf1483a31f4dba5e4387006bf283a9cfdfffebefb60", + "count": "2" + } + } } } }, { - "cursor": "IGq59R92+WYhAA5OcGSYorEkOqTJakh2jG6IyhnVY/rlBAAAAAAAAAA=", + "cursor": "IDoFKasvO3uRG36i8kDIIFwQcloILQn2wF4PAQIcTwYqBAAAAAAAAAA=", "node": { "name": { - "bcs": "pAEAAAAAAAA=", + "bcs": "A2RmMg==", "type": { - "repr": "u64" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "contents": { - "json": { - "id": "0x0ac7d3caff6fd8543b45b7f49793d0ce33e73d314a90646f2f3abc0dc0f5e7a6", - "count": "2" - } - } + "json": "df2" } } }, { - "cursor": "IMHOuFTfn41iPJnqKDYTTp2Amgl6gV9TCgF5EYXhzDUaBAAAAAAAAAA=", + "cursor": "ILZJDhqQtyqtQ07tnHozoq0BbJmXlZQypzZ+hHp3ZIBiBAAAAAAAAAA=", "node": { "name": { "bcs": "A2RmMQ==", @@ -738,7 +808,21 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IMHOuFTfn41iPJnqKDYTTp2Amgl6gV9TCgF5EYXhzDUaAgAAAAAAAAA=", + "cursor": "IDoFKasvO3uRG36i8kDIIFwQcloILQn2wF4PAQIcTwYqAgAAAAAAAAA=", + "node": { + "name": { + "bcs": "A2RmMg==", + "type": { + "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" + } + }, + "value": { + "json": "df2" + } + } + }, + { + "cursor": "ILZJDhqQtyqtQ07tnHozoq0BbJmXlZQypzZ+hHp3ZIBiAgAAAAAAAAA=", "node": { "name": { "bcs": "A2RmMQ==", @@ -758,21 +842,26 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IAECR2fOXHFO08vEcUZpNvzgnhTDUZzomslx9qLEZvv8BAAAAAAAAAA=", + "cursor": "IBkflpr//S+rLcwsf9BrQULoOCUdF2gzhpDlWnLv9dvJBAAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNA==", + "bcs": "pAEAAAAAAAA=", "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" + "repr": "u64" } }, "value": { - "json": "df4" + "contents": { + "json": { + "id": "0x8e27ff5a173340bddbd8bcf1483a31f4dba5e4387006bf283a9cfdfffebefb60", + "count": "2" + } + } } } }, { - "cursor": "IC70WQdDs6UnCpB5yZ1xZHfSSytat3mLcAW9wyb6gV/YBAAAAAAAAAA=", + "cursor": "IJj9WTOaH4fXBwaq2+79tcdTWMlsLD90tAA99wRYadaKBAAAAAAAAAA=", "node": { "name": { "bcs": "A2RmNg==", @@ -786,26 +875,21 @@ Response: { } }, { - "cursor": "IGq59R92+WYhAA5OcGSYorEkOqTJakh2jG6IyhnVY/rlBAAAAAAAAAA=", + "cursor": "IMg/FO6gjiPZmCvmjnU/nAaf/yi6/pDjjfvGVfr/lqXOBAAAAAAAAAA=", "node": { "name": { - "bcs": "pAEAAAAAAAA=", + "bcs": "A2RmNA==", "type": { - "repr": "u64" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "contents": { - "json": { - "id": "0x0ac7d3caff6fd8543b45b7f49793d0ce33e73d314a90646f2f3abc0dc0f5e7a6", - "count": "2" - } - } + "json": "df4" } } }, { - "cursor": "IMwQvC/gNVI0QaXqQ85M2/Ld7rFIXUjtdl+l9lZ+S7LFBAAAAAAAAAA=", + "cursor": "IN3UrBmzuomvuVn80suIIpOScrO99xrN0GJX752WrurUBAAAAAAAAAA=", "node": { "name": { "bcs": "A2RmNQ==", @@ -825,7 +909,35 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IMwQvC/gNVI0QaXqQ85M2/Ld7rFIXUjtdl+l9lZ+S7LFBAAAAAAAAAA=", + "cursor": "IJj9WTOaH4fXBwaq2+79tcdTWMlsLD90tAA99wRYadaKBAAAAAAAAAA=", + "node": { + "name": { + "bcs": "A2RmNg==", + "type": { + "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" + } + }, + "value": { + "json": "df6" + } + } + }, + { + "cursor": "IMg/FO6gjiPZmCvmjnU/nAaf/yi6/pDjjfvGVfr/lqXOBAAAAAAAAAA=", + "node": { + "name": { + "bcs": "A2RmNA==", + "type": { + "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" + } + }, + "value": { + "json": "df4" + } + } + }, + { + "cursor": "IN3UrBmzuomvuVn80suIIpOScrO99xrN0GJX752WrurUBAAAAAAAAAA=", "node": { "name": { "bcs": "A2RmNQ==", @@ -891,7 +1003,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IGq59R92+WYhAA5OcGSYorEkOqTJakh2jG6IyhnVY/rlBwAAAAAAAAA=", + "cursor": "IBkflpr//S+rLcwsf9BrQULoOCUdF2gzhpDlWnLv9dvJBwAAAAAAAAA=", "node": { "name": { "bcs": "pAEAAAAAAAA=", @@ -902,7 +1014,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x0ac7d3caff6fd8543b45b7f49793d0ce33e73d314a90646f2f3abc0dc0f5e7a6", + "id": "0x8e27ff5a173340bddbd8bcf1483a31f4dba5e4387006bf283a9cfdfffebefb60", "count": "2" } } @@ -917,21 +1029,26 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IAECR2fOXHFO08vEcUZpNvzgnhTDUZzomslx9qLEZvv8BwAAAAAAAAA=", + "cursor": "IBkflpr//S+rLcwsf9BrQULoOCUdF2gzhpDlWnLv9dvJBwAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmNA==", + "bcs": "pAEAAAAAAAA=", "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" + "repr": "u64" } }, "value": { - "json": "df4" + "contents": { + "json": { + "id": "0x8e27ff5a173340bddbd8bcf1483a31f4dba5e4387006bf283a9cfdfffebefb60", + "count": "2" + } + } } } }, { - "cursor": "IC70WQdDs6UnCpB5yZ1xZHfSSytat3mLcAW9wyb6gV/YBwAAAAAAAAA=", + "cursor": "IJj9WTOaH4fXBwaq2+79tcdTWMlsLD90tAA99wRYadaKBwAAAAAAAAA=", "node": { "name": { "bcs": "A2RmNg==", @@ -945,26 +1062,21 @@ Response: { } }, { - "cursor": "IGq59R92+WYhAA5OcGSYorEkOqTJakh2jG6IyhnVY/rlBwAAAAAAAAA=", + "cursor": "IMg/FO6gjiPZmCvmjnU/nAaf/yi6/pDjjfvGVfr/lqXOBwAAAAAAAAA=", "node": { "name": { - "bcs": "pAEAAAAAAAA=", + "bcs": "A2RmNA==", "type": { - "repr": "u64" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" } }, "value": { - "contents": { - "json": { - "id": "0x0ac7d3caff6fd8543b45b7f49793d0ce33e73d314a90646f2f3abc0dc0f5e7a6", - "count": "2" - } - } + "json": "df4" } } }, { - "cursor": "IMwQvC/gNVI0QaXqQ85M2/Ld7rFIXUjtdl+l9lZ+S7LFBwAAAAAAAAA=", + "cursor": "IN3UrBmzuomvuVn80suIIpOScrO99xrN0GJX752WrurUBwAAAAAAAAA=", "node": { "name": { "bcs": "A2RmNQ==", @@ -984,7 +1096,35 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IMwQvC/gNVI0QaXqQ85M2/Ld7rFIXUjtdl+l9lZ+S7LFBAAAAAAAAAA=", + "cursor": "IJj9WTOaH4fXBwaq2+79tcdTWMlsLD90tAA99wRYadaKBAAAAAAAAAA=", + "node": { + "name": { + "bcs": "A2RmNg==", + "type": { + "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" + } + }, + "value": { + "json": "df6" + } + } + }, + { + "cursor": "IMg/FO6gjiPZmCvmjnU/nAaf/yi6/pDjjfvGVfr/lqXOBAAAAAAAAAA=", + "node": { + "name": { + "bcs": "A2RmNA==", + "type": { + "repr": "0x0000000000000000000000000000000000000000000000000000000000000001::string::String" + } + }, + "value": { + "json": "df4" + } + } + }, + { + "cursor": "IN3UrBmzuomvuVn80suIIpOScrO99xrN0GJX752WrurUBAAAAAAAAAA=", "node": { "name": { "bcs": "A2RmNQ==", diff --git a/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/immutable_dof.exp b/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/immutable_dof.exp index ccebc85f6c1..fff4c15b7b7 100644 --- a/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/immutable_dof.exp +++ b/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/immutable_dof.exp @@ -58,11 +58,11 @@ Response: { "nodes": [ { "value": { - "address": "0x954877dc60cfd8aa5a1cdb1e53e40ca45949c616e6767758e800e790faecd2d8", + "address": "0x8603ad20d654d0c0c01565eea9c2e60ef1c3451d8039ccb82b766b1bbe0b1b63", "version": 5, "contents": { "json": { - "id": "0x954877dc60cfd8aa5a1cdb1e53e40ca45949c616e6767758e800e790faecd2d8", + "id": "0x8603ad20d654d0c0c01565eea9c2e60ef1c3451d8039ccb82b766b1bbe0b1b63", "count": "0" } }, @@ -86,11 +86,11 @@ Response: { "nodes": [ { "value": { - "address": "0x954877dc60cfd8aa5a1cdb1e53e40ca45949c616e6767758e800e790faecd2d8", + "address": "0x8603ad20d654d0c0c01565eea9c2e60ef1c3451d8039ccb82b766b1bbe0b1b63", "version": 5, "contents": { "json": { - "id": "0x954877dc60cfd8aa5a1cdb1e53e40ca45949c616e6767758e800e790faecd2d8", + "id": "0x8603ad20d654d0c0c01565eea9c2e60ef1c3451d8039ccb82b766b1bbe0b1b63", "count": "0" } }, @@ -98,11 +98,11 @@ Response: { "nodes": [ { "value": { - "address": "0x296e61954d174dee57f4a5fe9cab9c3451d4961df27d27c8a4a3a1c349185c4b", + "address": "0xf951c0b6f5ab4e8bee9eb5e914129387a884624132c454575d203d545691a5a2", "version": 6, "contents": { "json": { - "id": "0x296e61954d174dee57f4a5fe9cab9c3451d4961df27d27c8a4a3a1c349185c4b", + "id": "0xf951c0b6f5ab4e8bee9eb5e914129387a884624132c454575d203d545691a5a2", "count": "0" } } @@ -145,7 +145,7 @@ Response: { "object": { "owner": { "parent": { - "address": "0xd553d1752a04a98a3252ac682302b2d5a1f97eba7f752ec3c07f6052738b1b1b" + "address": "0x31c25614224e45aadeb93d9117cb1485b4e37dde7649eb6f1145cad43eef6057" } }, "dynamicFields": { @@ -175,11 +175,11 @@ Response: { "nodes": [ { "value": { - "address": "0x296e61954d174dee57f4a5fe9cab9c3451d4961df27d27c8a4a3a1c349185c4b", + "address": "0xf951c0b6f5ab4e8bee9eb5e914129387a884624132c454575d203d545691a5a2", "version": 6, "contents": { "json": { - "id": "0x296e61954d174dee57f4a5fe9cab9c3451d4961df27d27c8a4a3a1c349185c4b", + "id": "0xf951c0b6f5ab4e8bee9eb5e914129387a884624132c454575d203d545691a5a2", "count": "0" } } @@ -203,11 +203,11 @@ Response: { "nodes": [ { "value": { - "address": "0x296e61954d174dee57f4a5fe9cab9c3451d4961df27d27c8a4a3a1c349185c4b", + "address": "0xf951c0b6f5ab4e8bee9eb5e914129387a884624132c454575d203d545691a5a2", "version": 6, "contents": { "json": { - "id": "0x296e61954d174dee57f4a5fe9cab9c3451d4961df27d27c8a4a3a1c349185c4b", + "id": "0xf951c0b6f5ab4e8bee9eb5e914129387a884624132c454575d203d545691a5a2", "count": "0" } } diff --git a/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_df.exp b/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_df.exp index 184bf20fd4d..495afe8ec2a 100644 --- a/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_df.exp +++ b/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_df.exp @@ -78,29 +78,29 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IAOBRGK5lD0Nej7HS3XnFrhOWTDVz88WNSLSiQO/2YODAQAAAAAAAAA=", + "cursor": "ICL7pJfAQLj6WYX7JFqe8xzFC/CvS5IAKLUxLQMjEDPMAQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMg==" + "bcs": "A2RmMw==" }, "value": { - "json": "df2" + "json": "df3" } } }, { - "cursor": "IFV2VC/Njx0C8OSVu4etZNkBZv792+lw+UdKoPyWgevFAQAAAAAAAAA=", + "cursor": "IDDmzOHqC1rNbC7svj9ulnV/RJFyPyAyQ1aRX/whHumNAQAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMw==" + "bcs": "A2RmMg==" }, "value": { - "json": "df3" + "json": "df2" } } }, { - "cursor": "IGCzvIIt5UFj66EDIc/9FGdPSZDnmwGERDKgDt25QVTPAQAAAAAAAAA=", + "cursor": "IIVQTTVQjMUkDYOy1/VGNfpBmQxaJo6M0SMfHyrWrbGAAQAAAAAAAAA=", "node": { "name": { "bcs": "A2RmMQ==" @@ -201,29 +201,29 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IAOBRGK5lD0Nej7HS3XnFrhOWTDVz88WNSLSiQO/2YODAgAAAAAAAAA=", + "cursor": "ICL7pJfAQLj6WYX7JFqe8xzFC/CvS5IAKLUxLQMjEDPMAgAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMg==" + "bcs": "A2RmMw==" }, "value": { - "json": "df2" + "json": "df3" } } }, { - "cursor": "IFV2VC/Njx0C8OSVu4etZNkBZv792+lw+UdKoPyWgevFAgAAAAAAAAA=", + "cursor": "IDDmzOHqC1rNbC7svj9ulnV/RJFyPyAyQ1aRX/whHumNAgAAAAAAAAA=", "node": { "name": { - "bcs": "A2RmMw==" + "bcs": "A2RmMg==" }, "value": { - "json": "df3" + "json": "df2" } } }, { - "cursor": "IGCzvIIt5UFj66EDIc/9FGdPSZDnmwGERDKgDt25QVTPAgAAAAAAAAA=", + "cursor": "IIVQTTVQjMUkDYOy1/VGNfpBmQxaJo6M0SMfHyrWrbGAAgAAAAAAAAA=", "node": { "name": { "bcs": "A2RmMQ==" diff --git a/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_dof.exp b/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_dof.exp index d9eadb90c90..096fa5aa5cc 100644 --- a/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_dof.exp +++ b/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/mutated_dof.exp @@ -41,7 +41,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IPFVoW6+4tOMuFWJMAkUTL28EhQKr4K5u5KDjyJL22IxAQAAAAAAAAA=", + "cursor": "IDyE8cX8asJQ38Rt/kwo8heuhhDsWyl1CHjK/D32HvIxAQAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -49,7 +49,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x33462bf2007040ccc3a9bd9b38e2c2949f069ba336965fb517003380afb1ca8d", + "id": "0x4df431020b1db28d623c6129f55c56c5664a167913fe46fce4bed4c0e1cd5c3b", "count": "0" } } @@ -65,7 +65,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x33462bf2007040ccc3a9bd9b38e2c2949f069ba336965fb517003380afb1ca8d", + "id": "0x4df431020b1db28d623c6129f55c56c5664a167913fe46fce4bed4c0e1cd5c3b", "count": "0" } } @@ -77,7 +77,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IPFVoW6+4tOMuFWJMAkUTL28EhQKr4K5u5KDjyJL22IxAQAAAAAAAAA=", + "cursor": "IDyE8cX8asJQ38Rt/kwo8heuhhDsWyl1CHjK/D32HvIxAQAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -85,7 +85,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x33462bf2007040ccc3a9bd9b38e2c2949f069ba336965fb517003380afb1ca8d", + "id": "0x4df431020b1db28d623c6129f55c56c5664a167913fe46fce4bed4c0e1cd5c3b", "count": "0" } } @@ -101,7 +101,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x33462bf2007040ccc3a9bd9b38e2c2949f069ba336965fb517003380afb1ca8d", + "id": "0x4df431020b1db28d623c6129f55c56c5664a167913fe46fce4bed4c0e1cd5c3b", "count": "0" } } @@ -117,7 +117,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x33462bf2007040ccc3a9bd9b38e2c2949f069ba336965fb517003380afb1ca8d", + "id": "0x4df431020b1db28d623c6129f55c56c5664a167913fe46fce4bed4c0e1cd5c3b", "count": "0" } } @@ -168,7 +168,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x33462bf2007040ccc3a9bd9b38e2c2949f069ba336965fb517003380afb1ca8d", + "id": "0x4df431020b1db28d623c6129f55c56c5664a167913fe46fce4bed4c0e1cd5c3b", "count": "0" } } @@ -202,7 +202,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IPFVoW6+4tOMuFWJMAkUTL28EhQKr4K5u5KDjyJL22IxAwAAAAAAAAA=", + "cursor": "IDyE8cX8asJQ38Rt/kwo8heuhhDsWyl1CHjK/D32HvIxAwAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -210,7 +210,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x33462bf2007040ccc3a9bd9b38e2c2949f069ba336965fb517003380afb1ca8d", + "id": "0x4df431020b1db28d623c6129f55c56c5664a167913fe46fce4bed4c0e1cd5c3b", "count": "1" } } @@ -226,7 +226,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x33462bf2007040ccc3a9bd9b38e2c2949f069ba336965fb517003380afb1ca8d", + "id": "0x4df431020b1db28d623c6129f55c56c5664a167913fe46fce4bed4c0e1cd5c3b", "count": "1" } } @@ -238,7 +238,7 @@ Response: { "dynamicFields": { "edges": [ { - "cursor": "IPFVoW6+4tOMuFWJMAkUTL28EhQKr4K5u5KDjyJL22IxAwAAAAAAAAA=", + "cursor": "IDyE8cX8asJQ38Rt/kwo8heuhhDsWyl1CHjK/D32HvIxAwAAAAAAAAA=", "node": { "name": { "bcs": "KgAAAAAAAAA=" @@ -246,7 +246,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x33462bf2007040ccc3a9bd9b38e2c2949f069ba336965fb517003380afb1ca8d", + "id": "0x4df431020b1db28d623c6129f55c56c5664a167913fe46fce4bed4c0e1cd5c3b", "count": "1" } } @@ -262,7 +262,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x33462bf2007040ccc3a9bd9b38e2c2949f069ba336965fb517003380afb1ca8d", + "id": "0x4df431020b1db28d623c6129f55c56c5664a167913fe46fce4bed4c0e1cd5c3b", "count": "1" } } @@ -283,7 +283,7 @@ Response: { "value": { "contents": { "json": { - "id": "0x33462bf2007040ccc3a9bd9b38e2c2949f069ba336965fb517003380afb1ca8d", + "id": "0x4df431020b1db28d623c6129f55c56c5664a167913fe46fce4bed4c0e1cd5c3b", "count": "0" } } diff --git a/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/nested_dof.exp b/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/nested_dof.exp index f4e26e3c372..1bf5bd620cd 100644 --- a/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/nested_dof.exp +++ b/crates/iota-graphql-e2e-tests/tests/consistency/dynamic_fields/nested_dof.exp @@ -62,11 +62,11 @@ Response: { "nodes": [ { "value": { - "address": "0xe0f588e2ad8e6a1d63c189d3c92a70816d4eb8325cb5292739752e01100e89dc", + "address": "0x615e8039a1bf2fd65fc04d18cb2513e55837a421b1e39bd309d2b6fd3b8986a8", "version": 5, "contents": { "json": { - "id": "0xe0f588e2ad8e6a1d63c189d3c92a70816d4eb8325cb5292739752e01100e89dc", + "id": "0x615e8039a1bf2fd65fc04d18cb2513e55837a421b1e39bd309d2b6fd3b8986a8", "count": "0" } }, @@ -90,11 +90,11 @@ Response: { "nodes": [ { "value": { - "address": "0xe0f588e2ad8e6a1d63c189d3c92a70816d4eb8325cb5292739752e01100e89dc", + "address": "0x615e8039a1bf2fd65fc04d18cb2513e55837a421b1e39bd309d2b6fd3b8986a8", "version": 5, "contents": { "json": { - "id": "0xe0f588e2ad8e6a1d63c189d3c92a70816d4eb8325cb5292739752e01100e89dc", + "id": "0x615e8039a1bf2fd65fc04d18cb2513e55837a421b1e39bd309d2b6fd3b8986a8", "count": "0" } }, @@ -102,11 +102,11 @@ Response: { "nodes": [ { "value": { - "address": "0x112e84595495024dd53c12d1c45f71a2493266a63b3cebe0ef5379b8dbe5f0e9", + "address": "0xc2dd55dcfaacddef3f214a2c31824b6b9b3c4bbd473718de32a7020d6311435e", "version": 6, "contents": { "json": { - "id": "0x112e84595495024dd53c12d1c45f71a2493266a63b3cebe0ef5379b8dbe5f0e9", + "id": "0xc2dd55dcfaacddef3f214a2c31824b6b9b3c4bbd473718de32a7020d6311435e", "count": "0" } } @@ -131,11 +131,11 @@ Response: { "nodes": [ { "value": { - "address": "0xe0f588e2ad8e6a1d63c189d3c92a70816d4eb8325cb5292739752e01100e89dc", + "address": "0x615e8039a1bf2fd65fc04d18cb2513e55837a421b1e39bd309d2b6fd3b8986a8", "version": 7, "contents": { "json": { - "id": "0xe0f588e2ad8e6a1d63c189d3c92a70816d4eb8325cb5292739752e01100e89dc", + "id": "0x615e8039a1bf2fd65fc04d18cb2513e55837a421b1e39bd309d2b6fd3b8986a8", "count": "1" } }, @@ -143,11 +143,11 @@ Response: { "nodes": [ { "value": { - "address": "0x112e84595495024dd53c12d1c45f71a2493266a63b3cebe0ef5379b8dbe5f0e9", + "address": "0xc2dd55dcfaacddef3f214a2c31824b6b9b3c4bbd473718de32a7020d6311435e", "version": 6, "contents": { "json": { - "id": "0x112e84595495024dd53c12d1c45f71a2493266a63b3cebe0ef5379b8dbe5f0e9", + "id": "0xc2dd55dcfaacddef3f214a2c31824b6b9b3c4bbd473718de32a7020d6311435e", "count": "0" } } @@ -172,11 +172,11 @@ Response: { "nodes": [ { "value": { - "address": "0xe0f588e2ad8e6a1d63c189d3c92a70816d4eb8325cb5292739752e01100e89dc", + "address": "0x615e8039a1bf2fd65fc04d18cb2513e55837a421b1e39bd309d2b6fd3b8986a8", "version": 7, "contents": { "json": { - "id": "0xe0f588e2ad8e6a1d63c189d3c92a70816d4eb8325cb5292739752e01100e89dc", + "id": "0x615e8039a1bf2fd65fc04d18cb2513e55837a421b1e39bd309d2b6fd3b8986a8", "count": "1" } }, @@ -184,11 +184,11 @@ Response: { "nodes": [ { "value": { - "address": "0x112e84595495024dd53c12d1c45f71a2493266a63b3cebe0ef5379b8dbe5f0e9", + "address": "0xc2dd55dcfaacddef3f214a2c31824b6b9b3c4bbd473718de32a7020d6311435e", "version": 8, "contents": { "json": { - "id": "0x112e84595495024dd53c12d1c45f71a2493266a63b3cebe0ef5379b8dbe5f0e9", + "id": "0xc2dd55dcfaacddef3f214a2c31824b6b9b3c4bbd473718de32a7020d6311435e", "count": "1" } } @@ -233,11 +233,11 @@ Response: { "nodes": [ { "value": { - "address": "0x112e84595495024dd53c12d1c45f71a2493266a63b3cebe0ef5379b8dbe5f0e9", + "address": "0xc2dd55dcfaacddef3f214a2c31824b6b9b3c4bbd473718de32a7020d6311435e", "version": 6, "contents": { "json": { - "id": "0x112e84595495024dd53c12d1c45f71a2493266a63b3cebe0ef5379b8dbe5f0e9", + "id": "0xc2dd55dcfaacddef3f214a2c31824b6b9b3c4bbd473718de32a7020d6311435e", "count": "0" } } diff --git a/crates/iota-graphql-e2e-tests/tests/consistency/epochs/transaction_blocks.exp b/crates/iota-graphql-e2e-tests/tests/consistency/epochs/transaction_blocks.exp index d39f996d0cd..b45454f5e94 100644 --- a/crates/iota-graphql-e2e-tests/tests/consistency/epochs/transaction_blocks.exp +++ b/crates/iota-graphql-e2e-tests/tests/consistency/epochs/transaction_blocks.exp @@ -41,19 +41,19 @@ Response: { { "cursor": "eyJjIjozLCJ0IjowLCJpIjpmYWxzZX0", "node": { - "digest": "5kxKxJyFgHd4UJ5hRdDAqFKpxQ2By93WD5QBirmGxV5G" + "digest": "8twBu7kvzDbfSLjpBJ2GbDpfARJpwkdVCywZJqQCc3Eu" } }, { "cursor": "eyJjIjozLCJ0IjoxLCJpIjpmYWxzZX0", "node": { - "digest": "E6pjAnqyNZQ8Ye87uV6Twx5XTQdQ7jbFTrq2XKfjKLUd" + "digest": "8fpjvnkVGNNbPNqNiB865VayCFzpvvtNkHWYWYAWWAZw" } }, { "cursor": "eyJjIjozLCJ0IjoyLCJpIjpmYWxzZX0", "node": { - "digest": "EwmT47jKmNQDvxQgzwMCzjU7YbDD1aB7XAqDLXFCVk8S" + "digest": "3Wu2rNcM39pocoovpHUXZrWtwQXn8ZXAGpwrU7GthLLD" } }, { @@ -154,19 +154,19 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6MCwiaSI6ZmFsc2V9", "node": { - "digest": "5kxKxJyFgHd4UJ5hRdDAqFKpxQ2By93WD5QBirmGxV5G" + "digest": "8twBu7kvzDbfSLjpBJ2GbDpfARJpwkdVCywZJqQCc3Eu" } }, { "cursor": "eyJjIjoxMiwidCI6MSwiaSI6ZmFsc2V9", "node": { - "digest": "E6pjAnqyNZQ8Ye87uV6Twx5XTQdQ7jbFTrq2XKfjKLUd" + "digest": "8fpjvnkVGNNbPNqNiB865VayCFzpvvtNkHWYWYAWWAZw" } }, { "cursor": "eyJjIjoxMiwidCI6MiwiaSI6ZmFsc2V9", "node": { - "digest": "EwmT47jKmNQDvxQgzwMCzjU7YbDD1aB7XAqDLXFCVk8S" + "digest": "3Wu2rNcM39pocoovpHUXZrWtwQXn8ZXAGpwrU7GthLLD" } }, { @@ -183,19 +183,19 @@ Response: { { "cursor": "eyJjIjo0LCJ0IjowLCJpIjpmYWxzZX0", "node": { - "digest": "5kxKxJyFgHd4UJ5hRdDAqFKpxQ2By93WD5QBirmGxV5G" + "digest": "8twBu7kvzDbfSLjpBJ2GbDpfARJpwkdVCywZJqQCc3Eu" } }, { "cursor": "eyJjIjo0LCJ0IjoxLCJpIjpmYWxzZX0", "node": { - "digest": "E6pjAnqyNZQ8Ye87uV6Twx5XTQdQ7jbFTrq2XKfjKLUd" + "digest": "8fpjvnkVGNNbPNqNiB865VayCFzpvvtNkHWYWYAWWAZw" } }, { "cursor": "eyJjIjo0LCJ0IjoyLCJpIjpmYWxzZX0", "node": { - "digest": "EwmT47jKmNQDvxQgzwMCzjU7YbDD1aB7XAqDLXFCVk8S" + "digest": "3Wu2rNcM39pocoovpHUXZrWtwQXn8ZXAGpwrU7GthLLD" } } ] @@ -207,19 +207,19 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6NCwiaSI6ZmFsc2V9", "node": { - "digest": "A3BxB2KqSbEY5rzGjhm1FBLmRvVRG9pK8QEuaYnnvMZz" + "digest": "5Fx8EKmMoiHb59rVr2ch64EgLyvs9SWhuUHq6x3HAx3T" } }, { "cursor": "eyJjIjoxMiwidCI6NSwiaSI6ZmFsc2V9", "node": { - "digest": "3q3x6TLWzA6VGc3uRsxbB3P3pPfeD3W9XwaqbYbE9xac" + "digest": "DvNBuuqGugb9p76oMb1jLa6MdAv7mT184x69bGKC2rQw" } }, { "cursor": "eyJjIjoxMiwidCI6NiwiaSI6ZmFsc2V9", "node": { - "digest": "9iWLh5uU71BUZapSEAR7K7LN8LCMow3V6TTjtLUn3XmL" + "digest": "ERSRy9F3o39NCDRWeDVz5AgBGZPmaCdXzzJ6tjd8eY7k" } }, { @@ -236,19 +236,19 @@ Response: { { "cursor": "eyJjIjo4LCJ0IjowLCJpIjpmYWxzZX0", "node": { - "digest": "5kxKxJyFgHd4UJ5hRdDAqFKpxQ2By93WD5QBirmGxV5G" + "digest": "8twBu7kvzDbfSLjpBJ2GbDpfARJpwkdVCywZJqQCc3Eu" } }, { "cursor": "eyJjIjo4LCJ0IjoxLCJpIjpmYWxzZX0", "node": { - "digest": "E6pjAnqyNZQ8Ye87uV6Twx5XTQdQ7jbFTrq2XKfjKLUd" + "digest": "8fpjvnkVGNNbPNqNiB865VayCFzpvvtNkHWYWYAWWAZw" } }, { "cursor": "eyJjIjo4LCJ0IjoyLCJpIjpmYWxzZX0", "node": { - "digest": "EwmT47jKmNQDvxQgzwMCzjU7YbDD1aB7XAqDLXFCVk8S" + "digest": "3Wu2rNcM39pocoovpHUXZrWtwQXn8ZXAGpwrU7GthLLD" } }, { @@ -260,19 +260,19 @@ Response: { { "cursor": "eyJjIjo4LCJ0Ijo0LCJpIjpmYWxzZX0", "node": { - "digest": "A3BxB2KqSbEY5rzGjhm1FBLmRvVRG9pK8QEuaYnnvMZz" + "digest": "5Fx8EKmMoiHb59rVr2ch64EgLyvs9SWhuUHq6x3HAx3T" } }, { "cursor": "eyJjIjo4LCJ0Ijo1LCJpIjpmYWxzZX0", "node": { - "digest": "3q3x6TLWzA6VGc3uRsxbB3P3pPfeD3W9XwaqbYbE9xac" + "digest": "DvNBuuqGugb9p76oMb1jLa6MdAv7mT184x69bGKC2rQw" } }, { "cursor": "eyJjIjo4LCJ0Ijo2LCJpIjpmYWxzZX0", "node": { - "digest": "9iWLh5uU71BUZapSEAR7K7LN8LCMow3V6TTjtLUn3XmL" + "digest": "ERSRy9F3o39NCDRWeDVz5AgBGZPmaCdXzzJ6tjd8eY7k" } } ] @@ -284,19 +284,19 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6OCwiaSI6ZmFsc2V9", "node": { - "digest": "2WNkedo9ryA7XgpBREdQah76c8yu5h7KmUjD3MGJdsiC" + "digest": "2uLirA5sxREeS1UHEKCJWeoMv2R1MKCUiiep9Q6s7WA6" } }, { "cursor": "eyJjIjoxMiwidCI6OSwiaSI6ZmFsc2V9", "node": { - "digest": "3Hnz1hLa3UGLRvyophw12hwhfmwnYpJM75fDuT6bWBEB" + "digest": "4HgxdMoiQdZbLrd7ycQ3csPtccNPvr9BZW67ykV7NRk6" } }, { "cursor": "eyJjIjoxMiwidCI6MTAsImkiOmZhbHNlfQ", "node": { - "digest": "Bwx7M14Z3TTQ8HjJan4NpfTp9uab6zGZ1t3VyHexrkjY" + "digest": "d9yohmp3svrBRKZjbfv7Gn5TbCrmspbqis2wy76ES1M" } }, { @@ -313,19 +313,19 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6MCwiaSI6ZmFsc2V9", "node": { - "digest": "5kxKxJyFgHd4UJ5hRdDAqFKpxQ2By93WD5QBirmGxV5G" + "digest": "8twBu7kvzDbfSLjpBJ2GbDpfARJpwkdVCywZJqQCc3Eu" } }, { "cursor": "eyJjIjoxMiwidCI6MSwiaSI6ZmFsc2V9", "node": { - "digest": "E6pjAnqyNZQ8Ye87uV6Twx5XTQdQ7jbFTrq2XKfjKLUd" + "digest": "8fpjvnkVGNNbPNqNiB865VayCFzpvvtNkHWYWYAWWAZw" } }, { "cursor": "eyJjIjoxMiwidCI6MiwiaSI6ZmFsc2V9", "node": { - "digest": "EwmT47jKmNQDvxQgzwMCzjU7YbDD1aB7XAqDLXFCVk8S" + "digest": "3Wu2rNcM39pocoovpHUXZrWtwQXn8ZXAGpwrU7GthLLD" } }, { @@ -337,19 +337,19 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6NCwiaSI6ZmFsc2V9", "node": { - "digest": "A3BxB2KqSbEY5rzGjhm1FBLmRvVRG9pK8QEuaYnnvMZz" + "digest": "5Fx8EKmMoiHb59rVr2ch64EgLyvs9SWhuUHq6x3HAx3T" } }, { "cursor": "eyJjIjoxMiwidCI6NSwiaSI6ZmFsc2V9", "node": { - "digest": "3q3x6TLWzA6VGc3uRsxbB3P3pPfeD3W9XwaqbYbE9xac" + "digest": "DvNBuuqGugb9p76oMb1jLa6MdAv7mT184x69bGKC2rQw" } }, { "cursor": "eyJjIjoxMiwidCI6NiwiaSI6ZmFsc2V9", "node": { - "digest": "9iWLh5uU71BUZapSEAR7K7LN8LCMow3V6TTjtLUn3XmL" + "digest": "ERSRy9F3o39NCDRWeDVz5AgBGZPmaCdXzzJ6tjd8eY7k" } }, { @@ -361,19 +361,19 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6OCwiaSI6ZmFsc2V9", "node": { - "digest": "2WNkedo9ryA7XgpBREdQah76c8yu5h7KmUjD3MGJdsiC" + "digest": "2uLirA5sxREeS1UHEKCJWeoMv2R1MKCUiiep9Q6s7WA6" } }, { "cursor": "eyJjIjoxMiwidCI6OSwiaSI6ZmFsc2V9", "node": { - "digest": "3Hnz1hLa3UGLRvyophw12hwhfmwnYpJM75fDuT6bWBEB" + "digest": "4HgxdMoiQdZbLrd7ycQ3csPtccNPvr9BZW67ykV7NRk6" } }, { "cursor": "eyJjIjoxMiwidCI6MTAsImkiOmZhbHNlfQ", "node": { - "digest": "Bwx7M14Z3TTQ8HjJan4NpfTp9uab6zGZ1t3VyHexrkjY" + "digest": "d9yohmp3svrBRKZjbfv7Gn5TbCrmspbqis2wy76ES1M" } } ] @@ -395,13 +395,13 @@ Response: { { "cursor": "eyJjIjo3LCJ0IjoxLCJpIjpmYWxzZX0", "node": { - "digest": "E6pjAnqyNZQ8Ye87uV6Twx5XTQdQ7jbFTrq2XKfjKLUd" + "digest": "8fpjvnkVGNNbPNqNiB865VayCFzpvvtNkHWYWYAWWAZw" } }, { "cursor": "eyJjIjo3LCJ0IjoyLCJpIjpmYWxzZX0", "node": { - "digest": "EwmT47jKmNQDvxQgzwMCzjU7YbDD1aB7XAqDLXFCVk8S" + "digest": "3Wu2rNcM39pocoovpHUXZrWtwQXn8ZXAGpwrU7GthLLD" } }, { @@ -420,13 +420,13 @@ Response: { { "cursor": "eyJjIjoxMSwidCI6NSwiaSI6ZmFsc2V9", "node": { - "digest": "3q3x6TLWzA6VGc3uRsxbB3P3pPfeD3W9XwaqbYbE9xac" + "digest": "DvNBuuqGugb9p76oMb1jLa6MdAv7mT184x69bGKC2rQw" } }, { "cursor": "eyJjIjoxMSwidCI6NiwiaSI6ZmFsc2V9", "node": { - "digest": "9iWLh5uU71BUZapSEAR7K7LN8LCMow3V6TTjtLUn3XmL" + "digest": "ERSRy9F3o39NCDRWeDVz5AgBGZPmaCdXzzJ6tjd8eY7k" } }, { @@ -445,13 +445,13 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6OSwiaSI6ZmFsc2V9", "node": { - "digest": "3Hnz1hLa3UGLRvyophw12hwhfmwnYpJM75fDuT6bWBEB" + "digest": "4HgxdMoiQdZbLrd7ycQ3csPtccNPvr9BZW67ykV7NRk6" } }, { "cursor": "eyJjIjoxMiwidCI6MTAsImkiOmZhbHNlfQ", "node": { - "digest": "Bwx7M14Z3TTQ8HjJan4NpfTp9uab6zGZ1t3VyHexrkjY" + "digest": "d9yohmp3svrBRKZjbfv7Gn5TbCrmspbqis2wy76ES1M" } }, { @@ -480,7 +480,7 @@ Response: { { "cursor": "eyJjIjoyLCJ0IjoyLCJpIjpmYWxzZX0", "node": { - "digest": "EwmT47jKmNQDvxQgzwMCzjU7YbDD1aB7XAqDLXFCVk8S" + "digest": "3Wu2rNcM39pocoovpHUXZrWtwQXn8ZXAGpwrU7GthLLD" } } ] @@ -493,7 +493,7 @@ Response: { { "cursor": "eyJjIjo2LCJ0Ijo2LCJpIjpmYWxzZX0", "node": { - "digest": "9iWLh5uU71BUZapSEAR7K7LN8LCMow3V6TTjtLUn3XmL" + "digest": "ERSRy9F3o39NCDRWeDVz5AgBGZPmaCdXzzJ6tjd8eY7k" } } ] @@ -506,7 +506,7 @@ Response: { { "cursor": "eyJjIjoxMCwidCI6MTAsImkiOmZhbHNlfQ", "node": { - "digest": "Bwx7M14Z3TTQ8HjJan4NpfTp9uab6zGZ1t3VyHexrkjY" + "digest": "d9yohmp3svrBRKZjbfv7Gn5TbCrmspbqis2wy76ES1M" } } ] @@ -527,24 +527,24 @@ Response: { { "cursor": "eyJjIjo2LCJ0Ijo2LCJpIjpmYWxzZX0", "node": { - "digest": "9iWLh5uU71BUZapSEAR7K7LN8LCMow3V6TTjtLUn3XmL", + "digest": "ERSRy9F3o39NCDRWeDVz5AgBGZPmaCdXzzJ6tjd8eY7k", "sender": { "objects": { "edges": [ { - "cursor": "IAz2L92GTy3bRQokgdsccY5vfPuQK8KudYQMyh4Vf8+tBgAAAAAAAAA=" + "cursor": "IByRl+xjLSNEC4Q+Y0Few4xDVIcYyUxyZ4oe7WO63+sLBgAAAAAAAAA=" }, { - "cursor": "IBHX4D82A7/ZLerkJoHcZjVY/9QGa2PNThEMJ0i/xZhEBgAAAAAAAAA=" + "cursor": "IFStyAU4OS4HEIphwSJjArUsneR9JgYjXqrUZixEvrQuBgAAAAAAAAA=" }, { - "cursor": "IJ2oGY9DeOyhhxdX+ImgY+PjoaVS/HlyZ6cBqgyC9raABgAAAAAAAAA=" + "cursor": "IIdbcBHo+WUMzya2grau6zYFD5ZlFX1HQH4pJXAOaRQ7BgAAAAAAAAA=" }, { - "cursor": "ILOePBMfcokYNUYE29o3P2z1pIVl9KzwnrR5str8lONtBgAAAAAAAAA=" + "cursor": "IL4LyEqyfHaJp7x1F47HggXP5K/uTKM7JwRm7NYblBk+BgAAAAAAAAA=" }, { - "cursor": "IOJkIrorXAODWH18HBIrPvmj/7xA3k8oQyVOYuBJ/FQ8BgAAAAAAAAA=" + "cursor": "IOuXfIr/MFNZLw/UcBw1yb4Asy3a7l9mjzGLhiX0TNM2BgAAAAAAAAA=" } ] } @@ -558,33 +558,33 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6MiwiaSI6ZmFsc2V9", "node": { - "digest": "EwmT47jKmNQDvxQgzwMCzjU7YbDD1aB7XAqDLXFCVk8S", + "digest": "3Wu2rNcM39pocoovpHUXZrWtwQXn8ZXAGpwrU7GthLLD", "sender": { "objects": { "edges": [ { - "cursor": "IAZ41/7iWym3cIjIhB3ZxFQLOFHw0NJqy45zL9YZF+RRDAAAAAAAAAA=" + "cursor": "IADSYACaayWIeqSsYbYGygOHm+qGH85EWtI7FGVmu6jlDAAAAAAAAAA=" }, { - "cursor": "IAz2L92GTy3bRQokgdsccY5vfPuQK8KudYQMyh4Vf8+tDAAAAAAAAAA=" + "cursor": "IByRl+xjLSNEC4Q+Y0Few4xDVIcYyUxyZ4oe7WO63+sLDAAAAAAAAAA=" }, { - "cursor": "IBHX4D82A7/ZLerkJoHcZjVY/9QGa2PNThEMJ0i/xZhEDAAAAAAAAAA=" + "cursor": "IFStyAU4OS4HEIphwSJjArUsneR9JgYjXqrUZixEvrQuDAAAAAAAAAA=" }, { - "cursor": "IJ2oGY9DeOyhhxdX+ImgY+PjoaVS/HlyZ6cBqgyC9raADAAAAAAAAAA=" + "cursor": "IIBhlATYbPevAocg2y+ZqQu/SS+ryiQUhFJdTTaBb9XPDAAAAAAAAAA=" }, { - "cursor": "ILOePBMfcokYNUYE29o3P2z1pIVl9KzwnrR5str8lONtDAAAAAAAAAA=" + "cursor": "IIdbcBHo+WUMzya2grau6zYFD5ZlFX1HQH4pJXAOaRQ7DAAAAAAAAAA=" }, { - "cursor": "ILmCB8AzORD4eIKY+8uaJnvqM4zm8Qr80DTrrcy8OOBwDAAAAAAAAAA=" + "cursor": "IJFijS2QC5L0mgGDM8x75mv5mMwWRJMk+x9vBZwIoaU9DAAAAAAAAAA=" }, { - "cursor": "IOJkIrorXAODWH18HBIrPvmj/7xA3k8oQyVOYuBJ/FQ8DAAAAAAAAAA=" + "cursor": "IL4LyEqyfHaJp7x1F47HggXP5K/uTKM7JwRm7NYblBk+DAAAAAAAAAA=" }, { - "cursor": "IP/YY3sBms9tv6LOECqfoZ9YYyMPFwAH+CT+ReeP7XwTDAAAAAAAAAA=" + "cursor": "IOuXfIr/MFNZLw/UcBw1yb4Asy3a7l9mjzGLhiX0TNM2DAAAAAAAAAA=" } ] } @@ -594,33 +594,33 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6NCwiaSI6ZmFsc2V9", "node": { - "digest": "A3BxB2KqSbEY5rzGjhm1FBLmRvVRG9pK8QEuaYnnvMZz", + "digest": "5Fx8EKmMoiHb59rVr2ch64EgLyvs9SWhuUHq6x3HAx3T", "sender": { "objects": { "edges": [ { - "cursor": "IAZ41/7iWym3cIjIhB3ZxFQLOFHw0NJqy45zL9YZF+RRDAAAAAAAAAA=" + "cursor": "IADSYACaayWIeqSsYbYGygOHm+qGH85EWtI7FGVmu6jlDAAAAAAAAAA=" }, { - "cursor": "IAz2L92GTy3bRQokgdsccY5vfPuQK8KudYQMyh4Vf8+tDAAAAAAAAAA=" + "cursor": "IByRl+xjLSNEC4Q+Y0Few4xDVIcYyUxyZ4oe7WO63+sLDAAAAAAAAAA=" }, { - "cursor": "IBHX4D82A7/ZLerkJoHcZjVY/9QGa2PNThEMJ0i/xZhEDAAAAAAAAAA=" + "cursor": "IFStyAU4OS4HEIphwSJjArUsneR9JgYjXqrUZixEvrQuDAAAAAAAAAA=" }, { - "cursor": "IJ2oGY9DeOyhhxdX+ImgY+PjoaVS/HlyZ6cBqgyC9raADAAAAAAAAAA=" + "cursor": "IIBhlATYbPevAocg2y+ZqQu/SS+ryiQUhFJdTTaBb9XPDAAAAAAAAAA=" }, { - "cursor": "ILOePBMfcokYNUYE29o3P2z1pIVl9KzwnrR5str8lONtDAAAAAAAAAA=" + "cursor": "IIdbcBHo+WUMzya2grau6zYFD5ZlFX1HQH4pJXAOaRQ7DAAAAAAAAAA=" }, { - "cursor": "ILmCB8AzORD4eIKY+8uaJnvqM4zm8Qr80DTrrcy8OOBwDAAAAAAAAAA=" + "cursor": "IJFijS2QC5L0mgGDM8x75mv5mMwWRJMk+x9vBZwIoaU9DAAAAAAAAAA=" }, { - "cursor": "IOJkIrorXAODWH18HBIrPvmj/7xA3k8oQyVOYuBJ/FQ8DAAAAAAAAAA=" + "cursor": "IL4LyEqyfHaJp7x1F47HggXP5K/uTKM7JwRm7NYblBk+DAAAAAAAAAA=" }, { - "cursor": "IP/YY3sBms9tv6LOECqfoZ9YYyMPFwAH+CT+ReeP7XwTDAAAAAAAAAA=" + "cursor": "IOuXfIr/MFNZLw/UcBw1yb4Asy3a7l9mjzGLhiX0TNM2DAAAAAAAAAA=" } ] } @@ -630,33 +630,33 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6NSwiaSI6ZmFsc2V9", "node": { - "digest": "3q3x6TLWzA6VGc3uRsxbB3P3pPfeD3W9XwaqbYbE9xac", + "digest": "DvNBuuqGugb9p76oMb1jLa6MdAv7mT184x69bGKC2rQw", "sender": { "objects": { "edges": [ { - "cursor": "IAZ41/7iWym3cIjIhB3ZxFQLOFHw0NJqy45zL9YZF+RRDAAAAAAAAAA=" + "cursor": "IADSYACaayWIeqSsYbYGygOHm+qGH85EWtI7FGVmu6jlDAAAAAAAAAA=" }, { - "cursor": "IAz2L92GTy3bRQokgdsccY5vfPuQK8KudYQMyh4Vf8+tDAAAAAAAAAA=" + "cursor": "IByRl+xjLSNEC4Q+Y0Few4xDVIcYyUxyZ4oe7WO63+sLDAAAAAAAAAA=" }, { - "cursor": "IBHX4D82A7/ZLerkJoHcZjVY/9QGa2PNThEMJ0i/xZhEDAAAAAAAAAA=" + "cursor": "IFStyAU4OS4HEIphwSJjArUsneR9JgYjXqrUZixEvrQuDAAAAAAAAAA=" }, { - "cursor": "IJ2oGY9DeOyhhxdX+ImgY+PjoaVS/HlyZ6cBqgyC9raADAAAAAAAAAA=" + "cursor": "IIBhlATYbPevAocg2y+ZqQu/SS+ryiQUhFJdTTaBb9XPDAAAAAAAAAA=" }, { - "cursor": "ILOePBMfcokYNUYE29o3P2z1pIVl9KzwnrR5str8lONtDAAAAAAAAAA=" + "cursor": "IIdbcBHo+WUMzya2grau6zYFD5ZlFX1HQH4pJXAOaRQ7DAAAAAAAAAA=" }, { - "cursor": "ILmCB8AzORD4eIKY+8uaJnvqM4zm8Qr80DTrrcy8OOBwDAAAAAAAAAA=" + "cursor": "IJFijS2QC5L0mgGDM8x75mv5mMwWRJMk+x9vBZwIoaU9DAAAAAAAAAA=" }, { - "cursor": "IOJkIrorXAODWH18HBIrPvmj/7xA3k8oQyVOYuBJ/FQ8DAAAAAAAAAA=" + "cursor": "IL4LyEqyfHaJp7x1F47HggXP5K/uTKM7JwRm7NYblBk+DAAAAAAAAAA=" }, { - "cursor": "IP/YY3sBms9tv6LOECqfoZ9YYyMPFwAH+CT+ReeP7XwTDAAAAAAAAAA=" + "cursor": "IOuXfIr/MFNZLw/UcBw1yb4Asy3a7l9mjzGLhiX0TNM2DAAAAAAAAAA=" } ] } @@ -666,33 +666,33 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6NiwiaSI6ZmFsc2V9", "node": { - "digest": "9iWLh5uU71BUZapSEAR7K7LN8LCMow3V6TTjtLUn3XmL", + "digest": "ERSRy9F3o39NCDRWeDVz5AgBGZPmaCdXzzJ6tjd8eY7k", "sender": { "objects": { "edges": [ { - "cursor": "IAZ41/7iWym3cIjIhB3ZxFQLOFHw0NJqy45zL9YZF+RRDAAAAAAAAAA=" + "cursor": "IADSYACaayWIeqSsYbYGygOHm+qGH85EWtI7FGVmu6jlDAAAAAAAAAA=" }, { - "cursor": "IAz2L92GTy3bRQokgdsccY5vfPuQK8KudYQMyh4Vf8+tDAAAAAAAAAA=" + "cursor": "IByRl+xjLSNEC4Q+Y0Few4xDVIcYyUxyZ4oe7WO63+sLDAAAAAAAAAA=" }, { - "cursor": "IBHX4D82A7/ZLerkJoHcZjVY/9QGa2PNThEMJ0i/xZhEDAAAAAAAAAA=" + "cursor": "IFStyAU4OS4HEIphwSJjArUsneR9JgYjXqrUZixEvrQuDAAAAAAAAAA=" }, { - "cursor": "IJ2oGY9DeOyhhxdX+ImgY+PjoaVS/HlyZ6cBqgyC9raADAAAAAAAAAA=" + "cursor": "IIBhlATYbPevAocg2y+ZqQu/SS+ryiQUhFJdTTaBb9XPDAAAAAAAAAA=" }, { - "cursor": "ILOePBMfcokYNUYE29o3P2z1pIVl9KzwnrR5str8lONtDAAAAAAAAAA=" + "cursor": "IIdbcBHo+WUMzya2grau6zYFD5ZlFX1HQH4pJXAOaRQ7DAAAAAAAAAA=" }, { - "cursor": "ILmCB8AzORD4eIKY+8uaJnvqM4zm8Qr80DTrrcy8OOBwDAAAAAAAAAA=" + "cursor": "IJFijS2QC5L0mgGDM8x75mv5mMwWRJMk+x9vBZwIoaU9DAAAAAAAAAA=" }, { - "cursor": "IOJkIrorXAODWH18HBIrPvmj/7xA3k8oQyVOYuBJ/FQ8DAAAAAAAAAA=" + "cursor": "IL4LyEqyfHaJp7x1F47HggXP5K/uTKM7JwRm7NYblBk+DAAAAAAAAAA=" }, { - "cursor": "IP/YY3sBms9tv6LOECqfoZ9YYyMPFwAH+CT+ReeP7XwTDAAAAAAAAAA=" + "cursor": "IOuXfIr/MFNZLw/UcBw1yb4Asy3a7l9mjzGLhiX0TNM2DAAAAAAAAAA=" } ] } @@ -702,33 +702,33 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6OCwiaSI6ZmFsc2V9", "node": { - "digest": "2WNkedo9ryA7XgpBREdQah76c8yu5h7KmUjD3MGJdsiC", + "digest": "2uLirA5sxREeS1UHEKCJWeoMv2R1MKCUiiep9Q6s7WA6", "sender": { "objects": { "edges": [ { - "cursor": "IAZ41/7iWym3cIjIhB3ZxFQLOFHw0NJqy45zL9YZF+RRDAAAAAAAAAA=" + "cursor": "IADSYACaayWIeqSsYbYGygOHm+qGH85EWtI7FGVmu6jlDAAAAAAAAAA=" }, { - "cursor": "IAz2L92GTy3bRQokgdsccY5vfPuQK8KudYQMyh4Vf8+tDAAAAAAAAAA=" + "cursor": "IByRl+xjLSNEC4Q+Y0Few4xDVIcYyUxyZ4oe7WO63+sLDAAAAAAAAAA=" }, { - "cursor": "IBHX4D82A7/ZLerkJoHcZjVY/9QGa2PNThEMJ0i/xZhEDAAAAAAAAAA=" + "cursor": "IFStyAU4OS4HEIphwSJjArUsneR9JgYjXqrUZixEvrQuDAAAAAAAAAA=" }, { - "cursor": "IJ2oGY9DeOyhhxdX+ImgY+PjoaVS/HlyZ6cBqgyC9raADAAAAAAAAAA=" + "cursor": "IIBhlATYbPevAocg2y+ZqQu/SS+ryiQUhFJdTTaBb9XPDAAAAAAAAAA=" }, { - "cursor": "ILOePBMfcokYNUYE29o3P2z1pIVl9KzwnrR5str8lONtDAAAAAAAAAA=" + "cursor": "IIdbcBHo+WUMzya2grau6zYFD5ZlFX1HQH4pJXAOaRQ7DAAAAAAAAAA=" }, { - "cursor": "ILmCB8AzORD4eIKY+8uaJnvqM4zm8Qr80DTrrcy8OOBwDAAAAAAAAAA=" + "cursor": "IJFijS2QC5L0mgGDM8x75mv5mMwWRJMk+x9vBZwIoaU9DAAAAAAAAAA=" }, { - "cursor": "IOJkIrorXAODWH18HBIrPvmj/7xA3k8oQyVOYuBJ/FQ8DAAAAAAAAAA=" + "cursor": "IL4LyEqyfHaJp7x1F47HggXP5K/uTKM7JwRm7NYblBk+DAAAAAAAAAA=" }, { - "cursor": "IP/YY3sBms9tv6LOECqfoZ9YYyMPFwAH+CT+ReeP7XwTDAAAAAAAAAA=" + "cursor": "IOuXfIr/MFNZLw/UcBw1yb4Asy3a7l9mjzGLhiX0TNM2DAAAAAAAAAA=" } ] } @@ -738,33 +738,33 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6OSwiaSI6ZmFsc2V9", "node": { - "digest": "3Hnz1hLa3UGLRvyophw12hwhfmwnYpJM75fDuT6bWBEB", + "digest": "4HgxdMoiQdZbLrd7ycQ3csPtccNPvr9BZW67ykV7NRk6", "sender": { "objects": { "edges": [ { - "cursor": "IAZ41/7iWym3cIjIhB3ZxFQLOFHw0NJqy45zL9YZF+RRDAAAAAAAAAA=" + "cursor": "IADSYACaayWIeqSsYbYGygOHm+qGH85EWtI7FGVmu6jlDAAAAAAAAAA=" }, { - "cursor": "IAz2L92GTy3bRQokgdsccY5vfPuQK8KudYQMyh4Vf8+tDAAAAAAAAAA=" + "cursor": "IByRl+xjLSNEC4Q+Y0Few4xDVIcYyUxyZ4oe7WO63+sLDAAAAAAAAAA=" }, { - "cursor": "IBHX4D82A7/ZLerkJoHcZjVY/9QGa2PNThEMJ0i/xZhEDAAAAAAAAAA=" + "cursor": "IFStyAU4OS4HEIphwSJjArUsneR9JgYjXqrUZixEvrQuDAAAAAAAAAA=" }, { - "cursor": "IJ2oGY9DeOyhhxdX+ImgY+PjoaVS/HlyZ6cBqgyC9raADAAAAAAAAAA=" + "cursor": "IIBhlATYbPevAocg2y+ZqQu/SS+ryiQUhFJdTTaBb9XPDAAAAAAAAAA=" }, { - "cursor": "ILOePBMfcokYNUYE29o3P2z1pIVl9KzwnrR5str8lONtDAAAAAAAAAA=" + "cursor": "IIdbcBHo+WUMzya2grau6zYFD5ZlFX1HQH4pJXAOaRQ7DAAAAAAAAAA=" }, { - "cursor": "ILmCB8AzORD4eIKY+8uaJnvqM4zm8Qr80DTrrcy8OOBwDAAAAAAAAAA=" + "cursor": "IJFijS2QC5L0mgGDM8x75mv5mMwWRJMk+x9vBZwIoaU9DAAAAAAAAAA=" }, { - "cursor": "IOJkIrorXAODWH18HBIrPvmj/7xA3k8oQyVOYuBJ/FQ8DAAAAAAAAAA=" + "cursor": "IL4LyEqyfHaJp7x1F47HggXP5K/uTKM7JwRm7NYblBk+DAAAAAAAAAA=" }, { - "cursor": "IP/YY3sBms9tv6LOECqfoZ9YYyMPFwAH+CT+ReeP7XwTDAAAAAAAAAA=" + "cursor": "IOuXfIr/MFNZLw/UcBw1yb4Asy3a7l9mjzGLhiX0TNM2DAAAAAAAAAA=" } ] } @@ -774,33 +774,33 @@ Response: { { "cursor": "eyJjIjoxMiwidCI6MTAsImkiOmZhbHNlfQ", "node": { - "digest": "Bwx7M14Z3TTQ8HjJan4NpfTp9uab6zGZ1t3VyHexrkjY", + "digest": "d9yohmp3svrBRKZjbfv7Gn5TbCrmspbqis2wy76ES1M", "sender": { "objects": { "edges": [ { - "cursor": "IAZ41/7iWym3cIjIhB3ZxFQLOFHw0NJqy45zL9YZF+RRDAAAAAAAAAA=" + "cursor": "IADSYACaayWIeqSsYbYGygOHm+qGH85EWtI7FGVmu6jlDAAAAAAAAAA=" }, { - "cursor": "IAz2L92GTy3bRQokgdsccY5vfPuQK8KudYQMyh4Vf8+tDAAAAAAAAAA=" + "cursor": "IByRl+xjLSNEC4Q+Y0Few4xDVIcYyUxyZ4oe7WO63+sLDAAAAAAAAAA=" }, { - "cursor": "IBHX4D82A7/ZLerkJoHcZjVY/9QGa2PNThEMJ0i/xZhEDAAAAAAAAAA=" + "cursor": "IFStyAU4OS4HEIphwSJjArUsneR9JgYjXqrUZixEvrQuDAAAAAAAAAA=" }, { - "cursor": "IJ2oGY9DeOyhhxdX+ImgY+PjoaVS/HlyZ6cBqgyC9raADAAAAAAAAAA=" + "cursor": "IIBhlATYbPevAocg2y+ZqQu/SS+ryiQUhFJdTTaBb9XPDAAAAAAAAAA=" }, { - "cursor": "ILOePBMfcokYNUYE29o3P2z1pIVl9KzwnrR5str8lONtDAAAAAAAAAA=" + "cursor": "IIdbcBHo+WUMzya2grau6zYFD5ZlFX1HQH4pJXAOaRQ7DAAAAAAAAAA=" }, { - "cursor": "ILmCB8AzORD4eIKY+8uaJnvqM4zm8Qr80DTrrcy8OOBwDAAAAAAAAAA=" + "cursor": "IJFijS2QC5L0mgGDM8x75mv5mMwWRJMk+x9vBZwIoaU9DAAAAAAAAAA=" }, { - "cursor": "IOJkIrorXAODWH18HBIrPvmj/7xA3k8oQyVOYuBJ/FQ8DAAAAAAAAAA=" + "cursor": "IL4LyEqyfHaJp7x1F47HggXP5K/uTKM7JwRm7NYblBk+DAAAAAAAAAA=" }, { - "cursor": "IP/YY3sBms9tv6LOECqfoZ9YYyMPFwAH+CT+ReeP7XwTDAAAAAAAAAA=" + "cursor": "IOuXfIr/MFNZLw/UcBw1yb4Asy3a7l9mjzGLhiX0TNM2DAAAAAAAAAA=" } ] } diff --git a/crates/iota-graphql-e2e-tests/tests/consistency/object_at_version.exp b/crates/iota-graphql-e2e-tests/tests/consistency/object_at_version.exp index 4d9c6c85d40..9d554e7d4f5 100644 --- a/crates/iota-graphql-e2e-tests/tests/consistency/object_at_version.exp +++ b/crates/iota-graphql-e2e-tests/tests/consistency/object_at_version.exp @@ -29,7 +29,7 @@ Response: { "asMoveObject": { "contents": { "json": { - "id": "0xeabd1fec2bdf0127bb76f33a127372a8f49d362822878329073f6c09e827a375", + "id": "0x38a4c99d150ee4023f4ecd569c9c49c86c45a5d58bf9dda1355497eacacb7850", "value": "0" } } @@ -57,7 +57,7 @@ Response: { "asMoveObject": { "contents": { "json": { - "id": "0xeabd1fec2bdf0127bb76f33a127372a8f49d362822878329073f6c09e827a375", + "id": "0x38a4c99d150ee4023f4ecd569c9c49c86c45a5d58bf9dda1355497eacacb7850", "value": "1" } } @@ -69,7 +69,7 @@ Response: { "asMoveObject": { "contents": { "json": { - "id": "0xeabd1fec2bdf0127bb76f33a127372a8f49d362822878329073f6c09e827a375", + "id": "0x38a4c99d150ee4023f4ecd569c9c49c86c45a5d58bf9dda1355497eacacb7850", "value": "0" } } @@ -104,7 +104,7 @@ Response: { "asMoveObject": { "contents": { "json": { - "id": "0xeabd1fec2bdf0127bb76f33a127372a8f49d362822878329073f6c09e827a375", + "id": "0x38a4c99d150ee4023f4ecd569c9c49c86c45a5d58bf9dda1355497eacacb7850", "value": "1" } } @@ -134,7 +134,7 @@ Response: { "asMoveObject": { "contents": { "json": { - "id": "0xeabd1fec2bdf0127bb76f33a127372a8f49d362822878329073f6c09e827a375", + "id": "0x38a4c99d150ee4023f4ecd569c9c49c86c45a5d58bf9dda1355497eacacb7850", "value": "1" } } @@ -151,7 +151,7 @@ Response: { "asMoveObject": { "contents": { "json": { - "id": "0xeabd1fec2bdf0127bb76f33a127372a8f49d362822878329073f6c09e827a375", + "id": "0x38a4c99d150ee4023f4ecd569c9c49c86c45a5d58bf9dda1355497eacacb7850", "value": "0" } } @@ -205,7 +205,7 @@ Response: { "asMoveObject": { "contents": { "json": { - "id": "0xeabd1fec2bdf0127bb76f33a127372a8f49d362822878329073f6c09e827a375", + "id": "0x38a4c99d150ee4023f4ecd569c9c49c86c45a5d58bf9dda1355497eacacb7850", "value": "1" } } @@ -222,7 +222,7 @@ Response: { "asMoveObject": { "contents": { "json": { - "id": "0xeabd1fec2bdf0127bb76f33a127372a8f49d362822878329073f6c09e827a375", + "id": "0x38a4c99d150ee4023f4ecd569c9c49c86c45a5d58bf9dda1355497eacacb7850", "value": "0" } } diff --git a/crates/iota-graphql-e2e-tests/tests/consistency/objects_pagination.exp b/crates/iota-graphql-e2e-tests/tests/consistency/objects_pagination.exp index 416410d9990..c88584d2c19 100644 --- a/crates/iota-graphql-e2e-tests/tests/consistency/objects_pagination.exp +++ b/crates/iota-graphql-e2e-tests/tests/consistency/objects_pagination.exp @@ -36,10 +36,10 @@ Response: { "version": 4, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x4450c9a3c87cd72cc0fdf874dc80686c9f11bf7f830cbbf10bdb8c9d07229ddf", + "id": "0x4c94d3aa104e529fdf2ce54b0813332b0b587d5b36d04ec87a9776db93ae093a", "value": "1" } } @@ -80,10 +80,10 @@ Response: { "version": 4, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x4450c9a3c87cd72cc0fdf874dc80686c9f11bf7f830cbbf10bdb8c9d07229ddf", + "id": "0x4c94d3aa104e529fdf2ce54b0813332b0b587d5b36d04ec87a9776db93ae093a", "value": "1" } } @@ -105,50 +105,50 @@ Response: { "objects": { "nodes": [ { - "version": 3, + "version": 6, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x0258afe9337053eb70d2ea746669d74d210e99511518b6636a5e8658859769d8", - "value": "0" + "id": "0x0276236f1293f0797f2a9d85f4385dc166206d14963eb528a8f0cb82171e4a1c", + "value": "3" } } }, { - "version": 6, + "version": 3, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x36cd3155591495e28382976b4de50469e46276d04da364d81ab729b65354d043", - "value": "3" + "id": "0x239663104e1d8db2011e6eb4df325556361bbf73414d25d4545491d30b351666", + "value": "0" } } }, { - "version": 4, + "version": 5, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x4450c9a3c87cd72cc0fdf874dc80686c9f11bf7f830cbbf10bdb8c9d07229ddf", - "value": "1" + "id": "0x36f05b1d8a31406630118071eb1742dfc0c6283062b254d8e8e64d24320fd382", + "value": "2" } } }, { - "version": 5, + "version": 4, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0xfe2a855cb35f7b1dea804e23c02d0c78cc0cc933e41b9d2e320eb1b00d7d322e", - "value": "2" + "id": "0x4c94d3aa104e529fdf2ce54b0813332b0b587d5b36d04ec87a9776db93ae093a", + "value": "1" } } } @@ -166,50 +166,50 @@ Response: { "objects": { "nodes": [ { - "version": 3, + "version": 6, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x0258afe9337053eb70d2ea746669d74d210e99511518b6636a5e8658859769d8", - "value": "0" + "id": "0x0276236f1293f0797f2a9d85f4385dc166206d14963eb528a8f0cb82171e4a1c", + "value": "3" } } }, { - "version": 6, + "version": 3, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x36cd3155591495e28382976b4de50469e46276d04da364d81ab729b65354d043", - "value": "3" + "id": "0x239663104e1d8db2011e6eb4df325556361bbf73414d25d4545491d30b351666", + "value": "0" } } }, { - "version": 4, + "version": 5, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x4450c9a3c87cd72cc0fdf874dc80686c9f11bf7f830cbbf10bdb8c9d07229ddf", - "value": "1" + "id": "0x36f05b1d8a31406630118071eb1742dfc0c6283062b254d8e8e64d24320fd382", + "value": "2" } } }, { - "version": 5, + "version": 4, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0xfe2a855cb35f7b1dea804e23c02d0c78cc0cc933e41b9d2e320eb1b00d7d322e", - "value": "2" + "id": "0x4c94d3aa104e529fdf2ce54b0813332b0b587d5b36d04ec87a9776db93ae093a", + "value": "1" } } } @@ -235,48 +235,55 @@ Response: { "data": { "after_obj_6_0_at_checkpoint_2": { "objects": { - "nodes": [] - } - }, - "before_obj_6_0_at_checkpoint_2": { - "nodes": [ - { - "version": 3, - "asMoveObject": { + "nodes": [ + { + "version": 4, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x0258afe9337053eb70d2ea746669d74d210e99511518b6636a5e8658859769d8", - "value": "0" + "id": "0x4c94d3aa104e529fdf2ce54b0813332b0b587d5b36d04ec87a9776db93ae093a", + "value": "1" } }, - "note_that_owner_result_should_reflect_latest_state": { + "owner_at_latest_state_has_iota_only": { "owner": { "objects": { "nodes": [ + { + "version": 6, + "contents": { + "type": { + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" + }, + "json": { + "id": "0x0276236f1293f0797f2a9d85f4385dc166206d14963eb528a8f0cb82171e4a1c", + "value": "3" + } + } + }, { "version": 3, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x0258afe9337053eb70d2ea746669d74d210e99511518b6636a5e8658859769d8", + "id": "0x239663104e1d8db2011e6eb4df325556361bbf73414d25d4545491d30b351666", "value": "0" } } }, { - "version": 6, + "version": 5, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x36cd3155591495e28382976b4de50469e46276d04da364d81ab729b65354d043", - "value": "3" + "id": "0x36f05b1d8a31406630118071eb1742dfc0c6283062b254d8e8e64d24320fd382", + "value": "2" } } }, @@ -284,10 +291,10 @@ Response: { "version": 4, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x4450c9a3c87cd72cc0fdf874dc80686c9f11bf7f830cbbf10bdb8c9d07229ddf", + "id": "0x4c94d3aa104e529fdf2ce54b0813332b0b587d5b36d04ec87a9776db93ae093a", "value": "1" } } @@ -299,40 +306,32 @@ Response: { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::iota::IOTA>" }, "json": { - "id": "0x9da8198f4378eca1871757f889a063e3e3a1a552fc797267a701aa0c82f6b680", + "id": "0x875b7011e8f9650ccf26b682b6aeeb36050f9665157d47407e2925700e69143b", "balance": { "value": "300000000000000" } } } - }, - { - "version": 5, - "contents": { - "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" - }, - "json": { - "id": "0xfe2a855cb35f7b1dea804e23c02d0c78cc0cc933e41b9d2e320eb1b00d7d322e", - "value": "2" - } - } } ] } } } } - }, + ] + } + }, + "before_obj_6_0_at_checkpoint_2": { + "nodes": [ { "version": 6, "asMoveObject": { "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x36cd3155591495e28382976b4de50469e46276d04da364d81ab729b65354d043", + "id": "0x0276236f1293f0797f2a9d85f4385dc166206d14963eb528a8f0cb82171e4a1c", "value": "3" } }, @@ -340,27 +339,39 @@ Response: { "owner": { "objects": { "nodes": [ + { + "version": 6, + "contents": { + "type": { + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" + }, + "json": { + "id": "0x0276236f1293f0797f2a9d85f4385dc166206d14963eb528a8f0cb82171e4a1c", + "value": "3" + } + } + }, { "version": 3, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x0258afe9337053eb70d2ea746669d74d210e99511518b6636a5e8658859769d8", + "id": "0x239663104e1d8db2011e6eb4df325556361bbf73414d25d4545491d30b351666", "value": "0" } } }, { - "version": 6, + "version": 5, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x36cd3155591495e28382976b4de50469e46276d04da364d81ab729b65354d043", - "value": "3" + "id": "0x36f05b1d8a31406630118071eb1742dfc0c6283062b254d8e8e64d24320fd382", + "value": "2" } } }, @@ -368,10 +379,10 @@ Response: { "version": 4, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x4450c9a3c87cd72cc0fdf874dc80686c9f11bf7f830cbbf10bdb8c9d07229ddf", + "id": "0x4c94d3aa104e529fdf2ce54b0813332b0b587d5b36d04ec87a9776db93ae093a", "value": "1" } } @@ -383,24 +394,12 @@ Response: { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::iota::IOTA>" }, "json": { - "id": "0x9da8198f4378eca1871757f889a063e3e3a1a552fc797267a701aa0c82f6b680", + "id": "0x875b7011e8f9650ccf26b682b6aeeb36050f9665157d47407e2925700e69143b", "balance": { "value": "300000000000000" } } } - }, - { - "version": 5, - "contents": { - "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" - }, - "json": { - "id": "0xfe2a855cb35f7b1dea804e23c02d0c78cc0cc933e41b9d2e320eb1b00d7d322e", - "value": "2" - } - } } ] } @@ -409,42 +408,54 @@ Response: { } }, { - "version": 4, + "version": 3, "asMoveObject": { "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x4450c9a3c87cd72cc0fdf874dc80686c9f11bf7f830cbbf10bdb8c9d07229ddf", - "value": "1" + "id": "0x239663104e1d8db2011e6eb4df325556361bbf73414d25d4545491d30b351666", + "value": "0" } }, "note_that_owner_result_should_reflect_latest_state": { "owner": { "objects": { "nodes": [ + { + "version": 6, + "contents": { + "type": { + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" + }, + "json": { + "id": "0x0276236f1293f0797f2a9d85f4385dc166206d14963eb528a8f0cb82171e4a1c", + "value": "3" + } + } + }, { "version": 3, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x0258afe9337053eb70d2ea746669d74d210e99511518b6636a5e8658859769d8", + "id": "0x239663104e1d8db2011e6eb4df325556361bbf73414d25d4545491d30b351666", "value": "0" } } }, { - "version": 6, + "version": 5, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x36cd3155591495e28382976b4de50469e46276d04da364d81ab729b65354d043", - "value": "3" + "id": "0x36f05b1d8a31406630118071eb1742dfc0c6283062b254d8e8e64d24320fd382", + "value": "2" } } }, @@ -452,10 +463,10 @@ Response: { "version": 4, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x4450c9a3c87cd72cc0fdf874dc80686c9f11bf7f830cbbf10bdb8c9d07229ddf", + "id": "0x4c94d3aa104e529fdf2ce54b0813332b0b587d5b36d04ec87a9776db93ae093a", "value": "1" } } @@ -467,24 +478,12 @@ Response: { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::iota::IOTA>" }, "json": { - "id": "0x9da8198f4378eca1871757f889a063e3e3a1a552fc797267a701aa0c82f6b680", + "id": "0x875b7011e8f9650ccf26b682b6aeeb36050f9665157d47407e2925700e69143b", "balance": { "value": "300000000000000" } } } - }, - { - "version": 5, - "contents": { - "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" - }, - "json": { - "id": "0xfe2a855cb35f7b1dea804e23c02d0c78cc0cc933e41b9d2e320eb1b00d7d322e", - "value": "2" - } - } } ] } @@ -547,11 +546,11 @@ Response: { "version": 7, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x0258afe9337053eb70d2ea746669d74d210e99511518b6636a5e8658859769d8", - "value": "0" + "id": "0x0276236f1293f0797f2a9d85f4385dc166206d14963eb528a8f0cb82171e4a1c", + "value": "3" } } }, @@ -559,11 +558,11 @@ Response: { "version": 7, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x36cd3155591495e28382976b4de50469e46276d04da364d81ab729b65354d043", - "value": "3" + "id": "0x239663104e1d8db2011e6eb4df325556361bbf73414d25d4545491d30b351666", + "value": "0" } } }, @@ -571,11 +570,11 @@ Response: { "version": 7, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x4450c9a3c87cd72cc0fdf874dc80686c9f11bf7f830cbbf10bdb8c9d07229ddf", - "value": "1" + "id": "0x36f05b1d8a31406630118071eb1742dfc0c6283062b254d8e8e64d24320fd382", + "value": "2" } } }, @@ -583,11 +582,11 @@ Response: { "version": 7, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0xfe2a855cb35f7b1dea804e23c02d0c78cc0cc933e41b9d2e320eb1b00d7d322e", - "value": "2" + "id": "0x4c94d3aa104e529fdf2ce54b0813332b0b587d5b36d04ec87a9776db93ae093a", + "value": "1" } } } @@ -605,50 +604,50 @@ Response: { "objects": { "nodes": [ { - "version": 3, + "version": 6, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x0258afe9337053eb70d2ea746669d74d210e99511518b6636a5e8658859769d8", - "value": "0" + "id": "0x0276236f1293f0797f2a9d85f4385dc166206d14963eb528a8f0cb82171e4a1c", + "value": "3" } } }, { - "version": 6, + "version": 3, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x36cd3155591495e28382976b4de50469e46276d04da364d81ab729b65354d043", - "value": "3" + "id": "0x239663104e1d8db2011e6eb4df325556361bbf73414d25d4545491d30b351666", + "value": "0" } } }, { - "version": 4, + "version": 5, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0x4450c9a3c87cd72cc0fdf874dc80686c9f11bf7f830cbbf10bdb8c9d07229ddf", - "value": "1" + "id": "0x36f05b1d8a31406630118071eb1742dfc0c6283062b254d8e8e64d24320fd382", + "value": "2" } } }, { - "version": 5, + "version": 4, "contents": { "type": { - "repr": "0xe60791b8245c8890ebcd25d12a451ea681dd47c384c048a6ccb29ade8a29c2ae::M1::Object" + "repr": "0xa9cbee3dea1fbcfbc892ff3689f58dc1620558f5f31f6cd3e2b75010e2df732c::M1::Object" }, "json": { - "id": "0xfe2a855cb35f7b1dea804e23c02d0c78cc0cc933e41b9d2e320eb1b00d7d322e", - "value": "2" + "id": "0x4c94d3aa104e529fdf2ce54b0813332b0b587d5b36d04ec87a9776db93ae093a", + "value": "1" } } } diff --git a/crates/iota-graphql-e2e-tests/tests/consistency/objects_pagination_single.exp b/crates/iota-graphql-e2e-tests/tests/consistency/objects_pagination_single.exp index 5ba87a871df..d71ecb2f586 100644 --- a/crates/iota-graphql-e2e-tests/tests/consistency/objects_pagination_single.exp +++ b/crates/iota-graphql-e2e-tests/tests/consistency/objects_pagination_single.exp @@ -35,27 +35,27 @@ task 6, lines 38-66: Response: { "data": { "after_obj_3_0": { + "objects": { + "nodes": [] + } + }, + "before_obj_3_0": { "objects": { "nodes": [ { "version": 4, "contents": { "type": { - "repr": "0xf349599494469367ef732c17778cbdb8c9cb1b60e022b80bbcf61cb4897d2cc9::M1::Object" + "repr": "0x9a9f3049a8b227506cd1f5b7dbd3dd0aa91af7f3a23e25ae4d189bd2e113be7e::M1::Object" }, "json": { - "id": "0xc7889c8f4e5c2853d7e18f916c8d795728086b5899a4b17278978ebd741cd442", + "id": "0x17955f8b7d4669db399762e0f49286537d4b5cc715d098b704975cde14330807", "value": "100" } } } ] } - }, - "before_obj_3_0": { - "objects": { - "nodes": [] - } } } } @@ -74,27 +74,27 @@ task 9, lines 72-101: Response: { "data": { "after_obj_3_0_chkpt_1": { + "objects": { + "nodes": [] + } + }, + "before_obj_3_0_chkpt_1": { "objects": { "nodes": [ { "version": 4, "contents": { "type": { - "repr": "0xf349599494469367ef732c17778cbdb8c9cb1b60e022b80bbcf61cb4897d2cc9::M1::Object" + "repr": "0x9a9f3049a8b227506cd1f5b7dbd3dd0aa91af7f3a23e25ae4d189bd2e113be7e::M1::Object" }, "json": { - "id": "0xc7889c8f4e5c2853d7e18f916c8d795728086b5899a4b17278978ebd741cd442", + "id": "0x17955f8b7d4669db399762e0f49286537d4b5cc715d098b704975cde14330807", "value": "100" } } } ] } - }, - "before_obj_3_0_chkpt_1": { - "objects": { - "nodes": [] - } } } } @@ -107,26 +107,26 @@ Response: { "objects": { "nodes": [ { - "version": 4, + "version": 5, "contents": { "type": { - "repr": "0xf349599494469367ef732c17778cbdb8c9cb1b60e022b80bbcf61cb4897d2cc9::M1::Object" + "repr": "0x9a9f3049a8b227506cd1f5b7dbd3dd0aa91af7f3a23e25ae4d189bd2e113be7e::M1::Object" }, "json": { - "id": "0x7fd1be44922c6465d05261081f228a98883cdbebdc610b372894d5eedac04af6", - "value": "1" + "id": "0x17955f8b7d4669db399762e0f49286537d4b5cc715d098b704975cde14330807", + "value": "200" } } }, { - "version": 5, + "version": 4, "contents": { "type": { - "repr": "0xf349599494469367ef732c17778cbdb8c9cb1b60e022b80bbcf61cb4897d2cc9::M1::Object" + "repr": "0x9a9f3049a8b227506cd1f5b7dbd3dd0aa91af7f3a23e25ae4d189bd2e113be7e::M1::Object" }, "json": { - "id": "0xc7889c8f4e5c2853d7e18f916c8d795728086b5899a4b17278978ebd741cd442", - "value": "200" + "id": "0xd7532dbf3fb07f34f65015771ec654b90c30249994723242054b88f36bd177d3", + "value": "1" } } } @@ -134,16 +134,21 @@ Response: { } }, "after_obj_3_0_chkpt_2": { + "consistent_with_above": { + "nodes": [] + } + }, + "before_obj_3_0_chkpt_2": { "consistent_with_above": { "nodes": [ { "version": 5, "contents": { "type": { - "repr": "0xf349599494469367ef732c17778cbdb8c9cb1b60e022b80bbcf61cb4897d2cc9::M1::Object" + "repr": "0x9a9f3049a8b227506cd1f5b7dbd3dd0aa91af7f3a23e25ae4d189bd2e113be7e::M1::Object" }, "json": { - "id": "0xc7889c8f4e5c2853d7e18f916c8d795728086b5899a4b17278978ebd741cd442", + "id": "0x17955f8b7d4669db399762e0f49286537d4b5cc715d098b704975cde14330807", "value": "200" } }, @@ -152,26 +157,26 @@ Response: { "objects": { "nodes": [ { - "version": 4, + "version": 5, "contents": { "type": { - "repr": "0xf349599494469367ef732c17778cbdb8c9cb1b60e022b80bbcf61cb4897d2cc9::M1::Object" + "repr": "0x9a9f3049a8b227506cd1f5b7dbd3dd0aa91af7f3a23e25ae4d189bd2e113be7e::M1::Object" }, "json": { - "id": "0x7fd1be44922c6465d05261081f228a98883cdbebdc610b372894d5eedac04af6", - "value": "1" + "id": "0x17955f8b7d4669db399762e0f49286537d4b5cc715d098b704975cde14330807", + "value": "200" } } }, { - "version": 5, + "version": 4, "contents": { "type": { - "repr": "0xf349599494469367ef732c17778cbdb8c9cb1b60e022b80bbcf61cb4897d2cc9::M1::Object" + "repr": "0x9a9f3049a8b227506cd1f5b7dbd3dd0aa91af7f3a23e25ae4d189bd2e113be7e::M1::Object" }, "json": { - "id": "0xc7889c8f4e5c2853d7e18f916c8d795728086b5899a4b17278978ebd741cd442", - "value": "200" + "id": "0xd7532dbf3fb07f34f65015771ec654b90c30249994723242054b88f36bd177d3", + "value": "1" } } } @@ -182,11 +187,6 @@ Response: { } ] } - }, - "before_obj_3_0_chkpt_2": { - "consistent_with_above": { - "nodes": [] - } } } } @@ -205,16 +205,21 @@ task 13, lines 184-247: Response: { "data": { "after_obj_3_0_chkpt_2": { + "objects": { + "nodes": [] + } + }, + "before_obj_3_0_chkpt_2": { "objects": { "nodes": [ { "version": 5, "contents": { "type": { - "repr": "0xf349599494469367ef732c17778cbdb8c9cb1b60e022b80bbcf61cb4897d2cc9::M1::Object" + "repr": "0x9a9f3049a8b227506cd1f5b7dbd3dd0aa91af7f3a23e25ae4d189bd2e113be7e::M1::Object" }, "json": { - "id": "0xc7889c8f4e5c2853d7e18f916c8d795728086b5899a4b17278978ebd741cd442", + "id": "0x17955f8b7d4669db399762e0f49286537d4b5cc715d098b704975cde14330807", "value": "200" } }, @@ -223,26 +228,26 @@ Response: { "objects": { "nodes": [ { - "version": 4, + "version": 5, "contents": { "type": { - "repr": "0xf349599494469367ef732c17778cbdb8c9cb1b60e022b80bbcf61cb4897d2cc9::M1::Object" + "repr": "0x9a9f3049a8b227506cd1f5b7dbd3dd0aa91af7f3a23e25ae4d189bd2e113be7e::M1::Object" }, "json": { - "id": "0x7fd1be44922c6465d05261081f228a98883cdbebdc610b372894d5eedac04af6", - "value": "1" + "id": "0x17955f8b7d4669db399762e0f49286537d4b5cc715d098b704975cde14330807", + "value": "200" } } }, { - "version": 5, + "version": 4, "contents": { "type": { - "repr": "0xf349599494469367ef732c17778cbdb8c9cb1b60e022b80bbcf61cb4897d2cc9::M1::Object" + "repr": "0x9a9f3049a8b227506cd1f5b7dbd3dd0aa91af7f3a23e25ae4d189bd2e113be7e::M1::Object" }, "json": { - "id": "0xc7889c8f4e5c2853d7e18f916c8d795728086b5899a4b17278978ebd741cd442", - "value": "200" + "id": "0xd7532dbf3fb07f34f65015771ec654b90c30249994723242054b88f36bd177d3", + "value": "1" } } } @@ -253,11 +258,6 @@ Response: { } ] } - }, - "before_obj_3_0_chkpt_2": { - "objects": { - "nodes": [] - } } } } @@ -270,26 +270,26 @@ Response: { "objects": { "nodes": [ { - "version": 6, + "version": 5, "contents": { "type": { - "repr": "0xf349599494469367ef732c17778cbdb8c9cb1b60e022b80bbcf61cb4897d2cc9::M1::Object" + "repr": "0x9a9f3049a8b227506cd1f5b7dbd3dd0aa91af7f3a23e25ae4d189bd2e113be7e::M1::Object" }, "json": { - "id": "0x7fd1be44922c6465d05261081f228a98883cdbebdc610b372894d5eedac04af6", - "value": "300" + "id": "0x17955f8b7d4669db399762e0f49286537d4b5cc715d098b704975cde14330807", + "value": "200" } } }, { - "version": 5, + "version": 6, "contents": { "type": { - "repr": "0xf349599494469367ef732c17778cbdb8c9cb1b60e022b80bbcf61cb4897d2cc9::M1::Object" + "repr": "0x9a9f3049a8b227506cd1f5b7dbd3dd0aa91af7f3a23e25ae4d189bd2e113be7e::M1::Object" }, "json": { - "id": "0xc7889c8f4e5c2853d7e18f916c8d795728086b5899a4b17278978ebd741cd442", - "value": "200" + "id": "0xd7532dbf3fb07f34f65015771ec654b90c30249994723242054b88f36bd177d3", + "value": "300" } } } @@ -297,16 +297,21 @@ Response: { } }, "after_obj_3_0_chkpt_3": { + "consistent_with_above": { + "nodes": [] + } + }, + "before_obj_3_0_chkpt_3": { "consistent_with_above": { "nodes": [ { "version": 5, "contents": { "type": { - "repr": "0xf349599494469367ef732c17778cbdb8c9cb1b60e022b80bbcf61cb4897d2cc9::M1::Object" + "repr": "0x9a9f3049a8b227506cd1f5b7dbd3dd0aa91af7f3a23e25ae4d189bd2e113be7e::M1::Object" }, "json": { - "id": "0xc7889c8f4e5c2853d7e18f916c8d795728086b5899a4b17278978ebd741cd442", + "id": "0x17955f8b7d4669db399762e0f49286537d4b5cc715d098b704975cde14330807", "value": "200" } }, @@ -315,26 +320,26 @@ Response: { "objects": { "nodes": [ { - "version": 6, + "version": 5, "contents": { "type": { - "repr": "0xf349599494469367ef732c17778cbdb8c9cb1b60e022b80bbcf61cb4897d2cc9::M1::Object" + "repr": "0x9a9f3049a8b227506cd1f5b7dbd3dd0aa91af7f3a23e25ae4d189bd2e113be7e::M1::Object" }, "json": { - "id": "0x7fd1be44922c6465d05261081f228a98883cdbebdc610b372894d5eedac04af6", - "value": "300" + "id": "0x17955f8b7d4669db399762e0f49286537d4b5cc715d098b704975cde14330807", + "value": "200" } } }, { - "version": 5, + "version": 6, "contents": { "type": { - "repr": "0xf349599494469367ef732c17778cbdb8c9cb1b60e022b80bbcf61cb4897d2cc9::M1::Object" + "repr": "0x9a9f3049a8b227506cd1f5b7dbd3dd0aa91af7f3a23e25ae4d189bd2e113be7e::M1::Object" }, "json": { - "id": "0xc7889c8f4e5c2853d7e18f916c8d795728086b5899a4b17278978ebd741cd442", - "value": "200" + "id": "0xd7532dbf3fb07f34f65015771ec654b90c30249994723242054b88f36bd177d3", + "value": "300" } } } @@ -345,11 +350,6 @@ Response: { } ] } - }, - "before_obj_3_0_chkpt_3": { - "consistent_with_above": { - "nodes": [] - } } } } diff --git a/crates/iota-graphql-e2e-tests/tests/consistency/performance/many_objects.exp b/crates/iota-graphql-e2e-tests/tests/consistency/performance/many_objects.exp index 7821d35e5db..51fd00a74af 100644 --- a/crates/iota-graphql-e2e-tests/tests/consistency/performance/many_objects.exp +++ b/crates/iota-graphql-e2e-tests/tests/consistency/performance/many_objects.exp @@ -35,11 +35,11 @@ Response: { }, "contents": { "json": { - "id": "0xff6b496dbf122382b17c1b1ec2510feb9ec51241aa2c924e3721ed1771eb66ed", - "value": "330" + "id": "0xfec432cac95eff36e85cb215430943ddc198ae47b8a22e325c1dcc542363b0a7", + "value": "222" }, "type": { - "repr": "0x2f820bef796e15cafaeb819be9f7dd2d7847e5cd9d6353a96c3a6018d4f2d249::M1::Object" + "repr": "0xe3ea63728974cf03f1366718b6d9d3d3d8450e811ea17a4f77209e4b077a4423::M1::Object" } } } @@ -54,11 +54,11 @@ Response: { }, "contents": { "json": { - "id": "0xffbe9379a37c07fd73150d9e48e007c6654c6443436af64924c6ba6a284735d1", - "value": "307" + "id": "0xff9cd28672a00578a487ca017d55899a9d2bffe395546d4986e3d98251c8bc2b", + "value": "351" }, "type": { - "repr": "0x2f820bef796e15cafaeb819be9f7dd2d7847e5cd9d6353a96c3a6018d4f2d249::M1::Object" + "repr": "0xe3ea63728974cf03f1366718b6d9d3d3d8450e811ea17a4f77209e4b077a4423::M1::Object" } } } @@ -76,11 +76,11 @@ Response: { }, "contents": { "json": { - "id": "0xfe476a6a9382017f454d5954d8e1f4dab2548eca7dfd30d3a2b68759f857de57", - "value": "432" + "id": "0xfe513f99daeb9c6a48fac0f0cf25b99a30f6011207ce0608495d5532a5e44b14", + "value": "259" }, "type": { - "repr": "0x2f820bef796e15cafaeb819be9f7dd2d7847e5cd9d6353a96c3a6018d4f2d249::M1::Object" + "repr": "0xe3ea63728974cf03f1366718b6d9d3d3d8450e811ea17a4f77209e4b077a4423::M1::Object" } } }, @@ -92,11 +92,11 @@ Response: { }, "contents": { "json": { - "id": "0xfe96c7d99c112324b14e1ba80a70401c4d332f7c713550e2ffbcebc864c656a5", - "value": "253" + "id": "0xfec21d038be0759da9ac70f793a5f4cd8de5e5c84bb1f731fead162a30959cd6", + "value": "299" }, "type": { - "repr": "0x2f820bef796e15cafaeb819be9f7dd2d7847e5cd9d6353a96c3a6018d4f2d249::M1::Object" + "repr": "0xe3ea63728974cf03f1366718b6d9d3d3d8450e811ea17a4f77209e4b077a4423::M1::Object" } } }, @@ -108,11 +108,11 @@ Response: { }, "contents": { "json": { - "id": "0xff6b496dbf122382b17c1b1ec2510feb9ec51241aa2c924e3721ed1771eb66ed", - "value": "330" + "id": "0xfec432cac95eff36e85cb215430943ddc198ae47b8a22e325c1dcc542363b0a7", + "value": "222" }, "type": { - "repr": "0x2f820bef796e15cafaeb819be9f7dd2d7847e5cd9d6353a96c3a6018d4f2d249::M1::Object" + "repr": "0xe3ea63728974cf03f1366718b6d9d3d3d8450e811ea17a4f77209e4b077a4423::M1::Object" } } }, @@ -124,11 +124,11 @@ Response: { }, "contents": { "json": { - "id": "0xffbe9379a37c07fd73150d9e48e007c6654c6443436af64924c6ba6a284735d1", - "value": "307" + "id": "0xff9cd28672a00578a487ca017d55899a9d2bffe395546d4986e3d98251c8bc2b", + "value": "351" }, "type": { - "repr": "0x2f820bef796e15cafaeb819be9f7dd2d7847e5cd9d6353a96c3a6018d4f2d249::M1::Object" + "repr": "0xe3ea63728974cf03f1366718b6d9d3d3d8450e811ea17a4f77209e4b077a4423::M1::Object" } } } @@ -163,7 +163,7 @@ Contents: Test::M1::Object { bytes: fake(2,498), }, }, - value: 330u64, + value: 222u64, } task 9, line 93: @@ -176,7 +176,7 @@ Contents: Test::M1::Object { bytes: fake(2,497), }, }, - value: 253u64, + value: 299u64, } task 10, line 95: @@ -199,11 +199,11 @@ Response: { }, "contents": { "json": { - "id": "0xfe96c7d99c112324b14e1ba80a70401c4d332f7c713550e2ffbcebc864c656a5", - "value": "253" + "id": "0xfec21d038be0759da9ac70f793a5f4cd8de5e5c84bb1f731fead162a30959cd6", + "value": "299" }, "type": { - "repr": "0x2f820bef796e15cafaeb819be9f7dd2d7847e5cd9d6353a96c3a6018d4f2d249::M1::Object" + "repr": "0xe3ea63728974cf03f1366718b6d9d3d3d8450e811ea17a4f77209e4b077a4423::M1::Object" } } } @@ -218,11 +218,11 @@ Response: { }, "contents": { "json": { - "id": "0xff6b496dbf122382b17c1b1ec2510feb9ec51241aa2c924e3721ed1771eb66ed", - "value": "330" + "id": "0xfec432cac95eff36e85cb215430943ddc198ae47b8a22e325c1dcc542363b0a7", + "value": "222" }, "type": { - "repr": "0x2f820bef796e15cafaeb819be9f7dd2d7847e5cd9d6353a96c3a6018d4f2d249::M1::Object" + "repr": "0xe3ea63728974cf03f1366718b6d9d3d3d8450e811ea17a4f77209e4b077a4423::M1::Object" } } } @@ -237,11 +237,11 @@ Response: { }, "contents": { "json": { - "id": "0xffbe9379a37c07fd73150d9e48e007c6654c6443436af64924c6ba6a284735d1", - "value": "307" + "id": "0xff9cd28672a00578a487ca017d55899a9d2bffe395546d4986e3d98251c8bc2b", + "value": "351" }, "type": { - "repr": "0x2f820bef796e15cafaeb819be9f7dd2d7847e5cd9d6353a96c3a6018d4f2d249::M1::Object" + "repr": "0xe3ea63728974cf03f1366718b6d9d3d3d8450e811ea17a4f77209e4b077a4423::M1::Object" } } } @@ -260,11 +260,11 @@ Response: { }, "contents": { "json": { - "id": "0xfe476a6a9382017f454d5954d8e1f4dab2548eca7dfd30d3a2b68759f857de57", - "value": "432" + "id": "0xfe513f99daeb9c6a48fac0f0cf25b99a30f6011207ce0608495d5532a5e44b14", + "value": "259" }, "type": { - "repr": "0x2f820bef796e15cafaeb819be9f7dd2d7847e5cd9d6353a96c3a6018d4f2d249::M1::Object" + "repr": "0xe3ea63728974cf03f1366718b6d9d3d3d8450e811ea17a4f77209e4b077a4423::M1::Object" } } } @@ -287,11 +287,11 @@ Response: { }, "contents": { "json": { - "id": "0xffbe9379a37c07fd73150d9e48e007c6654c6443436af64924c6ba6a284735d1", - "value": "307" + "id": "0xff9cd28672a00578a487ca017d55899a9d2bffe395546d4986e3d98251c8bc2b", + "value": "351" }, "type": { - "repr": "0x2f820bef796e15cafaeb819be9f7dd2d7847e5cd9d6353a96c3a6018d4f2d249::M1::Object" + "repr": "0xe3ea63728974cf03f1366718b6d9d3d3d8450e811ea17a4f77209e4b077a4423::M1::Object" } } } @@ -305,11 +305,11 @@ Response: { }, "contents": { "json": { - "id": "0xffbe9379a37c07fd73150d9e48e007c6654c6443436af64924c6ba6a284735d1", - "value": "307" + "id": "0xff9cd28672a00578a487ca017d55899a9d2bffe395546d4986e3d98251c8bc2b", + "value": "351" }, "type": { - "repr": "0x2f820bef796e15cafaeb819be9f7dd2d7847e5cd9d6353a96c3a6018d4f2d249::M1::Object" + "repr": "0xe3ea63728974cf03f1366718b6d9d3d3d8450e811ea17a4f77209e4b077a4423::M1::Object" } } } @@ -325,11 +325,11 @@ Response: { }, "contents": { "json": { - "id": "0xfe96c7d99c112324b14e1ba80a70401c4d332f7c713550e2ffbcebc864c656a5", - "value": "253" + "id": "0xfec21d038be0759da9ac70f793a5f4cd8de5e5c84bb1f731fead162a30959cd6", + "value": "299" }, "type": { - "repr": "0x2f820bef796e15cafaeb819be9f7dd2d7847e5cd9d6353a96c3a6018d4f2d249::M1::Object" + "repr": "0xe3ea63728974cf03f1366718b6d9d3d3d8450e811ea17a4f77209e4b077a4423::M1::Object" } } } @@ -343,11 +343,11 @@ Response: { }, "contents": { "json": { - "id": "0xff6b496dbf122382b17c1b1ec2510feb9ec51241aa2c924e3721ed1771eb66ed", - "value": "330" + "id": "0xfec432cac95eff36e85cb215430943ddc198ae47b8a22e325c1dcc542363b0a7", + "value": "222" }, "type": { - "repr": "0x2f820bef796e15cafaeb819be9f7dd2d7847e5cd9d6353a96c3a6018d4f2d249::M1::Object" + "repr": "0xe3ea63728974cf03f1366718b6d9d3d3d8450e811ea17a4f77209e4b077a4423::M1::Object" } } } @@ -361,11 +361,11 @@ Response: { }, "contents": { "json": { - "id": "0xffbe9379a37c07fd73150d9e48e007c6654c6443436af64924c6ba6a284735d1", - "value": "307" + "id": "0xff9cd28672a00578a487ca017d55899a9d2bffe395546d4986e3d98251c8bc2b", + "value": "351" }, "type": { - "repr": "0x2f820bef796e15cafaeb819be9f7dd2d7847e5cd9d6353a96c3a6018d4f2d249::M1::Object" + "repr": "0xe3ea63728974cf03f1366718b6d9d3d3d8450e811ea17a4f77209e4b077a4423::M1::Object" } } } @@ -383,11 +383,11 @@ Response: { }, "contents": { "json": { - "id": "0xfe96c7d99c112324b14e1ba80a70401c4d332f7c713550e2ffbcebc864c656a5", - "value": "253" + "id": "0xfec21d038be0759da9ac70f793a5f4cd8de5e5c84bb1f731fead162a30959cd6", + "value": "299" }, "type": { - "repr": "0x2f820bef796e15cafaeb819be9f7dd2d7847e5cd9d6353a96c3a6018d4f2d249::M1::Object" + "repr": "0xe3ea63728974cf03f1366718b6d9d3d3d8450e811ea17a4f77209e4b077a4423::M1::Object" } } } @@ -401,11 +401,11 @@ Response: { }, "contents": { "json": { - "id": "0xff6b496dbf122382b17c1b1ec2510feb9ec51241aa2c924e3721ed1771eb66ed", - "value": "330" + "id": "0xfec432cac95eff36e85cb215430943ddc198ae47b8a22e325c1dcc542363b0a7", + "value": "222" }, "type": { - "repr": "0x2f820bef796e15cafaeb819be9f7dd2d7847e5cd9d6353a96c3a6018d4f2d249::M1::Object" + "repr": "0xe3ea63728974cf03f1366718b6d9d3d3d8450e811ea17a4f77209e4b077a4423::M1::Object" } } } @@ -419,11 +419,11 @@ Response: { }, "contents": { "json": { - "id": "0xffbe9379a37c07fd73150d9e48e007c6654c6443436af64924c6ba6a284735d1", - "value": "307" + "id": "0xff9cd28672a00578a487ca017d55899a9d2bffe395546d4986e3d98251c8bc2b", + "value": "351" }, "type": { - "repr": "0x2f820bef796e15cafaeb819be9f7dd2d7847e5cd9d6353a96c3a6018d4f2d249::M1::Object" + "repr": "0xe3ea63728974cf03f1366718b6d9d3d3d8450e811ea17a4f77209e4b077a4423::M1::Object" } } } @@ -442,7 +442,7 @@ Response: { }, "contents": { "json": { - "id": "0x9dbc88f03fbfa51b5ad6898b36d9184473d05f1b0d30333c535d0fcb4d49b994", + "id": "0x12458bdc1e04395483544cf98ec61de64bc9e2bf11bf8cc09121c266e151f623", "balance": { "value": "300000000000000" } @@ -461,11 +461,11 @@ Response: { }, "contents": { "json": { - "id": "0xfe96c7d99c112324b14e1ba80a70401c4d332f7c713550e2ffbcebc864c656a5", - "value": "253" + "id": "0xfec21d038be0759da9ac70f793a5f4cd8de5e5c84bb1f731fead162a30959cd6", + "value": "299" }, "type": { - "repr": "0x2f820bef796e15cafaeb819be9f7dd2d7847e5cd9d6353a96c3a6018d4f2d249::M1::Object" + "repr": "0xe3ea63728974cf03f1366718b6d9d3d3d8450e811ea17a4f77209e4b077a4423::M1::Object" } } }, @@ -478,11 +478,11 @@ Response: { }, "contents": { "json": { - "id": "0xff6b496dbf122382b17c1b1ec2510feb9ec51241aa2c924e3721ed1771eb66ed", - "value": "330" + "id": "0xfec432cac95eff36e85cb215430943ddc198ae47b8a22e325c1dcc542363b0a7", + "value": "222" }, "type": { - "repr": "0x2f820bef796e15cafaeb819be9f7dd2d7847e5cd9d6353a96c3a6018d4f2d249::M1::Object" + "repr": "0xe3ea63728974cf03f1366718b6d9d3d3d8450e811ea17a4f77209e4b077a4423::M1::Object" } } }, @@ -495,11 +495,11 @@ Response: { }, "contents": { "json": { - "id": "0xffbe9379a37c07fd73150d9e48e007c6654c6443436af64924c6ba6a284735d1", - "value": "307" + "id": "0xff9cd28672a00578a487ca017d55899a9d2bffe395546d4986e3d98251c8bc2b", + "value": "351" }, "type": { - "repr": "0x2f820bef796e15cafaeb819be9f7dd2d7847e5cd9d6353a96c3a6018d4f2d249::M1::Object" + "repr": "0xe3ea63728974cf03f1366718b6d9d3d3d8450e811ea17a4f77209e4b077a4423::M1::Object" } } } diff --git a/crates/iota-graphql-e2e-tests/tests/consistency/staked_iota.exp b/crates/iota-graphql-e2e-tests/tests/consistency/staked_iota.exp index 3b7ce5ddb4d..01f804555e1 100644 --- a/crates/iota-graphql-e2e-tests/tests/consistency/staked_iota.exp +++ b/crates/iota-graphql-e2e-tests/tests/consistency/staked_iota.exp @@ -25,7 +25,7 @@ gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: task 3, line 25: //# run 0x3::iota_system::request_add_stake --args object(0x5) object(2,0) @validator_0 --sender C -events: Event { package_id: iota_system, transaction_module: Identifier("iota_system"), sender: C, type_: StructTag { address: iota_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [233, 207, 22, 117, 92, 142, 77, 109, 192, 159, 55, 48, 51, 243, 196, 130, 69, 227, 174, 117, 15, 72, 135, 76, 78, 53, 195, 204, 77, 84, 130, 131, 175, 163, 158, 79, 0, 218, 226, 120, 249, 119, 199, 198, 147, 10, 94, 44, 118, 232, 93, 23, 165, 38, 215, 36, 187, 206, 15, 184, 31, 176, 125, 76, 140, 202, 78, 28, 224, 186, 89, 4, 206, 166, 29, 249, 36, 45, 162, 247, 210, 158, 62, 243, 40, 251, 126, 192, 124, 8, 107, 59, 244, 124, 166, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } +events: Event { package_id: iota_system, transaction_module: Identifier("iota_system"), sender: C, type_: StructTag { address: iota_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [171, 56, 174, 116, 116, 231, 90, 122, 148, 80, 189, 213, 3, 8, 47, 190, 80, 171, 87, 32, 84, 9, 231, 203, 82, 3, 186, 181, 58, 235, 194, 1, 175, 163, 158, 79, 0, 218, 226, 120, 249, 119, 199, 198, 147, 10, 94, 44, 118, 232, 93, 23, 165, 38, 215, 36, 187, 206, 15, 184, 31, 176, 125, 76, 140, 202, 78, 28, 224, 186, 89, 4, 206, 166, 29, 249, 36, 45, 162, 247, 210, 158, 62, 243, 40, 251, 126, 192, 124, 8, 107, 59, 244, 124, 166, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } created: object(3,0), object(3,1) mutated: 0x0000000000000000000000000000000000000000000000000000000000000005, object(0,0) deleted: object(_), object(2,0) @@ -49,7 +49,7 @@ gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: task 7, line 35: //# run 0x3::iota_system::request_add_stake --args object(0x5) object(6,0) @validator_0 --sender C -events: Event { package_id: iota_system, transaction_module: Identifier("iota_system"), sender: C, type_: StructTag { address: iota_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [233, 207, 22, 117, 92, 142, 77, 109, 192, 159, 55, 48, 51, 243, 196, 130, 69, 227, 174, 117, 15, 72, 135, 76, 78, 53, 195, 204, 77, 84, 130, 131, 175, 163, 158, 79, 0, 218, 226, 120, 249, 119, 199, 198, 147, 10, 94, 44, 118, 232, 93, 23, 165, 38, 215, 36, 187, 206, 15, 184, 31, 176, 125, 76, 140, 202, 78, 28, 224, 186, 89, 4, 206, 166, 29, 249, 36, 45, 162, 247, 210, 158, 62, 243, 40, 251, 126, 192, 124, 8, 107, 59, 244, 124, 166, 26, 1, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } +events: Event { package_id: iota_system, transaction_module: Identifier("iota_system"), sender: C, type_: StructTag { address: iota_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [171, 56, 174, 116, 116, 231, 90, 122, 148, 80, 189, 213, 3, 8, 47, 190, 80, 171, 87, 32, 84, 9, 231, 203, 82, 3, 186, 181, 58, 235, 194, 1, 175, 163, 158, 79, 0, 218, 226, 120, 249, 119, 199, 198, 147, 10, 94, 44, 118, 232, 93, 23, 165, 38, 215, 36, 187, 206, 15, 184, 31, 176, 125, 76, 140, 202, 78, 28, 224, 186, 89, 4, 206, 166, 29, 249, 36, 45, 162, 247, 210, 158, 62, 243, 40, 251, 126, 192, 124, 8, 107, 59, 244, 124, 166, 26, 1, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } created: object(7,0) mutated: 0x0000000000000000000000000000000000000000000000000000000000000005, object(0,0), object(3,0) deleted: object(6,0) @@ -109,13 +109,13 @@ Response: { "stakedIotas": { "edges": [ { - "cursor": "ILTOB6NvCqXx1bHJbIx7P4fDLYSvut1t00nu514tp5J9BAAAAAAAAAA=", + "cursor": "ICyVnatyIW8BBQyropcZeyQEQxpFiSDIk5mD/WFlco2wBAAAAAAAAAA=", "node": { "principal": "10000000000" } }, { - "cursor": "IOnE7aJU6U1Isae47+9Q/LjemKofCkTn6xN5WNNmjvrdBAAAAAAAAAA=", + "cursor": "IFRKz2tTggQgu1xvCFWrIDLlqvonsA/vzDzPPN8u8UDtBAAAAAAAAAA=", "node": { "principal": "10000000000" } @@ -158,15 +158,10 @@ task 14, lines 105-148: Response: { "data": { "coins_after_obj_3_1_chkpt_3": { - "stakedIotas": { - "edges": [] - } - }, - "coins_before_obj_3_1_chkpt_3": { "stakedIotas": { "edges": [ { - "cursor": "ILTOB6NvCqXx1bHJbIx7P4fDLYSvut1t00nu514tp5J9AwAAAAAAAAA=", + "cursor": "IFRKz2tTggQgu1xvCFWrIDLlqvonsA/vzDzPPN8u8UDtAwAAAAAAAAA=", "node": { "principal": "10000000000" } @@ -174,22 +169,27 @@ Response: { ] } }, + "coins_before_obj_3_1_chkpt_3": { + "stakedIotas": { + "edges": [] + } + }, "coins_after_obj_7_0_chkpt_3": { + "stakedIotas": { + "edges": [] + } + }, + "coins_before_obj_7_0_chkpt_3": { "stakedIotas": { "edges": [ { - "cursor": "IOnE7aJU6U1Isae47+9Q/LjemKofCkTn6xN5WNNmjvrdAwAAAAAAAAA=", + "cursor": "ICyVnatyIW8BBQyropcZeyQEQxpFiSDIk5mD/WFlco2wAwAAAAAAAAA=", "node": { "principal": "10000000000" } } ] } - }, - "coins_before_obj_7_0_chkpt_3": { - "stakedIotas": { - "edges": [] - } } } } diff --git a/crates/iota-graphql-e2e-tests/tests/consistency/tx_address_objects.exp b/crates/iota-graphql-e2e-tests/tests/consistency/tx_address_objects.exp index 1c19a13fa61..950b02f0932 100644 --- a/crates/iota-graphql-e2e-tests/tests/consistency/tx_address_objects.exp +++ b/crates/iota-graphql-e2e-tests/tests/consistency/tx_address_objects.exp @@ -61,66 +61,66 @@ Response: { { "contents": { "json": { - "id": "0x0a507f8a603f8431cce07f1e60d17881ce747dfcc8b9c24a2d6807deb37101ce", - "value": "5" + "id": "0x1cf95cbbb66d52398519dbe561c026c8b2f8f3ca58294f162ad9a1f2957d6035", + "value": "3" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2938d6b60f2b12193916aa014580060f2a9dfc71bcbeeb93877790ac03a7cd0c", - "value": "4" + "id": "0x20f00cdc31f4b422ecda21ace92ea2ade64d9a5aa38c03cf526a7f67836deff0", + "value": "2" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2e3299fcac2580392087459adfb6cf19b1119c70e374a817bb82572a43c617c7", - "value": "200" + "id": "0x27204d98aadcf334e4b1a4fa39208c260669339c83808e2eb04e7ad4b1ba01cd", + "value": "5" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x7dccde2025181ded38d74712316b9e895fea91416e2c6fece98ab81a7f2feaa4", - "value": "3" + "id": "0x82ef8d537fb2fe2c4a35f50cec7d8e46a96ffa1e76f90a66144b3e247696d17d", + "value": "200" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x97c68bfbc11acf399e750ad156194bf934b261952ce1dc251494471138521ec4", - "value": "2" + "id": "0x96a37c40cad4455aedf4d66f8d94aa9f91542bf2a6766f0669cf91058f82c0ed", + "value": "4" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0xde730de2672d23259fb9d179736de5c2262eac616ba4aa947c79f7493dc4edbb", + "id": "0xdfa6c182e56bdcafb49a262da0da5ed17a58b8d53e9e4378baebc71748b5b3dc", "value": "6" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } } @@ -136,66 +136,66 @@ Response: { { "contents": { "json": { - "id": "0x0a507f8a603f8431cce07f1e60d17881ce747dfcc8b9c24a2d6807deb37101ce", - "value": "5" + "id": "0x1cf95cbbb66d52398519dbe561c026c8b2f8f3ca58294f162ad9a1f2957d6035", + "value": "3" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2938d6b60f2b12193916aa014580060f2a9dfc71bcbeeb93877790ac03a7cd0c", - "value": "4" + "id": "0x20f00cdc31f4b422ecda21ace92ea2ade64d9a5aa38c03cf526a7f67836deff0", + "value": "2" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2e3299fcac2580392087459adfb6cf19b1119c70e374a817bb82572a43c617c7", - "value": "200" + "id": "0x27204d98aadcf334e4b1a4fa39208c260669339c83808e2eb04e7ad4b1ba01cd", + "value": "5" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x7dccde2025181ded38d74712316b9e895fea91416e2c6fece98ab81a7f2feaa4", - "value": "3" + "id": "0x82ef8d537fb2fe2c4a35f50cec7d8e46a96ffa1e76f90a66144b3e247696d17d", + "value": "200" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x97c68bfbc11acf399e750ad156194bf934b261952ce1dc251494471138521ec4", - "value": "2" + "id": "0x96a37c40cad4455aedf4d66f8d94aa9f91542bf2a6766f0669cf91058f82c0ed", + "value": "4" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0xde730de2672d23259fb9d179736de5c2262eac616ba4aa947c79f7493dc4edbb", + "id": "0xdfa6c182e56bdcafb49a262da0da5ed17a58b8d53e9e4378baebc71748b5b3dc", "value": "6" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } } @@ -209,66 +209,66 @@ Response: { { "contents": { "json": { - "id": "0x0a507f8a603f8431cce07f1e60d17881ce747dfcc8b9c24a2d6807deb37101ce", - "value": "5" + "id": "0x1cf95cbbb66d52398519dbe561c026c8b2f8f3ca58294f162ad9a1f2957d6035", + "value": "3" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2938d6b60f2b12193916aa014580060f2a9dfc71bcbeeb93877790ac03a7cd0c", - "value": "4" + "id": "0x20f00cdc31f4b422ecda21ace92ea2ade64d9a5aa38c03cf526a7f67836deff0", + "value": "2" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2e3299fcac2580392087459adfb6cf19b1119c70e374a817bb82572a43c617c7", - "value": "200" + "id": "0x27204d98aadcf334e4b1a4fa39208c260669339c83808e2eb04e7ad4b1ba01cd", + "value": "5" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x7dccde2025181ded38d74712316b9e895fea91416e2c6fece98ab81a7f2feaa4", - "value": "3" + "id": "0x82ef8d537fb2fe2c4a35f50cec7d8e46a96ffa1e76f90a66144b3e247696d17d", + "value": "200" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x97c68bfbc11acf399e750ad156194bf934b261952ce1dc251494471138521ec4", - "value": "2" + "id": "0x96a37c40cad4455aedf4d66f8d94aa9f91542bf2a6766f0669cf91058f82c0ed", + "value": "4" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0xde730de2672d23259fb9d179736de5c2262eac616ba4aa947c79f7493dc4edbb", + "id": "0xdfa6c182e56bdcafb49a262da0da5ed17a58b8d53e9e4378baebc71748b5b3dc", "value": "6" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } } @@ -284,7 +284,7 @@ Response: { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::iota::IOTA>" }, "json": { - "id": "0x9da8198f4378eca1871757f889a063e3e3a1a552fc797267a701aa0c82f6b680", + "id": "0x875b7011e8f9650ccf26b682b6aeeb36050f9665157d47407e2925700e69143b", "balance": { "value": "299999993067600" } @@ -306,66 +306,66 @@ Response: { { "contents": { "json": { - "id": "0x0a507f8a603f8431cce07f1e60d17881ce747dfcc8b9c24a2d6807deb37101ce", - "value": "5" + "id": "0x1cf95cbbb66d52398519dbe561c026c8b2f8f3ca58294f162ad9a1f2957d6035", + "value": "3" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2938d6b60f2b12193916aa014580060f2a9dfc71bcbeeb93877790ac03a7cd0c", - "value": "4" + "id": "0x20f00cdc31f4b422ecda21ace92ea2ade64d9a5aa38c03cf526a7f67836deff0", + "value": "2" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2e3299fcac2580392087459adfb6cf19b1119c70e374a817bb82572a43c617c7", - "value": "200" + "id": "0x27204d98aadcf334e4b1a4fa39208c260669339c83808e2eb04e7ad4b1ba01cd", + "value": "5" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x7dccde2025181ded38d74712316b9e895fea91416e2c6fece98ab81a7f2feaa4", - "value": "3" + "id": "0x82ef8d537fb2fe2c4a35f50cec7d8e46a96ffa1e76f90a66144b3e247696d17d", + "value": "200" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x97c68bfbc11acf399e750ad156194bf934b261952ce1dc251494471138521ec4", - "value": "2" + "id": "0x96a37c40cad4455aedf4d66f8d94aa9f91542bf2a6766f0669cf91058f82c0ed", + "value": "4" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0xde730de2672d23259fb9d179736de5c2262eac616ba4aa947c79f7493dc4edbb", + "id": "0xdfa6c182e56bdcafb49a262da0da5ed17a58b8d53e9e4378baebc71748b5b3dc", "value": "6" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } } @@ -390,66 +390,66 @@ Response: { { "contents": { "json": { - "id": "0x0a507f8a603f8431cce07f1e60d17881ce747dfcc8b9c24a2d6807deb37101ce", - "value": "5" + "id": "0x1cf95cbbb66d52398519dbe561c026c8b2f8f3ca58294f162ad9a1f2957d6035", + "value": "3" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2938d6b60f2b12193916aa014580060f2a9dfc71bcbeeb93877790ac03a7cd0c", - "value": "4" + "id": "0x20f00cdc31f4b422ecda21ace92ea2ade64d9a5aa38c03cf526a7f67836deff0", + "value": "2" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2e3299fcac2580392087459adfb6cf19b1119c70e374a817bb82572a43c617c7", - "value": "200" + "id": "0x27204d98aadcf334e4b1a4fa39208c260669339c83808e2eb04e7ad4b1ba01cd", + "value": "5" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x7dccde2025181ded38d74712316b9e895fea91416e2c6fece98ab81a7f2feaa4", - "value": "3" + "id": "0x82ef8d537fb2fe2c4a35f50cec7d8e46a96ffa1e76f90a66144b3e247696d17d", + "value": "200" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x97c68bfbc11acf399e750ad156194bf934b261952ce1dc251494471138521ec4", - "value": "2" + "id": "0x96a37c40cad4455aedf4d66f8d94aa9f91542bf2a6766f0669cf91058f82c0ed", + "value": "4" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0xde730de2672d23259fb9d179736de5c2262eac616ba4aa947c79f7493dc4edbb", + "id": "0xdfa6c182e56bdcafb49a262da0da5ed17a58b8d53e9e4378baebc71748b5b3dc", "value": "6" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } } @@ -463,66 +463,66 @@ Response: { { "contents": { "json": { - "id": "0x0a507f8a603f8431cce07f1e60d17881ce747dfcc8b9c24a2d6807deb37101ce", - "value": "5" + "id": "0x1cf95cbbb66d52398519dbe561c026c8b2f8f3ca58294f162ad9a1f2957d6035", + "value": "3" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2938d6b60f2b12193916aa014580060f2a9dfc71bcbeeb93877790ac03a7cd0c", - "value": "4" + "id": "0x20f00cdc31f4b422ecda21ace92ea2ade64d9a5aa38c03cf526a7f67836deff0", + "value": "2" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2e3299fcac2580392087459adfb6cf19b1119c70e374a817bb82572a43c617c7", - "value": "200" + "id": "0x27204d98aadcf334e4b1a4fa39208c260669339c83808e2eb04e7ad4b1ba01cd", + "value": "5" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x7dccde2025181ded38d74712316b9e895fea91416e2c6fece98ab81a7f2feaa4", - "value": "3" + "id": "0x82ef8d537fb2fe2c4a35f50cec7d8e46a96ffa1e76f90a66144b3e247696d17d", + "value": "200" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x97c68bfbc11acf399e750ad156194bf934b261952ce1dc251494471138521ec4", - "value": "2" + "id": "0x96a37c40cad4455aedf4d66f8d94aa9f91542bf2a6766f0669cf91058f82c0ed", + "value": "4" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0xde730de2672d23259fb9d179736de5c2262eac616ba4aa947c79f7493dc4edbb", + "id": "0xdfa6c182e56bdcafb49a262da0da5ed17a58b8d53e9e4378baebc71748b5b3dc", "value": "6" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } } @@ -538,7 +538,7 @@ Response: { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::iota::IOTA>" }, "json": { - "id": "0x9da8198f4378eca1871757f889a063e3e3a1a552fc797267a701aa0c82f6b680", + "id": "0x875b7011e8f9650ccf26b682b6aeeb36050f9665157d47407e2925700e69143b", "balance": { "value": "300000000000000" } @@ -557,66 +557,66 @@ Response: { { "contents": { "json": { - "id": "0x0a507f8a603f8431cce07f1e60d17881ce747dfcc8b9c24a2d6807deb37101ce", - "value": "5" + "id": "0x1cf95cbbb66d52398519dbe561c026c8b2f8f3ca58294f162ad9a1f2957d6035", + "value": "3" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2938d6b60f2b12193916aa014580060f2a9dfc71bcbeeb93877790ac03a7cd0c", - "value": "4" + "id": "0x20f00cdc31f4b422ecda21ace92ea2ade64d9a5aa38c03cf526a7f67836deff0", + "value": "2" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2e3299fcac2580392087459adfb6cf19b1119c70e374a817bb82572a43c617c7", - "value": "200" + "id": "0x27204d98aadcf334e4b1a4fa39208c260669339c83808e2eb04e7ad4b1ba01cd", + "value": "5" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x7dccde2025181ded38d74712316b9e895fea91416e2c6fece98ab81a7f2feaa4", - "value": "3" + "id": "0x82ef8d537fb2fe2c4a35f50cec7d8e46a96ffa1e76f90a66144b3e247696d17d", + "value": "200" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x97c68bfbc11acf399e750ad156194bf934b261952ce1dc251494471138521ec4", - "value": "2" + "id": "0x96a37c40cad4455aedf4d66f8d94aa9f91542bf2a6766f0669cf91058f82c0ed", + "value": "4" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0xde730de2672d23259fb9d179736de5c2262eac616ba4aa947c79f7493dc4edbb", + "id": "0xdfa6c182e56bdcafb49a262da0da5ed17a58b8d53e9e4378baebc71748b5b3dc", "value": "6" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } } @@ -630,66 +630,66 @@ Response: { { "contents": { "json": { - "id": "0x0a507f8a603f8431cce07f1e60d17881ce747dfcc8b9c24a2d6807deb37101ce", - "value": "5" + "id": "0x1cf95cbbb66d52398519dbe561c026c8b2f8f3ca58294f162ad9a1f2957d6035", + "value": "3" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2938d6b60f2b12193916aa014580060f2a9dfc71bcbeeb93877790ac03a7cd0c", - "value": "4" + "id": "0x20f00cdc31f4b422ecda21ace92ea2ade64d9a5aa38c03cf526a7f67836deff0", + "value": "2" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2e3299fcac2580392087459adfb6cf19b1119c70e374a817bb82572a43c617c7", - "value": "200" + "id": "0x27204d98aadcf334e4b1a4fa39208c260669339c83808e2eb04e7ad4b1ba01cd", + "value": "5" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x7dccde2025181ded38d74712316b9e895fea91416e2c6fece98ab81a7f2feaa4", - "value": "3" + "id": "0x82ef8d537fb2fe2c4a35f50cec7d8e46a96ffa1e76f90a66144b3e247696d17d", + "value": "200" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x97c68bfbc11acf399e750ad156194bf934b261952ce1dc251494471138521ec4", - "value": "2" + "id": "0x96a37c40cad4455aedf4d66f8d94aa9f91542bf2a6766f0669cf91058f82c0ed", + "value": "4" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0xde730de2672d23259fb9d179736de5c2262eac616ba4aa947c79f7493dc4edbb", + "id": "0xdfa6c182e56bdcafb49a262da0da5ed17a58b8d53e9e4378baebc71748b5b3dc", "value": "6" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } } @@ -705,7 +705,7 @@ Response: { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::iota::IOTA>" }, "json": { - "id": "0x9da8198f4378eca1871757f889a063e3e3a1a552fc797267a701aa0c82f6b680", + "id": "0x875b7011e8f9650ccf26b682b6aeeb36050f9665157d47407e2925700e69143b", "balance": { "value": "299999996697200" } @@ -724,66 +724,66 @@ Response: { { "contents": { "json": { - "id": "0x0a507f8a603f8431cce07f1e60d17881ce747dfcc8b9c24a2d6807deb37101ce", - "value": "5" + "id": "0x1cf95cbbb66d52398519dbe561c026c8b2f8f3ca58294f162ad9a1f2957d6035", + "value": "3" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2938d6b60f2b12193916aa014580060f2a9dfc71bcbeeb93877790ac03a7cd0c", - "value": "4" + "id": "0x20f00cdc31f4b422ecda21ace92ea2ade64d9a5aa38c03cf526a7f67836deff0", + "value": "2" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2e3299fcac2580392087459adfb6cf19b1119c70e374a817bb82572a43c617c7", - "value": "200" + "id": "0x27204d98aadcf334e4b1a4fa39208c260669339c83808e2eb04e7ad4b1ba01cd", + "value": "5" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x7dccde2025181ded38d74712316b9e895fea91416e2c6fece98ab81a7f2feaa4", - "value": "3" + "id": "0x82ef8d537fb2fe2c4a35f50cec7d8e46a96ffa1e76f90a66144b3e247696d17d", + "value": "200" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x97c68bfbc11acf399e750ad156194bf934b261952ce1dc251494471138521ec4", - "value": "2" + "id": "0x96a37c40cad4455aedf4d66f8d94aa9f91542bf2a6766f0669cf91058f82c0ed", + "value": "4" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0xde730de2672d23259fb9d179736de5c2262eac616ba4aa947c79f7493dc4edbb", + "id": "0xdfa6c182e56bdcafb49a262da0da5ed17a58b8d53e9e4378baebc71748b5b3dc", "value": "6" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } } @@ -797,66 +797,66 @@ Response: { { "contents": { "json": { - "id": "0x0a507f8a603f8431cce07f1e60d17881ce747dfcc8b9c24a2d6807deb37101ce", - "value": "5" + "id": "0x1cf95cbbb66d52398519dbe561c026c8b2f8f3ca58294f162ad9a1f2957d6035", + "value": "3" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2938d6b60f2b12193916aa014580060f2a9dfc71bcbeeb93877790ac03a7cd0c", - "value": "4" + "id": "0x20f00cdc31f4b422ecda21ace92ea2ade64d9a5aa38c03cf526a7f67836deff0", + "value": "2" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2e3299fcac2580392087459adfb6cf19b1119c70e374a817bb82572a43c617c7", - "value": "200" + "id": "0x27204d98aadcf334e4b1a4fa39208c260669339c83808e2eb04e7ad4b1ba01cd", + "value": "5" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x7dccde2025181ded38d74712316b9e895fea91416e2c6fece98ab81a7f2feaa4", - "value": "3" + "id": "0x82ef8d537fb2fe2c4a35f50cec7d8e46a96ffa1e76f90a66144b3e247696d17d", + "value": "200" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x97c68bfbc11acf399e750ad156194bf934b261952ce1dc251494471138521ec4", - "value": "2" + "id": "0x96a37c40cad4455aedf4d66f8d94aa9f91542bf2a6766f0669cf91058f82c0ed", + "value": "4" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0xde730de2672d23259fb9d179736de5c2262eac616ba4aa947c79f7493dc4edbb", + "id": "0xdfa6c182e56bdcafb49a262da0da5ed17a58b8d53e9e4378baebc71748b5b3dc", "value": "6" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } } @@ -872,7 +872,7 @@ Response: { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::iota::IOTA>" }, "json": { - "id": "0x9da8198f4378eca1871757f889a063e3e3a1a552fc797267a701aa0c82f6b680", + "id": "0x875b7011e8f9650ccf26b682b6aeeb36050f9665157d47407e2925700e69143b", "balance": { "value": "299999993067600" } @@ -907,66 +907,66 @@ Response: { { "contents": { "json": { - "id": "0x0a507f8a603f8431cce07f1e60d17881ce747dfcc8b9c24a2d6807deb37101ce", - "value": "5" + "id": "0x1cf95cbbb66d52398519dbe561c026c8b2f8f3ca58294f162ad9a1f2957d6035", + "value": "3" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2938d6b60f2b12193916aa014580060f2a9dfc71bcbeeb93877790ac03a7cd0c", - "value": "4" + "id": "0x20f00cdc31f4b422ecda21ace92ea2ade64d9a5aa38c03cf526a7f67836deff0", + "value": "2" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2e3299fcac2580392087459adfb6cf19b1119c70e374a817bb82572a43c617c7", - "value": "200" + "id": "0x27204d98aadcf334e4b1a4fa39208c260669339c83808e2eb04e7ad4b1ba01cd", + "value": "5" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x7dccde2025181ded38d74712316b9e895fea91416e2c6fece98ab81a7f2feaa4", - "value": "3" + "id": "0x82ef8d537fb2fe2c4a35f50cec7d8e46a96ffa1e76f90a66144b3e247696d17d", + "value": "200" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x97c68bfbc11acf399e750ad156194bf934b261952ce1dc251494471138521ec4", - "value": "2" + "id": "0x96a37c40cad4455aedf4d66f8d94aa9f91542bf2a6766f0669cf91058f82c0ed", + "value": "4" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0xde730de2672d23259fb9d179736de5c2262eac616ba4aa947c79f7493dc4edbb", + "id": "0xdfa6c182e56bdcafb49a262da0da5ed17a58b8d53e9e4378baebc71748b5b3dc", "value": "6" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } } @@ -982,66 +982,66 @@ Response: { { "contents": { "json": { - "id": "0x0a507f8a603f8431cce07f1e60d17881ce747dfcc8b9c24a2d6807deb37101ce", - "value": "5" + "id": "0x1cf95cbbb66d52398519dbe561c026c8b2f8f3ca58294f162ad9a1f2957d6035", + "value": "3" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2938d6b60f2b12193916aa014580060f2a9dfc71bcbeeb93877790ac03a7cd0c", - "value": "4" + "id": "0x20f00cdc31f4b422ecda21ace92ea2ade64d9a5aa38c03cf526a7f67836deff0", + "value": "2" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2e3299fcac2580392087459adfb6cf19b1119c70e374a817bb82572a43c617c7", - "value": "200" + "id": "0x27204d98aadcf334e4b1a4fa39208c260669339c83808e2eb04e7ad4b1ba01cd", + "value": "5" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x7dccde2025181ded38d74712316b9e895fea91416e2c6fece98ab81a7f2feaa4", - "value": "3" + "id": "0x82ef8d537fb2fe2c4a35f50cec7d8e46a96ffa1e76f90a66144b3e247696d17d", + "value": "200" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x97c68bfbc11acf399e750ad156194bf934b261952ce1dc251494471138521ec4", - "value": "2" + "id": "0x96a37c40cad4455aedf4d66f8d94aa9f91542bf2a6766f0669cf91058f82c0ed", + "value": "4" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0xde730de2672d23259fb9d179736de5c2262eac616ba4aa947c79f7493dc4edbb", + "id": "0xdfa6c182e56bdcafb49a262da0da5ed17a58b8d53e9e4378baebc71748b5b3dc", "value": "6" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } } @@ -1055,66 +1055,66 @@ Response: { { "contents": { "json": { - "id": "0x0a507f8a603f8431cce07f1e60d17881ce747dfcc8b9c24a2d6807deb37101ce", - "value": "5" + "id": "0x1cf95cbbb66d52398519dbe561c026c8b2f8f3ca58294f162ad9a1f2957d6035", + "value": "3" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2938d6b60f2b12193916aa014580060f2a9dfc71bcbeeb93877790ac03a7cd0c", - "value": "4" + "id": "0x20f00cdc31f4b422ecda21ace92ea2ade64d9a5aa38c03cf526a7f67836deff0", + "value": "2" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2e3299fcac2580392087459adfb6cf19b1119c70e374a817bb82572a43c617c7", - "value": "200" + "id": "0x27204d98aadcf334e4b1a4fa39208c260669339c83808e2eb04e7ad4b1ba01cd", + "value": "5" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x7dccde2025181ded38d74712316b9e895fea91416e2c6fece98ab81a7f2feaa4", - "value": "3" + "id": "0x82ef8d537fb2fe2c4a35f50cec7d8e46a96ffa1e76f90a66144b3e247696d17d", + "value": "200" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x97c68bfbc11acf399e750ad156194bf934b261952ce1dc251494471138521ec4", - "value": "2" + "id": "0x96a37c40cad4455aedf4d66f8d94aa9f91542bf2a6766f0669cf91058f82c0ed", + "value": "4" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0xde730de2672d23259fb9d179736de5c2262eac616ba4aa947c79f7493dc4edbb", + "id": "0xdfa6c182e56bdcafb49a262da0da5ed17a58b8d53e9e4378baebc71748b5b3dc", "value": "6" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } } @@ -1130,7 +1130,7 @@ Response: { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::iota::IOTA>" }, "json": { - "id": "0x9da8198f4378eca1871757f889a063e3e3a1a552fc797267a701aa0c82f6b680", + "id": "0x875b7011e8f9650ccf26b682b6aeeb36050f9665157d47407e2925700e69143b", "balance": { "value": "299999993067600" } @@ -1152,66 +1152,66 @@ Response: { { "contents": { "json": { - "id": "0x0a507f8a603f8431cce07f1e60d17881ce747dfcc8b9c24a2d6807deb37101ce", - "value": "5" + "id": "0x1cf95cbbb66d52398519dbe561c026c8b2f8f3ca58294f162ad9a1f2957d6035", + "value": "3" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2938d6b60f2b12193916aa014580060f2a9dfc71bcbeeb93877790ac03a7cd0c", - "value": "4" + "id": "0x20f00cdc31f4b422ecda21ace92ea2ade64d9a5aa38c03cf526a7f67836deff0", + "value": "2" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2e3299fcac2580392087459adfb6cf19b1119c70e374a817bb82572a43c617c7", - "value": "200" + "id": "0x27204d98aadcf334e4b1a4fa39208c260669339c83808e2eb04e7ad4b1ba01cd", + "value": "5" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x7dccde2025181ded38d74712316b9e895fea91416e2c6fece98ab81a7f2feaa4", - "value": "3" + "id": "0x82ef8d537fb2fe2c4a35f50cec7d8e46a96ffa1e76f90a66144b3e247696d17d", + "value": "200" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x97c68bfbc11acf399e750ad156194bf934b261952ce1dc251494471138521ec4", - "value": "2" + "id": "0x96a37c40cad4455aedf4d66f8d94aa9f91542bf2a6766f0669cf91058f82c0ed", + "value": "4" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0xde730de2672d23259fb9d179736de5c2262eac616ba4aa947c79f7493dc4edbb", + "id": "0xdfa6c182e56bdcafb49a262da0da5ed17a58b8d53e9e4378baebc71748b5b3dc", "value": "6" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } } @@ -1240,66 +1240,66 @@ Response: { { "contents": { "json": { - "id": "0x0a507f8a603f8431cce07f1e60d17881ce747dfcc8b9c24a2d6807deb37101ce", - "value": "5" + "id": "0x1cf95cbbb66d52398519dbe561c026c8b2f8f3ca58294f162ad9a1f2957d6035", + "value": "3" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2938d6b60f2b12193916aa014580060f2a9dfc71bcbeeb93877790ac03a7cd0c", - "value": "4" + "id": "0x20f00cdc31f4b422ecda21ace92ea2ade64d9a5aa38c03cf526a7f67836deff0", + "value": "2" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2e3299fcac2580392087459adfb6cf19b1119c70e374a817bb82572a43c617c7", - "value": "200" + "id": "0x27204d98aadcf334e4b1a4fa39208c260669339c83808e2eb04e7ad4b1ba01cd", + "value": "5" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x7dccde2025181ded38d74712316b9e895fea91416e2c6fece98ab81a7f2feaa4", - "value": "3" + "id": "0x82ef8d537fb2fe2c4a35f50cec7d8e46a96ffa1e76f90a66144b3e247696d17d", + "value": "200" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x97c68bfbc11acf399e750ad156194bf934b261952ce1dc251494471138521ec4", - "value": "2" + "id": "0x96a37c40cad4455aedf4d66f8d94aa9f91542bf2a6766f0669cf91058f82c0ed", + "value": "4" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0xde730de2672d23259fb9d179736de5c2262eac616ba4aa947c79f7493dc4edbb", + "id": "0xdfa6c182e56bdcafb49a262da0da5ed17a58b8d53e9e4378baebc71748b5b3dc", "value": "6" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } } @@ -1313,66 +1313,66 @@ Response: { { "contents": { "json": { - "id": "0x0a507f8a603f8431cce07f1e60d17881ce747dfcc8b9c24a2d6807deb37101ce", - "value": "5" + "id": "0x1cf95cbbb66d52398519dbe561c026c8b2f8f3ca58294f162ad9a1f2957d6035", + "value": "3" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2938d6b60f2b12193916aa014580060f2a9dfc71bcbeeb93877790ac03a7cd0c", - "value": "4" + "id": "0x20f00cdc31f4b422ecda21ace92ea2ade64d9a5aa38c03cf526a7f67836deff0", + "value": "2" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2e3299fcac2580392087459adfb6cf19b1119c70e374a817bb82572a43c617c7", - "value": "200" + "id": "0x27204d98aadcf334e4b1a4fa39208c260669339c83808e2eb04e7ad4b1ba01cd", + "value": "5" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x7dccde2025181ded38d74712316b9e895fea91416e2c6fece98ab81a7f2feaa4", - "value": "3" + "id": "0x82ef8d537fb2fe2c4a35f50cec7d8e46a96ffa1e76f90a66144b3e247696d17d", + "value": "200" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x97c68bfbc11acf399e750ad156194bf934b261952ce1dc251494471138521ec4", - "value": "2" + "id": "0x96a37c40cad4455aedf4d66f8d94aa9f91542bf2a6766f0669cf91058f82c0ed", + "value": "4" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0xde730de2672d23259fb9d179736de5c2262eac616ba4aa947c79f7493dc4edbb", + "id": "0xdfa6c182e56bdcafb49a262da0da5ed17a58b8d53e9e4378baebc71748b5b3dc", "value": "6" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } } @@ -1388,66 +1388,66 @@ Response: { { "contents": { "json": { - "id": "0x0a507f8a603f8431cce07f1e60d17881ce747dfcc8b9c24a2d6807deb37101ce", - "value": "5" + "id": "0x1cf95cbbb66d52398519dbe561c026c8b2f8f3ca58294f162ad9a1f2957d6035", + "value": "3" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2938d6b60f2b12193916aa014580060f2a9dfc71bcbeeb93877790ac03a7cd0c", - "value": "4" + "id": "0x20f00cdc31f4b422ecda21ace92ea2ade64d9a5aa38c03cf526a7f67836deff0", + "value": "2" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2e3299fcac2580392087459adfb6cf19b1119c70e374a817bb82572a43c617c7", - "value": "200" + "id": "0x27204d98aadcf334e4b1a4fa39208c260669339c83808e2eb04e7ad4b1ba01cd", + "value": "5" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x7dccde2025181ded38d74712316b9e895fea91416e2c6fece98ab81a7f2feaa4", - "value": "3" + "id": "0x82ef8d537fb2fe2c4a35f50cec7d8e46a96ffa1e76f90a66144b3e247696d17d", + "value": "200" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x97c68bfbc11acf399e750ad156194bf934b261952ce1dc251494471138521ec4", - "value": "2" + "id": "0x96a37c40cad4455aedf4d66f8d94aa9f91542bf2a6766f0669cf91058f82c0ed", + "value": "4" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0xde730de2672d23259fb9d179736de5c2262eac616ba4aa947c79f7493dc4edbb", + "id": "0xdfa6c182e56bdcafb49a262da0da5ed17a58b8d53e9e4378baebc71748b5b3dc", "value": "6" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } } @@ -1461,66 +1461,66 @@ Response: { { "contents": { "json": { - "id": "0x0a507f8a603f8431cce07f1e60d17881ce747dfcc8b9c24a2d6807deb37101ce", - "value": "5" + "id": "0x1cf95cbbb66d52398519dbe561c026c8b2f8f3ca58294f162ad9a1f2957d6035", + "value": "3" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2938d6b60f2b12193916aa014580060f2a9dfc71bcbeeb93877790ac03a7cd0c", - "value": "4" + "id": "0x20f00cdc31f4b422ecda21ace92ea2ade64d9a5aa38c03cf526a7f67836deff0", + "value": "2" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2e3299fcac2580392087459adfb6cf19b1119c70e374a817bb82572a43c617c7", - "value": "200" + "id": "0x27204d98aadcf334e4b1a4fa39208c260669339c83808e2eb04e7ad4b1ba01cd", + "value": "5" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x7dccde2025181ded38d74712316b9e895fea91416e2c6fece98ab81a7f2feaa4", - "value": "3" + "id": "0x82ef8d537fb2fe2c4a35f50cec7d8e46a96ffa1e76f90a66144b3e247696d17d", + "value": "200" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x97c68bfbc11acf399e750ad156194bf934b261952ce1dc251494471138521ec4", - "value": "2" + "id": "0x96a37c40cad4455aedf4d66f8d94aa9f91542bf2a6766f0669cf91058f82c0ed", + "value": "4" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0xde730de2672d23259fb9d179736de5c2262eac616ba4aa947c79f7493dc4edbb", + "id": "0xdfa6c182e56bdcafb49a262da0da5ed17a58b8d53e9e4378baebc71748b5b3dc", "value": "6" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } } @@ -1536,66 +1536,66 @@ Response: { { "contents": { "json": { - "id": "0x0a507f8a603f8431cce07f1e60d17881ce747dfcc8b9c24a2d6807deb37101ce", - "value": "5" + "id": "0x1cf95cbbb66d52398519dbe561c026c8b2f8f3ca58294f162ad9a1f2957d6035", + "value": "3" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2938d6b60f2b12193916aa014580060f2a9dfc71bcbeeb93877790ac03a7cd0c", - "value": "4" + "id": "0x20f00cdc31f4b422ecda21ace92ea2ade64d9a5aa38c03cf526a7f67836deff0", + "value": "2" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2e3299fcac2580392087459adfb6cf19b1119c70e374a817bb82572a43c617c7", - "value": "200" + "id": "0x27204d98aadcf334e4b1a4fa39208c260669339c83808e2eb04e7ad4b1ba01cd", + "value": "5" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x7dccde2025181ded38d74712316b9e895fea91416e2c6fece98ab81a7f2feaa4", - "value": "3" + "id": "0x82ef8d537fb2fe2c4a35f50cec7d8e46a96ffa1e76f90a66144b3e247696d17d", + "value": "200" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x97c68bfbc11acf399e750ad156194bf934b261952ce1dc251494471138521ec4", - "value": "2" + "id": "0x96a37c40cad4455aedf4d66f8d94aa9f91542bf2a6766f0669cf91058f82c0ed", + "value": "4" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0xde730de2672d23259fb9d179736de5c2262eac616ba4aa947c79f7493dc4edbb", + "id": "0xdfa6c182e56bdcafb49a262da0da5ed17a58b8d53e9e4378baebc71748b5b3dc", "value": "6" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } } @@ -1609,66 +1609,66 @@ Response: { { "contents": { "json": { - "id": "0x0a507f8a603f8431cce07f1e60d17881ce747dfcc8b9c24a2d6807deb37101ce", - "value": "5" + "id": "0x1cf95cbbb66d52398519dbe561c026c8b2f8f3ca58294f162ad9a1f2957d6035", + "value": "3" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2938d6b60f2b12193916aa014580060f2a9dfc71bcbeeb93877790ac03a7cd0c", - "value": "4" + "id": "0x20f00cdc31f4b422ecda21ace92ea2ade64d9a5aa38c03cf526a7f67836deff0", + "value": "2" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x2e3299fcac2580392087459adfb6cf19b1119c70e374a817bb82572a43c617c7", - "value": "200" + "id": "0x27204d98aadcf334e4b1a4fa39208c260669339c83808e2eb04e7ad4b1ba01cd", + "value": "5" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x7dccde2025181ded38d74712316b9e895fea91416e2c6fece98ab81a7f2feaa4", - "value": "3" + "id": "0x82ef8d537fb2fe2c4a35f50cec7d8e46a96ffa1e76f90a66144b3e247696d17d", + "value": "200" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0x97c68bfbc11acf399e750ad156194bf934b261952ce1dc251494471138521ec4", - "value": "2" + "id": "0x96a37c40cad4455aedf4d66f8d94aa9f91542bf2a6766f0669cf91058f82c0ed", + "value": "4" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } }, { "contents": { "json": { - "id": "0xde730de2672d23259fb9d179736de5c2262eac616ba4aa947c79f7493dc4edbb", + "id": "0xdfa6c182e56bdcafb49a262da0da5ed17a58b8d53e9e4378baebc71748b5b3dc", "value": "6" }, "type": { - "repr": "0x204efe51de22563b6bb6dec618af36f29dc881247ee04b11f816a2ea35e1de44::M1::Object" + "repr": "0x54c66a0373d27370da1294a4635920f2f8f3b09e1befe9de0d5602bbbbd4d1a7::M1::Object" } } } diff --git a/crates/iota-graphql-e2e-tests/tests/epoch/chain_identifier.exp b/crates/iota-graphql-e2e-tests/tests/epoch/chain_identifier.exp index 642c3cd09ce..c150dc82e61 100644 --- a/crates/iota-graphql-e2e-tests/tests/epoch/chain_identifier.exp +++ b/crates/iota-graphql-e2e-tests/tests/epoch/chain_identifier.exp @@ -11,6 +11,6 @@ task 2, lines 10-13: //# run-graphql Response: { "data": { - "chainIdentifier": "157e9367" + "chainIdentifier": "e1d5137d" } } diff --git a/crates/iota-graphql-e2e-tests/tests/epoch/epoch.exp b/crates/iota-graphql-e2e-tests/tests/epoch/epoch.exp index ea58f7249c7..9001cbd3bb2 100644 --- a/crates/iota-graphql-e2e-tests/tests/epoch/epoch.exp +++ b/crates/iota-graphql-e2e-tests/tests/epoch/epoch.exp @@ -21,7 +21,7 @@ gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: task 4, lines 17-19: //# run 0x3::iota_system::request_add_stake --args object(0x5) object(3,0) @validator_0 --sender C -events: Event { package_id: iota_system, transaction_module: Identifier("iota_system"), sender: C, type_: StructTag { address: iota_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [233, 207, 22, 117, 92, 142, 77, 109, 192, 159, 55, 48, 51, 243, 196, 130, 69, 227, 174, 117, 15, 72, 135, 76, 78, 53, 195, 204, 77, 84, 130, 131, 175, 163, 158, 79, 0, 218, 226, 120, 249, 119, 199, 198, 147, 10, 94, 44, 118, 232, 93, 23, 165, 38, 215, 36, 187, 206, 15, 184, 31, 176, 125, 76, 140, 202, 78, 28, 224, 186, 89, 4, 206, 166, 29, 249, 36, 45, 162, 247, 210, 158, 62, 243, 40, 251, 126, 192, 124, 8, 107, 59, 244, 124, 166, 26, 1, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } +events: Event { package_id: iota_system, transaction_module: Identifier("iota_system"), sender: C, type_: StructTag { address: iota_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [171, 56, 174, 116, 116, 231, 90, 122, 148, 80, 189, 213, 3, 8, 47, 190, 80, 171, 87, 32, 84, 9, 231, 203, 82, 3, 186, 181, 58, 235, 194, 1, 175, 163, 158, 79, 0, 218, 226, 120, 249, 119, 199, 198, 147, 10, 94, 44, 118, 232, 93, 23, 165, 38, 215, 36, 187, 206, 15, 184, 31, 176, 125, 76, 140, 202, 78, 28, 224, 186, 89, 4, 206, 166, 29, 249, 36, 45, 162, 247, 210, 158, 62, 243, 40, 251, 126, 192, 124, 8, 107, 59, 244, 124, 166, 26, 1, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } created: object(4,0) mutated: object(_), 0x0000000000000000000000000000000000000000000000000000000000000005, object(0,0) deleted: object(3,0) @@ -67,7 +67,7 @@ Response: { ] }, "validatorCandidatesSize": 0, - "inactivePoolsId": "0xccb58847e6337f3f9b05773365f62f7187e0b805ece63f932e8270e51188a9e0" + "inactivePoolsId": "0xa0ca410cb152a8d20832f3009367a5e33c1d8c3c20d146d7c6b749952e6b92ec" }, "totalGasFees": "1000000", "totalStakeRewards": "767000000000000", @@ -81,7 +81,7 @@ Response: { "kind": { "__typename": "ProgrammableTransactionBlock" }, - "digest": "o5rxrq6e35THRZTrCB1LM3nVC7r4sM4vaeSBzDzhE6R" + "digest": "4SwJFCerfaDJbFof2RVhiGmbbAjiiYA2nyurwzaF7NoK" }, { "kind": { diff --git a/crates/iota-graphql-e2e-tests/tests/epoch/system_state.exp b/crates/iota-graphql-e2e-tests/tests/epoch/system_state.exp index 1e33a8e13f3..cc9b2e4c516 100644 --- a/crates/iota-graphql-e2e-tests/tests/epoch/system_state.exp +++ b/crates/iota-graphql-e2e-tests/tests/epoch/system_state.exp @@ -21,7 +21,7 @@ gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: task 4, line 19: //# run 0x3::iota_system::request_add_stake --args object(0x5) object(3,0) @validator_0 --sender C -events: Event { package_id: iota_system, transaction_module: Identifier("iota_system"), sender: C, type_: StructTag { address: iota_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [141, 194, 182, 191, 13, 223, 31, 163, 140, 181, 81, 55, 49, 228, 140, 195, 208, 123, 162, 48, 172, 111, 154, 21, 33, 5, 186, 53, 41, 60, 215, 132, 175, 163, 158, 79, 0, 218, 226, 120, 249, 119, 199, 198, 147, 10, 94, 44, 118, 232, 93, 23, 165, 38, 215, 36, 187, 206, 15, 184, 31, 176, 125, 76, 140, 202, 78, 28, 224, 186, 89, 4, 206, 166, 29, 249, 36, 45, 162, 247, 210, 158, 62, 243, 40, 251, 126, 192, 124, 8, 107, 59, 244, 124, 166, 26, 1, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } +events: Event { package_id: iota_system, transaction_module: Identifier("iota_system"), sender: C, type_: StructTag { address: iota_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [238, 153, 37, 48, 37, 251, 65, 114, 78, 217, 166, 206, 113, 249, 11, 156, 146, 124, 75, 213, 236, 255, 221, 178, 144, 192, 67, 121, 55, 3, 90, 248, 175, 163, 158, 79, 0, 218, 226, 120, 249, 119, 199, 198, 147, 10, 94, 44, 118, 232, 93, 23, 165, 38, 215, 36, 187, 206, 15, 184, 31, 176, 125, 76, 140, 202, 78, 28, 224, 186, 89, 4, 206, 166, 29, 249, 36, 45, 162, 247, 210, 158, 62, 243, 40, 251, 126, 192, 124, 8, 107, 59, 244, 124, 166, 26, 1, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } created: object(4,0) mutated: object(_), 0x0000000000000000000000000000000000000000000000000000000000000005, object(0,0) deleted: object(3,0) @@ -61,7 +61,7 @@ Epoch advanced: 3 task 12, line 37: //# run 0x3::iota_system::request_withdraw_stake --args object(0x5) object(4,0) --sender C -events: Event { package_id: iota_system, transaction_module: Identifier("iota_system"), sender: C, type_: StructTag { address: iota_system, module: Identifier("validator"), name: Identifier("UnstakingRequestEvent"), type_params: [] }, contents: [141, 194, 182, 191, 13, 223, 31, 163, 140, 181, 81, 55, 49, 228, 140, 195, 208, 123, 162, 48, 172, 111, 154, 21, 33, 5, 186, 53, 41, 60, 215, 132, 175, 163, 158, 79, 0, 218, 226, 120, 249, 119, 199, 198, 147, 10, 94, 44, 118, 232, 93, 23, 165, 38, 215, 36, 187, 206, 15, 184, 31, 176, 125, 76, 140, 202, 78, 28, 224, 186, 89, 4, 206, 166, 29, 249, 36, 45, 162, 247, 210, 158, 62, 243, 40, 251, 126, 192, 124, 8, 107, 59, 244, 124, 166, 26, 2, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0, 12, 33, 189, 38, 1, 0, 0, 0] } +events: Event { package_id: iota_system, transaction_module: Identifier("iota_system"), sender: C, type_: StructTag { address: iota_system, module: Identifier("validator"), name: Identifier("UnstakingRequestEvent"), type_params: [] }, contents: [238, 153, 37, 48, 37, 251, 65, 114, 78, 217, 166, 206, 113, 249, 11, 156, 146, 124, 75, 213, 236, 255, 221, 178, 144, 192, 67, 121, 55, 3, 90, 248, 175, 163, 158, 79, 0, 218, 226, 120, 249, 119, 199, 198, 147, 10, 94, 44, 118, 232, 93, 23, 165, 38, 215, 36, 187, 206, 15, 184, 31, 176, 125, 76, 140, 202, 78, 28, 224, 186, 89, 4, 206, 166, 29, 249, 36, 45, 162, 247, 210, 158, 62, 243, 40, 251, 126, 192, 124, 8, 107, 59, 244, 124, 166, 26, 2, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0, 12, 33, 189, 38, 1, 0, 0, 0] } created: object(12,0) mutated: object(_), 0x0000000000000000000000000000000000000000000000000000000000000005, object(0,0) deleted: object(4,0) diff --git a/crates/iota-graphql-e2e-tests/tests/errors/clever_errors.exp b/crates/iota-graphql-e2e-tests/tests/errors/clever_errors.exp index 42d3ab05ce5..bd9c13a8314 100644 --- a/crates/iota-graphql-e2e-tests/tests/errors/clever_errors.exp +++ b/crates/iota-graphql-e2e-tests/tests/errors/clever_errors.exp @@ -77,67 +77,67 @@ Response: { { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x1803af073fdd925c6531abdeac9a6970139e99522f1c51b3d8ee19f9ecf97a53::m::callU8' (line 30), abort 'ImAU8': 0" + "errors": "Error in 1st command, from '0x89423a90eca23c8d14ab44895f6f8b49e1e692e2e7ea8a9adb677e982cff2a99::m::callU8' (line 30), abort 'ImAU8': 0" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x1803af073fdd925c6531abdeac9a6970139e99522f1c51b3d8ee19f9ecf97a53::m::callU16' (line 33), abort 'ImAU16': 1" + "errors": "Error in 1st command, from '0x89423a90eca23c8d14ab44895f6f8b49e1e692e2e7ea8a9adb677e982cff2a99::m::callU16' (line 33), abort 'ImAU16': 1" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x1803af073fdd925c6531abdeac9a6970139e99522f1c51b3d8ee19f9ecf97a53::m::callU32' (line 36), abort 'ImAU32': 2" + "errors": "Error in 1st command, from '0x89423a90eca23c8d14ab44895f6f8b49e1e692e2e7ea8a9adb677e982cff2a99::m::callU32' (line 36), abort 'ImAU32': 2" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x1803af073fdd925c6531abdeac9a6970139e99522f1c51b3d8ee19f9ecf97a53::m::callU64' (line 39), abort 'ImAU64': 3" + "errors": "Error in 1st command, from '0x89423a90eca23c8d14ab44895f6f8b49e1e692e2e7ea8a9adb677e982cff2a99::m::callU64' (line 39), abort 'ImAU64': 3" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x1803af073fdd925c6531abdeac9a6970139e99522f1c51b3d8ee19f9ecf97a53::m::callU128' (line 42), abort 'ImAU128': 4" + "errors": "Error in 1st command, from '0x89423a90eca23c8d14ab44895f6f8b49e1e692e2e7ea8a9adb677e982cff2a99::m::callU128' (line 42), abort 'ImAU128': 4" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x1803af073fdd925c6531abdeac9a6970139e99522f1c51b3d8ee19f9ecf97a53::m::callU256' (line 45), abort 'ImAU256': 5" + "errors": "Error in 1st command, from '0x89423a90eca23c8d14ab44895f6f8b49e1e692e2e7ea8a9adb677e982cff2a99::m::callU256' (line 45), abort 'ImAU256': 5" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x1803af073fdd925c6531abdeac9a6970139e99522f1c51b3d8ee19f9ecf97a53::m::callAddress' (line 48), abort 'ImAnAddress': 0x0000000000000000000000000000000000000000000000000000000000000006" + "errors": "Error in 1st command, from '0x89423a90eca23c8d14ab44895f6f8b49e1e692e2e7ea8a9adb677e982cff2a99::m::callAddress' (line 48), abort 'ImAnAddress': 0x0000000000000000000000000000000000000000000000000000000000000006" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x1803af073fdd925c6531abdeac9a6970139e99522f1c51b3d8ee19f9ecf97a53::m::callString' (line 51), abort 'ImAString': This is a string" + "errors": "Error in 1st command, from '0x89423a90eca23c8d14ab44895f6f8b49e1e692e2e7ea8a9adb677e982cff2a99::m::callString' (line 51), abort 'ImAString': This is a string" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x1803af073fdd925c6531abdeac9a6970139e99522f1c51b3d8ee19f9ecf97a53::m::callU64vec' (line 54), abort 'ImNotAString': BQEAAAAAAAAAAgAAAAAAAAADAAAAAAAAAAQAAAAAAAAABQAAAAAAAAA=" + "errors": "Error in 1st command, from '0x89423a90eca23c8d14ab44895f6f8b49e1e692e2e7ea8a9adb677e982cff2a99::m::callU64vec' (line 54), abort 'ImNotAString': BQEAAAAAAAAAAgAAAAAAAAADAAAAAAAAAAQAAAAAAAAABQAAAAAAAAA=" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x1803af073fdd925c6531abdeac9a6970139e99522f1c51b3d8ee19f9ecf97a53::m::normalAbort' (instruction 1), abort code: 0" + "errors": "Error in 1st command, from '0x89423a90eca23c8d14ab44895f6f8b49e1e692e2e7ea8a9adb677e982cff2a99::m::normalAbort' (instruction 1), abort code: 0" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x1803af073fdd925c6531abdeac9a6970139e99522f1c51b3d8ee19f9ecf97a53::m::assertLineNo' (line 60)" + "errors": "Error in 1st command, from '0x89423a90eca23c8d14ab44895f6f8b49e1e692e2e7ea8a9adb677e982cff2a99::m::assertLineNo' (line 60)" } } ] @@ -248,7 +248,7 @@ Response: { }, "errors": [ { - "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: 9a1632bc40f410b1c232035381c32fa7d17da47d861dbcc83837abdfed6d142d", + "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: f4edd879a3a46dd7756ce940d92d10443b1e930ebfafc542ee488fb6d94c29fb", "locations": [ { "line": 6, @@ -264,7 +264,7 @@ Response: { ] }, { - "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: 9a1632bc40f410b1c232035381c32fa7d17da47d861dbcc83837abdfed6d142d", + "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: f4edd879a3a46dd7756ce940d92d10443b1e930ebfafc542ee488fb6d94c29fb", "locations": [ { "line": 6, @@ -280,7 +280,7 @@ Response: { ] }, { - "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: 9a1632bc40f410b1c232035381c32fa7d17da47d861dbcc83837abdfed6d142d", + "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: f4edd879a3a46dd7756ce940d92d10443b1e930ebfafc542ee488fb6d94c29fb", "locations": [ { "line": 6, @@ -296,7 +296,7 @@ Response: { ] }, { - "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: 9a1632bc40f410b1c232035381c32fa7d17da47d861dbcc83837abdfed6d142d", + "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: f4edd879a3a46dd7756ce940d92d10443b1e930ebfafc542ee488fb6d94c29fb", "locations": [ { "line": 6, @@ -312,7 +312,7 @@ Response: { ] }, { - "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: 9a1632bc40f410b1c232035381c32fa7d17da47d861dbcc83837abdfed6d142d", + "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: f4edd879a3a46dd7756ce940d92d10443b1e930ebfafc542ee488fb6d94c29fb", "locations": [ { "line": 6, @@ -328,7 +328,7 @@ Response: { ] }, { - "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: 9a1632bc40f410b1c232035381c32fa7d17da47d861dbcc83837abdfed6d142d", + "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: f4edd879a3a46dd7756ce940d92d10443b1e930ebfafc542ee488fb6d94c29fb", "locations": [ { "line": 6, @@ -344,7 +344,7 @@ Response: { ] }, { - "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: 9a1632bc40f410b1c232035381c32fa7d17da47d861dbcc83837abdfed6d142d", + "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: f4edd879a3a46dd7756ce940d92d10443b1e930ebfafc542ee488fb6d94c29fb", "locations": [ { "line": 6, @@ -360,7 +360,7 @@ Response: { ] }, { - "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: 9a1632bc40f410b1c232035381c32fa7d17da47d861dbcc83837abdfed6d142d", + "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: f4edd879a3a46dd7756ce940d92d10443b1e930ebfafc542ee488fb6d94c29fb", "locations": [ { "line": 6, @@ -376,7 +376,7 @@ Response: { ] }, { - "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: 9a1632bc40f410b1c232035381c32fa7d17da47d861dbcc83837abdfed6d142d", + "message": "Internal error occurred while processing request: Error resolving Move location: Linkage not found for package: f4edd879a3a46dd7756ce940d92d10443b1e930ebfafc542ee488fb6d94c29fb", "locations": [ { "line": 6, diff --git a/crates/iota-graphql-e2e-tests/tests/errors/clever_errors_in_macros.exp b/crates/iota-graphql-e2e-tests/tests/errors/clever_errors_in_macros.exp index f93b4ed10e6..2a1dad360a2 100644 --- a/crates/iota-graphql-e2e-tests/tests/errors/clever_errors_in_macros.exp +++ b/crates/iota-graphql-e2e-tests/tests/errors/clever_errors_in_macros.exp @@ -37,19 +37,19 @@ Response: { { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x091f35449748beed874ae0236724fa6793ecac06e84c2008e37537d0cecd94ec::m::t_a' (line 21)" + "errors": "Error in 1st command, from '0x232dca06e9cd0e6f2f6d5a3fbf1dae33e98e604f83bab179a2941b9829442fe5::m::t_a' (line 21)" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x091f35449748beed874ae0236724fa6793ecac06e84c2008e37537d0cecd94ec::m::t_calls_a' (line 24)" + "errors": "Error in 1st command, from '0x232dca06e9cd0e6f2f6d5a3fbf1dae33e98e604f83bab179a2941b9829442fe5::m::t_calls_a' (line 24)" } }, { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0x091f35449748beed874ae0236724fa6793ecac06e84c2008e37537d0cecd94ec::m::t_const_assert' (line 10), abort 'EMsg': This is a string" + "errors": "Error in 1st command, from '0x232dca06e9cd0e6f2f6d5a3fbf1dae33e98e604f83bab179a2941b9829442fe5::m::t_const_assert' (line 10), abort 'EMsg': This is a string" } } ] diff --git a/crates/iota-graphql-e2e-tests/tests/event_connection/event_connection.exp b/crates/iota-graphql-e2e-tests/tests/event_connection/event_connection.exp index c0cbd080bff..3bc37bd892e 100644 --- a/crates/iota-graphql-e2e-tests/tests/event_connection/event_connection.exp +++ b/crates/iota-graphql-e2e-tests/tests/event_connection/event_connection.exp @@ -62,7 +62,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x4e7fc229c08ef64b7f9149318b3ede4bfd3aa0a8b5fb0c1a1c1339e90bb38a80::M1::EventA" + "repr": "0xbbc4ca6eb4699aae135eeaf9dc150a0d4aa62872e29f557ab7416f1eadcf434a::M1::EventA" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -80,7 +80,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x4e7fc229c08ef64b7f9149318b3ede4bfd3aa0a8b5fb0c1a1c1339e90bb38a80::M1::EventB<0x4e7fc229c08ef64b7f9149318b3ede4bfd3aa0a8b5fb0c1a1c1339e90bb38a80::M1::Object>" + "repr": "0xbbc4ca6eb4699aae135eeaf9dc150a0d4aa62872e29f557ab7416f1eadcf434a::M1::EventB<0xbbc4ca6eb4699aae135eeaf9dc150a0d4aa62872e29f557ab7416f1eadcf434a::M1::Object>" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -98,7 +98,7 @@ Response: { "name": "M2" }, "type": { - "repr": "0x4e7fc229c08ef64b7f9149318b3ede4bfd3aa0a8b5fb0c1a1c1339e90bb38a80::M2::EventA" + "repr": "0xbbc4ca6eb4699aae135eeaf9dc150a0d4aa62872e29f557ab7416f1eadcf434a::M2::EventA" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -116,7 +116,7 @@ Response: { "name": "M2" }, "type": { - "repr": "0x4e7fc229c08ef64b7f9149318b3ede4bfd3aa0a8b5fb0c1a1c1339e90bb38a80::M2::EventB<0x4e7fc229c08ef64b7f9149318b3ede4bfd3aa0a8b5fb0c1a1c1339e90bb38a80::M2::Object>" + "repr": "0xbbc4ca6eb4699aae135eeaf9dc150a0d4aa62872e29f557ab7416f1eadcf434a::M2::EventB<0xbbc4ca6eb4699aae135eeaf9dc150a0d4aa62872e29f557ab7416f1eadcf434a::M2::Object>" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -145,7 +145,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x4e7fc229c08ef64b7f9149318b3ede4bfd3aa0a8b5fb0c1a1c1339e90bb38a80::M1::EventA" + "repr": "0xbbc4ca6eb4699aae135eeaf9dc150a0d4aa62872e29f557ab7416f1eadcf434a::M1::EventA" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -163,7 +163,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x4e7fc229c08ef64b7f9149318b3ede4bfd3aa0a8b5fb0c1a1c1339e90bb38a80::M1::EventB<0x4e7fc229c08ef64b7f9149318b3ede4bfd3aa0a8b5fb0c1a1c1339e90bb38a80::M1::Object>" + "repr": "0xbbc4ca6eb4699aae135eeaf9dc150a0d4aa62872e29f557ab7416f1eadcf434a::M1::EventB<0xbbc4ca6eb4699aae135eeaf9dc150a0d4aa62872e29f557ab7416f1eadcf434a::M1::Object>" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -181,7 +181,7 @@ Response: { "name": "M2" }, "type": { - "repr": "0x4e7fc229c08ef64b7f9149318b3ede4bfd3aa0a8b5fb0c1a1c1339e90bb38a80::M2::EventA" + "repr": "0xbbc4ca6eb4699aae135eeaf9dc150a0d4aa62872e29f557ab7416f1eadcf434a::M2::EventA" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -199,7 +199,7 @@ Response: { "name": "M2" }, "type": { - "repr": "0x4e7fc229c08ef64b7f9149318b3ede4bfd3aa0a8b5fb0c1a1c1339e90bb38a80::M2::EventB<0x4e7fc229c08ef64b7f9149318b3ede4bfd3aa0a8b5fb0c1a1c1339e90bb38a80::M2::Object>" + "repr": "0xbbc4ca6eb4699aae135eeaf9dc150a0d4aa62872e29f557ab7416f1eadcf434a::M2::EventB<0xbbc4ca6eb4699aae135eeaf9dc150a0d4aa62872e29f557ab7416f1eadcf434a::M2::Object>" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -228,7 +228,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x4e7fc229c08ef64b7f9149318b3ede4bfd3aa0a8b5fb0c1a1c1339e90bb38a80::M1::EventA" + "repr": "0xbbc4ca6eb4699aae135eeaf9dc150a0d4aa62872e29f557ab7416f1eadcf434a::M1::EventA" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -246,7 +246,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x4e7fc229c08ef64b7f9149318b3ede4bfd3aa0a8b5fb0c1a1c1339e90bb38a80::M1::EventB<0x4e7fc229c08ef64b7f9149318b3ede4bfd3aa0a8b5fb0c1a1c1339e90bb38a80::M1::Object>" + "repr": "0xbbc4ca6eb4699aae135eeaf9dc150a0d4aa62872e29f557ab7416f1eadcf434a::M1::EventB<0xbbc4ca6eb4699aae135eeaf9dc150a0d4aa62872e29f557ab7416f1eadcf434a::M1::Object>" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -275,7 +275,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x4e7fc229c08ef64b7f9149318b3ede4bfd3aa0a8b5fb0c1a1c1339e90bb38a80::M1::EventA" + "repr": "0xbbc4ca6eb4699aae135eeaf9dc150a0d4aa62872e29f557ab7416f1eadcf434a::M1::EventA" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -304,7 +304,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x4e7fc229c08ef64b7f9149318b3ede4bfd3aa0a8b5fb0c1a1c1339e90bb38a80::M1::EventB<0x4e7fc229c08ef64b7f9149318b3ede4bfd3aa0a8b5fb0c1a1c1339e90bb38a80::M1::Object>" + "repr": "0xbbc4ca6eb4699aae135eeaf9dc150a0d4aa62872e29f557ab7416f1eadcf434a::M1::EventB<0xbbc4ca6eb4699aae135eeaf9dc150a0d4aa62872e29f557ab7416f1eadcf434a::M1::Object>" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" diff --git a/crates/iota-graphql-e2e-tests/tests/event_connection/nested_emit_event.exp b/crates/iota-graphql-e2e-tests/tests/event_connection/nested_emit_event.exp index d2dd26e9b7c..af318745132 100644 --- a/crates/iota-graphql-e2e-tests/tests/event_connection/nested_emit_event.exp +++ b/crates/iota-graphql-e2e-tests/tests/event_connection/nested_emit_event.exp @@ -30,7 +30,7 @@ Response: { "name": "M3" }, "type": { - "repr": "0x0d89bcf2cce9440c1c24fe316ab44e3149f852bb47714bd088d318fff135b772::M1::EventA" + "repr": "0xe97fc5bb4773ce63b9891018d2859918153e40e7db15133fd25cd170734cef6f::M1::EventA" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -56,7 +56,7 @@ Response: { "name": "M3" }, "type": { - "repr": "0x0d89bcf2cce9440c1c24fe316ab44e3149f852bb47714bd088d318fff135b772::M1::EventA" + "repr": "0xe97fc5bb4773ce63b9891018d2859918153e40e7db15133fd25cd170734cef6f::M1::EventA" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -102,7 +102,7 @@ Response: { "name": "M3" }, "type": { - "repr": "0x0d89bcf2cce9440c1c24fe316ab44e3149f852bb47714bd088d318fff135b772::M1::EventA" + "repr": "0xe97fc5bb4773ce63b9891018d2859918153e40e7db15133fd25cd170734cef6f::M1::EventA" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" diff --git a/crates/iota-graphql-e2e-tests/tests/event_connection/no_filter.exp b/crates/iota-graphql-e2e-tests/tests/event_connection/no_filter.exp index 973bfc67972..6ea0b3c6b60 100644 --- a/crates/iota-graphql-e2e-tests/tests/event_connection/no_filter.exp +++ b/crates/iota-graphql-e2e-tests/tests/event_connection/no_filter.exp @@ -33,12 +33,12 @@ Response: { "nodes": [ { "json": { - "id": "0x9541b2c72dd79fda1356a14f2c65a3236d9fa8690f91e52bf8f24b39fa636e36" + "id": "0x2b91473159957c052b1a93d9c1376ab0d91b605c8316be4b2662e9cc336d083e" } }, { "json": { - "id": "0x9541b2c72dd79fda1356a14f2c65a3236d9fa8690f91e52bf8f24b39fa636e36", + "id": "0x2b91473159957c052b1a93d9c1376ab0d91b605c8316be4b2662e9cc336d083e", "version": 1, "fields": { "contents": [ diff --git a/crates/iota-graphql-e2e-tests/tests/event_connection/pagination.exp b/crates/iota-graphql-e2e-tests/tests/event_connection/pagination.exp index fdc46c72775..3e71075225a 100644 --- a/crates/iota-graphql-e2e-tests/tests/event_connection/pagination.exp +++ b/crates/iota-graphql-e2e-tests/tests/event_connection/pagination.exp @@ -42,7 +42,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x1f57915ce0ae42aa219f3cc99dc4c285414b0df9ffdac98c0eb944c64c1cd4ad::M1::EventA" + "repr": "0xcbb55f60a0de682701cda4af908db58c79fdc776113e863da4c5d1ddd0b8e5cf::M1::EventA" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -60,7 +60,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x1f57915ce0ae42aa219f3cc99dc4c285414b0df9ffdac98c0eb944c64c1cd4ad::M1::EventA" + "repr": "0xcbb55f60a0de682701cda4af908db58c79fdc776113e863da4c5d1ddd0b8e5cf::M1::EventA" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -78,7 +78,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x1f57915ce0ae42aa219f3cc99dc4c285414b0df9ffdac98c0eb944c64c1cd4ad::M1::EventA" + "repr": "0xcbb55f60a0de682701cda4af908db58c79fdc776113e863da4c5d1ddd0b8e5cf::M1::EventA" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -111,7 +111,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x1f57915ce0ae42aa219f3cc99dc4c285414b0df9ffdac98c0eb944c64c1cd4ad::M1::EventA" + "repr": "0xcbb55f60a0de682701cda4af908db58c79fdc776113e863da4c5d1ddd0b8e5cf::M1::EventA" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -129,7 +129,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x1f57915ce0ae42aa219f3cc99dc4c285414b0df9ffdac98c0eb944c64c1cd4ad::M1::EventA" + "repr": "0xcbb55f60a0de682701cda4af908db58c79fdc776113e863da4c5d1ddd0b8e5cf::M1::EventA" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -162,7 +162,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x1f57915ce0ae42aa219f3cc99dc4c285414b0df9ffdac98c0eb944c64c1cd4ad::M1::EventA" + "repr": "0xcbb55f60a0de682701cda4af908db58c79fdc776113e863da4c5d1ddd0b8e5cf::M1::EventA" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -180,7 +180,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x1f57915ce0ae42aa219f3cc99dc4c285414b0df9ffdac98c0eb944c64c1cd4ad::M1::EventA" + "repr": "0xcbb55f60a0de682701cda4af908db58c79fdc776113e863da4c5d1ddd0b8e5cf::M1::EventA" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -213,7 +213,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x1f57915ce0ae42aa219f3cc99dc4c285414b0df9ffdac98c0eb944c64c1cd4ad::M1::EventA" + "repr": "0xcbb55f60a0de682701cda4af908db58c79fdc776113e863da4c5d1ddd0b8e5cf::M1::EventA" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -231,7 +231,7 @@ Response: { "name": "M1" }, "type": { - "repr": "0x1f57915ce0ae42aa219f3cc99dc4c285414b0df9ffdac98c0eb944c64c1cd4ad::M1::EventA" + "repr": "0xcbb55f60a0de682701cda4af908db58c79fdc776113e863da4c5d1ddd0b8e5cf::M1::EventA" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" diff --git a/crates/iota-graphql-e2e-tests/tests/event_connection/tx_digest.exp b/crates/iota-graphql-e2e-tests/tests/event_connection/tx_digest.exp index 3cacae4e1e1..68b49a7f84e 100644 --- a/crates/iota-graphql-e2e-tests/tests/event_connection/tx_digest.exp +++ b/crates/iota-graphql-e2e-tests/tests/event_connection/tx_digest.exp @@ -37,19 +37,19 @@ Response: { "transactionBlocks": { "nodes": [ { - "digest": "5kxKxJyFgHd4UJ5hRdDAqFKpxQ2By93WD5QBirmGxV5G" + "digest": "8twBu7kvzDbfSLjpBJ2GbDpfARJpwkdVCywZJqQCc3Eu" }, { - "digest": "3VvtCtpFF6d1xVP8MaxQG1jKhGMwztHkgmr4oxFQvwQB" + "digest": "GaaiNS8XyGWps9PtJ2ApYExhGVZrc7wPuzbYezy5c8WU" }, { - "digest": "GmxLBE86X53MRMtMSsrvT7jQNgP2WUm58f2vTUmnWCmb" + "digest": "3BB3PxmDSRahQe17BJZFE4tidPq4L9nGzabs7DF1jqvD" }, { - "digest": "D8JKWZpfXiixotdWiU4U8gFsMP1zqytn67BrcmMcs8Ta" + "digest": "8kPLT27dhuva4i5SCqEZFFsBuBD1NZuYcMZnVBEPkhnU" }, { - "digest": "BocKaPfQva3uSbuNjdWjQ7L8PGT3QH5TMENKyM4Tk6y9" + "digest": "5NrZrqgHFvE75nD5DmpyWgbr1rjPNwFqh86cn2v9eB7V" } ] } diff --git a/crates/iota-graphql-e2e-tests/tests/event_connection/tx_digest.move b/crates/iota-graphql-e2e-tests/tests/event_connection/tx_digest.move index 76bee10bffd..f794e2404ab 100644 --- a/crates/iota-graphql-e2e-tests/tests/event_connection/tx_digest.move +++ b/crates/iota-graphql-e2e-tests/tests/event_connection/tx_digest.move @@ -47,7 +47,7 @@ module Test::M1 { { # `transactionDigest` is the digest of the 4th transaction returned by # task 6 (see `tx_digest.exp`) - events(filter: {transactionDigest: "D8JKWZpfXiixotdWiU4U8gFsMP1zqytn67BrcmMcs8Ta"}) { + events(filter: {transactionDigest: "8kPLT27dhuva4i5SCqEZFFsBuBD1NZuYcMZnVBEPkhnU"}) { edges { cursor node { @@ -62,7 +62,7 @@ module Test::M1 { { # `transactionDigest` is the digest of the 4th transaction returned by # task 6 (see `tx_digest.exp`) - events(after: "@{cursor_0}" filter: {transactionDigest: "D8JKWZpfXiixotdWiU4U8gFsMP1zqytn67BrcmMcs8Ta"}) { + events(after: "@{cursor_0}" filter: {transactionDigest: "8kPLT27dhuva4i5SCqEZFFsBuBD1NZuYcMZnVBEPkhnU"}) { edges { cursor node { @@ -79,7 +79,7 @@ module Test::M1 { { # `transactionDigest` is the digest of the 4th transaction returned by # task 6 (see `tx_digest.exp`) - events(after: "@{cursor_0}" filter: {transactionDigest: "D8JKWZpfXiixotdWiU4U8gFsMP1zqytn67BrcmMcs8Ta"}) { + events(after: "@{cursor_0}" filter: {transactionDigest: "8kPLT27dhuva4i5SCqEZFFsBuBD1NZuYcMZnVBEPkhnU"}) { edges { cursor node { @@ -94,7 +94,7 @@ module Test::M1 { { # `transactionDigest` is the digest of the 5th transaction returned by # task 6 (see `tx_digest.exp`) - events(filter: {transactionDigest: "BocKaPfQva3uSbuNjdWjQ7L8PGT3QH5TMENKyM4Tk6y9"}) { + events(filter: {transactionDigest: "5NrZrqgHFvE75nD5DmpyWgbr1rjPNwFqh86cn2v9eB7V"}) { edges { cursor node { @@ -108,7 +108,7 @@ module Test::M1 { { # `transactionDigest` is the digest of the 5th transaction returned by # task 6 (see `tx_digest.exp`) - events(after: "@{cursor_0}" filter: {transactionDigest: "BocKaPfQva3uSbuNjdWjQ7L8PGT3QH5TMENKyM4Tk6y9"}) { + events(after: "@{cursor_0}" filter: {transactionDigest: "5NrZrqgHFvE75nD5DmpyWgbr1rjPNwFqh86cn2v9eB7V"}) { edges { cursor node { @@ -123,7 +123,7 @@ module Test::M1 { { # `transactionDigest` is the digest of the 4th transaction returned by # task 6 (see `tx_digest.exp`) - events(last: 10 filter: {transactionDigest: "D8JKWZpfXiixotdWiU4U8gFsMP1zqytn67BrcmMcs8Ta"}) { + events(last: 10 filter: {transactionDigest: "8kPLT27dhuva4i5SCqEZFFsBuBD1NZuYcMZnVBEPkhnU"}) { edges { cursor node { @@ -138,7 +138,7 @@ module Test::M1 { { # `transactionDigest` is the digest of the 4th transaction returned by # task 6 (see `tx_digest.exp`) - events(last: 10 before: "@{cursor_0}" filter: {transactionDigest: "D8JKWZpfXiixotdWiU4U8gFsMP1zqytn67BrcmMcs8Ta"}) { + events(last: 10 before: "@{cursor_0}" filter: {transactionDigest: "8kPLT27dhuva4i5SCqEZFFsBuBD1NZuYcMZnVBEPkhnU"}) { edges { cursor node { @@ -155,7 +155,7 @@ module Test::M1 { { # `transactionDigest` is the digest of the 4th transaction returned by # task 6 (see `tx_digest.exp`) - events(last: 10 before: "@{cursor_0}" filter: {transactionDigest: "D8JKWZpfXiixotdWiU4U8gFsMP1zqytn67BrcmMcs8Ta"}) { + events(last: 10 before: "@{cursor_0}" filter: {transactionDigest: "8kPLT27dhuva4i5SCqEZFFsBuBD1NZuYcMZnVBEPkhnU"}) { edges { cursor node { @@ -170,7 +170,7 @@ module Test::M1 { { # `transactionDigest` is the digest of the 5th transaction returned by # task 6 (see `tx_digest.exp`) - events(last: 10 filter: {transactionDigest: "BocKaPfQva3uSbuNjdWjQ7L8PGT3QH5TMENKyM4Tk6y9"}) { + events(last: 10 filter: {transactionDigest: "5NrZrqgHFvE75nD5DmpyWgbr1rjPNwFqh86cn2v9eB7V"}) { edges { cursor node { @@ -184,7 +184,7 @@ module Test::M1 { { # `transactionDigest` is the digest of the 5th transaction returned by # task 6 (see `tx_digest.exp`) - events(last: 10 before: "@{cursor_0}" filter: {transactionDigest: "BocKaPfQva3uSbuNjdWjQ7L8PGT3QH5TMENKyM4Tk6y9"}) { + events(last: 10 before: "@{cursor_0}" filter: {transactionDigest: "5NrZrqgHFvE75nD5DmpyWgbr1rjPNwFqh86cn2v9eB7V"}) { edges { cursor node { @@ -199,7 +199,7 @@ module Test::M1 { { # `transactionDigest` is the digest of the 4th transaction returned by # task 6 (see `tx_digest.exp`) - events(filter: {sender: "@{A}" transactionDigest: "D8JKWZpfXiixotdWiU4U8gFsMP1zqytn67BrcmMcs8Ta"}) { + events(filter: {sender: "@{A}" transactionDigest: "8kPLT27dhuva4i5SCqEZFFsBuBD1NZuYcMZnVBEPkhnU"}) { edges { cursor node { @@ -214,7 +214,7 @@ module Test::M1 { { # `transactionDigest` is the digest of the 5th transaction returned by # task 6 (see `tx_digest.exp`) - events(filter: {sender: "@{B}" transactionDigest: "BocKaPfQva3uSbuNjdWjQ7L8PGT3QH5TMENKyM4Tk6y9"}) { + events(filter: {sender: "@{B}" transactionDigest: "5NrZrqgHFvE75nD5DmpyWgbr1rjPNwFqh86cn2v9eB7V"}) { edges { cursor node { @@ -229,7 +229,7 @@ module Test::M1 { { # `transactionDigest` is the digest of the 4th transaction returned by # task 6 (see `tx_digest.exp`) - events(filter: {sender: "@{B}" transactionDigest: "D8JKWZpfXiixotdWiU4U8gFsMP1zqytn67BrcmMcs8Ta"}) { + events(filter: {sender: "@{B}" transactionDigest: "8kPLT27dhuva4i5SCqEZFFsBuBD1NZuYcMZnVBEPkhnU"}) { edges { cursor node { @@ -244,7 +244,7 @@ module Test::M1 { { # `transactionDigest` is the digest of the 5th transaction returned by # task 6 (see `tx_digest.exp`) - events(filter: {sender: "@{A}" transactionDigest: "BocKaPfQva3uSbuNjdWjQ7L8PGT3QH5TMENKyM4Tk6y9"}) { + events(filter: {sender: "@{A}" transactionDigest: "5NrZrqgHFvE75nD5DmpyWgbr1rjPNwFqh86cn2v9eB7V"}) { edges { cursor node { diff --git a/crates/iota-graphql-e2e-tests/tests/event_connection/type_filter.exp b/crates/iota-graphql-e2e-tests/tests/event_connection/type_filter.exp index aece0c3370a..94cafd894b3 100644 --- a/crates/iota-graphql-e2e-tests/tests/event_connection/type_filter.exp +++ b/crates/iota-graphql-e2e-tests/tests/event_connection/type_filter.exp @@ -30,7 +30,7 @@ Response: { "name": "M2" }, "type": { - "repr": "0x2bed8b3b7c1c1f4946172f829fb3543392313644354882477a5db7ab2ce42d61::M1::EventA" + "repr": "0xbd28426e10aae174ca0ee0574592a36e7b996541f639d2c042f8c1ec9a083c33::M1::EventA" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -72,7 +72,7 @@ Response: { "name": "M2" }, "type": { - "repr": "0x2bed8b3b7c1c1f4946172f829fb3543392313644354882477a5db7ab2ce42d61::M1::EventA" + "repr": "0xbd28426e10aae174ca0ee0574592a36e7b996541f639d2c042f8c1ec9a083c33::M1::EventA" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -98,7 +98,7 @@ Response: { "name": "M2" }, "type": { - "repr": "0x2bed8b3b7c1c1f4946172f829fb3543392313644354882477a5db7ab2ce42d61::M2::EventB" + "repr": "0xbd28426e10aae174ca0ee0574592a36e7b996541f639d2c042f8c1ec9a083c33::M2::EventB" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -124,7 +124,7 @@ Response: { "name": "M2" }, "type": { - "repr": "0x2bed8b3b7c1c1f4946172f829fb3543392313644354882477a5db7ab2ce42d61::M1::EventA" + "repr": "0xbd28426e10aae174ca0ee0574592a36e7b996541f639d2c042f8c1ec9a083c33::M1::EventA" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -139,7 +139,7 @@ Response: { "name": "M2" }, "type": { - "repr": "0x2bed8b3b7c1c1f4946172f829fb3543392313644354882477a5db7ab2ce42d61::M2::EventB" + "repr": "0xbd28426e10aae174ca0ee0574592a36e7b996541f639d2c042f8c1ec9a083c33::M2::EventB" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -165,7 +165,7 @@ Response: { "name": "M2" }, "type": { - "repr": "0x2bed8b3b7c1c1f4946172f829fb3543392313644354882477a5db7ab2ce42d61::M1::EventA" + "repr": "0xbd28426e10aae174ca0ee0574592a36e7b996541f639d2c042f8c1ec9a083c33::M1::EventA" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -180,7 +180,7 @@ Response: { "name": "M2" }, "type": { - "repr": "0x2bed8b3b7c1c1f4946172f829fb3543392313644354882477a5db7ab2ce42d61::M2::EventB" + "repr": "0xbd28426e10aae174ca0ee0574592a36e7b996541f639d2c042f8c1ec9a083c33::M2::EventB" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -195,7 +195,7 @@ Response: { "name": "M2" }, "type": { - "repr": "0x2bed8b3b7c1c1f4946172f829fb3543392313644354882477a5db7ab2ce42d61::M2::EventB" + "repr": "0xbd28426e10aae174ca0ee0574592a36e7b996541f639d2c042f8c1ec9a083c33::M2::EventB" }, "sender": { "address": "0x28f02a953f3553f51a9365593c7d4bd0643d2085f004b18c6ca9de51682b2c80" diff --git a/crates/iota-graphql-e2e-tests/tests/event_connection/type_param_filter.exp b/crates/iota-graphql-e2e-tests/tests/event_connection/type_param_filter.exp index 24528c6fd89..b76b284381b 100644 --- a/crates/iota-graphql-e2e-tests/tests/event_connection/type_param_filter.exp +++ b/crates/iota-graphql-e2e-tests/tests/event_connection/type_param_filter.exp @@ -38,19 +38,19 @@ Response: { "transactionBlocks": { "nodes": [ { - "digest": "5kxKxJyFgHd4UJ5hRdDAqFKpxQ2By93WD5QBirmGxV5G" + "digest": "8twBu7kvzDbfSLjpBJ2GbDpfARJpwkdVCywZJqQCc3Eu" }, { - "digest": "BEXbvgKWGQhMvS1PoV2a7c2Wgr3dfK229ir5Ubkfhm8o" + "digest": "DajMe5yQb58g3mEg5Lro7654ttnUL7WYbAcfdJQusLQy" }, { - "digest": "AzMRRSR2Uu39kRnpNZQDAs7Mg9rfo57uZn4zk7D8n9Ly" + "digest": "HBZfkNS4HTKTqSf6xsBBrBkTP9FTP8s2kFHYEeGV3i2F" }, { - "digest": "5ZnHMJYaowR9GX7j6uUbeJgDqDUwk8z5j9d5QeZ87w3E" + "digest": "FMUBpggCSevRg1mMsj7xyJ8Hcwk1u49SWnZo2arciPxM" }, { - "digest": "tqCdKSzTf2AtDS5QwSup41Vr1kSGtzUMWZuAgKNHRNu" + "digest": "ECJhnduFaZDQdcnG6iNdKweAnq6LvgnkvuDWVkAFwywj" } ] } @@ -65,7 +65,7 @@ Response: { "nodes": [ { "type": { - "repr": "0x2792abbe5866e4e9d048ea7b9a41fe13b198b4fdf6e3d8b68032e4b9e1065de9::M1::EventA<0x2792abbe5866e4e9d048ea7b9a41fe13b198b4fdf6e3d8b68032e4b9e1065de9::M1::T1>" + "repr": "0xf15189808de27b1c917c0f82626b69bf4a2fd46948f2e8e26f8af93634124cb2::M1::EventA<0xf15189808de27b1c917c0f82626b69bf4a2fd46948f2e8e26f8af93634124cb2::M1::T1>" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -78,7 +78,7 @@ Response: { }, { "type": { - "repr": "0x2792abbe5866e4e9d048ea7b9a41fe13b198b4fdf6e3d8b68032e4b9e1065de9::M1::EventA<0x2792abbe5866e4e9d048ea7b9a41fe13b198b4fdf6e3d8b68032e4b9e1065de9::M1::T2>" + "repr": "0xf15189808de27b1c917c0f82626b69bf4a2fd46948f2e8e26f8af93634124cb2::M1::EventA<0xf15189808de27b1c917c0f82626b69bf4a2fd46948f2e8e26f8af93634124cb2::M1::T2>" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -91,7 +91,7 @@ Response: { }, { "type": { - "repr": "0x2792abbe5866e4e9d048ea7b9a41fe13b198b4fdf6e3d8b68032e4b9e1065de9::M1::EventA<0x2792abbe5866e4e9d048ea7b9a41fe13b198b4fdf6e3d8b68032e4b9e1065de9::M1::T1>" + "repr": "0xf15189808de27b1c917c0f82626b69bf4a2fd46948f2e8e26f8af93634124cb2::M1::EventA<0xf15189808de27b1c917c0f82626b69bf4a2fd46948f2e8e26f8af93634124cb2::M1::T1>" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -104,7 +104,7 @@ Response: { }, { "type": { - "repr": "0x2792abbe5866e4e9d048ea7b9a41fe13b198b4fdf6e3d8b68032e4b9e1065de9::M1::EventA<0x2792abbe5866e4e9d048ea7b9a41fe13b198b4fdf6e3d8b68032e4b9e1065de9::M1::T2>" + "repr": "0xf15189808de27b1c917c0f82626b69bf4a2fd46948f2e8e26f8af93634124cb2::M1::EventA<0xf15189808de27b1c917c0f82626b69bf4a2fd46948f2e8e26f8af93634124cb2::M1::T2>" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -128,7 +128,7 @@ Response: { "nodes": [ { "type": { - "repr": "0x2792abbe5866e4e9d048ea7b9a41fe13b198b4fdf6e3d8b68032e4b9e1065de9::M1::EventA<0x2792abbe5866e4e9d048ea7b9a41fe13b198b4fdf6e3d8b68032e4b9e1065de9::M1::T1>" + "repr": "0xf15189808de27b1c917c0f82626b69bf4a2fd46948f2e8e26f8af93634124cb2::M1::EventA<0xf15189808de27b1c917c0f82626b69bf4a2fd46948f2e8e26f8af93634124cb2::M1::T1>" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -141,7 +141,7 @@ Response: { }, { "type": { - "repr": "0x2792abbe5866e4e9d048ea7b9a41fe13b198b4fdf6e3d8b68032e4b9e1065de9::M1::EventA<0x2792abbe5866e4e9d048ea7b9a41fe13b198b4fdf6e3d8b68032e4b9e1065de9::M1::T1>" + "repr": "0xf15189808de27b1c917c0f82626b69bf4a2fd46948f2e8e26f8af93634124cb2::M1::EventA<0xf15189808de27b1c917c0f82626b69bf4a2fd46948f2e8e26f8af93634124cb2::M1::T1>" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" @@ -165,7 +165,7 @@ Response: { "nodes": [ { "type": { - "repr": "0x2792abbe5866e4e9d048ea7b9a41fe13b198b4fdf6e3d8b68032e4b9e1065de9::M1::EventA<0x2792abbe5866e4e9d048ea7b9a41fe13b198b4fdf6e3d8b68032e4b9e1065de9::M1::T2>" + "repr": "0xf15189808de27b1c917c0f82626b69bf4a2fd46948f2e8e26f8af93634124cb2::M1::EventA<0xf15189808de27b1c917c0f82626b69bf4a2fd46948f2e8e26f8af93634124cb2::M1::T2>" }, "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" diff --git a/crates/iota-graphql-e2e-tests/tests/event_connection/type_param_filter.move b/crates/iota-graphql-e2e-tests/tests/event_connection/type_param_filter.move index cf75960b6d5..6a8c249e01f 100644 --- a/crates/iota-graphql-e2e-tests/tests/event_connection/type_param_filter.move +++ b/crates/iota-graphql-e2e-tests/tests/event_connection/type_param_filter.move @@ -81,7 +81,7 @@ module Test::M1 { { # `transactionDigest` is the digest of the 5th transaction returned from # task 6 (see `type_param_filter.exp`) - events(filter: {eventType: "@{Test}::M1::EventA<@{Test}::M1::T2>", transactionDigest: "tqCdKSzTf2AtDS5QwSup41Vr1kSGtzUMWZuAgKNHRNu"}) { + events(filter: {eventType: "@{Test}::M1::EventA<@{Test}::M1::T2>", transactionDigest: "ECJhnduFaZDQdcnG6iNdKweAnq6LvgnkvuDWVkAFwywj"}) { nodes { type { repr diff --git a/crates/iota-graphql-e2e-tests/tests/limits/directives.exp b/crates/iota-graphql-e2e-tests/tests/limits/directives.exp index 6bb7821a67a..e01ddb91d62 100644 --- a/crates/iota-graphql-e2e-tests/tests/limits/directives.exp +++ b/crates/iota-graphql-e2e-tests/tests/limits/directives.exp @@ -73,7 +73,7 @@ task 5, lines 59-63: //# run-graphql Response: { "data": { - "chainIdentifier": "157e9367" + "chainIdentifier": "e1d5137d" } } @@ -81,7 +81,7 @@ task 6, lines 65-69: //# run-graphql Response: { "data": { - "chainIdentifier": "157e9367" + "chainIdentifier": "e1d5137d" } } diff --git a/crates/iota-graphql-e2e-tests/tests/limits/output_node_estimation.exp b/crates/iota-graphql-e2e-tests/tests/limits/output_node_estimation.exp index e3788b7ca7e..16e0028a7a4 100644 --- a/crates/iota-graphql-e2e-tests/tests/limits/output_node_estimation.exp +++ b/crates/iota-graphql-e2e-tests/tests/limits/output_node_estimation.exp @@ -30,7 +30,7 @@ Response: { "edges": [ { "node": { - "digest": "3Q2jsrXKU4XeL54Zha5iaGZ1o8vS8v2w1yNmzctFP8nx" + "digest": "Cpgs1hPAQs2nfbQkD2ZsEfEAvmtTjb7QT5mtXaMQwhgD" } } ] @@ -59,7 +59,7 @@ Response: { "edges": [ { "txns": { - "digest": "3Q2jsrXKU4XeL54Zha5iaGZ1o8vS8v2w1yNmzctFP8nx" + "digest": "Cpgs1hPAQs2nfbQkD2ZsEfEAvmtTjb7QT5mtXaMQwhgD" } } ] @@ -91,7 +91,7 @@ Response: { "edges": [ { "txns": { - "digest": "3Q2jsrXKU4XeL54Zha5iaGZ1o8vS8v2w1yNmzctFP8nx" + "digest": "Cpgs1hPAQs2nfbQkD2ZsEfEAvmtTjb7QT5mtXaMQwhgD" } } ] @@ -100,7 +100,7 @@ Response: { "edges": [ { "txns": { - "digest": "3Q2jsrXKU4XeL54Zha5iaGZ1o8vS8v2w1yNmzctFP8nx" + "digest": "Cpgs1hPAQs2nfbQkD2ZsEfEAvmtTjb7QT5mtXaMQwhgD" } } ] @@ -132,7 +132,7 @@ Response: { "edges": [ { "txns": { - "digest": "3Q2jsrXKU4XeL54Zha5iaGZ1o8vS8v2w1yNmzctFP8nx" + "digest": "Cpgs1hPAQs2nfbQkD2ZsEfEAvmtTjb7QT5mtXaMQwhgD" } } ] @@ -164,7 +164,7 @@ Response: { "edges": [ { "txns": { - "digest": "3Q2jsrXKU4XeL54Zha5iaGZ1o8vS8v2w1yNmzctFP8nx" + "digest": "Cpgs1hPAQs2nfbQkD2ZsEfEAvmtTjb7QT5mtXaMQwhgD" } } ] @@ -190,7 +190,7 @@ Response: { "edges": [ { "txns": { - "digest": "3Q2jsrXKU4XeL54Zha5iaGZ1o8vS8v2w1yNmzctFP8nx" + "digest": "Cpgs1hPAQs2nfbQkD2ZsEfEAvmtTjb7QT5mtXaMQwhgD" } } ] @@ -216,7 +216,7 @@ Response: { "edges": [ { "txns": { - "digest": "3Q2jsrXKU4XeL54Zha5iaGZ1o8vS8v2w1yNmzctFP8nx", + "digest": "Cpgs1hPAQs2nfbQkD2ZsEfEAvmtTjb7QT5mtXaMQwhgD", "first": null, "last": null } @@ -243,7 +243,7 @@ Response: { "transactionBlocks": { "nodes": [ { - "digest": "3Q2jsrXKU4XeL54Zha5iaGZ1o8vS8v2w1yNmzctFP8nx", + "digest": "Cpgs1hPAQs2nfbQkD2ZsEfEAvmtTjb7QT5mtXaMQwhgD", "first": null, "last": null } @@ -270,7 +270,7 @@ Response: { "edges": [ { "txns": { - "digest": "3Q2jsrXKU4XeL54Zha5iaGZ1o8vS8v2w1yNmzctFP8nx", + "digest": "Cpgs1hPAQs2nfbQkD2ZsEfEAvmtTjb7QT5mtXaMQwhgD", "a": null, "b": null } @@ -324,7 +324,7 @@ Response: { "edges": [ { "node": { - "digest": "3Q2jsrXKU4XeL54Zha5iaGZ1o8vS8v2w1yNmzctFP8nx", + "digest": "Cpgs1hPAQs2nfbQkD2ZsEfEAvmtTjb7QT5mtXaMQwhgD", "a": null } } @@ -350,14 +350,14 @@ Response: { "fragmentSpread": { "nodes": [ { - "digest": "3Q2jsrXKU4XeL54Zha5iaGZ1o8vS8v2w1yNmzctFP8nx" + "digest": "Cpgs1hPAQs2nfbQkD2ZsEfEAvmtTjb7QT5mtXaMQwhgD" } ] }, "inlineFragment": { "nodes": [ { - "digest": "3Q2jsrXKU4XeL54Zha5iaGZ1o8vS8v2w1yNmzctFP8nx" + "digest": "Cpgs1hPAQs2nfbQkD2ZsEfEAvmtTjb7QT5mtXaMQwhgD" } ] } diff --git a/crates/iota-graphql-e2e-tests/tests/objects/coin.exp b/crates/iota-graphql-e2e-tests/tests/objects/coin.exp index 022776bd296..9375b4e1bb2 100644 --- a/crates/iota-graphql-e2e-tests/tests/objects/coin.exp +++ b/crates/iota-graphql-e2e-tests/tests/objects/coin.exp @@ -21,9 +21,9 @@ Response: { "iotaCoins": { "edges": [ { - "cursor": "ICYbB8yabwJpJa85NV5Ml4hbZwmh+Dk5u4oYwCdRHhXHAQAAAAAAAAA=", + "cursor": "IBao6IhDn7hl4uu2XYkOhyvmcXQU9AHwebV0HmdGfKQcAQAAAAAAAAA=", "node": { - "coinBalance": "30000000000000000", + "coinBalance": "299999983336400", "contents": { "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::iota::IOTA>" @@ -32,9 +32,9 @@ Response: { } }, { - "cursor": "IHqyduB7yB08AKw/UjTM5yFLXmn1y/oHU18UsF7spVl8AQAAAAAAAAA=", + "cursor": "IIz+6PGvwXCeVC7Vm0H9kJEMAsXnzlBZzrSz99JdySOdAQAAAAAAAAA=", "node": { - "coinBalance": "299999983336400", + "coinBalance": "30000000000000000", "contents": { "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::iota::IOTA>" @@ -43,7 +43,7 @@ Response: { } }, { - "cursor": "IJxCLHjKRKWXWqm27erPobYKzVvMRQ7CDLAEbIXhMbSaAQAAAAAAAAA=", + "cursor": "IJvawMH0VbgEh/ZtB0erXxE+/rzdAlj0WIt3JzjQs8sRAQAAAAAAAAA=", "node": { "coinBalance": "300000000000000", "contents": { @@ -58,34 +58,34 @@ Response: { "fakeCoins": { "edges": [ { - "cursor": "IDfBTpW4Gk9r2WwLe6RXhCU3QV4gHvosomQcJvbaQ6WeAQAAAAAAAAA=", + "cursor": "IIg4QyiMWUOTVMNTmRkL1HIQr7k/z9dcG4oAetb6QjbGAQAAAAAAAAA=", "node": { "coinBalance": "2", "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0a47ea4347bcd024df307a10bbe264c358b63f74fab5346285ee912ba2fc89ea::fake::FAKE>" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x5427c77851d42bea4fbbfe56724d57756b843e2038f23785cef5b9559d01bef8::fake::FAKE>" } } } }, { - "cursor": "IHdmN4tiqKqMTphDhbKuNxyBkFvllV5nvqX1AUHP7Af/AQAAAAAAAAA=", + "cursor": "IImP7Bx+qUUTyvUk5wSrKU90abCFrbzb0AfgLca4fyV7AQAAAAAAAAA=", "node": { "coinBalance": "1", "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0a47ea4347bcd024df307a10bbe264c358b63f74fab5346285ee912ba2fc89ea::fake::FAKE>" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x5427c77851d42bea4fbbfe56724d57756b843e2038f23785cef5b9559d01bef8::fake::FAKE>" } } } }, { - "cursor": "INbHCg0pGQzm8VcanOqukxcfJzpPDcf0k17AapNHLVpwAQAAAAAAAAA=", + "cursor": "IJU3paGJOHPouEf9+iN6nqiqFacvNzEI//kR9mj6PQYiAQAAAAAAAAA=", "node": { "coinBalance": "3", "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0a47ea4347bcd024df307a10bbe264c358b63f74fab5346285ee912ba2fc89ea::fake::FAKE>" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x5427c77851d42bea4fbbfe56724d57756b843e2038f23785cef5b9559d01bef8::fake::FAKE>" } } } @@ -96,7 +96,7 @@ Response: { "coins": { "edges": [ { - "cursor": "IHqyduB7yB08AKw/UjTM5yFLXmn1y/oHU18UsF7spVl8AQAAAAAAAAA=", + "cursor": "IBao6IhDn7hl4uu2XYkOhyvmcXQU9AHwebV0HmdGfKQcAQAAAAAAAAA=", "node": { "coinBalance": "299999983336400", "contents": { @@ -121,10 +121,10 @@ Response: { } }, { - "cursor": "eyJ0IjoiMHgwYTQ3ZWE0MzQ3YmNkMDI0ZGYzMDdhMTBiYmUyNjRjMzU4YjYzZjc0ZmFiNTM0NjI4NWVlOTEyYmEyZmM4OWVhOjpmYWtlOjpGQUtFIiwiYyI6MX0", + "cursor": "eyJ0IjoiMHg1NDI3Yzc3ODUxZDQyYmVhNGZiYmZlNTY3MjRkNTc3NTZiODQzZTIwMzhmMjM3ODVjZWY1Yjk1NTlkMDFiZWY4OjpmYWtlOjpGQUtFIiwiYyI6MX0", "node": { "coinType": { - "repr": "0x0a47ea4347bcd024df307a10bbe264c358b63f74fab5346285ee912ba2fc89ea::fake::FAKE" + "repr": "0x5427c77851d42bea4fbbfe56724d57756b843e2038f23785cef5b9559d01bef8::fake::FAKE" }, "coinObjectCount": 3, "totalBalance": "6" @@ -142,7 +142,7 @@ Response: { "lastBalance": { "edges": [ { - "cursor": "eyJ0IjoiMHgwYTQ3ZWE0MzQ3YmNkMDI0ZGYzMDdhMTBiYmUyNjRjMzU4YjYzZjc0ZmFiNTM0NjI4NWVlOTEyYmEyZmM4OWVhOjpmYWtlOjpGQUtFIiwiYyI6MX0" + "cursor": "eyJ0IjoiMHg1NDI3Yzc3ODUxZDQyYmVhNGZiYmZlNTY3MjRkNTc3NTZiODQzZTIwMzhmMjM3ODVjZWY1Yjk1NTlkMDFiZWY4OjpmYWtlOjpGQUtFIiwiYyI6MX0" } ] } diff --git a/crates/iota-graphql-e2e-tests/tests/objects/data.exp b/crates/iota-graphql-e2e-tests/tests/objects/data.exp index a19ad66d0dc..e9559c6c1ae 100644 --- a/crates/iota-graphql-e2e-tests/tests/objects/data.exp +++ b/crates/iota-graphql-e2e-tests/tests/objects/data.exp @@ -44,38 +44,38 @@ Response: { "name": "id", "value": { "UID": [ - 156, - 66, - 44, - 120, - 202, - 68, - 165, - 151, - 90, - 169, - 182, - 237, - 234, - 207, - 161, - 182, - 10, - 205, - 91, - 204, - 69, - 14, - 194, - 12, - 176, + 155, + 218, + 192, + 193, + 244, + 85, + 184, 4, - 108, - 133, - 225, - 49, - 180, - 154 + 135, + 246, + 109, + 7, + 71, + 171, + 95, + 17, + 62, + 254, + 188, + 221, + 2, + 88, + 244, + 88, + 139, + 119, + 39, + 56, + 208, + 179, + 203, + 17 ] } }, @@ -95,7 +95,7 @@ Response: { ] }, "json": { - "id": "0x9c422c78ca44a5975aa9b6edeacfa1b60acd5bcc450ec20cb0046c85e131b49a", + "id": "0x9bdac0c1f455b80487f66d0747ab5f113efebcdd0258f4588b772738d0b3cb11", "balance": { "value": "299999988454400" } @@ -109,7 +109,7 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0x0efae4c4ef97efbff02076010b775c6bd3f97c5d6d3506f4097825c9b6cc136a::m::Foo" + "repr": "0xaac88efdf69f44a44633c28935fc8834a333cdd1372ae3f9b858eb897bb52c14::m::Foo" }, "data": { "Struct": [ @@ -117,38 +117,38 @@ Response: { "name": "id", "value": { "UID": [ + 222, + 16, + 127, + 78, 164, - 17, - 213, - 232, - 47, - 31, - 112, - 148, - 198, - 194, - 58, - 105, - 83, - 52, - 194, - 18, - 45, - 68, - 30, - 182, - 62, - 88, + 189, + 180, + 48, + 5, + 65, + 191, + 115, + 225, + 187, + 228, + 4, + 78, + 29, + 216, + 201, + 12, + 74, + 221, 186, - 87, - 247, + 81, + 50, + 245, + 14, + 57, + 227, 96, - 70, - 82, - 4, - 3, - 72, - 43 + 40 ] } }, @@ -156,38 +156,38 @@ Response: { "name": "f0", "value": { "ID": [ + 222, + 16, + 127, + 78, 164, - 17, - 213, - 232, - 47, - 31, - 112, - 148, - 198, - 194, - 58, - 105, - 83, - 52, - 194, - 18, - 45, - 68, - 30, - 182, - 62, - 88, + 189, + 180, + 48, + 5, + 65, + 191, + 115, + 225, + 187, + 228, + 4, + 78, + 29, + 216, + 201, + 12, + 74, + 221, 186, - 87, - 247, + 81, + 50, + 245, + 14, + 57, + 227, 96, - 70, - 82, - 4, - 3, - 72, - 43 + 40 ] } }, @@ -227,38 +227,38 @@ Response: { "Vector": [ { "Address": [ + 222, + 16, + 127, + 78, 164, - 17, - 213, - 232, - 47, - 31, - 112, - 148, - 198, - 194, - 58, - 105, - 83, - 52, - 194, - 18, - 45, - 68, - 30, - 182, - 62, - 88, + 189, + 180, + 48, + 5, + 65, + 191, + 115, + 225, + 187, + 228, + 4, + 78, + 29, + 216, + 201, + 12, + 74, + 221, 186, - 87, - 247, + 81, + 50, + 245, + 14, + 57, + 227, 96, - 70, - 82, - 4, - 3, - 72, - 43 + 40 ] } ] @@ -275,15 +275,15 @@ Response: { ] }, "json": { - "id": "0xa411d5e82f1f7094c6c23a695334c2122d441eb63e58ba57f76046520403482b", - "f0": "0xa411d5e82f1f7094c6c23a695334c2122d441eb63e58ba57f76046520403482b", + "id": "0xde107f4ea4bdb4300541bf73e1bbe4044e1dd8c90c4addba5132f50e39e36028", + "f0": "0xde107f4ea4bdb4300541bf73e1bbe4044e1dd8c90c4addba5132f50e39e36028", "f1": true, "f2": 42, "f3": "43", "f4": "hello", "f5": "world", "f6": [ - "0xa411d5e82f1f7094c6c23a695334c2122d441eb63e58ba57f76046520403482b" + "0xde107f4ea4bdb4300541bf73e1bbe4044e1dd8c90c4addba5132f50e39e36028" ], "f7": 44 } diff --git a/crates/iota-graphql-e2e-tests/tests/objects/display.exp b/crates/iota-graphql-e2e-tests/tests/objects/display.exp index 30438e439e3..55af5c6afcf 100644 --- a/crates/iota-graphql-e2e-tests/tests/objects/display.exp +++ b/crates/iota-graphql-e2e-tests/tests/objects/display.exp @@ -5,7 +5,7 @@ A: object(0,0) task 1, lines 7-131: //# publish --sender A -events: Event { package_id: Test, transaction_module: Identifier("boars"), sender: A, type_: StructTag { address: iota, module: Identifier("display"), name: Identifier("DisplayCreated"), type_params: [Struct(StructTag { address: Test, module: Identifier("boars"), name: Identifier("Boar"), type_params: [] })] }, contents: [79, 141, 203, 153, 57, 55, 108, 120, 194, 53, 199, 30, 160, 171, 249, 41, 24, 66, 59, 90, 24, 118, 129, 144, 208, 225, 134, 169, 17, 34, 56, 99] } +events: Event { package_id: Test, transaction_module: Identifier("boars"), sender: A, type_: StructTag { address: iota, module: Identifier("display"), name: Identifier("DisplayCreated"), type_params: [Struct(StructTag { address: Test, module: Identifier("boars"), name: Identifier("Boar"), type_params: [] })] }, contents: [91, 12, 10, 43, 119, 160, 47, 175, 213, 37, 57, 38, 91, 66, 168, 83, 130, 247, 170, 150, 13, 25, 185, 175, 7, 21, 197, 128, 93, 72, 108, 33] } created: object(1,0), object(1,1), object(1,2) mutated: object(0,0) gas summary: computation_cost: 1000000, storage_cost: 21470000, storage_rebate: 0, non_refundable_storage_fee: 0 @@ -16,7 +16,7 @@ Checkpoint created: 1 task 3, line 135: //# view-checkpoint -CheckpointSummary { epoch: 0, seq: 1, content_digest: 9F7c2TgpqEJgQfpoZVgrShGJY6hDy4w7V72tDsYGmFdA, +CheckpointSummary { epoch: 0, seq: 1, content_digest: DbUNZNH3kBMZDctWEPfNqahnKKDU2AQAm2JuXameKnri, epoch_rolling_gas_cost_summary: GasCostSummary { computation_cost: 1000000, storage_cost: 21470000, storage_rebate: 0, non_refundable_storage_fee: 0 }} task 4, line 137: @@ -27,7 +27,7 @@ gas summary: computation_cost: 1000000, storage_cost: 3556800, storage_rebate: task 5, line 139: //# run Test::boars::update_display_faulty --sender A --args object(1,1) -events: Event { package_id: Test, transaction_module: Identifier("boars"), sender: A, type_: StructTag { address: iota, module: Identifier("display"), name: Identifier("VersionUpdated"), type_params: [Struct(StructTag { address: Test, module: Identifier("boars"), name: Identifier("Boar"), type_params: [] })] }, contents: [79, 141, 203, 153, 57, 55, 108, 120, 194, 53, 199, 30, 160, 171, 249, 41, 24, 66, 59, 90, 24, 118, 129, 144, 208, 225, 134, 169, 17, 34, 56, 99, 1, 0, 3, 7, 118, 101, 99, 116, 111, 114, 115, 5, 123, 118, 101, 99, 125, 3, 105, 100, 100, 5, 123, 105, 100, 100, 125, 5, 110, 97, 109, 101, 101, 7, 123, 110, 97, 109, 101, 101, 125] } +events: Event { package_id: Test, transaction_module: Identifier("boars"), sender: A, type_: StructTag { address: iota, module: Identifier("display"), name: Identifier("VersionUpdated"), type_params: [Struct(StructTag { address: Test, module: Identifier("boars"), name: Identifier("Boar"), type_params: [] })] }, contents: [91, 12, 10, 43, 119, 160, 47, 175, 213, 37, 57, 38, 91, 66, 168, 83, 130, 247, 170, 150, 13, 25, 185, 175, 7, 21, 197, 128, 93, 72, 108, 33, 1, 0, 3, 7, 118, 101, 99, 116, 111, 114, 115, 5, 123, 118, 101, 99, 125, 3, 105, 100, 100, 5, 123, 105, 100, 100, 125, 5, 110, 97, 109, 101, 101, 7, 123, 110, 97, 109, 101, 101, 125] } mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 2941200, storage_rebate: 2652400, non_refundable_storage_fee: 0 @@ -37,7 +37,7 @@ Checkpoint created: 2 task 7, line 143: //# view-checkpoint -CheckpointSummary { epoch: 0, seq: 2, content_digest: FesnkK13c6BpGeE4gdZA7y3mH6wCYPTen1PWBeH7HyAj, +CheckpointSummary { epoch: 0, seq: 2, content_digest: AXoLpv4nzVNNQWqZZDvvErHqqZ7inju4FDZHfXxs2WH3, epoch_rolling_gas_cost_summary: GasCostSummary { computation_cost: 3000000, storage_cost: 27968000, storage_rebate: 3640400, non_refundable_storage_fee: 0 }} task 8, lines 145-158: @@ -74,7 +74,7 @@ Response: { task 9, line 160: //# run Test::boars::single_add --sender A --args object(1,1) -events: Event { package_id: Test, transaction_module: Identifier("boars"), sender: A, type_: StructTag { address: iota, module: Identifier("display"), name: Identifier("VersionUpdated"), type_params: [Struct(StructTag { address: Test, module: Identifier("boars"), name: Identifier("Boar"), type_params: [] })] }, contents: [79, 141, 203, 153, 57, 55, 108, 120, 194, 53, 199, 30, 160, 171, 249, 41, 24, 66, 59, 90, 24, 118, 129, 144, 208, 225, 134, 169, 17, 34, 56, 99, 2, 0, 4, 7, 118, 101, 99, 116, 111, 114, 115, 5, 123, 118, 101, 99, 125, 3, 105, 100, 100, 5, 123, 105, 100, 100, 125, 5, 110, 97, 109, 101, 101, 7, 123, 110, 97, 109, 101, 101, 125, 4, 110, 117, 109, 115, 6, 123, 110, 117, 109, 115, 125] } +events: Event { package_id: Test, transaction_module: Identifier("boars"), sender: A, type_: StructTag { address: iota, module: Identifier("display"), name: Identifier("VersionUpdated"), type_params: [Struct(StructTag { address: Test, module: Identifier("boars"), name: Identifier("Boar"), type_params: [] })] }, contents: [91, 12, 10, 43, 119, 160, 47, 175, 213, 37, 57, 38, 91, 66, 168, 83, 130, 247, 170, 150, 13, 25, 185, 175, 7, 21, 197, 128, 93, 72, 108, 33, 2, 0, 4, 7, 118, 101, 99, 116, 111, 114, 115, 5, 123, 118, 101, 99, 125, 3, 105, 100, 100, 5, 123, 105, 100, 100, 125, 5, 110, 97, 109, 101, 101, 7, 123, 110, 97, 109, 101, 101, 125, 4, 110, 117, 109, 115, 6, 123, 110, 117, 109, 115, 125] } mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 3032400, storage_rebate: 2941200, non_refundable_storage_fee: 0 @@ -84,7 +84,7 @@ Checkpoint created: 3 task 11, line 164: //# view-checkpoint -CheckpointSummary { epoch: 0, seq: 3, content_digest: GieDkngnP3zKqAVwq9Z3dzLV3SFxQSF6MCzLRTR21a1Y, +CheckpointSummary { epoch: 0, seq: 3, content_digest: 2BVqD56hZGPtPBg9bBdVJ9mrZNd2DStiCLKncnedfDEH, epoch_rolling_gas_cost_summary: GasCostSummary { computation_cost: 4000000, storage_cost: 31000400, storage_rebate: 6581600, non_refundable_storage_fee: 0 }} task 12, lines 166-179: @@ -126,7 +126,7 @@ Response: { task 13, line 181: //# run Test::boars::multi_add --sender A --args object(1,1) -events: Event { package_id: Test, transaction_module: Identifier("boars"), sender: A, type_: StructTag { address: iota, module: Identifier("display"), name: Identifier("VersionUpdated"), type_params: [Struct(StructTag { address: Test, module: Identifier("boars"), name: Identifier("Boar"), type_params: [] })] }, contents: [79, 141, 203, 153, 57, 55, 108, 120, 194, 53, 199, 30, 160, 171, 249, 41, 24, 66, 59, 90, 24, 118, 129, 144, 208, 225, 134, 169, 17, 34, 56, 99, 3, 0, 15, 7, 118, 101, 99, 116, 111, 114, 115, 5, 123, 118, 101, 99, 125, 3, 105, 100, 100, 5, 123, 105, 100, 100, 125, 5, 110, 97, 109, 101, 101, 7, 123, 110, 97, 109, 101, 101, 125, 4, 110, 117, 109, 115, 6, 123, 110, 117, 109, 115, 125, 5, 98, 111, 111, 108, 115, 7, 123, 98, 111, 111, 108, 115, 125, 5, 98, 117, 121, 101, 114, 7, 123, 98, 117, 121, 101, 114, 125, 4, 110, 97, 109, 101, 6, 123, 110, 97, 109, 101, 125, 7, 99, 114, 101, 97, 116, 111, 114, 9, 123, 99, 114, 101, 97, 116, 111, 114, 125, 5, 112, 114, 105, 99, 101, 7, 123, 112, 114, 105, 99, 101, 125, 11, 112, 114, 111, 106, 101, 99, 116, 95, 117, 114, 108, 58, 85, 110, 105, 113, 117, 101, 32, 66, 111, 97, 114, 32, 102, 114, 111, 109, 32, 116, 104, 101, 32, 66, 111, 97, 114, 115, 32, 99, 111, 108, 108, 101, 99, 116, 105, 111, 110, 32, 119, 105, 116, 104, 32, 123, 110, 97, 109, 101, 125, 32, 97, 110, 100, 32, 123, 105, 100, 125, 8, 98, 97, 115, 101, 95, 117, 114, 108, 32, 104, 116, 116, 112, 115, 58, 47, 47, 103, 101, 116, 45, 97, 45, 98, 111, 97, 114, 46, 99, 111, 109, 47, 123, 105, 109, 103, 95, 117, 114, 108, 125, 11, 110, 111, 95, 116, 101, 109, 112, 108, 97, 116, 101, 23, 104, 116, 116, 112, 115, 58, 47, 47, 103, 101, 116, 45, 97, 45, 98, 111, 97, 114, 46, 99, 111, 109, 47, 3, 97, 103, 101, 21, 123, 109, 101, 116, 97, 100, 97, 116, 97, 46, 110, 101, 115, 116, 101, 100, 46, 97, 103, 101, 125, 8, 102, 117, 108, 108, 95, 117, 114, 108, 10, 123, 102, 117, 108, 108, 95, 117, 114, 108, 125, 13, 101, 115, 99, 97, 112, 101, 95, 115, 121, 110, 116, 97, 120, 8, 92, 123, 110, 97, 109, 101, 92, 125] } +events: Event { package_id: Test, transaction_module: Identifier("boars"), sender: A, type_: StructTag { address: iota, module: Identifier("display"), name: Identifier("VersionUpdated"), type_params: [Struct(StructTag { address: Test, module: Identifier("boars"), name: Identifier("Boar"), type_params: [] })] }, contents: [91, 12, 10, 43, 119, 160, 47, 175, 213, 37, 57, 38, 91, 66, 168, 83, 130, 247, 170, 150, 13, 25, 185, 175, 7, 21, 197, 128, 93, 72, 108, 33, 3, 0, 15, 7, 118, 101, 99, 116, 111, 114, 115, 5, 123, 118, 101, 99, 125, 3, 105, 100, 100, 5, 123, 105, 100, 100, 125, 5, 110, 97, 109, 101, 101, 7, 123, 110, 97, 109, 101, 101, 125, 4, 110, 117, 109, 115, 6, 123, 110, 117, 109, 115, 125, 5, 98, 111, 111, 108, 115, 7, 123, 98, 111, 111, 108, 115, 125, 5, 98, 117, 121, 101, 114, 7, 123, 98, 117, 121, 101, 114, 125, 4, 110, 97, 109, 101, 6, 123, 110, 97, 109, 101, 125, 7, 99, 114, 101, 97, 116, 111, 114, 9, 123, 99, 114, 101, 97, 116, 111, 114, 125, 5, 112, 114, 105, 99, 101, 7, 123, 112, 114, 105, 99, 101, 125, 11, 112, 114, 111, 106, 101, 99, 116, 95, 117, 114, 108, 58, 85, 110, 105, 113, 117, 101, 32, 66, 111, 97, 114, 32, 102, 114, 111, 109, 32, 116, 104, 101, 32, 66, 111, 97, 114, 115, 32, 99, 111, 108, 108, 101, 99, 116, 105, 111, 110, 32, 119, 105, 116, 104, 32, 123, 110, 97, 109, 101, 125, 32, 97, 110, 100, 32, 123, 105, 100, 125, 8, 98, 97, 115, 101, 95, 117, 114, 108, 32, 104, 116, 116, 112, 115, 58, 47, 47, 103, 101, 116, 45, 97, 45, 98, 111, 97, 114, 46, 99, 111, 109, 47, 123, 105, 109, 103, 95, 117, 114, 108, 125, 11, 110, 111, 95, 116, 101, 109, 112, 108, 97, 116, 101, 23, 104, 116, 116, 112, 115, 58, 47, 47, 103, 101, 116, 45, 97, 45, 98, 111, 97, 114, 46, 99, 111, 109, 47, 3, 97, 103, 101, 21, 123, 109, 101, 116, 97, 100, 97, 116, 97, 46, 110, 101, 115, 116, 101, 100, 46, 97, 103, 101, 125, 8, 102, 117, 108, 108, 95, 117, 114, 108, 10, 123, 102, 117, 108, 108, 95, 117, 114, 108, 125, 13, 101, 115, 99, 97, 112, 101, 95, 115, 121, 110, 116, 97, 120, 8, 92, 123, 110, 97, 109, 101, 92, 125] } mutated: object(0,0), object(1,1) gas summary: computation_cost: 1000000, storage_cost: 5236400, storage_rebate: 3032400, non_refundable_storage_fee: 0 @@ -136,7 +136,7 @@ Checkpoint created: 4 task 15, line 185: //# view-checkpoint -CheckpointSummary { epoch: 0, seq: 4, content_digest: GejuPGmwpDZZsYHjhdWhgd7iUEbmLptrvyeEDG3vDfnv, +CheckpointSummary { epoch: 0, seq: 4, content_digest: EmMrLtLuyYesFUFnrqSgjozhxxtc4i5cyW1GE24TpqY5, epoch_rolling_gas_cost_summary: GasCostSummary { computation_cost: 5000000, storage_cost: 36236800, storage_rebate: 9614000, non_refundable_storage_fee: 0 }} task 16, lines 187-200: @@ -195,7 +195,7 @@ Response: { }, { "key": "project_url", - "value": "Unique Boar from the Boars collection with First Boar and 0x10f5201cbbe803388e1b03c7a6836c655639f67c8f14a742e9119e9fb4286e58", + "value": "Unique Boar from the Boars collection with First Boar and 0x1d14b05a0e4de04a366be5fb238a260b319e94a986a953f31ab9e0284fb0ca61", "error": null }, { diff --git a/crates/iota-graphql-e2e-tests/tests/objects/enum_data.exp b/crates/iota-graphql-e2e-tests/tests/objects/enum_data.exp index 6f1b7fab628..6138279f370 100644 --- a/crates/iota-graphql-e2e-tests/tests/objects/enum_data.exp +++ b/crates/iota-graphql-e2e-tests/tests/objects/enum_data.exp @@ -36,7 +36,7 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0xbc9658781cb63be50f8df25d28690777e9f756684b2b4fdfed5d88609f5c06b1::m::Foo" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::iota::IOTA>" }, "data": { "Struct": [ @@ -44,38 +44,111 @@ Response: { "name": "id", "value": { "UID": [ - 148, - 127, - 206, - 36, - 57, + 155, + 218, + 192, + 193, + 244, + 85, + 184, + 4, + 135, + 246, + 109, + 7, + 71, + 171, + 95, + 17, + 62, + 254, + 188, + 221, + 2, + 88, + 244, + 88, 139, - 230, - 19, - 69, - 97, + 119, + 39, + 56, + 208, + 179, 203, - 64, - 214, - 243, - 96, - 16, - 59, - 31, - 219, + 17 + ] + } + }, + { + "name": "balance", + "value": { + "Struct": [ + { + "name": "value", + "value": { + "Number": "299999995967600" + } + } + ] + } + } + ] + }, + "json": { + "id": "0x9bdac0c1f455b80487f66d0747ab5f113efebcdd0258f4588b772738d0b3cb11", + "balance": { + "value": "299999995967600" + } + } + } + } + } + }, + { + "outputState": { + "asMoveObject": { + "contents": { + "type": { + "repr": "0x66ec5f38cce33a6aeba11afe550856c87f6b57c585b69e14f0311447d5820c73::m::Foo" + }, + "data": { + "Struct": [ + { + "name": "id", + "value": { + "UID": [ + 185, + 241, + 144, + 30, + 249, + 175, + 178, + 209, + 182, + 91, + 235, 220, - 158, - 217, - 81, - 135, + 70, + 222, + 101, + 82, + 67, 126, - 8, - 233, - 88, - 40, - 255, - 71, - 12 + 38, + 215, + 113, + 183, + 75, + 12, + 89, + 242, + 129, + 117, + 237, + 39, + 184, + 165 ] } }, @@ -83,38 +156,38 @@ Response: { "name": "f0", "value": { "ID": [ - 148, - 127, - 206, - 36, - 57, - 139, - 230, - 19, - 69, - 97, - 203, - 64, - 214, - 243, - 96, - 16, - 59, - 31, - 219, + 185, + 241, + 144, + 30, + 249, + 175, + 178, + 209, + 182, + 91, + 235, 220, - 158, - 217, - 81, - 135, + 70, + 222, + 101, + 82, + 67, 126, - 8, - 233, - 88, - 40, - 255, - 71, - 12 + 38, + 215, + 113, + 183, + 75, + 12, + 89, + 242, + 129, + 117, + 237, + 39, + 184, + 165 ] } }, @@ -154,38 +227,38 @@ Response: { "Vector": [ { "Address": [ - 148, - 127, - 206, - 36, - 57, - 139, - 230, - 19, - 69, - 97, - 203, - 64, - 214, - 243, - 96, - 16, - 59, - 31, - 219, + 185, + 241, + 144, + 30, + 249, + 175, + 178, + 209, + 182, + 91, + 235, 220, - 158, - 217, - 81, - 135, + 70, + 222, + 101, + 82, + 67, 126, - 8, - 233, - 88, - 40, - 255, - 71, - 12 + 38, + 215, + 113, + 183, + 75, + 12, + 89, + 242, + 129, + 117, + 237, + 39, + 184, + 165 ] } ] @@ -252,15 +325,15 @@ Response: { ] }, "json": { - "id": "0x947fce24398be6134561cb40d6f360103b1fdbdc9ed951877e08e95828ff470c", - "f0": "0x947fce24398be6134561cb40d6f360103b1fdbdc9ed951877e08e95828ff470c", + "id": "0xb9f1901ef9afb2d1b65bebdc46de6552437e26d771b74b0c59f28175ed27b8a5", + "f0": "0xb9f1901ef9afb2d1b65bebdc46de6552437e26d771b74b0c59f28175ed27b8a5", "f1": true, "f2": 42, "f3": "43", "f4": "hello", "f5": "world", "f6": [ - "0x947fce24398be6134561cb40d6f360103b1fdbdc9ed951877e08e95828ff470c" + "0xb9f1901ef9afb2d1b65bebdc46de6552437e26d771b74b0c59f28175ed27b8a5" ], "f7": 44, "f8": { @@ -283,79 +356,6 @@ Response: { } } } - }, - { - "outputState": { - "asMoveObject": { - "contents": { - "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::iota::IOTA>" - }, - "data": { - "Struct": [ - { - "name": "id", - "value": { - "UID": [ - 156, - 66, - 44, - 120, - 202, - 68, - 165, - 151, - 90, - 169, - 182, - 237, - 234, - 207, - 161, - 182, - 10, - 205, - 91, - 204, - 69, - 14, - 194, - 12, - 176, - 4, - 108, - 133, - 225, - 49, - 180, - 154 - ] - } - }, - { - "name": "balance", - "value": { - "Struct": [ - { - "name": "value", - "value": { - "Number": "299999995967600" - } - } - ] - } - } - ] - }, - "json": { - "id": "0x9c422c78ca44a5975aa9b6edeacfa1b60acd5bcc450ec20cb0046c85e131b49a", - "balance": { - "value": "299999995967600" - } - } - } - } - } } ] } diff --git a/crates/iota-graphql-e2e-tests/tests/objects/filter_by_type.exp b/crates/iota-graphql-e2e-tests/tests/objects/filter_by_type.exp index c09e3defafe..bd9162c4cb7 100644 --- a/crates/iota-graphql-e2e-tests/tests/objects/filter_by_type.exp +++ b/crates/iota-graphql-e2e-tests/tests/objects/filter_by_type.exp @@ -21,7 +21,7 @@ gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: task 4, lines 16-18: //# run 0x3::iota_system::request_add_stake --args object(0x5) object(3,0) @validator_0 --sender C -events: Event { package_id: iota_system, transaction_module: Identifier("iota_system"), sender: C, type_: StructTag { address: iota_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [233, 207, 22, 117, 92, 142, 77, 109, 192, 159, 55, 48, 51, 243, 196, 130, 69, 227, 174, 117, 15, 72, 135, 76, 78, 53, 195, 204, 77, 84, 130, 131, 175, 163, 158, 79, 0, 218, 226, 120, 249, 119, 199, 198, 147, 10, 94, 44, 118, 232, 93, 23, 165, 38, 215, 36, 187, 206, 15, 184, 31, 176, 125, 76, 140, 202, 78, 28, 224, 186, 89, 4, 206, 166, 29, 249, 36, 45, 162, 247, 210, 158, 62, 243, 40, 251, 126, 192, 124, 8, 107, 59, 244, 124, 166, 26, 1, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } +events: Event { package_id: iota_system, transaction_module: Identifier("iota_system"), sender: C, type_: StructTag { address: iota_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [171, 56, 174, 116, 116, 231, 90, 122, 148, 80, 189, 213, 3, 8, 47, 190, 80, 171, 87, 32, 84, 9, 231, 203, 82, 3, 186, 181, 58, 235, 194, 1, 175, 163, 158, 79, 0, 218, 226, 120, 249, 119, 199, 198, 147, 10, 94, 44, 118, 232, 93, 23, 165, 38, 215, 36, 187, 206, 15, 184, 31, 176, 125, 76, 140, 202, 78, 28, 224, 186, 89, 4, 206, 166, 29, 249, 36, 45, 162, 247, 210, 158, 62, 243, 40, 251, 126, 192, 124, 8, 107, 59, 244, 124, 166, 26, 1, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } created: object(4,0) mutated: object(_), 0x0000000000000000000000000000000000000000000000000000000000000005, object(0,0) deleted: object(3,0) @@ -145,7 +145,7 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::display::Display<0x000000000000000000000000000000000000000000000000000000000000107a::nft::Nft>" } } } @@ -156,7 +156,7 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field,0x0000000000000000000000000000000000000000000000000000000000000002::timelock::SystemTimelockCap>" } } } @@ -167,7 +167,7 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field,0x0000000000000000000000000000000000000000000000000000000000000002::timelock::SystemTimelockCap>" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field" } } } @@ -200,7 +200,7 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::iota::IOTA>" } } } @@ -222,7 +222,7 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field" } } } @@ -233,7 +233,7 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::display::Display<0x000000000000000000000000000000000000000000000000000000000000107a::nft::Nft>" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field" } } } @@ -244,7 +244,7 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::iota::IOTA>" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field<0x0000000000000000000000000000000000000000000000000000000000000002::object::ID,address>" } } } @@ -255,7 +255,7 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field<0x0000000000000000000000000000000000000000000000000000000000000002::object::ID,address>" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field" } } } diff --git a/crates/iota-graphql-e2e-tests/tests/objects/pagination.exp b/crates/iota-graphql-e2e-tests/tests/objects/pagination.exp index 952eba3ffcd..1c7b0508d36 100644 --- a/crates/iota-graphql-e2e-tests/tests/objects/pagination.exp +++ b/crates/iota-graphql-e2e-tests/tests/objects/pagination.exp @@ -48,19 +48,19 @@ Response: { "objects": { "edges": [ { - "cursor": "IEDSk627fQsytn/ikdGQtF3KwSuu/naEpKOvuirYJ5m0AQAAAAAAAAA=" + "cursor": "ICtsolfhSs84dlGvOImwI5jzXXQu2djMTh/gQQJgahXGAQAAAAAAAAA=" }, { - "cursor": "IFGKFT9PZ8JOjuvml92sXxsJ7bILPYFp+HnbpIuVbiMBAQAAAAAAAAA=" + "cursor": "IIt71raxnB/0N0g4+DWkvYCE3zMwk/e4DvXm1zFlJwt0AQAAAAAAAAA=" }, { - "cursor": "IH16DW3lpd8N1iV4jvbm8kALVovmI+sl+VUeffpH8snwAQAAAAAAAAA=" + "cursor": "II5CZZLbHHjpLgtfdPqwkekv/h4PbtW2t3jDYeM1OLloAQAAAAAAAAA=" }, { - "cursor": "IJ4etep87+xECxMt7pHa/nvzbxtgS/fPiZFOM3aFVgqAAQAAAAAAAAA=" + "cursor": "IJlUozzGeAqyGOEW+M5AEBV7mSeyEPC82WBdwBQh7krzAQAAAAAAAAA=" }, { - "cursor": "INK0CTjfJeJxj9bteOyQhcLDgG2Pr3cfwDvII3tNj+XRAQAAAAAAAAA=" + "cursor": "IJsn9ZEZnNXewi7e86kFfZssa+oH496dRRxZR/uo6X0ZAQAAAAAAAAA=" } ] } @@ -76,10 +76,10 @@ Response: { "objects": { "edges": [ { - "cursor": "IEDSk627fQsytn/ikdGQtF3KwSuu/naEpKOvuirYJ5m0AQAAAAAAAAA=" + "cursor": "ICtsolfhSs84dlGvOImwI5jzXXQu2djMTh/gQQJgahXGAQAAAAAAAAA=" }, { - "cursor": "IFGKFT9PZ8JOjuvml92sXxsJ7bILPYFp+HnbpIuVbiMBAQAAAAAAAAA=" + "cursor": "IIt71raxnB/0N0g4+DWkvYCE3zMwk/e4DvXm1zFlJwt0AQAAAAAAAAA=" } ] } @@ -95,52 +95,52 @@ Response: { "objects": { "edges": [ { - "cursor": "IEDSk627fQsytn/ikdGQtF3KwSuu/naEpKOvuirYJ5m0AQAAAAAAAAA=", + "cursor": "ICtsolfhSs84dlGvOImwI5jzXXQu2djMTh/gQQJgahXGAQAAAAAAAAA=", "node": { - "address": "0x40d293adbb7d0b32b67fe291d190b45dcac12baefe7684a4a3afba2ad82799b4" + "address": "0x2b6ca257e14acf387651af3889b02398f35d742ed9d8cc4e1fe04102606a15c6" } }, { - "cursor": "IFGKFT9PZ8JOjuvml92sXxsJ7bILPYFp+HnbpIuVbiMBAQAAAAAAAAA=", + "cursor": "IIt71raxnB/0N0g4+DWkvYCE3zMwk/e4DvXm1zFlJwt0AQAAAAAAAAA=", "node": { - "address": "0x518a153f4f67c24e8eebe697ddac5f1b09edb20b3d8169f879dba48b956e2301" + "address": "0x8b7bd6b6b19c1ff4374838f835a4bd8084df333093f7b80ef5e6d73165270b74" } }, { - "cursor": "IH16DW3lpd8N1iV4jvbm8kALVovmI+sl+VUeffpH8snwAQAAAAAAAAA=", + "cursor": "II5CZZLbHHjpLgtfdPqwkekv/h4PbtW2t3jDYeM1OLloAQAAAAAAAAA=", "node": { - "address": "0x7d7a0d6de5a5df0dd625788ef6e6f2400b568be623eb25f9551e7dfa47f2c9f0" + "address": "0x8e426592db1c78e92e0b5f74fab091e92ffe1e0f6ed5b6b778c361e33538b968" } }, { - "cursor": "IJ4etep87+xECxMt7pHa/nvzbxtgS/fPiZFOM3aFVgqAAQAAAAAAAAA=", + "cursor": "IJlUozzGeAqyGOEW+M5AEBV7mSeyEPC82WBdwBQh7krzAQAAAAAAAAA=", "node": { - "address": "0x9e1eb5ea7cefec440b132dee91dafe7bf36f1b604bf7cf89914e337685560a80" + "address": "0x9954a33cc6780ab218e116f8ce4010157b9927b210f0bcd9605dc01421ee4af3" } }, { - "cursor": "INK0CTjfJeJxj9bteOyQhcLDgG2Pr3cfwDvII3tNj+XRAQAAAAAAAAA=", + "cursor": "IJsn9ZEZnNXewi7e86kFfZssa+oH496dRRxZR/uo6X0ZAQAAAAAAAAA=", "node": { - "address": "0xd2b40938df25e2718fd6ed78ec9085c2c3806d8faf771fc03bc8237b4d8fe5d1" + "address": "0x9b27f591199cd5dec22edef3a9057d9b2c6bea07e3de9d451c5947fba8e97d19" } } ] } }, "obj_3_0": { - "address": "0x40d293adbb7d0b32b67fe291d190b45dcac12baefe7684a4a3afba2ad82799b4" + "address": "0x8b7bd6b6b19c1ff4374838f835a4bd8084df333093f7b80ef5e6d73165270b74" }, "obj_5_0": { - "address": "0xd2b40938df25e2718fd6ed78ec9085c2c3806d8faf771fc03bc8237b4d8fe5d1" + "address": "0x9954a33cc6780ab218e116f8ce4010157b9927b210f0bcd9605dc01421ee4af3" }, "obj_6_0": { - "address": "0x9e1eb5ea7cefec440b132dee91dafe7bf36f1b604bf7cf89914e337685560a80" + "address": "0x9b27f591199cd5dec22edef3a9057d9b2c6bea07e3de9d451c5947fba8e97d19" }, "obj_4_0": { - "address": "0x518a153f4f67c24e8eebe697ddac5f1b09edb20b3d8169f879dba48b956e2301" + "address": "0x8e426592db1c78e92e0b5f74fab091e92ffe1e0f6ed5b6b778c361e33538b968" }, "obj_2_0": { - "address": "0x7d7a0d6de5a5df0dd625788ef6e6f2400b568be623eb25f9551e7dfa47f2c9f0" + "address": "0x2b6ca257e14acf387651af3889b02398f35d742ed9d8cc4e1fe04102606a15c6" } } } @@ -151,7 +151,11 @@ Response: { "data": { "address": { "objects": { - "edges": [] + "edges": [ + { + "cursor": "IJsn9ZEZnNXewi7e86kFfZssa+oH496dRRxZR/uo6X0ZAQAAAAAAAAA=" + } + ] } } } @@ -165,7 +169,7 @@ Response: { "objects": { "edges": [ { - "cursor": "IH16DW3lpd8N1iV4jvbm8kALVovmI+sl+VUeffpH8snwAQAAAAAAAAA=" + "cursor": "IJlUozzGeAqyGOEW+M5AEBV7mSeyEPC82WBdwBQh7krzAQAAAAAAAAA=" } ] } @@ -179,7 +183,11 @@ Response: { "data": { "address": { "objects": { - "edges": [] + "edges": [ + { + "cursor": "ICtsolfhSs84dlGvOImwI5jzXXQu2djMTh/gQQJgahXGAQAAAAAAAAA=" + } + ] } } } @@ -193,15 +201,15 @@ Response: { "objects": { "edges": [ { - "cursor": "IJ4etep87+xECxMt7pHa/nvzbxtgS/fPiZFOM3aFVgqAAQAAAAAAAAA=", + "cursor": "IJlUozzGeAqyGOEW+M5AEBV7mSeyEPC82WBdwBQh7krzAQAAAAAAAAA=", "node": { - "address": "0x9e1eb5ea7cefec440b132dee91dafe7bf36f1b604bf7cf89914e337685560a80" + "address": "0x9954a33cc6780ab218e116f8ce4010157b9927b210f0bcd9605dc01421ee4af3" } }, { - "cursor": "INK0CTjfJeJxj9bteOyQhcLDgG2Pr3cfwDvII3tNj+XRAQAAAAAAAAA=", + "cursor": "IJsn9ZEZnNXewi7e86kFfZssa+oH496dRRxZR/uo6X0ZAQAAAAAAAAA=", "node": { - "address": "0xd2b40938df25e2718fd6ed78ec9085c2c3806d8faf771fc03bc8237b4d8fe5d1" + "address": "0x9b27f591199cd5dec22edef3a9057d9b2c6bea07e3de9d451c5947fba8e97d19" } } ] diff --git a/crates/iota-graphql-e2e-tests/tests/objects/public_transfer.exp b/crates/iota-graphql-e2e-tests/tests/objects/public_transfer.exp index cda429bd0d7..59da6a2004d 100644 --- a/crates/iota-graphql-e2e-tests/tests/objects/public_transfer.exp +++ b/crates/iota-graphql-e2e-tests/tests/objects/public_transfer.exp @@ -37,10 +37,10 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0x90fe12b6a159cd99f67000fb7102a692407cb182a97c5c47bbbd2013685e4e2f::m::Bar" + "repr": "0x24c656fc76e9147ca76a3d20b7933a417a10714e9c32360ba95aaac0407d6a7b::m::Foo" } }, - "hasPublicTransfer": false + "hasPublicTransfer": true } } }, @@ -61,10 +61,10 @@ Response: { "asMoveObject": { "contents": { "type": { - "repr": "0x90fe12b6a159cd99f67000fb7102a692407cb182a97c5c47bbbd2013685e4e2f::m::Foo" + "repr": "0x24c656fc76e9147ca76a3d20b7933a417a10714e9c32360ba95aaac0407d6a7b::m::Bar" } }, - "hasPublicTransfer": true + "hasPublicTransfer": false } } } diff --git a/crates/iota-graphql-e2e-tests/tests/objects/received.exp b/crates/iota-graphql-e2e-tests/tests/objects/received.exp index d12cb1a5b46..ccd85baf2ed 100644 --- a/crates/iota-graphql-e2e-tests/tests/objects/received.exp +++ b/crates/iota-graphql-e2e-tests/tests/objects/received.exp @@ -30,7 +30,7 @@ Response: { "receivedTransactionBlocks": { "nodes": [ { - "digest": "8Tpmc27hRrtKVmzNYax4GUjS9KjxV6gp6TWU85arSBuF" + "digest": "HKYdrd3SigjtyshocUcpngqrcEHd5bLE7a5PuqopsEp6" } ] } diff --git a/crates/iota-graphql-e2e-tests/tests/objects/staked_iota.exp b/crates/iota-graphql-e2e-tests/tests/objects/staked_iota.exp index 36ea35aec35..a4d3ec518fa 100644 --- a/crates/iota-graphql-e2e-tests/tests/objects/staked_iota.exp +++ b/crates/iota-graphql-e2e-tests/tests/objects/staked_iota.exp @@ -10,7 +10,7 @@ Response: { "objects": { "edges": [ { - "cursor": "ID2b/KDmn+mINf+fV2rpfJtyLKYwbJXgm/zNF3KeS3QhAAAAAAAAAAA=", + "cursor": "IL6XFugQ26bu+xGPneNsvxIrMLQoA3owT5H4f3zHNuXIAAAAAAAAAAA=", "node": { "asMoveObject": { "asStakedIota": { @@ -39,7 +39,7 @@ gas summary: computation_cost: 1000000, storage_cost: 1976000, storage_rebate: task 3, line 38: //# run 0x3::iota_system::request_add_stake --args object(0x5) object(2,0) @validator_0 --sender C -events: Event { package_id: iota_system, transaction_module: Identifier("iota_system"), sender: C, type_: StructTag { address: iota_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [233, 207, 22, 117, 92, 142, 77, 109, 192, 159, 55, 48, 51, 243, 196, 130, 69, 227, 174, 117, 15, 72, 135, 76, 78, 53, 195, 204, 77, 84, 130, 131, 175, 163, 158, 79, 0, 218, 226, 120, 249, 119, 199, 198, 147, 10, 94, 44, 118, 232, 93, 23, 165, 38, 215, 36, 187, 206, 15, 184, 31, 176, 125, 76, 140, 202, 78, 28, 224, 186, 89, 4, 206, 166, 29, 249, 36, 45, 162, 247, 210, 158, 62, 243, 40, 251, 126, 192, 124, 8, 107, 59, 244, 124, 166, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } +events: Event { package_id: iota_system, transaction_module: Identifier("iota_system"), sender: C, type_: StructTag { address: iota_system, module: Identifier("validator"), name: Identifier("StakingRequestEvent"), type_params: [] }, contents: [171, 56, 174, 116, 116, 231, 90, 122, 148, 80, 189, 213, 3, 8, 47, 190, 80, 171, 87, 32, 84, 9, 231, 203, 82, 3, 186, 181, 58, 235, 194, 1, 175, 163, 158, 79, 0, 218, 226, 120, 249, 119, 199, 198, 147, 10, 94, 44, 118, 232, 93, 23, 165, 38, 215, 36, 187, 206, 15, 184, 31, 176, 125, 76, 140, 202, 78, 28, 224, 186, 89, 4, 206, 166, 29, 249, 36, 45, 162, 247, 210, 158, 62, 243, 40, 251, 126, 192, 124, 8, 107, 59, 244, 124, 166, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 11, 84, 2, 0, 0, 0] } created: object(3,0), object(3,1) mutated: 0x0000000000000000000000000000000000000000000000000000000000000005, object(0,0) deleted: object(_), object(2,0) @@ -60,34 +60,34 @@ Response: { "objects": { "edges": [ { - "cursor": "ID2b/KDmn+mINf+fV2rpfJtyLKYwbJXgm/zNF3KeS3QhAgAAAAAAAAA=", + "cursor": "ICyVnatyIW8BBQyropcZeyQEQxpFiSDIk5mD/WFlco2wAgAAAAAAAAA=", "node": { "asMoveObject": { "asStakedIota": { - "principal": "1500000000000000", - "poolId": "0xe9cf16755c8e4d6dc09f373033f3c48245e3ae750f48874c4e35c3cc4d548283" + "principal": "10000000000", + "poolId": "0xab38ae7474e75a7a9450bdd503082fbe50ab57205409e7cb5203bab53aebc201" } } } }, { - "cursor": "IMqZuQSI1P4/w7vGb7cegyAhP7MlN0wtU6CPLPVuQweKAgAAAAAAAAA=", + "cursor": "IL6XFugQ26bu+xGPneNsvxIrMLQoA3owT5H4f3zHNuXIAgAAAAAAAAA=", "node": { "asMoveObject": { "asStakedIota": { - "principal": "15340000000000", - "poolId": "0xe9cf16755c8e4d6dc09f373033f3c48245e3ae750f48874c4e35c3cc4d548283" + "principal": "1500000000000000", + "poolId": "0xab38ae7474e75a7a9450bdd503082fbe50ab57205409e7cb5203bab53aebc201" } } } }, { - "cursor": "IOnE7aJU6U1Isae47+9Q/LjemKofCkTn6xN5WNNmjvrdAgAAAAAAAAA=", + "cursor": "IMqZuQSI1P4/w7vGb7cegyAhP7MlN0wtU6CPLPVuQweKAgAAAAAAAAA=", "node": { "asMoveObject": { "asStakedIota": { - "principal": "10000000000", - "poolId": "0xe9cf16755c8e4d6dc09f373033f3c48245e3ae750f48874c4e35c3cc4d548283" + "principal": "15340000000000", + "poolId": "0xab38ae7474e75a7a9450bdd503082fbe50ab57205409e7cb5203bab53aebc201" } } } @@ -98,7 +98,7 @@ Response: { "stakedIotas": { "edges": [ { - "cursor": "IOnE7aJU6U1Isae47+9Q/LjemKofCkTn6xN5WNNmjvrdAgAAAAAAAAA=", + "cursor": "ICyVnatyIW8BBQyropcZeyQEQxpFiSDIk5mD/WFlco2wAgAAAAAAAAA=", "node": { "principal": "10000000000" } diff --git a/crates/iota-graphql-e2e-tests/tests/owner/downcasts.exp b/crates/iota-graphql-e2e-tests/tests/owner/downcasts.exp index b41f08d1d15..9128df7e650 100644 --- a/crates/iota-graphql-e2e-tests/tests/owner/downcasts.exp +++ b/crates/iota-graphql-e2e-tests/tests/owner/downcasts.exp @@ -24,7 +24,7 @@ Response: { }, "coin": { "asObject": { - "digest": "CJYTW4TXXaEQJvcmgyenkLnWccpto2ydL5GsngYtKh6r" + "digest": "5vRWjBz8CXM1nbBRud4xQLkHPa5hUfomnTs2Vbc6PruV" } } } diff --git a/crates/iota-graphql-e2e-tests/tests/owner/root_version.exp b/crates/iota-graphql-e2e-tests/tests/owner/root_version.exp index 4b3f1605e94..07ae68efadb 100644 --- a/crates/iota-graphql-e2e-tests/tests/owner/root_version.exp +++ b/crates/iota-graphql-e2e-tests/tests/owner/root_version.exp @@ -124,10 +124,10 @@ Response: { "version": 11, "contents": { "json": { - "id": "0x929221e11df0175aa1eabad96d59c8d410b9d21b645aaf79d7dffe8a2ca6fd5e", + "id": "0x7f25c843015b0ca01a7bb3d5c433ed7a925ebf816889a33039b4c01ef1d57a55", "count": "1", "wrapped": { - "id": "0xc63a859ad3565d14dd2a6e86727feeb50f7c83e8fd6ef0ba6060a27a987a6779", + "id": "0x18000440516999a85b3bdf516c720df29f7a858360de51f4178a7232f5460cdc", "count": "1" } } @@ -141,10 +141,10 @@ Response: { "version": 10, "contents": { "json": { - "id": "0x929221e11df0175aa1eabad96d59c8d410b9d21b645aaf79d7dffe8a2ca6fd5e", + "id": "0x7f25c843015b0ca01a7bb3d5c433ed7a925ebf816889a33039b4c01ef1d57a55", "count": "1", "wrapped": { - "id": "0xc63a859ad3565d14dd2a6e86727feeb50f7c83e8fd6ef0ba6060a27a987a6779", + "id": "0x18000440516999a85b3bdf516c720df29f7a858360de51f4178a7232f5460cdc", "count": "1" } } @@ -158,10 +158,10 @@ Response: { "version": 8, "contents": { "json": { - "id": "0x929221e11df0175aa1eabad96d59c8d410b9d21b645aaf79d7dffe8a2ca6fd5e", + "id": "0x7f25c843015b0ca01a7bb3d5c433ed7a925ebf816889a33039b4c01ef1d57a55", "count": "1", "wrapped": { - "id": "0xc63a859ad3565d14dd2a6e86727feeb50f7c83e8fd6ef0ba6060a27a987a6779", + "id": "0x18000440516999a85b3bdf516c720df29f7a858360de51f4178a7232f5460cdc", "count": "0" } } @@ -175,10 +175,10 @@ Response: { "version": 7, "contents": { "json": { - "id": "0x929221e11df0175aa1eabad96d59c8d410b9d21b645aaf79d7dffe8a2ca6fd5e", + "id": "0x7f25c843015b0ca01a7bb3d5c433ed7a925ebf816889a33039b4c01ef1d57a55", "count": "0", "wrapped": { - "id": "0xc63a859ad3565d14dd2a6e86727feeb50f7c83e8fd6ef0ba6060a27a987a6779", + "id": "0x18000440516999a85b3bdf516c720df29f7a858360de51f4178a7232f5460cdc", "count": "0" } } @@ -199,7 +199,7 @@ Response: { "version": 7, "contents": { "json": { - "id": "0x4ad8511fbee8662b83da22a400b18d49bf895a1bad9949f877664346cb778d6d", + "id": "0x521959664b50a297d21c5d2adca1265cf0fceecdc1082262335b9fb681294d99", "count": "0" } } @@ -212,7 +212,7 @@ Response: { "version": 10, "contents": { "json": { - "id": "0x4ad8511fbee8662b83da22a400b18d49bf895a1bad9949f877664346cb778d6d", + "id": "0x521959664b50a297d21c5d2adca1265cf0fceecdc1082262335b9fb681294d99", "count": "1" } } @@ -225,7 +225,7 @@ Response: { "version": 10, "contents": { "json": { - "id": "0x4ad8511fbee8662b83da22a400b18d49bf895a1bad9949f877664346cb778d6d", + "id": "0x521959664b50a297d21c5d2adca1265cf0fceecdc1082262335b9fb681294d99", "count": "1" } } @@ -238,7 +238,7 @@ Response: { "version": 7, "contents": { "json": { - "id": "0x4ad8511fbee8662b83da22a400b18d49bf895a1bad9949f877664346cb778d6d", + "id": "0x521959664b50a297d21c5d2adca1265cf0fceecdc1082262335b9fb681294d99", "count": "0" } } @@ -251,7 +251,7 @@ Response: { "version": 7, "contents": { "json": { - "id": "0x4ad8511fbee8662b83da22a400b18d49bf895a1bad9949f877664346cb778d6d", + "id": "0x521959664b50a297d21c5d2adca1265cf0fceecdc1082262335b9fb681294d99", "count": "0" } } @@ -271,7 +271,7 @@ Response: { "version": 7, "contents": { "json": { - "id": "0x4e0d15c4938faa6096532976870ea525d839acc4c009c31f1c91b2d583f0ca2a", + "id": "0x89fde96c1fe78bfc82af2bdaeba88cf217b22cb5574d6472080033d2c40ff796", "count": "0" } } @@ -284,7 +284,7 @@ Response: { "version": 11, "contents": { "json": { - "id": "0x4e0d15c4938faa6096532976870ea525d839acc4c009c31f1c91b2d583f0ca2a", + "id": "0x89fde96c1fe78bfc82af2bdaeba88cf217b22cb5574d6472080033d2c40ff796", "count": "1" } } @@ -297,7 +297,7 @@ Response: { "version": 7, "contents": { "json": { - "id": "0x4e0d15c4938faa6096532976870ea525d839acc4c009c31f1c91b2d583f0ca2a", + "id": "0x89fde96c1fe78bfc82af2bdaeba88cf217b22cb5574d6472080033d2c40ff796", "count": "0" } } diff --git a/crates/iota-graphql-e2e-tests/tests/packages/datatypes.exp b/crates/iota-graphql-e2e-tests/tests/packages/datatypes.exp index ed011d80157..b747718aa6d 100644 --- a/crates/iota-graphql-e2e-tests/tests/packages/datatypes.exp +++ b/crates/iota-graphql-e2e-tests/tests/packages/datatypes.exp @@ -155,7 +155,7 @@ task 5, lines 73-97: Response: { "data": { "object": { - "address": "0x1cf6f19e22c23560433d84559c5eb7e454e90934f1cdbaf80c0217a3d41b7813", + "address": "0x5ce5f3dd044a95427557b25105b6970a0d777788331b6805c0b444d7c984c5c5", "asMovePackage": { "module": { "datatypes": { @@ -190,7 +190,7 @@ task 6, lines 99-144: Response: { "data": { "object": { - "address": "0x1cf6f19e22c23560433d84559c5eb7e454e90934f1cdbaf80c0217a3d41b7813", + "address": "0x5ce5f3dd044a95427557b25105b6970a0d777788331b6805c0b444d7c984c5c5", "asMovePackage": { "module": { "datatypes": { diff --git a/crates/iota-graphql-e2e-tests/tests/packages/enums.exp b/crates/iota-graphql-e2e-tests/tests/packages/enums.exp index 9d1e1b8a447..e521f6045ad 100644 --- a/crates/iota-graphql-e2e-tests/tests/packages/enums.exp +++ b/crates/iota-graphql-e2e-tests/tests/packages/enums.exp @@ -25,13 +25,19 @@ Response: { "nodes": [ { "outputState": { - "address": "0x0db69147531907018e7ef8ffb915739dec59f5429d05c9185fbadb7611fc809e", + "address": "0x16a8e888439fb865e2ebb65d890e872be6717414f401f079b5741e67467ca41c", "asMovePackage": null } }, { "outputState": { - "address": "0x13ab44ee556ad8724e413be666922fa51857ffe553640a8a81a0b077a9454c49", + "address": "0x88753f8821c7d5b8e634264999e593f39e15cb68e4814abd86a995e8c88746e9", + "asMovePackage": null + } + }, + { + "outputState": { + "address": "0xdc6634b155a40eb697bff23f384ba7e04a70a9772e88c44ba983327437c66db6", "asMovePackage": { "module": { "enum": { @@ -87,12 +93,6 @@ Response: { } } } - }, - { - "outputState": { - "address": "0x7ab276e07bc81d3c00ac3f5234cce7214b5e69f5cbfa07535f14b05eeca5597c", - "asMovePackage": null - } } ] } @@ -125,25 +125,19 @@ Response: { "nodes": [ { "outputState": { - "address": "0x0db69147531907018e7ef8ffb915739dec59f5429d05c9185fbadb7611fc809e", - "asMovePackage": null - } - }, - { - "outputState": { - "address": "0x7ab276e07bc81d3c00ac3f5234cce7214b5e69f5cbfa07535f14b05eeca5597c", + "address": "0x16a8e888439fb865e2ebb65d890e872be6717414f401f079b5741e67467ca41c", "asMovePackage": null } }, { "outputState": { - "address": "0xee91556fa4546eb038a6a74f34443839d75f83514c7eee2c567aac6ca5daca50", + "address": "0x4f420f2f6ae06a6f316000f71001cd4de755380770f0a31ff05c77b9f753875c", "asMovePackage": { "module": { "s": { "module": { "package": { - "address": "0x13ab44ee556ad8724e413be666922fa51857ffe553640a8a81a0b077a9454c49" + "address": "0xdc6634b155a40eb697bff23f384ba7e04a70a9772e88c44ba983327437c66db6" } }, "name": "S", @@ -198,7 +192,7 @@ Response: { "t": { "module": { "package": { - "address": "0xee91556fa4546eb038a6a74f34443839d75f83514c7eee2c567aac6ca5daca50" + "address": "0x4f420f2f6ae06a6f316000f71001cd4de755380770f0a31ff05c77b9f753875c" } }, "name": "T", @@ -228,12 +222,12 @@ Response: { { "name": "s", "type": { - "repr": "0x13ab44ee556ad8724e413be666922fa51857ffe553640a8a81a0b077a9454c49::m::S", + "repr": "0xdc6634b155a40eb697bff23f384ba7e04a70a9772e88c44ba983327437c66db6::m::S", "signature": { "ref": null, "body": { "datatype": { - "package": "0x13ab44ee556ad8724e413be666922fa51857ffe553640a8a81a0b077a9454c49", + "package": "0xdc6634b155a40eb697bff23f384ba7e04a70a9772e88c44ba983327437c66db6", "module": "m", "type": "S", "typeParameters": [] @@ -267,7 +261,7 @@ Response: { { "name": "t", "type": { - "repr": "0x13ab44ee556ad8724e413be666922fa51857ffe553640a8a81a0b077a9454c49::m::T<0x13ab44ee556ad8724e413be666922fa51857ffe553640a8a81a0b077a9454c49::m::S>" + "repr": "0xdc6634b155a40eb697bff23f384ba7e04a70a9772e88c44ba983327437c66db6::m::T<0xdc6634b155a40eb697bff23f384ba7e04a70a9772e88c44ba983327437c66db6::m::S>" } } ] @@ -277,6 +271,12 @@ Response: { } } } + }, + { + "outputState": { + "address": "0x88753f8821c7d5b8e634264999e593f39e15cb68e4814abd86a995e8c88746e9", + "asMovePackage": null + } } ] } @@ -302,11 +302,6 @@ Response: { "asMovePackage": null } }, - { - "outputState": { - "asMovePackage": null - } - }, { "outputState": { "asMovePackage": { @@ -326,6 +321,11 @@ Response: { } } } + }, + { + "outputState": { + "asMovePackage": null + } } ] } diff --git a/crates/iota-graphql-e2e-tests/tests/packages/friends.exp b/crates/iota-graphql-e2e-tests/tests/packages/friends.exp index 8438ebbed7a..b19c3041ef6 100644 --- a/crates/iota-graphql-e2e-tests/tests/packages/friends.exp +++ b/crates/iota-graphql-e2e-tests/tests/packages/friends.exp @@ -28,6 +28,11 @@ Response: { "asMovePackage": null } }, + { + "outputState": { + "asMovePackage": null + } + }, { "outputState": { "asMovePackage": { @@ -101,11 +106,6 @@ Response: { } } } - }, - { - "outputState": { - "asMovePackage": null - } } ] } @@ -133,14 +133,14 @@ Response: { }, { "outputState": { - "asMovePackage": { - "module": null - } + "asMovePackage": null } }, { "outputState": { - "asMovePackage": null + "asMovePackage": { + "module": null + } } } ] @@ -166,7 +166,7 @@ Response: { "effects", "objectChanges", "nodes", - 1, + 2, "outputState", "asMovePackage", "module", @@ -194,6 +194,11 @@ Response: { "asMovePackage": null } }, + { + "outputState": { + "asMovePackage": null + } + }, { "outputState": { "asMovePackage": { @@ -269,11 +274,6 @@ Response: { } } } - }, - { - "outputState": { - "asMovePackage": null - } } ] } diff --git a/crates/iota-graphql-e2e-tests/tests/packages/functions.exp b/crates/iota-graphql-e2e-tests/tests/packages/functions.exp index 184e066e9dc..58481617aa2 100644 --- a/crates/iota-graphql-e2e-tests/tests/packages/functions.exp +++ b/crates/iota-graphql-e2e-tests/tests/packages/functions.exp @@ -95,25 +95,19 @@ Response: { "nodes": [ { "outputState": { - "address": "0x7ab276e07bc81d3c00ac3f5234cce7214b5e69f5cbfa07535f14b05eeca5597c", + "address": "0x16a8e888439fb865e2ebb65d890e872be6717414f401f079b5741e67467ca41c", "asMovePackage": null } }, { "outputState": { - "address": "0xc1d3538ac73128faa829ebaa9b30627b579215e00c2e47960311bbd2d5086c09", - "asMovePackage": null - } - }, - { - "outputState": { - "address": "0xf2091469462fa60ab4f96f0f5ef490f77890aae5fa8d485ab5f05d8fe6a9e5b3", + "address": "0x4f02b282959db3d0b3c34ee9be4bd8e39023b8cf1a1a069e14325e650672b480", "asMovePackage": { "module": { "function": { "module": { "package": { - "address": "0xf2091469462fa60ab4f96f0f5ef490f77890aae5fa8d485ab5f05d8fe6a9e5b3" + "address": "0x4f02b282959db3d0b3c34ee9be4bd8e39023b8cf1a1a069e14325e650672b480" } }, "name": "f", @@ -143,6 +137,12 @@ Response: { } } } + }, + { + "outputState": { + "address": "0xd3ca42aff193387adecc01129e9e6444616c5d57c065e118dbff9e7e0d3f6f96", + "asMovePackage": null + } } ] } @@ -175,13 +175,19 @@ Response: { "nodes": [ { "outputState": { - "address": "0x114752060737346a4ec7c59dac8629f83b1934589d8f085401d3bbd783bfba90", + "address": "0x16a8e888439fb865e2ebb65d890e872be6717414f401f079b5741e67467ca41c", + "asMovePackage": null + } + }, + { + "outputState": { + "address": "0x40aee5b33d9247ebd2df3db5644ee494dff36c45c2fd6b550e9a0701bf9f00f6", "asMovePackage": { "module": { "f": { "module": { "package": { - "address": "0x114752060737346a4ec7c59dac8629f83b1934589d8f085401d3bbd783bfba90" + "address": "0x40aee5b33d9247ebd2df3db5644ee494dff36c45c2fd6b550e9a0701bf9f00f6" } }, "name": "f", @@ -211,7 +217,7 @@ Response: { "g": { "module": { "package": { - "address": "0x114752060737346a4ec7c59dac8629f83b1934589d8f085401d3bbd783bfba90" + "address": "0x40aee5b33d9247ebd2df3db5644ee494dff36c45c2fd6b550e9a0701bf9f00f6" } }, "name": "g", @@ -231,13 +237,7 @@ Response: { }, { "outputState": { - "address": "0x7ab276e07bc81d3c00ac3f5234cce7214b5e69f5cbfa07535f14b05eeca5597c", - "asMovePackage": null - } - }, - { - "outputState": { - "address": "0xc1d3538ac73128faa829ebaa9b30627b579215e00c2e47960311bbd2d5086c09", + "address": "0xd3ca42aff193387adecc01129e9e6444616c5d57c065e118dbff9e7e0d3f6f96", "asMovePackage": null } } diff --git a/crates/iota-graphql-e2e-tests/tests/packages/modules.exp b/crates/iota-graphql-e2e-tests/tests/packages/modules.exp index f812edc1c62..60291c7367e 100644 --- a/crates/iota-graphql-e2e-tests/tests/packages/modules.exp +++ b/crates/iota-graphql-e2e-tests/tests/packages/modules.exp @@ -22,25 +22,25 @@ Response: { "nodes": [ { "outputState": { - "address": "0x51e8c26146c1df0ca5c935c4e0b2d9a99ef83e9e201735f71e647f3b1255d56c", - "asMovePackage": null - } - }, - { - "outputState": { - "address": "0xa21b5f9202bbe1625bd3639eb01a88aa92b75343751327d1ba99f7044789cd7b", + "address": "0x00abce450bda0ce7092d4c8930eaedf884ee0cb4584bf840e8f8950aa50de247", "asMovePackage": { "module": { "name": "m", "package": { - "address": "0xa21b5f9202bbe1625bd3639eb01a88aa92b75343751327d1ba99f7044789cd7b" + "address": "0x00abce450bda0ce7092d4c8930eaedf884ee0cb4584bf840e8f8950aa50de247" }, "fileFormatVersion": 6, - "bytes": "oRzrCwYAAAAIAQAGAgYKAxARBCEEBSUfB0QkCGhADKgBMAAGAQMBBQEADAEAAQIBAgAABAABAQIAAgIBAAEHBQEBAAIEAAYCAwYLAAEJAAEDAQYLAAEIAQABCQABBgsAAQkAAQgBBENvaW4ESU9UQQNiYXIEY29pbgNmb28EaW90YQFtBXZhbHVlohtfkgK74WJb02OesBqIqpK3U0N1EyfRupn3BEeJzXsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgABAAADBQsBOAALABYCAQEAAAMIBioAAAAAAAAACgA4AQYrAAAAAAAAAAsAOAEYAgA=", - "disassembly": "// Move bytecode v6\nmodule a21b5f9202bbe1625bd3639eb01a88aa92b75343751327d1ba99f7044789cd7b.m {\nuse 0000000000000000000000000000000000000000000000000000000000000002::coin;\nuse 0000000000000000000000000000000000000000000000000000000000000002::iota;\n\n\n\n\n\n\npublic foo(Arg0: u64, Arg1: &Coin): u64 {\nB0:\n\t0: MoveLoc[1](Arg1: &Coin)\n\t1: Call coin::value(&Coin): u64\n\t2: MoveLoc[0](Arg0: u64)\n\t3: Add\n\t4: Ret\n\n}\npublic bar(Arg0: &Coin): u64 {\nB0:\n\t0: LdU64(42)\n\t1: CopyLoc[0](Arg0: &Coin)\n\t2: Call foo(u64, &Coin): u64\n\t3: LdU64(43)\n\t4: MoveLoc[0](Arg0: &Coin)\n\t5: Call foo(u64, &Coin): u64\n\t6: Mul\n\t7: Ret\n\n}\n}" + "bytes": "oRzrCwYAAAAIAQAGAgYKAxARBCEEBSUfB0QkCGhADKgBMAAGAQMBBQEADAEAAQIBAgAABAABAQIAAgIBAAEHBQEBAAIEAAYCAwYLAAEJAAEDAQYLAAEIAQABCQABBgsAAQkAAQgBBENvaW4ESU9UQQNiYXIEY29pbgNmb28EaW90YQFtBXZhbHVlAKvORQvaDOcJLUyJMOrt+ITuDLRYS/hA6PiVCqUN4kcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgABAAADBQsBOAALABYCAQEAAAMIBioAAAAAAAAACgA4AQYrAAAAAAAAAAsAOAEYAgA=", + "disassembly": "// Move bytecode v6\nmodule abce450bda0ce7092d4c8930eaedf884ee0cb4584bf840e8f8950aa50de247.m {\nuse 0000000000000000000000000000000000000000000000000000000000000002::coin;\nuse 0000000000000000000000000000000000000000000000000000000000000002::iota;\n\n\n\n\n\n\npublic foo(Arg0: u64, Arg1: &Coin): u64 {\nB0:\n\t0: MoveLoc[1](Arg1: &Coin)\n\t1: Call coin::value(&Coin): u64\n\t2: MoveLoc[0](Arg0: u64)\n\t3: Add\n\t4: Ret\n\n}\npublic bar(Arg0: &Coin): u64 {\nB0:\n\t0: LdU64(42)\n\t1: CopyLoc[0](Arg0: &Coin)\n\t2: Call foo(u64, &Coin): u64\n\t3: LdU64(43)\n\t4: MoveLoc[0](Arg0: &Coin)\n\t5: Call foo(u64, &Coin): u64\n\t6: Mul\n\t7: Ret\n\n}\n}" } } } + }, + { + "outputState": { + "address": "0xc22d782d6b686022721c7a680612c20817b6cad04210f7df35e471dfd78881f8", + "asMovePackage": null + } } ] } @@ -63,13 +63,7 @@ Response: { "nodes": [ { "outputState": { - "address": "0x51e8c26146c1df0ca5c935c4e0b2d9a99ef83e9e201735f71e647f3b1255d56c", - "asMovePackage": null - } - }, - { - "outputState": { - "address": "0xa21b5f9202bbe1625bd3639eb01a88aa92b75343751327d1ba99f7044789cd7b", + "address": "0x00abce450bda0ce7092d4c8930eaedf884ee0cb4584bf840e8f8950aa50de247", "asMovePackage": { "all": { "edges": [ @@ -139,6 +133,12 @@ Response: { } } } + }, + { + "outputState": { + "address": "0xc22d782d6b686022721c7a680612c20817b6cad04210f7df35e471dfd78881f8", + "asMovePackage": null + } } ] } @@ -161,13 +161,7 @@ Response: { "nodes": [ { "outputState": { - "address": "0x51e8c26146c1df0ca5c935c4e0b2d9a99ef83e9e201735f71e647f3b1255d56c", - "asMovePackage": null - } - }, - { - "outputState": { - "address": "0xa21b5f9202bbe1625bd3639eb01a88aa92b75343751327d1ba99f7044789cd7b", + "address": "0x00abce450bda0ce7092d4c8930eaedf884ee0cb4584bf840e8f8950aa50de247", "asMovePackage": { "prefix": { "edges": [ @@ -279,6 +273,12 @@ Response: { } } } + }, + { + "outputState": { + "address": "0xc22d782d6b686022721c7a680612c20817b6cad04210f7df35e471dfd78881f8", + "asMovePackage": null + } } ] } diff --git a/crates/iota-graphql-e2e-tests/tests/packages/structs.exp b/crates/iota-graphql-e2e-tests/tests/packages/structs.exp index 09ca1e93224..1c7016391ad 100644 --- a/crates/iota-graphql-e2e-tests/tests/packages/structs.exp +++ b/crates/iota-graphql-e2e-tests/tests/packages/structs.exp @@ -154,19 +154,19 @@ Response: { "nodes": [ { "outputState": { - "address": "0x37256da94764212f98d6ad0e8127abfa76f1f162ef41d95418647d57e8eaca7a", + "address": "0x01df1e639fcb6895a9e429bc1451159e9555af99efa7a890d2aefaa9a64715bb", "asMovePackage": null } }, { "outputState": { - "address": "0x7ab276e07bc81d3c00ac3f5234cce7214b5e69f5cbfa07535f14b05eeca5597c", + "address": "0x16a8e888439fb865e2ebb65d890e872be6717414f401f079b5741e67467ca41c", "asMovePackage": null } }, { "outputState": { - "address": "0x9f6e2de5e33a325a9cdb4202adeef86f2f8b503595fcbf291a8c697e2ff8e8ce", + "address": "0xfdc7773709c6f2c65d4cc9fbd7f8f2386ebc8262bb3e98f3bc3e530bfbedc0b0", "asMovePackage": { "module": { "struct": { @@ -224,13 +224,25 @@ Response: { "nodes": [ { "outputState": { - "address": "0x10be345598e39acb2359e836c0b9abc86e1d7f952964f32e94bc7df976af1639", + "address": "0x01df1e639fcb6895a9e429bc1451159e9555af99efa7a890d2aefaa9a64715bb", + "asMovePackage": null + } + }, + { + "outputState": { + "address": "0x16a8e888439fb865e2ebb65d890e872be6717414f401f079b5741e67467ca41c", + "asMovePackage": null + } + }, + { + "outputState": { + "address": "0xdad85c173d1d2fb07344bcc64b496391646d774cf22e95c7285c7176ade2ce76", "asMovePackage": { "module": { "s": { "module": { "package": { - "address": "0x9f6e2de5e33a325a9cdb4202adeef86f2f8b503595fcbf291a8c697e2ff8e8ce" + "address": "0xfdc7773709c6f2c65d4cc9fbd7f8f2386ebc8262bb3e98f3bc3e530bfbedc0b0" } }, "name": "S", @@ -255,7 +267,7 @@ Response: { "t": { "module": { "package": { - "address": "0x10be345598e39acb2359e836c0b9abc86e1d7f952964f32e94bc7df976af1639" + "address": "0xdad85c173d1d2fb07344bcc64b496391646d774cf22e95c7285c7176ade2ce76" } }, "name": "T", @@ -282,12 +294,12 @@ Response: { { "name": "s", "type": { - "repr": "0x9f6e2de5e33a325a9cdb4202adeef86f2f8b503595fcbf291a8c697e2ff8e8ce::m::S", + "repr": "0xfdc7773709c6f2c65d4cc9fbd7f8f2386ebc8262bb3e98f3bc3e530bfbedc0b0::m::S", "signature": { "ref": null, "body": { "datatype": { - "package": "0x9f6e2de5e33a325a9cdb4202adeef86f2f8b503595fcbf291a8c697e2ff8e8ce", + "package": "0xfdc7773709c6f2c65d4cc9fbd7f8f2386ebc8262bb3e98f3bc3e530bfbedc0b0", "module": "m", "type": "S", "typeParameters": [] @@ -316,7 +328,7 @@ Response: { { "name": "t", "type": { - "repr": "0x9f6e2de5e33a325a9cdb4202adeef86f2f8b503595fcbf291a8c697e2ff8e8ce::m::T<0x9f6e2de5e33a325a9cdb4202adeef86f2f8b503595fcbf291a8c697e2ff8e8ce::m::S>" + "repr": "0xfdc7773709c6f2c65d4cc9fbd7f8f2386ebc8262bb3e98f3bc3e530bfbedc0b0::m::T<0xfdc7773709c6f2c65d4cc9fbd7f8f2386ebc8262bb3e98f3bc3e530bfbedc0b0::m::S>" } } ] @@ -324,18 +336,6 @@ Response: { } } } - }, - { - "outputState": { - "address": "0x37256da94764212f98d6ad0e8127abfa76f1f162ef41d95418647d57e8eaca7a", - "asMovePackage": null - } - }, - { - "outputState": { - "address": "0x7ab276e07bc81d3c00ac3f5234cce7214b5e69f5cbfa07535f14b05eeca5597c", - "asMovePackage": null - } } ] } @@ -356,6 +356,16 @@ Response: { "effects": { "objectChanges": { "nodes": [ + { + "outputState": { + "asMovePackage": null + } + }, + { + "outputState": { + "asMovePackage": null + } + }, { "outputState": { "asMovePackage": { @@ -375,16 +385,6 @@ Response: { } } } - }, - { - "outputState": { - "asMovePackage": null - } - }, - { - "outputState": { - "asMovePackage": null - } } ] } diff --git a/crates/iota-graphql-e2e-tests/tests/packages/types.exp b/crates/iota-graphql-e2e-tests/tests/packages/types.exp index 4e5af50b04f..f731c1ef6ed 100644 --- a/crates/iota-graphql-e2e-tests/tests/packages/types.exp +++ b/crates/iota-graphql-e2e-tests/tests/packages/types.exp @@ -275,7 +275,7 @@ Response: { "data": null, "errors": [ { - "message": "Internal error occurred while processing request: Error calculating layout for 0xdd96816456c86fc4fc43a5befdf6bdde3192f61c386009b917c0d00302dd149c::m::S1: Type layout nesting exceeded limit of 128", + "message": "Internal error occurred while processing request: Error calculating layout for 0x031f3c00b1e08a7663d48c96fa70684b022acc5fc423f9d1fbb60ac89af05e7e::m::S1: Type layout nesting exceeded limit of 128", "locations": [ { "line": 4, diff --git a/crates/iota-graphql-e2e-tests/tests/packages/versioning.exp b/crates/iota-graphql-e2e-tests/tests/packages/versioning.exp index 4c2a051c2b5..1621a244b2a 100644 --- a/crates/iota-graphql-e2e-tests/tests/packages/versioning.exp +++ b/crates/iota-graphql-e2e-tests/tests/packages/versioning.exp @@ -31,14 +31,14 @@ Response: { "packageVersions": { "nodes": [ { - "address": "0x131afb2e02cb300d9b0c5c4c04ad792ca6e557fae7e6179d125580be4f3ba1f5", + "address": "0xd4313c43c3a911f170e773b3b7932bbcb1757046c826728fb48a95e0736bbafb", "version": 1 } ] } }, "firstPackage": { - "address": "0x131afb2e02cb300d9b0c5c4c04ad792ca6e557fae7e6179d125580be4f3ba1f5", + "address": "0xd4313c43c3a911f170e773b3b7932bbcb1757046c826728fb48a95e0736bbafb", "version": 1, "module": { "functions": { @@ -52,7 +52,7 @@ Response: { "packageVersions": { "nodes": [ { - "address": "0x131afb2e02cb300d9b0c5c4c04ad792ca6e557fae7e6179d125580be4f3ba1f5", + "address": "0xd4313c43c3a911f170e773b3b7932bbcb1757046c826728fb48a95e0736bbafb", "version": 1 } ] @@ -81,11 +81,7 @@ Response: { "version": 1 }, { - "address": "0x000000000000000000000000000000000000000000000000000000000000dee9", - "version": 1 - }, - { - "address": "0x131afb2e02cb300d9b0c5c4c04ad792ca6e557fae7e6179d125580be4f3ba1f5", + "address": "0xd4313c43c3a911f170e773b3b7932bbcb1757046c826728fb48a95e0736bbafb", "version": 1 } ] @@ -124,18 +120,18 @@ Response: { "packageVersions": { "nodes": [ { - "address": "0x131afb2e02cb300d9b0c5c4c04ad792ca6e557fae7e6179d125580be4f3ba1f5", + "address": "0xd4313c43c3a911f170e773b3b7932bbcb1757046c826728fb48a95e0736bbafb", "version": 1 }, { - "address": "0xe59cf51865936dc000487a5672ad3b32b94f6ad8d4831b2b5d352e099540402a", + "address": "0xeaea5669c4477955a962870c0275f3b307883497f1691b181bcebde9dda76d08", "version": 2 } ] } }, "firstPackage": { - "address": "0x131afb2e02cb300d9b0c5c4c04ad792ca6e557fae7e6179d125580be4f3ba1f5", + "address": "0xd4313c43c3a911f170e773b3b7932bbcb1757046c826728fb48a95e0736bbafb", "version": 1, "module": { "functions": { @@ -149,11 +145,11 @@ Response: { "packageVersions": { "nodes": [ { - "address": "0x131afb2e02cb300d9b0c5c4c04ad792ca6e557fae7e6179d125580be4f3ba1f5", + "address": "0xd4313c43c3a911f170e773b3b7932bbcb1757046c826728fb48a95e0736bbafb", "version": 1 }, { - "address": "0xe59cf51865936dc000487a5672ad3b32b94f6ad8d4831b2b5d352e099540402a", + "address": "0xeaea5669c4477955a962870c0275f3b307883497f1691b181bcebde9dda76d08", "version": 2 } ] @@ -182,15 +178,11 @@ Response: { "version": 1 }, { - "address": "0x000000000000000000000000000000000000000000000000000000000000dee9", - "version": 1 - }, - { - "address": "0x131afb2e02cb300d9b0c5c4c04ad792ca6e557fae7e6179d125580be4f3ba1f5", + "address": "0xd4313c43c3a911f170e773b3b7932bbcb1757046c826728fb48a95e0736bbafb", "version": 1 }, { - "address": "0xe59cf51865936dc000487a5672ad3b32b94f6ad8d4831b2b5d352e099540402a", + "address": "0xeaea5669c4477955a962870c0275f3b307883497f1691b181bcebde9dda76d08", "version": 2 } ] @@ -232,22 +224,22 @@ Response: { "packageVersions": { "nodes": [ { - "address": "0x131afb2e02cb300d9b0c5c4c04ad792ca6e557fae7e6179d125580be4f3ba1f5", + "address": "0xd4313c43c3a911f170e773b3b7932bbcb1757046c826728fb48a95e0736bbafb", "version": 1 }, { - "address": "0xe59cf51865936dc000487a5672ad3b32b94f6ad8d4831b2b5d352e099540402a", + "address": "0xeaea5669c4477955a962870c0275f3b307883497f1691b181bcebde9dda76d08", "version": 2 }, { - "address": "0xc9f52b52c53c55f1412d98e7cfa069c37a1af74dbf12fd3f0420400c7ee18d3c", + "address": "0x05384e77aa2501f0d36356d441b6071eaed2e43d1e02a357a9be6efb0c821c2d", "version": 3 } ] } }, "firstPackage": { - "address": "0x131afb2e02cb300d9b0c5c4c04ad792ca6e557fae7e6179d125580be4f3ba1f5", + "address": "0xd4313c43c3a911f170e773b3b7932bbcb1757046c826728fb48a95e0736bbafb", "version": 1, "module": { "functions": { @@ -261,15 +253,15 @@ Response: { "packageVersions": { "nodes": [ { - "address": "0x131afb2e02cb300d9b0c5c4c04ad792ca6e557fae7e6179d125580be4f3ba1f5", + "address": "0xd4313c43c3a911f170e773b3b7932bbcb1757046c826728fb48a95e0736bbafb", "version": 1 }, { - "address": "0xe59cf51865936dc000487a5672ad3b32b94f6ad8d4831b2b5d352e099540402a", + "address": "0xeaea5669c4477955a962870c0275f3b307883497f1691b181bcebde9dda76d08", "version": 2 }, { - "address": "0xc9f52b52c53c55f1412d98e7cfa069c37a1af74dbf12fd3f0420400c7ee18d3c", + "address": "0x05384e77aa2501f0d36356d441b6071eaed2e43d1e02a357a9be6efb0c821c2d", "version": 3 } ] @@ -298,19 +290,15 @@ Response: { "version": 1 }, { - "address": "0x000000000000000000000000000000000000000000000000000000000000dee9", + "address": "0xd4313c43c3a911f170e773b3b7932bbcb1757046c826728fb48a95e0736bbafb", "version": 1 }, { - "address": "0x131afb2e02cb300d9b0c5c4c04ad792ca6e557fae7e6179d125580be4f3ba1f5", - "version": 1 - }, - { - "address": "0xe59cf51865936dc000487a5672ad3b32b94f6ad8d4831b2b5d352e099540402a", + "address": "0xeaea5669c4477955a962870c0275f3b307883497f1691b181bcebde9dda76d08", "version": 2 }, { - "address": "0xc9f52b52c53c55f1412d98e7cfa069c37a1af74dbf12fd3f0420400c7ee18d3c", + "address": "0x05384e77aa2501f0d36356d441b6071eaed2e43d1e02a357a9be6efb0c821c2d", "version": 3 } ] @@ -721,24 +709,13 @@ Response: { } } } - }, - { - "address": "0x000000000000000000000000000000000000000000000000000000000000dee9", - "version": 1, - "previousTransactionBlock": { - "effects": { - "checkpoint": { - "sequenceNumber": 0 - } - } - } } ] }, "after": { "nodes": [ { - "address": "0xe59cf51865936dc000487a5672ad3b32b94f6ad8d4831b2b5d352e099540402a", + "address": "0xeaea5669c4477955a962870c0275f3b307883497f1691b181bcebde9dda76d08", "version": 2, "previousTransactionBlock": { "effects": { @@ -749,7 +726,7 @@ Response: { } }, { - "address": "0xc9f52b52c53c55f1412d98e7cfa069c37a1af74dbf12fd3f0420400c7ee18d3c", + "address": "0x05384e77aa2501f0d36356d441b6071eaed2e43d1e02a357a9be6efb0c821c2d", "version": 3, "previousTransactionBlock": { "effects": { @@ -764,7 +741,7 @@ Response: { "between": { "nodes": [ { - "address": "0xe59cf51865936dc000487a5672ad3b32b94f6ad8d4831b2b5d352e099540402a", + "address": "0xeaea5669c4477955a962870c0275f3b307883497f1691b181bcebde9dda76d08", "version": 2, "previousTransactionBlock": { "effects": { @@ -786,15 +763,15 @@ Response: { "packageVersions": { "nodes": [ { - "address": "0x131afb2e02cb300d9b0c5c4c04ad792ca6e557fae7e6179d125580be4f3ba1f5", + "address": "0xd4313c43c3a911f170e773b3b7932bbcb1757046c826728fb48a95e0736bbafb", "version": 1 }, { - "address": "0xe59cf51865936dc000487a5672ad3b32b94f6ad8d4831b2b5d352e099540402a", + "address": "0xeaea5669c4477955a962870c0275f3b307883497f1691b181bcebde9dda76d08", "version": 2 }, { - "address": "0xc9f52b52c53c55f1412d98e7cfa069c37a1af74dbf12fd3f0420400c7ee18d3c", + "address": "0x05384e77aa2501f0d36356d441b6071eaed2e43d1e02a357a9be6efb0c821c2d", "version": 3 } ] @@ -802,11 +779,11 @@ Response: { "after": { "nodes": [ { - "address": "0xe59cf51865936dc000487a5672ad3b32b94f6ad8d4831b2b5d352e099540402a", + "address": "0xeaea5669c4477955a962870c0275f3b307883497f1691b181bcebde9dda76d08", "version": 2 }, { - "address": "0xc9f52b52c53c55f1412d98e7cfa069c37a1af74dbf12fd3f0420400c7ee18d3c", + "address": "0x05384e77aa2501f0d36356d441b6071eaed2e43d1e02a357a9be6efb0c821c2d", "version": 3 } ] @@ -814,11 +791,11 @@ Response: { "before": { "nodes": [ { - "address": "0x131afb2e02cb300d9b0c5c4c04ad792ca6e557fae7e6179d125580be4f3ba1f5", + "address": "0xd4313c43c3a911f170e773b3b7932bbcb1757046c826728fb48a95e0736bbafb", "version": 1 }, { - "address": "0xe59cf51865936dc000487a5672ad3b32b94f6ad8d4831b2b5d352e099540402a", + "address": "0xeaea5669c4477955a962870c0275f3b307883497f1691b181bcebde9dda76d08", "version": 2 } ] @@ -826,7 +803,7 @@ Response: { "between": { "nodes": [ { - "address": "0xe59cf51865936dc000487a5672ad3b32b94f6ad8d4831b2b5d352e099540402a", + "address": "0xeaea5669c4477955a962870c0275f3b307883497f1691b181bcebde9dda76d08", "version": 2 } ] diff --git a/crates/iota-graphql-e2e-tests/tests/transaction_block_effects/balance_changes.exp b/crates/iota-graphql-e2e-tests/tests/transaction_block_effects/balance_changes.exp index 9ab65b66f26..8a57c332a50 100644 --- a/crates/iota-graphql-e2e-tests/tests/transaction_block_effects/balance_changes.exp +++ b/crates/iota-graphql-e2e-tests/tests/transaction_block_effects/balance_changes.exp @@ -54,7 +54,7 @@ Response: { }, { "node": { - "amount": "1000" + "amount": "2000" }, "cursor": "eyJpIjoxLCJjIjoyfQ" }, @@ -66,13 +66,13 @@ Response: { }, { "node": { - "amount": "3000" + "amount": "1000" }, "cursor": "eyJpIjozLCJjIjoyfQ" }, { "node": { - "amount": "2000" + "amount": "3000" }, "cursor": "eyJpIjo0LCJjIjoyfQ" }, @@ -111,13 +111,13 @@ Response: { "edges": [ { "node": { - "amount": "3000" + "amount": "1000" }, "cursor": "eyJpIjozLCJjIjoxfQ" }, { "node": { - "amount": "2000" + "amount": "3000" }, "cursor": "eyJpIjo0LCJjIjoxfQ" } @@ -156,7 +156,7 @@ Response: { }, { "node": { - "amount": "1000" + "amount": "2000" }, "cursor": "eyJpIjoxLCJjIjoxfQ" }, diff --git a/crates/iota-graphql-e2e-tests/tests/transaction_block_effects/dependencies.exp b/crates/iota-graphql-e2e-tests/tests/transaction_block_effects/dependencies.exp index 0ff47387599..0bf1900be38 100644 --- a/crates/iota-graphql-e2e-tests/tests/transaction_block_effects/dependencies.exp +++ b/crates/iota-graphql-e2e-tests/tests/transaction_block_effects/dependencies.exp @@ -65,7 +65,7 @@ Response: { "transactionBlocks": { "nodes": [ { - "digest": "FbcsxoLgm67eMhxSJRGFmfHjBbNCzL3BnjFZv3saDvKR", + "digest": "42fGuDs8aQxGjEqKymwG1KQWaRyd7xXxyepLyd8MKDLu", "effects": { "dependencies": { "pageInfo": { @@ -78,7 +78,7 @@ Response: { { "cursor": "eyJpIjowLCJjIjoxfQ", "node": { - "digest": "6i44bwXAW6MXN7GAcqGCF7aYqP3G4MBENSLpdUr583B", + "digest": "4zoVEmZwsi62buCayUU8Skgc5jNx3nnQvUtQCncotRXj", "kind": { "__typename": "ProgrammableTransactionBlock", "transactions": { @@ -107,7 +107,7 @@ Response: { { "cursor": "eyJpIjoxLCJjIjoxfQ", "node": { - "digest": "5ihQLwkWokwDJhgsx7VxuBeivmkWEysWg8DXA9rK3Uum", + "digest": "Hv4oG9EB5nPxKgyLCyAonFFUa97mxLnUXVapMBu2nH43", "kind": { "__typename": "ProgrammableTransactionBlock", "transactions": { @@ -138,7 +138,7 @@ Response: { "transactionBlocks": { "nodes": [ { - "digest": "FbcsxoLgm67eMhxSJRGFmfHjBbNCzL3BnjFZv3saDvKR", + "digest": "42fGuDs8aQxGjEqKymwG1KQWaRyd7xXxyepLyd8MKDLu", "effects": { "dependencies": { "pageInfo": { @@ -151,7 +151,7 @@ Response: { { "cursor": "eyJpIjoxLCJjIjoxfQ", "node": { - "digest": "5ihQLwkWokwDJhgsx7VxuBeivmkWEysWg8DXA9rK3Uum", + "digest": "Hv4oG9EB5nPxKgyLCyAonFFUa97mxLnUXVapMBu2nH43", "kind": { "__typename": "ProgrammableTransactionBlock", "transactions": { diff --git a/crates/iota-graphql-e2e-tests/tests/transactions/at_checkpoint.exp b/crates/iota-graphql-e2e-tests/tests/transactions/at_checkpoint.exp index 9cdc0d06c2e..9038014fdc2 100644 --- a/crates/iota-graphql-e2e-tests/tests/transactions/at_checkpoint.exp +++ b/crates/iota-graphql-e2e-tests/tests/transactions/at_checkpoint.exp @@ -30,7 +30,7 @@ Response: { "c0": { "nodes": [ { - "digest": "JBuShctBdzAwMsiNHQnxTJqUhRuJgrTdUEyCbFc8S86L", + "digest": "GcUyosXyBY31652hSgsU5Gde7jzPyTQimDfM2GznB1S2", "kind": { "__typename": "GenesisTransaction" } @@ -46,7 +46,7 @@ Response: { } }, { - "digest": "CgGRbLYTFKi8nSsm4UEsXR2FrJkZA8beUx3LUP2p6m6A", + "digest": "9BxxY2aKepD3ktJ3QEsP1vjAJkjtwQMw5p6csFUB17Pf", "kind": { "__typename": "ProgrammableTransactionBlock" } @@ -87,7 +87,7 @@ Response: { "transactionBlocks": { "nodes": [ { - "digest": "JBuShctBdzAwMsiNHQnxTJqUhRuJgrTdUEyCbFc8S86L", + "digest": "GcUyosXyBY31652hSgsU5Gde7jzPyTQimDfM2GznB1S2", "kind": { "__typename": "GenesisTransaction" } @@ -105,7 +105,7 @@ Response: { } }, { - "digest": "CgGRbLYTFKi8nSsm4UEsXR2FrJkZA8beUx3LUP2p6m6A", + "digest": "9BxxY2aKepD3ktJ3QEsP1vjAJkjtwQMw5p6csFUB17Pf", "kind": { "__typename": "ProgrammableTransactionBlock" } @@ -154,7 +154,7 @@ Response: { "transactionBlocks": { "nodes": [ { - "digest": "JBuShctBdzAwMsiNHQnxTJqUhRuJgrTdUEyCbFc8S86L", + "digest": "GcUyosXyBY31652hSgsU5Gde7jzPyTQimDfM2GznB1S2", "kind": { "__typename": "GenesisTransaction" } @@ -172,7 +172,7 @@ Response: { } }, { - "digest": "CgGRbLYTFKi8nSsm4UEsXR2FrJkZA8beUx3LUP2p6m6A", + "digest": "9BxxY2aKepD3ktJ3QEsP1vjAJkjtwQMw5p6csFUB17Pf", "kind": { "__typename": "ProgrammableTransactionBlock" } diff --git a/crates/iota-graphql-e2e-tests/tests/transactions/errors.exp b/crates/iota-graphql-e2e-tests/tests/transactions/errors.exp index 823e479d2ca..73b69dd5520 100644 --- a/crates/iota-graphql-e2e-tests/tests/transactions/errors.exp +++ b/crates/iota-graphql-e2e-tests/tests/transactions/errors.exp @@ -25,7 +25,7 @@ Response: { { "effects": { "status": "FAILURE", - "errors": "Error in 1st command, from '0xeb1c83c67776e844cbb6af066709ed47641f75be7bf5a850ab338d5ddf99d31b::m::boom' (instruction 1), abort code: 42" + "errors": "Error in 1st command, from '0xec93b0e3c417e18e054f00f0cc4c66b8a78539a949ca5b306620b7f8aaf5913d::m::boom' (instruction 1), abort code: 42" } } ] @@ -54,7 +54,7 @@ Response: { { "effects": { "status": "FAILURE", - "errors": "Error in 3rd command, from '0xeb1c83c67776e844cbb6af066709ed47641f75be7bf5a850ab338d5ddf99d31b::m::boom' (instruction 1), abort code: 42" + "errors": "Error in 3rd command, from '0xec93b0e3c417e18e054f00f0cc4c66b8a78539a949ca5b306620b7f8aaf5913d::m::boom' (instruction 1), abort code: 42" } } ] diff --git a/crates/iota-graphql-e2e-tests/tests/transactions/filters/kind.exp b/crates/iota-graphql-e2e-tests/tests/transactions/filters/kind.exp index 2d6f87efd9c..f0919b2d060 100644 --- a/crates/iota-graphql-e2e-tests/tests/transactions/filters/kind.exp +++ b/crates/iota-graphql-e2e-tests/tests/transactions/filters/kind.exp @@ -60,7 +60,7 @@ Response: { }, "nodes": [ { - "digest": "BHnWbs1bAGTHvqmVM8QakhekPkR5xoNa4LSaeFRaU9oU", + "digest": "BrmwoxKGkndWUriBkmajng7GuWDDDJwgfu9wwGuN9zev", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -68,7 +68,7 @@ Response: { } }, { - "digest": "GfT83ydV3hZD4JE7BpRfiqqZ5TFENQDzAVeiEUSVJKdJ", + "digest": "5ksUtqcbsG5tM57GXnAWqPopAYzgnpGnCnRFSTw4Awb3", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -76,7 +76,7 @@ Response: { } }, { - "digest": "J5WeQemqsD7PiAYUk8o5jbf7m7G4bNqejJ4dUwijQmh5", + "digest": "AN5sVYJHUTVTYnFYgwkyukLMXSUscg7YKax42d9135FX", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -84,7 +84,7 @@ Response: { } }, { - "digest": "89Eq2RtFcvykVH8jYAF91mjF1DBRsLeGU4gfnL96jMoC", + "digest": "DFeFptJ3Tc3sAmBYdrsbDZnEJ8zDnvp4byqzaXzewaG4", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -92,7 +92,7 @@ Response: { } }, { - "digest": "9RMtDD1o2929hoHsxJt5RhPXkKAVBREjCpDCiRSGWD4j", + "digest": "6P1wyYsPmDahzvWjTqtFSTqASLqiVQx4YB2e3gN7Vq7V", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -117,7 +117,7 @@ Response: { }, "nodes": [ { - "digest": "BHnWbs1bAGTHvqmVM8QakhekPkR5xoNa4LSaeFRaU9oU", + "digest": "BrmwoxKGkndWUriBkmajng7GuWDDDJwgfu9wwGuN9zev", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -142,7 +142,7 @@ Response: { }, "nodes": [ { - "digest": "GfT83ydV3hZD4JE7BpRfiqqZ5TFENQDzAVeiEUSVJKdJ", + "digest": "5ksUtqcbsG5tM57GXnAWqPopAYzgnpGnCnRFSTw4Awb3", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -167,7 +167,7 @@ Response: { }, "nodes": [ { - "digest": "J5WeQemqsD7PiAYUk8o5jbf7m7G4bNqejJ4dUwijQmh5", + "digest": "AN5sVYJHUTVTYnFYgwkyukLMXSUscg7YKax42d9135FX", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -192,7 +192,7 @@ Response: { }, "nodes": [ { - "digest": "89Eq2RtFcvykVH8jYAF91mjF1DBRsLeGU4gfnL96jMoC", + "digest": "DFeFptJ3Tc3sAmBYdrsbDZnEJ8zDnvp4byqzaXzewaG4", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -217,7 +217,7 @@ Response: { }, "nodes": [ { - "digest": "9RMtDD1o2929hoHsxJt5RhPXkKAVBREjCpDCiRSGWD4j", + "digest": "6P1wyYsPmDahzvWjTqtFSTqASLqiVQx4YB2e3gN7Vq7V", "effects": { "checkpoint": { "sequenceNumber": 2 diff --git a/crates/iota-graphql-e2e-tests/tests/transactions/programmable.exp b/crates/iota-graphql-e2e-tests/tests/transactions/programmable.exp index 0241771046d..388358ae4f3 100644 --- a/crates/iota-graphql-e2e-tests/tests/transactions/programmable.exp +++ b/crates/iota-graphql-e2e-tests/tests/transactions/programmable.exp @@ -20,12 +20,12 @@ Response: { "transactionBlocks": { "nodes": [ { - "digest": "ZUbAobS9qYvY2zJRbjLRktjrF2iYTbB71VeF3G1AH9h", + "digest": "7yu83zzohW1XpMxHAwrUrivcfdqmdh2KCKvZ37v5iPBg", "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" }, "signatures": [ - "APNPMlU6mtK7kyV+DrL5Fp/WskzHMYZipLckBE+bVvCK9Ubp7gjioKxQF3Unpe9X4vZClyXfowHm7O+yUAphpg1/UUY663bYjcm3XmNyULIgxJz1t5Z9vxfB+fp8WUoJKA==" + "AKoXg/6D5YGXLPA9oIT9KLV3H/24fNJoZt9W7fPVKt4SUEYbX8S8DHZBmA5SkAXSbl2t9v7jBkKaUpy0pa8luwx/UUY663bYjcm3XmNyULIgxJz1t5Z9vxfB+fp8WUoJKA==" ], "gasInput": { "gasSponsor": { @@ -34,7 +34,7 @@ Response: { "gasPayment": { "nodes": [ { - "address": "0x7ab276e07bc81d3c00ac3f5234cce7214b5e69f5cbfa07535f14b05eeca5597c" + "address": "0x16a8e888439fb865e2ebb65d890e872be6717414f401f079b5741e67467ca41c" } ] }, @@ -96,7 +96,7 @@ Response: { "dependencies": { "nodes": [ { - "digest": "JBuShctBdzAwMsiNHQnxTJqUhRuJgrTdUEyCbFc8S86L" + "digest": "GcUyosXyBY31652hSgsU5Gde7jzPyTQimDfM2GznB1S2" } ] }, @@ -116,37 +116,37 @@ Response: { "objectChanges": { "nodes": [ { - "address": "0x546651aa715c29ee68ae0bb3d18aada7c2e76d51c82776bf400b13e864415294", + "address": "0x0846efff08221f9685365d064287d49054327432c48741661d46f494b2f84c8d", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x546651aa715c29ee68ae0bb3d18aada7c2e76d51c82776bf400b13e864415294", - "digest": "AEVaWDFKA3n7tVyT4wUk2s8kLdk3sYio2JnZseCWVNZb" + "address": "0x0846efff08221f9685365d064287d49054327432c48741661d46f494b2f84c8d", + "digest": "3kdnX61T9paJQeedhS8QYKCAdAx2ja5mWbDMtMzEzRdC" } }, { - "address": "0x728c8a7066d6ddefc37cc27f5fa9d8da87d3fbb14ea89b7e086ad243f90c1377", - "idCreated": true, + "address": "0x16a8e888439fb865e2ebb65d890e872be6717414f401f079b5741e67467ca41c", + "idCreated": false, "idDeleted": false, "outputState": { - "address": "0x728c8a7066d6ddefc37cc27f5fa9d8da87d3fbb14ea89b7e086ad243f90c1377", - "digest": "NYGzm4bKmhujbFFQZu3qQqY9vSypUxfShyZkQEQ86Rr" + "address": "0x16a8e888439fb865e2ebb65d890e872be6717414f401f079b5741e67467ca41c", + "digest": "2b1szGUEp7X4W6G43J3gs6qUvyofEKG6Xqto7qJdtvQQ" } }, { - "address": "0x7ab276e07bc81d3c00ac3f5234cce7214b5e69f5cbfa07535f14b05eeca5597c", - "idCreated": false, + "address": "0x4727e7a070d440299c8918a5b0361df08474a087d088351f36158e2b5667d827", + "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x7ab276e07bc81d3c00ac3f5234cce7214b5e69f5cbfa07535f14b05eeca5597c", - "digest": "4rLL3j957kPuUUA392cdFdUEg1P4UGopS1PpXQPwfSty" + "address": "0x4727e7a070d440299c8918a5b0361df08474a087d088351f36158e2b5667d827", + "digest": "CoaEaKR1McozywApryxJWWxEYuncs5cuiFtUsve8qu7d" } } ] }, "gasEffects": { "gasObject": { - "address": "0x7ab276e07bc81d3c00ac3f5234cce7214b5e69f5cbfa07535f14b05eeca5597c" + "address": "0x16a8e888439fb865e2ebb65d890e872be6717414f401f079b5741e67467ca41c" }, "gasSummary": { "computationCost": "1000000", @@ -163,7 +163,7 @@ Response: { "sequenceNumber": 1 }, "transactionBlock": { - "digest": "ZUbAobS9qYvY2zJRbjLRktjrF2iYTbB71VeF3G1AH9h" + "digest": "7yu83zzohW1XpMxHAwrUrivcfdqmdh2KCKvZ37v5iPBg" } }, "expiration": null @@ -190,12 +190,12 @@ Response: { "transactionBlocks": { "nodes": [ { - "digest": "BecbdoVwCC8UzhxBZTe4W9PYRQ8sTmd24eN8PTkvC6mp", + "digest": "9cxJZcyPgXjMPmoTBxM7PQ1Z1LEFSPXdBFV5UNYcBBsr", "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" }, "signatures": [ - "AOSbBTMsSnDQBiaV6h0zRPeXAZ9OSBfvS8kdAGOHFOm3i79pjXeBWS1ZKwfpc9/lrHDVRp2EfFlrDZ/hmz5MfAR/UUY663bYjcm3XmNyULIgxJz1t5Z9vxfB+fp8WUoJKA==" + "ACvyxn5vTOoJ2R/Cn2W8tvENjipIcrUTfNCCTlM3BgPXQxtV7Bfo4E2fmEUHGhBcfvyP3AHVi9HOUPJGmJuW5QN/UUY663bYjcm3XmNyULIgxJz1t5Z9vxfB+fp8WUoJKA==" ], "gasInput": { "gasSponsor": { @@ -204,7 +204,7 @@ Response: { "gasPayment": { "nodes": [ { - "address": "0x7ab276e07bc81d3c00ac3f5234cce7214b5e69f5cbfa07535f14b05eeca5597c" + "address": "0x16a8e888439fb865e2ebb65d890e872be6717414f401f079b5741e67467ca41c" } ] }, @@ -219,21 +219,21 @@ Response: { "cursor": "eyJpIjowLCJjIjoyfQ", "node": { "__typename": "OwnedOrImmutable", - "address": "0x546651aa715c29ee68ae0bb3d18aada7c2e76d51c82776bf400b13e864415294", + "address": "0x0846efff08221f9685365d064287d49054327432c48741661d46f494b2f84c8d", "version": 2, - "digest": "AEVaWDFKA3n7tVyT4wUk2s8kLdk3sYio2JnZseCWVNZb", + "digest": "3kdnX61T9paJQeedhS8QYKCAdAx2ja5mWbDMtMzEzRdC", "object": { - "address": "0x546651aa715c29ee68ae0bb3d18aada7c2e76d51c82776bf400b13e864415294", + "address": "0x0846efff08221f9685365d064287d49054327432c48741661d46f494b2f84c8d", "version": 2, - "digest": "AEVaWDFKA3n7tVyT4wUk2s8kLdk3sYio2JnZseCWVNZb", + "digest": "3kdnX61T9paJQeedhS8QYKCAdAx2ja5mWbDMtMzEzRdC", "asMoveObject": { "contents": { "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::package::UpgradeCap" }, "json": { - "id": "0x546651aa715c29ee68ae0bb3d18aada7c2e76d51c82776bf400b13e864415294", - "package": "0x728c8a7066d6ddefc37cc27f5fa9d8da87d3fbb14ea89b7e086ad243f90c1377", + "id": "0x0846efff08221f9685365d064287d49054327432c48741661d46f494b2f84c8d", + "package": "0x4727e7a070d440299c8918a5b0361df08474a087d088351f36158e2b5667d827", "version": "1", "policy": 0 } @@ -315,7 +315,7 @@ Response: { "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000002" ], - "currentPackage": "0x728c8a7066d6ddefc37cc27f5fa9d8da87d3fbb14ea89b7e086ad243f90c1377", + "currentPackage": "0x4727e7a070d440299c8918a5b0361df08474a087d088351f36158e2b5667d827", "upgradeTicket": { "__typename": "Result", "cmd": 0, @@ -367,10 +367,10 @@ Response: { "dependencies": { "nodes": [ { - "digest": "ZUbAobS9qYvY2zJRbjLRktjrF2iYTbB71VeF3G1AH9h" + "digest": "7yu83zzohW1XpMxHAwrUrivcfdqmdh2KCKvZ37v5iPBg" }, { - "digest": "JBuShctBdzAwMsiNHQnxTJqUhRuJgrTdUEyCbFc8S86L" + "digest": "GcUyosXyBY31652hSgsU5Gde7jzPyTQimDfM2GznB1S2" } ] }, @@ -390,37 +390,37 @@ Response: { "objectChanges": { "nodes": [ { - "address": "0x169bb0aedf2afe70f81aab6fa4ca35821ecfdf49aa4387e541f593922152294a", - "idCreated": true, + "address": "0x0846efff08221f9685365d064287d49054327432c48741661d46f494b2f84c8d", + "idCreated": false, "idDeleted": false, "outputState": { - "address": "0x169bb0aedf2afe70f81aab6fa4ca35821ecfdf49aa4387e541f593922152294a", - "digest": "6H4hmau8qvGqfnfMXhdfcwgBWFKh8gZG1C6ViR1GpXW6" + "address": "0x0846efff08221f9685365d064287d49054327432c48741661d46f494b2f84c8d", + "digest": "5rqHkqTAvB4gGrpdwKB3X7yx42fQPmXkjQX6HquzE4YQ" } }, { - "address": "0x546651aa715c29ee68ae0bb3d18aada7c2e76d51c82776bf400b13e864415294", + "address": "0x16a8e888439fb865e2ebb65d890e872be6717414f401f079b5741e67467ca41c", "idCreated": false, "idDeleted": false, "outputState": { - "address": "0x546651aa715c29ee68ae0bb3d18aada7c2e76d51c82776bf400b13e864415294", - "digest": "2r8yRaT1XWQYzzEdfmBoLcsBG4p75SkKn9drYvcnsNsU" + "address": "0x16a8e888439fb865e2ebb65d890e872be6717414f401f079b5741e67467ca41c", + "digest": "3hPsFkPRBXXQZa5B6yfaMC1cB5rKq79NPwWHJJDfzs5G" } }, { - "address": "0x7ab276e07bc81d3c00ac3f5234cce7214b5e69f5cbfa07535f14b05eeca5597c", - "idCreated": false, + "address": "0x636fec2071b067cd47d6388d380d029b6bbfe255e75ebdec9106a60f26d90560", + "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x7ab276e07bc81d3c00ac3f5234cce7214b5e69f5cbfa07535f14b05eeca5597c", - "digest": "EyDiCnSu3gSi8XRcFEwzG4qdjPzLG33asQ4P81TraEfq" + "address": "0x636fec2071b067cd47d6388d380d029b6bbfe255e75ebdec9106a60f26d90560", + "digest": "Bn3mxU9z7FrdUHXYFsm9f26wftdPkN29JswS5SGKpT6Y" } } ] }, "gasEffects": { "gasObject": { - "address": "0x7ab276e07bc81d3c00ac3f5234cce7214b5e69f5cbfa07535f14b05eeca5597c" + "address": "0x16a8e888439fb865e2ebb65d890e872be6717414f401f079b5741e67467ca41c" }, "gasSummary": { "computationCost": "1000000", @@ -437,7 +437,7 @@ Response: { "sequenceNumber": 2 }, "transactionBlock": { - "digest": "BecbdoVwCC8UzhxBZTe4W9PYRQ8sTmd24eN8PTkvC6mp" + "digest": "9cxJZcyPgXjMPmoTBxM7PQ1Z1LEFSPXdBFV5UNYcBBsr" } }, "expiration": null @@ -482,12 +482,12 @@ Response: { "transactionBlocks": { "nodes": [ { - "digest": "GWe4UJgcoRJZDmjc2ayBhfwM8Yy7KvWXUHJ4wK5oPe9F", + "digest": "JDtQReNP9NNFzaR91VpSitkB1cw11g41n4ieVCcLW2Ke", "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" }, "signatures": [ - "AMeXJ/X9zAOnWVa5Go9e4sfrB2Ays1ZOwMbWYjBmpx5VePg5a5rGBal1Umeps8GS+Yzqvf6kFH/M1uRBIC64FwN/UUY663bYjcm3XmNyULIgxJz1t5Z9vxfB+fp8WUoJKA==" + "ABcl1+dP9M/d04GQDpNCcmgfAojVDelh7UML/+nWlF9vVzM/9Zgu3tAX95EhDsMC/nlkwzg/Xd+kGKZtyVUZIw9/UUY663bYjcm3XmNyULIgxJz1t5Z9vxfB+fp8WUoJKA==" ], "gasInput": { "gasSponsor": { @@ -496,7 +496,7 @@ Response: { "gasPayment": { "nodes": [ { - "address": "0x7ab276e07bc81d3c00ac3f5234cce7214b5e69f5cbfa07535f14b05eeca5597c" + "address": "0x16a8e888439fb865e2ebb65d890e872be6717414f401f079b5741e67467ca41c" } ] }, @@ -591,7 +591,7 @@ Response: { "cursor": "eyJpIjozLCJjIjozfQ", "node": { "__typename": "MoveCallTransaction", - "package": "0x169bb0aedf2afe70f81aab6fa4ca35821ecfdf49aa4387e541f593922152294a", + "package": "0x636fec2071b067cd47d6388d380d029b6bbfe255e75ebdec9106a60f26d90560", "module": "m", "functionName": "new", "typeArguments": [], @@ -615,7 +615,7 @@ Response: { ], "return": [ { - "repr": "0x728c8a7066d6ddefc37cc27f5fa9d8da87d3fbb14ea89b7e086ad243f90c1377::m::Foo" + "repr": "0x4727e7a070d440299c8918a5b0361df08474a087d088351f36158e2b5667d827::m::Foo" } ] } @@ -642,7 +642,7 @@ Response: { "cursor": "eyJpIjo1LCJjIjozfQ", "node": { "__typename": "MoveCallTransaction", - "package": "0x169bb0aedf2afe70f81aab6fa4ca35821ecfdf49aa4387e541f593922152294a", + "package": "0x636fec2071b067cd47d6388d380d029b6bbfe255e75ebdec9106a60f26d90560", "module": "m", "functionName": "new", "typeArguments": [], @@ -666,7 +666,7 @@ Response: { ], "return": [ { - "repr": "0x728c8a7066d6ddefc37cc27f5fa9d8da87d3fbb14ea89b7e086ad243f90c1377::m::Foo" + "repr": "0x4727e7a070d440299c8918a5b0361df08474a087d088351f36158e2b5667d827::m::Foo" } ] } @@ -676,7 +676,7 @@ Response: { "cursor": "eyJpIjo2LCJjIjozfQ", "node": { "__typename": "MoveCallTransaction", - "package": "0x169bb0aedf2afe70f81aab6fa4ca35821ecfdf49aa4387e541f593922152294a", + "package": "0x636fec2071b067cd47d6388d380d029b6bbfe255e75ebdec9106a60f26d90560", "module": "m", "functionName": "burn", "typeArguments": [], @@ -692,7 +692,7 @@ Response: { "typeParameters": [], "parameters": [ { - "repr": "0x728c8a7066d6ddefc37cc27f5fa9d8da87d3fbb14ea89b7e086ad243f90c1377::m::Foo" + "repr": "0x4727e7a070d440299c8918a5b0361df08474a087d088351f36158e2b5667d827::m::Foo" } ], "return": [] @@ -744,10 +744,10 @@ Response: { "dependencies": { "nodes": [ { - "digest": "9SGG8wjvABKmhGZGN8ZS8UzzqP3LHnTikE14z5P91e3B" + "digest": "9cxJZcyPgXjMPmoTBxM7PQ1Z1LEFSPXdBFV5UNYcBBsr" }, { - "digest": "BecbdoVwCC8UzhxBZTe4W9PYRQ8sTmd24eN8PTkvC6mp" + "digest": "Cs9826UoCWKf1hNiL3AvZLUNEdvbjq7koKgSCW3JZFjD" } ] }, @@ -767,19 +767,19 @@ Response: { "objectChanges": { "nodes": [ { - "address": "0x7ab276e07bc81d3c00ac3f5234cce7214b5e69f5cbfa07535f14b05eeca5597c", + "address": "0x16a8e888439fb865e2ebb65d890e872be6717414f401f079b5741e67467ca41c", "idCreated": false, "idDeleted": false, "outputState": { - "address": "0x7ab276e07bc81d3c00ac3f5234cce7214b5e69f5cbfa07535f14b05eeca5597c", - "digest": "6ZNLDZAUBWeWxUBnLg65KWXnYHxutPpbBakZe8k2tPsE", + "address": "0x16a8e888439fb865e2ebb65d890e872be6717414f401f079b5741e67467ca41c", + "digest": "Axs9o9g6zRLWTk8y4h6yFgZViTPzF4RXaGNpnkce8gxU", "asMoveObject": { "contents": { "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::iota::IOTA>" }, "json": { - "id": "0x7ab276e07bc81d3c00ac3f5234cce7214b5e69f5cbfa07535f14b05eeca5597c", + "id": "0x16a8e888439fb865e2ebb65d890e872be6717414f401f079b5741e67467ca41c", "balance": { "value": "299999982082400" } @@ -789,19 +789,19 @@ Response: { } }, { - "address": "0x836d268782552c67bfba754975f2a4c65eba95bfb20e90109f2cd0042b86e138", + "address": "0x3ae6702801c6902eb3bdc76e3f254e336a50f37903c9537fb08ebdc66af45af4", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x836d268782552c67bfba754975f2a4c65eba95bfb20e90109f2cd0042b86e138", - "digest": "8z6Et5PK2UemWbFaA7DyRrHjQcymBmzYHYRf3AbvNqWL", + "address": "0x3ae6702801c6902eb3bdc76e3f254e336a50f37903c9537fb08ebdc66af45af4", + "digest": "CuFbeNaTANhD4P9um1KeZq3N6yLAE9YfEqph3x7naeVy", "asMoveObject": { "contents": { "type": { - "repr": "0x728c8a7066d6ddefc37cc27f5fa9d8da87d3fbb14ea89b7e086ad243f90c1377::m::Foo" + "repr": "0x4727e7a070d440299c8918a5b0361df08474a087d088351f36158e2b5667d827::m::Foo" }, "json": { - "id": "0x836d268782552c67bfba754975f2a4c65eba95bfb20e90109f2cd0042b86e138", + "id": "0x3ae6702801c6902eb3bdc76e3f254e336a50f37903c9537fb08ebdc66af45af4", "xs": [ "42", "43" @@ -812,19 +812,19 @@ Response: { } }, { - "address": "0xae540e061a6faeaebf8a526b06721ef2c062d648d62dfd1af51f2b0865ead81f", + "address": "0x74b6c16a640092f327aa742a3f444c8a9c0e99e048736735e99e0639202f07da", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0xae540e061a6faeaebf8a526b06721ef2c062d648d62dfd1af51f2b0865ead81f", - "digest": "27hwyX9cgvmSEEU4Zin8g6Mykm24M22cKPzmQKVsKNc1", + "address": "0x74b6c16a640092f327aa742a3f444c8a9c0e99e048736735e99e0639202f07da", + "digest": "H7p7DsvGqkan27ADQsooKx3v8MZwgDTS5LDBnV1S34pw", "asMoveObject": { "contents": { "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::iota::IOTA>" }, "json": { - "id": "0xae540e061a6faeaebf8a526b06721ef2c062d648d62dfd1af51f2b0865ead81f", + "id": "0x74b6c16a640092f327aa742a3f444c8a9c0e99e048736735e99e0639202f07da", "balance": { "value": "2000" } @@ -837,7 +837,7 @@ Response: { }, "gasEffects": { "gasObject": { - "address": "0x7ab276e07bc81d3c00ac3f5234cce7214b5e69f5cbfa07535f14b05eeca5597c" + "address": "0x16a8e888439fb865e2ebb65d890e872be6717414f401f079b5741e67467ca41c" }, "gasSummary": { "computationCost": "1000000", @@ -854,7 +854,7 @@ Response: { "sequenceNumber": 3 }, "transactionBlock": { - "digest": "GWe4UJgcoRJZDmjc2ayBhfwM8Yy7KvWXUHJ4wK5oPe9F" + "digest": "JDtQReNP9NNFzaR91VpSitkB1cw11g41n4ieVCcLW2Ke" } }, "expiration": null @@ -881,12 +881,12 @@ Response: { "transactionBlocks": { "nodes": [ { - "digest": "AkfM4f9bFkhH3oHtk1SxQoJg6hd4YEUipZ5nEHGUuyhE", + "digest": "3sWb5ikHtuVYUoRg7WecPj4cj3UzuZJgz6wW8yA9Hp9o", "sender": { "address": "0x8cca4e1ce0ba5904cea61df9242da2f7d29e3ef328fb7ec07c086b3bf47ca61a" }, "signatures": [ - "AHhUjshtxmJOoXShHpdM4zp2PIV/veE97JWH2BhKRa/njO9/CFKGf31/VXHKilUTj7zuRfC4/hPhNd0meG+KDwp/UUY663bYjcm3XmNyULIgxJz1t5Z9vxfB+fp8WUoJKA==" + "ACOUIjr22KZzZZ+i1I00zWbnlDdRakWNKcqjb47IQW6AvdSGdbxz4Lx/U+3oyhrAma/jwV/yiWdmSeDooErZtAF/UUY663bYjcm3XmNyULIgxJz1t5Z9vxfB+fp8WUoJKA==" ], "gasInput": { "gasSponsor": { @@ -895,7 +895,7 @@ Response: { "gasPayment": { "nodes": [ { - "address": "0x7ab276e07bc81d3c00ac3f5234cce7214b5e69f5cbfa07535f14b05eeca5597c" + "address": "0x16a8e888439fb865e2ebb65d890e872be6717414f401f079b5741e67467ca41c" } ] }, @@ -942,7 +942,7 @@ Response: { "dependencies": { "nodes": [ { - "digest": "GWe4UJgcoRJZDmjc2ayBhfwM8Yy7KvWXUHJ4wK5oPe9F" + "digest": "JDtQReNP9NNFzaR91VpSitkB1cw11g41n4ieVCcLW2Ke" } ] }, @@ -962,19 +962,19 @@ Response: { "objectChanges": { "nodes": [ { - "address": "0x7ab276e07bc81d3c00ac3f5234cce7214b5e69f5cbfa07535f14b05eeca5597c", + "address": "0x16a8e888439fb865e2ebb65d890e872be6717414f401f079b5741e67467ca41c", "idCreated": false, "idDeleted": false, "outputState": { - "address": "0x7ab276e07bc81d3c00ac3f5234cce7214b5e69f5cbfa07535f14b05eeca5597c", - "digest": "7TpRhyt5go4geHBvPgiMPNWrFVfi1j6sAfTW5YrLszDu" + "address": "0x16a8e888439fb865e2ebb65d890e872be6717414f401f079b5741e67467ca41c", + "digest": "8uEkTALwnaXWBEX7WYE5WcA7iZDwDnU1txGPvu2qHM8t" } } ] }, "gasEffects": { "gasObject": { - "address": "0x7ab276e07bc81d3c00ac3f5234cce7214b5e69f5cbfa07535f14b05eeca5597c" + "address": "0x16a8e888439fb865e2ebb65d890e872be6717414f401f079b5741e67467ca41c" }, "gasSummary": { "computationCost": "1000000", @@ -991,7 +991,7 @@ Response: { "sequenceNumber": 4 }, "transactionBlock": { - "digest": "AkfM4f9bFkhH3oHtk1SxQoJg6hd4YEUipZ5nEHGUuyhE" + "digest": "3sWb5ikHtuVYUoRg7WecPj4cj3UzuZJgz6wW8yA9Hp9o" } }, "expiration": null diff --git a/crates/iota-graphql-e2e-tests/tests/transactions/random.exp b/crates/iota-graphql-e2e-tests/tests/transactions/random.exp index 932362d55f8..ebeb8b8e7d7 100644 --- a/crates/iota-graphql-e2e-tests/tests/transactions/random.exp +++ b/crates/iota-graphql-e2e-tests/tests/transactions/random.exp @@ -19,7 +19,7 @@ Response: { "json": { "id": "0x0000000000000000000000000000000000000000000000000000000000000008", "inner": { - "id": "0x64245391f93d86304a99e09b136505481f2374b4bf9e6aeeae25976310517f76", + "id": "0x0a4818932295cdda8e2bf2bdf2af0d8022da23aafcc2a3a671f0db8a18a40914", "version": "1" } } diff --git a/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/alternating.exp b/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/alternating.exp index 9776e283cec..2f8cca14658 100644 --- a/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/alternating.exp +++ b/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/alternating.exp @@ -96,7 +96,7 @@ Response: { { "cursor": "eyJjIjozLCJ0IjoyLCJpIjpmYWxzZX0", "node": { - "digest": "mwCyozmxsNvmGdRkPQFGnz1FWbSsbi1Y5nAwwoCEvYj", + "digest": "EqqWSPU9Xpov2yDutF8bhtMpkbqB66Ct3AN8sMJWBUCu", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -124,7 +124,7 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo0LCJpIjpmYWxzZX0", "node": { - "digest": "8JVhaHpmcF8nXEiddc27dbsY2kUQYcNTm6Hnh27LWDmM", + "digest": "5wW9eGhGKPoDfUxsiWHTgcxDBz34QD7Fc6cMiMEqwMW", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -135,7 +135,7 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo2LCJpIjpmYWxzZX0", "node": { - "digest": "DhuoWAfbY5rhBBmNA8BF2UPgCkZ4hL4kzFSHy568ZCxQ", + "digest": "DvLhb1b8EgZnnqHeJewPu5wcySe1Emthar62n68G2JeA", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -163,7 +163,7 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo0LCJpIjpmYWxzZX0", "node": { - "digest": "8JVhaHpmcF8nXEiddc27dbsY2kUQYcNTm6Hnh27LWDmM", + "digest": "5wW9eGhGKPoDfUxsiWHTgcxDBz34QD7Fc6cMiMEqwMW", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -191,7 +191,7 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo4LCJpIjpmYWxzZX0", "node": { - "digest": "6ZBJU5xxGpDGCV6ppjMaobNEjXn4vWFZ2M2uxA4SeUbg", + "digest": "4JVs5UtEghNfT8MhBCxi5Dqc64sb2qM3gKynVrrDSnvM", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -219,7 +219,7 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo2LCJpIjpmYWxzZX0", "node": { - "digest": "DhuoWAfbY5rhBBmNA8BF2UPgCkZ4hL4kzFSHy568ZCxQ", + "digest": "DvLhb1b8EgZnnqHeJewPu5wcySe1Emthar62n68G2JeA", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -230,7 +230,7 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo4LCJpIjpmYWxzZX0", "node": { - "digest": "6ZBJU5xxGpDGCV6ppjMaobNEjXn4vWFZ2M2uxA4SeUbg", + "digest": "4JVs5UtEghNfT8MhBCxi5Dqc64sb2qM3gKynVrrDSnvM", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -258,7 +258,7 @@ Response: { { "cursor": "eyJjIjozLCJ0IjoxMCwiaSI6ZmFsc2V9", "node": { - "digest": "4qbyWF6ThFK1cvfjzoTBvPn1CjbHr89KamgvMABSsVfY", + "digest": "FjEwv7uuizMyfXs2xHPRkTUHKhyAL7W9yGHGTBV7uwMW", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -286,7 +286,7 @@ Response: { { "cursor": "eyJjIjozLCJ0IjoxMCwiaSI6ZmFsc2V9", "node": { - "digest": "4qbyWF6ThFK1cvfjzoTBvPn1CjbHr89KamgvMABSsVfY", + "digest": "FjEwv7uuizMyfXs2xHPRkTUHKhyAL7W9yGHGTBV7uwMW", "effects": { "checkpoint": { "sequenceNumber": 3 diff --git a/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/both_cursors.exp b/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/both_cursors.exp index 7cd694e7d50..34bdb4c1234 100644 --- a/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/both_cursors.exp +++ b/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/both_cursors.exp @@ -96,7 +96,7 @@ Response: { { "cursor": "eyJjIjo0LCJ0Ijo0LCJpIjpmYWxzZX0", "node": { - "digest": "3gWiKogJTZXwNofPHC8o6VSFAqZ94YDqw2nJkWxKj9UW", + "digest": "EjHhzapgKBFRNw7b6w1Ug7FPYjDZZgPvtwb3BVzu9HVw", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -124,7 +124,7 @@ Response: { { "cursor": "eyJjIjo0LCJ0Ijo0LCJpIjpmYWxzZX0", "node": { - "digest": "3gWiKogJTZXwNofPHC8o6VSFAqZ94YDqw2nJkWxKj9UW", + "digest": "EjHhzapgKBFRNw7b6w1Ug7FPYjDZZgPvtwb3BVzu9HVw", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -135,7 +135,7 @@ Response: { { "cursor": "eyJjIjo0LCJ0Ijo2LCJpIjpmYWxzZX0", "node": { - "digest": "b4pDNoqxfBPsQ7WnHcLG5sZ81CrxVtUgWiUJ8DPggxk", + "digest": "3YkKM9NR6VoFxtnDP4QgVvCUmda7paoXjse17LjsVqH5", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -163,7 +163,7 @@ Response: { { "cursor": "eyJjIjo0LCJ0Ijo1LCJpIjpmYWxzZX0", "node": { - "digest": "4moXjSKeRMSz1d3X9mf5WVoufqXpy9yNsy7UtVczW5t7", + "digest": "AjYmhGr6j3jYSES2NVkd57p973gwa3UZbh2tv9QK6S2m", "effects": { "checkpoint": { "sequenceNumber": 2 diff --git a/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/equal/first.exp b/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/equal/first.exp index 3472aea5585..ee5efca31d1 100644 --- a/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/equal/first.exp +++ b/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/equal/first.exp @@ -96,7 +96,7 @@ Response: { { "cursor": "eyJjIjozLCJ0IjoyLCJpIjpmYWxzZX0", "node": { - "digest": "4zKyKcWSZ8q5JAis9wDq6s6Dd2QK3xxZJGbj4kA3xeDs", + "digest": "Fpc7N9qYBCegSxBgmmEwANpQecoRmNriyNnA1WCgZ7T9", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -107,7 +107,7 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo0LCJpIjpmYWxzZX0", "node": { - "digest": "3gWiKogJTZXwNofPHC8o6VSFAqZ94YDqw2nJkWxKj9UW", + "digest": "EjHhzapgKBFRNw7b6w1Ug7FPYjDZZgPvtwb3BVzu9HVw", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -118,7 +118,7 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo2LCJpIjpmYWxzZX0", "node": { - "digest": "b4pDNoqxfBPsQ7WnHcLG5sZ81CrxVtUgWiUJ8DPggxk", + "digest": "3YkKM9NR6VoFxtnDP4QgVvCUmda7paoXjse17LjsVqH5", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -129,7 +129,7 @@ Response: { { "cursor": "eyJjIjozLCJ0IjoxMCwiaSI6ZmFsc2V9", "node": { - "digest": "638XQvJJ3thhxEWXSguc1CgYogWZ4qbJqRv8GoX93q3J", + "digest": "Ejp4Gnf3Gw8A3GpDDSEK1dTFXckwp6gs2bMnysHPMrzm", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -140,7 +140,7 @@ Response: { { "cursor": "eyJjIjozLCJ0IjoxMSwiaSI6ZmFsc2V9", "node": { - "digest": "ECJfcn3hTE2pb5PruJsfjZNHiRezpFTPRxBS9XMy6HwH", + "digest": "4MTQKdLBaFpFGTLpFqWHjeWmzuvCmbiDuqp6uRi8wBfx", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -168,7 +168,7 @@ Response: { { "cursor": "eyJjIjozLCJ0IjoyLCJpIjpmYWxzZX0", "node": { - "digest": "4zKyKcWSZ8q5JAis9wDq6s6Dd2QK3xxZJGbj4kA3xeDs", + "digest": "Fpc7N9qYBCegSxBgmmEwANpQecoRmNriyNnA1WCgZ7T9", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -196,7 +196,7 @@ Response: { { "cursor": "eyJjIjo0LCJ0Ijo0LCJpIjpmYWxzZX0", "node": { - "digest": "3gWiKogJTZXwNofPHC8o6VSFAqZ94YDqw2nJkWxKj9UW", + "digest": "EjHhzapgKBFRNw7b6w1Ug7FPYjDZZgPvtwb3BVzu9HVw", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -224,7 +224,7 @@ Response: { { "cursor": "eyJjIjo0LCJ0Ijo2LCJpIjpmYWxzZX0", "node": { - "digest": "b4pDNoqxfBPsQ7WnHcLG5sZ81CrxVtUgWiUJ8DPggxk", + "digest": "3YkKM9NR6VoFxtnDP4QgVvCUmda7paoXjse17LjsVqH5", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -268,7 +268,7 @@ Response: { { "cursor": "eyJjIjo0LCJ0IjoxMCwiaSI6ZmFsc2V9", "node": { - "digest": "638XQvJJ3thhxEWXSguc1CgYogWZ4qbJqRv8GoX93q3J", + "digest": "Ejp4Gnf3Gw8A3GpDDSEK1dTFXckwp6gs2bMnysHPMrzm", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -279,7 +279,7 @@ Response: { { "cursor": "eyJjIjo0LCJ0IjoxMSwiaSI6ZmFsc2V9", "node": { - "digest": "ECJfcn3hTE2pb5PruJsfjZNHiRezpFTPRxBS9XMy6HwH", + "digest": "4MTQKdLBaFpFGTLpFqWHjeWmzuvCmbiDuqp6uRi8wBfx", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -333,7 +333,7 @@ Response: { { "cursor": "eyJjIjo0LCJ0IjoxMCwiaSI6ZmFsc2V9", "node": { - "digest": "638XQvJJ3thhxEWXSguc1CgYogWZ4qbJqRv8GoX93q3J", + "digest": "Ejp4Gnf3Gw8A3GpDDSEK1dTFXckwp6gs2bMnysHPMrzm", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -344,7 +344,7 @@ Response: { { "cursor": "eyJjIjo0LCJ0IjoxMSwiaSI6ZmFsc2V9", "node": { - "digest": "ECJfcn3hTE2pb5PruJsfjZNHiRezpFTPRxBS9XMy6HwH", + "digest": "4MTQKdLBaFpFGTLpFqWHjeWmzuvCmbiDuqp6uRi8wBfx", "effects": { "checkpoint": { "sequenceNumber": 3 diff --git a/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/equal/last.exp b/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/equal/last.exp index 6d78c4b0f1b..1d598558f67 100644 --- a/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/equal/last.exp +++ b/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/equal/last.exp @@ -96,7 +96,7 @@ Response: { { "cursor": "eyJjIjozLCJ0IjoyLCJpIjpmYWxzZX0", "node": { - "digest": "4zKyKcWSZ8q5JAis9wDq6s6Dd2QK3xxZJGbj4kA3xeDs", + "digest": "Fpc7N9qYBCegSxBgmmEwANpQecoRmNriyNnA1WCgZ7T9", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -107,7 +107,7 @@ Response: { { "cursor": "eyJjIjozLCJ0IjozLCJpIjpmYWxzZX0", "node": { - "digest": "5mukuWJ2kPAe8Pg2NcMf9vZPk4ioUH9Tv4NMBXcK7Mw7", + "digest": "FirY733kBLzzbcnFsSPoeWLWAYBA1DcjHcurF9X1yxWa", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -118,7 +118,7 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo3LCJpIjpmYWxzZX0", "node": { - "digest": "8YjT1HZeAY2qEE5mYbZMS4aGzyt1YDXoHhgScA9NUgBR", + "digest": "7xVbGwKZMhSTY8fc9AhmcxsSagqiN55EgWstg8tzJRDg", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -129,7 +129,7 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo5LCJpIjpmYWxzZX0", "node": { - "digest": "B3tP4VxNzXd1Y4WP5dwsRbnRtcRTfQSenZ15EbfEQH3p", + "digest": "FCX74CUei7vEA5kENiNyRGsWg2KuPNfyy1U81yRgnt1P", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -140,7 +140,7 @@ Response: { { "cursor": "eyJjIjozLCJ0IjoxMSwiaSI6ZmFsc2V9", "node": { - "digest": "2ywy8D7ccV9TXjq5fK3YSW988JduU6cno22z2veFDwAa", + "digest": "MWWXrHgPzcyTSU7qoV7QAwTcrwLt2djL5qHWED2354v", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -168,7 +168,7 @@ Response: { { "cursor": "eyJjIjozLCJ0IjoxMSwiaSI6ZmFsc2V9", "node": { - "digest": "2ywy8D7ccV9TXjq5fK3YSW988JduU6cno22z2veFDwAa", + "digest": "MWWXrHgPzcyTSU7qoV7QAwTcrwLt2djL5qHWED2354v", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -196,7 +196,7 @@ Response: { { "cursor": "eyJjIjo0LCJ0Ijo5LCJpIjpmYWxzZX0", "node": { - "digest": "B3tP4VxNzXd1Y4WP5dwsRbnRtcRTfQSenZ15EbfEQH3p", + "digest": "FCX74CUei7vEA5kENiNyRGsWg2KuPNfyy1U81yRgnt1P", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -224,7 +224,7 @@ Response: { { "cursor": "eyJjIjo0LCJ0Ijo3LCJpIjpmYWxzZX0", "node": { - "digest": "8YjT1HZeAY2qEE5mYbZMS4aGzyt1YDXoHhgScA9NUgBR", + "digest": "7xVbGwKZMhSTY8fc9AhmcxsSagqiN55EgWstg8tzJRDg", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -268,7 +268,7 @@ Response: { { "cursor": "eyJjIjo0LCJ0IjoyLCJpIjpmYWxzZX0", "node": { - "digest": "4zKyKcWSZ8q5JAis9wDq6s6Dd2QK3xxZJGbj4kA3xeDs", + "digest": "Fpc7N9qYBCegSxBgmmEwANpQecoRmNriyNnA1WCgZ7T9", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -279,7 +279,7 @@ Response: { { "cursor": "eyJjIjo0LCJ0IjozLCJpIjpmYWxzZX0", "node": { - "digest": "5mukuWJ2kPAe8Pg2NcMf9vZPk4ioUH9Tv4NMBXcK7Mw7", + "digest": "FirY733kBLzzbcnFsSPoeWLWAYBA1DcjHcurF9X1yxWa", "effects": { "checkpoint": { "sequenceNumber": 2 diff --git a/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/ge_page/first.exp b/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/ge_page/first.exp index bcc56c614e1..0fa196e86e5 100644 --- a/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/ge_page/first.exp +++ b/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/ge_page/first.exp @@ -164,7 +164,7 @@ Response: { { "cursor": "eyJjIjo1LCJ0IjoyLCJpIjpmYWxzZX0", "node": { - "digest": "mwCyozmxsNvmGdRkPQFGnz1FWbSsbi1Y5nAwwoCEvYj", + "digest": "EqqWSPU9Xpov2yDutF8bhtMpkbqB66Ct3AN8sMJWBUCu", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -175,7 +175,7 @@ Response: { { "cursor": "eyJjIjo1LCJ0IjozLCJpIjpmYWxzZX0", "node": { - "digest": "HXhwQy2Cd8biC8fe111TFSYLKYYZoi5cWAFb7n4Epfdr", + "digest": "3B8UsX3diudqqgPmkuwremUc5cR49mJkxdPzfLUJ1BGq", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -186,7 +186,7 @@ Response: { { "cursor": "eyJjIjo1LCJ0IjoxNywiaSI6ZmFsc2V9", "node": { - "digest": "4w9544BVTSDYvvDibJmDsTJanU8zK8SpVMDzEzCMyv5W", + "digest": "FvrRt4VHFqh8RtDtR3FPwiDAbt1VuV1aS9bJyp3DSnu8", "effects": { "checkpoint": { "sequenceNumber": 5 @@ -197,7 +197,7 @@ Response: { { "cursor": "eyJjIjo1LCJ0IjoxOCwiaSI6ZmFsc2V9", "node": { - "digest": "HatuDy6reNH1mTyo6fAwmJ84Syx53poEjZyYh22fMmcJ", + "digest": "3bQyYzXuE22XcazmaR9fb48yyAXHwazXqzszfSvj1CnH", "effects": { "checkpoint": { "sequenceNumber": 5 @@ -208,7 +208,7 @@ Response: { { "cursor": "eyJjIjo1LCJ0IjoyMSwiaSI6ZmFsc2V9", "node": { - "digest": "E93RP9r3oqbpfxyrBi93MgHAvF4tWZhk4XHrvBcgevyZ", + "digest": "99chatBJVEwgJFy2cLCpEafTSgcs3kYjsjm8WymdLmdY", "effects": { "checkpoint": { "sequenceNumber": 5 @@ -236,7 +236,7 @@ Response: { { "cursor": "eyJjIjo1LCJ0IjoyLCJpIjpmYWxzZX0", "node": { - "digest": "mwCyozmxsNvmGdRkPQFGnz1FWbSsbi1Y5nAwwoCEvYj", + "digest": "EqqWSPU9Xpov2yDutF8bhtMpkbqB66Ct3AN8sMJWBUCu", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -264,7 +264,7 @@ Response: { { "cursor": "eyJjIjo3LCJ0IjozLCJpIjpmYWxzZX0", "node": { - "digest": "HXhwQy2Cd8biC8fe111TFSYLKYYZoi5cWAFb7n4Epfdr", + "digest": "3B8UsX3diudqqgPmkuwremUc5cR49mJkxdPzfLUJ1BGq", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -308,7 +308,7 @@ Response: { { "cursor": "eyJjIjo3LCJ0IjoxNywiaSI6ZmFsc2V9", "node": { - "digest": "4w9544BVTSDYvvDibJmDsTJanU8zK8SpVMDzEzCMyv5W", + "digest": "FvrRt4VHFqh8RtDtR3FPwiDAbt1VuV1aS9bJyp3DSnu8", "effects": { "checkpoint": { "sequenceNumber": 5 @@ -336,7 +336,7 @@ Response: { { "cursor": "eyJjIjo3LCJ0IjoxOCwiaSI6ZmFsc2V9", "node": { - "digest": "HatuDy6reNH1mTyo6fAwmJ84Syx53poEjZyYh22fMmcJ", + "digest": "3bQyYzXuE22XcazmaR9fb48yyAXHwazXqzszfSvj1CnH", "effects": { "checkpoint": { "sequenceNumber": 5 @@ -364,7 +364,7 @@ Response: { { "cursor": "eyJjIjo3LCJ0IjoyMSwiaSI6ZmFsc2V9", "node": { - "digest": "E93RP9r3oqbpfxyrBi93MgHAvF4tWZhk4XHrvBcgevyZ", + "digest": "99chatBJVEwgJFy2cLCpEafTSgcs3kYjsjm8WymdLmdY", "effects": { "checkpoint": { "sequenceNumber": 5 diff --git a/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/ge_page/last.exp b/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/ge_page/last.exp index e5244a5f968..69ef41256cf 100644 --- a/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/ge_page/last.exp +++ b/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/ge_page/last.exp @@ -164,7 +164,7 @@ Response: { { "cursor": "eyJjIjo1LCJ0IjoyLCJpIjpmYWxzZX0", "node": { - "digest": "mwCyozmxsNvmGdRkPQFGnz1FWbSsbi1Y5nAwwoCEvYj", + "digest": "EqqWSPU9Xpov2yDutF8bhtMpkbqB66Ct3AN8sMJWBUCu", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -175,7 +175,7 @@ Response: { { "cursor": "eyJjIjo1LCJ0IjozLCJpIjpmYWxzZX0", "node": { - "digest": "HXhwQy2Cd8biC8fe111TFSYLKYYZoi5cWAFb7n4Epfdr", + "digest": "3B8UsX3diudqqgPmkuwremUc5cR49mJkxdPzfLUJ1BGq", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -186,7 +186,7 @@ Response: { { "cursor": "eyJjIjo1LCJ0IjoxNywiaSI6ZmFsc2V9", "node": { - "digest": "4w9544BVTSDYvvDibJmDsTJanU8zK8SpVMDzEzCMyv5W", + "digest": "FvrRt4VHFqh8RtDtR3FPwiDAbt1VuV1aS9bJyp3DSnu8", "effects": { "checkpoint": { "sequenceNumber": 5 @@ -197,7 +197,7 @@ Response: { { "cursor": "eyJjIjo1LCJ0IjoyMSwiaSI6ZmFsc2V9", "node": { - "digest": "9zEYeCv3r6s91Kg4YuD9PdNNNagSbQcCWHVFVa7xddMx", + "digest": "Hjqv7QdSM2G2yfurdHv36unknXNu1JnoHjJcW2UsYwVq", "effects": { "checkpoint": { "sequenceNumber": 5 @@ -225,7 +225,7 @@ Response: { { "cursor": "eyJjIjo1LCJ0IjoyMSwiaSI6ZmFsc2V9", "node": { - "digest": "9zEYeCv3r6s91Kg4YuD9PdNNNagSbQcCWHVFVa7xddMx", + "digest": "Hjqv7QdSM2G2yfurdHv36unknXNu1JnoHjJcW2UsYwVq", "effects": { "checkpoint": { "sequenceNumber": 5 @@ -253,7 +253,7 @@ Response: { { "cursor": "eyJjIjo3LCJ0IjoxNywiaSI6ZmFsc2V9", "node": { - "digest": "4w9544BVTSDYvvDibJmDsTJanU8zK8SpVMDzEzCMyv5W", + "digest": "FvrRt4VHFqh8RtDtR3FPwiDAbt1VuV1aS9bJyp3DSnu8", "effects": { "checkpoint": { "sequenceNumber": 5 @@ -313,7 +313,7 @@ Response: { { "cursor": "eyJjIjo3LCJ0IjozLCJpIjpmYWxzZX0", "node": { - "digest": "HXhwQy2Cd8biC8fe111TFSYLKYYZoi5cWAFb7n4Epfdr", + "digest": "3B8UsX3diudqqgPmkuwremUc5cR49mJkxdPzfLUJ1BGq", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -341,7 +341,7 @@ Response: { { "cursor": "eyJjIjo3LCJ0IjoyLCJpIjpmYWxzZX0", "node": { - "digest": "mwCyozmxsNvmGdRkPQFGnz1FWbSsbi1Y5nAwwoCEvYj", + "digest": "EqqWSPU9Xpov2yDutF8bhtMpkbqB66Ct3AN8sMJWBUCu", "effects": { "checkpoint": { "sequenceNumber": 2 diff --git a/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/le_page/first.exp b/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/le_page/first.exp index b2b204cf6e5..94613b6858d 100644 --- a/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/le_page/first.exp +++ b/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/le_page/first.exp @@ -96,7 +96,7 @@ Response: { { "cursor": "eyJjIjozLCJ0IjoyLCJpIjpmYWxzZX0", "node": { - "digest": "mwCyozmxsNvmGdRkPQFGnz1FWbSsbi1Y5nAwwoCEvYj", + "digest": "EqqWSPU9Xpov2yDutF8bhtMpkbqB66Ct3AN8sMJWBUCu", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -107,7 +107,7 @@ Response: { { "cursor": "eyJjIjozLCJ0IjozLCJpIjpmYWxzZX0", "node": { - "digest": "7WkPvP5a39xpy98ZNga8NrTAJLdShhovwvvmCxiZFaz2", + "digest": "8yc9oAm3R4131ZyaFPmyUpzQR5gz42Bin7ADTqjvRnCx", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -118,7 +118,7 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo0LCJpIjpmYWxzZX0", "node": { - "digest": "8JVhaHpmcF8nXEiddc27dbsY2kUQYcNTm6Hnh27LWDmM", + "digest": "5wW9eGhGKPoDfUxsiWHTgcxDBz34QD7Fc6cMiMEqwMW", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -129,7 +129,7 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo1LCJpIjpmYWxzZX0", "node": { - "digest": "9ReXMV51j2TMW2Hj9mc3mk2V4NuYqRUjrG3H7osPGWgN", + "digest": "D6AUvEYJVe6aZsxRn1CqcPLFbcuLKskfrSY1jMYNR2Ha", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -140,7 +140,7 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo2LCJpIjpmYWxzZX0", "node": { - "digest": "DhuoWAfbY5rhBBmNA8BF2UPgCkZ4hL4kzFSHy568ZCxQ", + "digest": "DvLhb1b8EgZnnqHeJewPu5wcySe1Emthar62n68G2JeA", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -151,7 +151,7 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo3LCJpIjpmYWxzZX0", "node": { - "digest": "FEHxAg62jzcSDiMqqw5dX821XsMhcTDUhyXGcqVo9uY6", + "digest": "96n3Rq5QnAGcXPHsom5kMHiWorsd28yAcjTpjKU2mDht", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -162,7 +162,7 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo4LCJpIjpmYWxzZX0", "node": { - "digest": "6ZBJU5xxGpDGCV6ppjMaobNEjXn4vWFZ2M2uxA4SeUbg", + "digest": "4JVs5UtEghNfT8MhBCxi5Dqc64sb2qM3gKynVrrDSnvM", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -173,7 +173,7 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo5LCJpIjpmYWxzZX0", "node": { - "digest": "FTASFTZ9Rcr52HKv5V5v8n1dN5cYMBRQc9Qyo716WpiN", + "digest": "85YmFDGF6qzNkXjeXwqfguzjopXQk4Yo6S7rizt5BXSH", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -184,7 +184,7 @@ Response: { { "cursor": "eyJjIjozLCJ0IjoxMCwiaSI6ZmFsc2V9", "node": { - "digest": "4qbyWF6ThFK1cvfjzoTBvPn1CjbHr89KamgvMABSsVfY", + "digest": "FjEwv7uuizMyfXs2xHPRkTUHKhyAL7W9yGHGTBV7uwMW", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -195,7 +195,7 @@ Response: { { "cursor": "eyJjIjozLCJ0IjoxMSwiaSI6ZmFsc2V9", "node": { - "digest": "5kuiVU9xejCQ2Ziw2srV3UA2Lon3o1mF5UJVkHoL36eH", + "digest": "4DpnvwQZvwxPUBVmBDntFc5ie5L2kA6W2GWU6NtG5dzm", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -223,7 +223,7 @@ Response: { { "cursor": "eyJjIjozLCJ0IjoyLCJpIjpmYWxzZX0", "node": { - "digest": "mwCyozmxsNvmGdRkPQFGnz1FWbSsbi1Y5nAwwoCEvYj", + "digest": "EqqWSPU9Xpov2yDutF8bhtMpkbqB66Ct3AN8sMJWBUCu", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -251,7 +251,7 @@ Response: { { "cursor": "eyJjIjo0LCJ0Ijo0LCJpIjpmYWxzZX0", "node": { - "digest": "8JVhaHpmcF8nXEiddc27dbsY2kUQYcNTm6Hnh27LWDmM", + "digest": "5wW9eGhGKPoDfUxsiWHTgcxDBz34QD7Fc6cMiMEqwMW", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -279,7 +279,7 @@ Response: { { "cursor": "eyJjIjo0LCJ0Ijo2LCJpIjpmYWxzZX0", "node": { - "digest": "DhuoWAfbY5rhBBmNA8BF2UPgCkZ4hL4kzFSHy568ZCxQ", + "digest": "DvLhb1b8EgZnnqHeJewPu5wcySe1Emthar62n68G2JeA", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -290,7 +290,7 @@ Response: { { "cursor": "eyJjIjo0LCJ0Ijo4LCJpIjpmYWxzZX0", "node": { - "digest": "6ZBJU5xxGpDGCV6ppjMaobNEjXn4vWFZ2M2uxA4SeUbg", + "digest": "4JVs5UtEghNfT8MhBCxi5Dqc64sb2qM3gKynVrrDSnvM", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -318,7 +318,7 @@ Response: { { "cursor": "eyJjIjo0LCJ0IjoxMCwiaSI6ZmFsc2V9", "node": { - "digest": "4qbyWF6ThFK1cvfjzoTBvPn1CjbHr89KamgvMABSsVfY", + "digest": "FjEwv7uuizMyfXs2xHPRkTUHKhyAL7W9yGHGTBV7uwMW", "effects": { "checkpoint": { "sequenceNumber": 3 diff --git a/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/le_page/last.exp b/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/le_page/last.exp index ffa5ee71059..1017c645ef0 100644 --- a/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/le_page/last.exp +++ b/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/le_page/last.exp @@ -96,7 +96,7 @@ Response: { { "cursor": "eyJjIjozLCJ0IjoyLCJpIjpmYWxzZX0", "node": { - "digest": "mwCyozmxsNvmGdRkPQFGnz1FWbSsbi1Y5nAwwoCEvYj", + "digest": "EqqWSPU9Xpov2yDutF8bhtMpkbqB66Ct3AN8sMJWBUCu", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -107,7 +107,7 @@ Response: { { "cursor": "eyJjIjozLCJ0IjozLCJpIjpmYWxzZX0", "node": { - "digest": "7WkPvP5a39xpy98ZNga8NrTAJLdShhovwvvmCxiZFaz2", + "digest": "8yc9oAm3R4131ZyaFPmyUpzQR5gz42Bin7ADTqjvRnCx", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -118,7 +118,7 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo0LCJpIjpmYWxzZX0", "node": { - "digest": "8JVhaHpmcF8nXEiddc27dbsY2kUQYcNTm6Hnh27LWDmM", + "digest": "5wW9eGhGKPoDfUxsiWHTgcxDBz34QD7Fc6cMiMEqwMW", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -129,7 +129,7 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo1LCJpIjpmYWxzZX0", "node": { - "digest": "9ReXMV51j2TMW2Hj9mc3mk2V4NuYqRUjrG3H7osPGWgN", + "digest": "D6AUvEYJVe6aZsxRn1CqcPLFbcuLKskfrSY1jMYNR2Ha", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -140,7 +140,7 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo2LCJpIjpmYWxzZX0", "node": { - "digest": "DhuoWAfbY5rhBBmNA8BF2UPgCkZ4hL4kzFSHy568ZCxQ", + "digest": "DvLhb1b8EgZnnqHeJewPu5wcySe1Emthar62n68G2JeA", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -151,7 +151,7 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo3LCJpIjpmYWxzZX0", "node": { - "digest": "FEHxAg62jzcSDiMqqw5dX821XsMhcTDUhyXGcqVo9uY6", + "digest": "96n3Rq5QnAGcXPHsom5kMHiWorsd28yAcjTpjKU2mDht", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -162,7 +162,7 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo4LCJpIjpmYWxzZX0", "node": { - "digest": "6ZBJU5xxGpDGCV6ppjMaobNEjXn4vWFZ2M2uxA4SeUbg", + "digest": "4JVs5UtEghNfT8MhBCxi5Dqc64sb2qM3gKynVrrDSnvM", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -173,7 +173,7 @@ Response: { { "cursor": "eyJjIjozLCJ0Ijo5LCJpIjpmYWxzZX0", "node": { - "digest": "FTASFTZ9Rcr52HKv5V5v8n1dN5cYMBRQc9Qyo716WpiN", + "digest": "85YmFDGF6qzNkXjeXwqfguzjopXQk4Yo6S7rizt5BXSH", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -184,7 +184,7 @@ Response: { { "cursor": "eyJjIjozLCJ0IjoxMCwiaSI6ZmFsc2V9", "node": { - "digest": "4qbyWF6ThFK1cvfjzoTBvPn1CjbHr89KamgvMABSsVfY", + "digest": "FjEwv7uuizMyfXs2xHPRkTUHKhyAL7W9yGHGTBV7uwMW", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -195,7 +195,7 @@ Response: { { "cursor": "eyJjIjozLCJ0IjoxMSwiaSI6ZmFsc2V9", "node": { - "digest": "5kuiVU9xejCQ2Ziw2srV3UA2Lon3o1mF5UJVkHoL36eH", + "digest": "4DpnvwQZvwxPUBVmBDntFc5ie5L2kA6W2GWU6NtG5dzm", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -223,7 +223,7 @@ Response: { { "cursor": "eyJjIjozLCJ0IjoxMCwiaSI6ZmFsc2V9", "node": { - "digest": "4qbyWF6ThFK1cvfjzoTBvPn1CjbHr89KamgvMABSsVfY", + "digest": "FjEwv7uuizMyfXs2xHPRkTUHKhyAL7W9yGHGTBV7uwMW", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -251,7 +251,7 @@ Response: { { "cursor": "eyJjIjo0LCJ0Ijo4LCJpIjpmYWxzZX0", "node": { - "digest": "6ZBJU5xxGpDGCV6ppjMaobNEjXn4vWFZ2M2uxA4SeUbg", + "digest": "4JVs5UtEghNfT8MhBCxi5Dqc64sb2qM3gKynVrrDSnvM", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -279,7 +279,7 @@ Response: { { "cursor": "eyJjIjo0LCJ0Ijo2LCJpIjpmYWxzZX0", "node": { - "digest": "DhuoWAfbY5rhBBmNA8BF2UPgCkZ4hL4kzFSHy568ZCxQ", + "digest": "DvLhb1b8EgZnnqHeJewPu5wcySe1Emthar62n68G2JeA", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -307,7 +307,7 @@ Response: { { "cursor": "eyJjIjo0LCJ0Ijo0LCJpIjpmYWxzZX0", "node": { - "digest": "8JVhaHpmcF8nXEiddc27dbsY2kUQYcNTm6Hnh27LWDmM", + "digest": "5wW9eGhGKPoDfUxsiWHTgcxDBz34QD7Fc6cMiMEqwMW", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -335,7 +335,7 @@ Response: { { "cursor": "eyJjIjo0LCJ0IjoyLCJpIjpmYWxzZX0", "node": { - "digest": "mwCyozmxsNvmGdRkPQFGnz1FWbSsbi1Y5nAwwoCEvYj", + "digest": "EqqWSPU9Xpov2yDutF8bhtMpkbqB66Ct3AN8sMJWBUCu", "effects": { "checkpoint": { "sequenceNumber": 2 diff --git a/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/require.exp b/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/require.exp index 304a5a18043..a6d7e6fae03 100644 --- a/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/require.exp +++ b/crates/iota-graphql-e2e-tests/tests/transactions/scan_limit/require.exp @@ -94,7 +94,7 @@ Response: { }, "nodes": [ { - "digest": "4zKyKcWSZ8q5JAis9wDq6s6Dd2QK3xxZJGbj4kA3xeDs", + "digest": "Fpc7N9qYBCegSxBgmmEwANpQecoRmNriyNnA1WCgZ7T9", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -102,7 +102,7 @@ Response: { } }, { - "digest": "5mukuWJ2kPAe8Pg2NcMf9vZPk4ioUH9Tv4NMBXcK7Mw7", + "digest": "FirY733kBLzzbcnFsSPoeWLWAYBA1DcjHcurF9X1yxWa", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -110,7 +110,7 @@ Response: { } }, { - "digest": "H1hNjz6fLwZM2gtcnDBbJDFCdMGt1dXNBMj6SYtkVbrZ", + "digest": "9K2FJpFUUXiEV8LznzjUQJcY2K4vmX9kECwKas2vsyG", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -118,7 +118,7 @@ Response: { } }, { - "digest": "77y9Ar7drhCp1fG4AbEEcND8b3UC1AinA719tCKeAUaQ", + "digest": "BwBbnCKP9UAtpPSVV3RZqzozM15AaHDFtoRnpqkWDBMk", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -126,7 +126,7 @@ Response: { } }, { - "digest": "3K2kUPMCVQX82QSL7TVXVoyJVo3TJVqgk5k6gB96oLbF", + "digest": "9EdPgfA4esk9eiAHDGuhDSwznBpu4Z35cpEaaADvP5zT", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -134,7 +134,7 @@ Response: { } }, { - "digest": "AoaNoKrkQAW7R8epyboHAhrNmiJed7WqxUYHX2p9W3Gi", + "digest": "CxwvRZkjcFEqnFeqT4zQyQwKRpaS1NMnfk6ZHgrcuWEQ", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -142,7 +142,7 @@ Response: { } }, { - "digest": "2LnbVjwp4WsEPTCttuU3Ae3ZaMYDbU9hAjAtYZHABfNU", + "digest": "DSidHVd7b7Thys1ehtjw9sDtGq34KiMKC3sTmg2ys5sX", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -150,7 +150,7 @@ Response: { } }, { - "digest": "5Kh9fi4ppVyknuXtAPKszkh4iGGjLgoKLjUosLsJYrNM", + "digest": "4LPxvoFmcA94gU2RuAmzhLP5QQZ8dyrMo8LVb8gmpVo1", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -158,7 +158,7 @@ Response: { } }, { - "digest": "5hB8rPyv4pApk9abZStGxoJQ72ecDB4JmnR2Cd5CAQ5T", + "digest": "7jpEY9PpZzHzDq7r9iBijzJuaLbCAKnSL6eujudmsSr4", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -166,7 +166,7 @@ Response: { } }, { - "digest": "3pNVMUJVJwDwUzebUReA3pXEHtyWLhGR1UeuGdZFPoNP", + "digest": "Cvni8txxPnGMqbECvskbzo3T2JKoenM8bUYSYRZnqrDt", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -191,7 +191,7 @@ Response: { }, "nodes": [ { - "digest": "4zKyKcWSZ8q5JAis9wDq6s6Dd2QK3xxZJGbj4kA3xeDs", + "digest": "Fpc7N9qYBCegSxBgmmEwANpQecoRmNriyNnA1WCgZ7T9", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -199,7 +199,7 @@ Response: { } }, { - "digest": "5mukuWJ2kPAe8Pg2NcMf9vZPk4ioUH9Tv4NMBXcK7Mw7", + "digest": "FirY733kBLzzbcnFsSPoeWLWAYBA1DcjHcurF9X1yxWa", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -207,7 +207,7 @@ Response: { } }, { - "digest": "H1hNjz6fLwZM2gtcnDBbJDFCdMGt1dXNBMj6SYtkVbrZ", + "digest": "9K2FJpFUUXiEV8LznzjUQJcY2K4vmX9kECwKas2vsyG", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -215,7 +215,7 @@ Response: { } }, { - "digest": "77y9Ar7drhCp1fG4AbEEcND8b3UC1AinA719tCKeAUaQ", + "digest": "BwBbnCKP9UAtpPSVV3RZqzozM15AaHDFtoRnpqkWDBMk", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -223,7 +223,7 @@ Response: { } }, { - "digest": "3K2kUPMCVQX82QSL7TVXVoyJVo3TJVqgk5k6gB96oLbF", + "digest": "9EdPgfA4esk9eiAHDGuhDSwznBpu4Z35cpEaaADvP5zT", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -231,7 +231,7 @@ Response: { } }, { - "digest": "AoaNoKrkQAW7R8epyboHAhrNmiJed7WqxUYHX2p9W3Gi", + "digest": "CxwvRZkjcFEqnFeqT4zQyQwKRpaS1NMnfk6ZHgrcuWEQ", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -239,7 +239,7 @@ Response: { } }, { - "digest": "2LnbVjwp4WsEPTCttuU3Ae3ZaMYDbU9hAjAtYZHABfNU", + "digest": "DSidHVd7b7Thys1ehtjw9sDtGq34KiMKC3sTmg2ys5sX", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -247,7 +247,7 @@ Response: { } }, { - "digest": "5Kh9fi4ppVyknuXtAPKszkh4iGGjLgoKLjUosLsJYrNM", + "digest": "4LPxvoFmcA94gU2RuAmzhLP5QQZ8dyrMo8LVb8gmpVo1", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -255,7 +255,7 @@ Response: { } }, { - "digest": "5hB8rPyv4pApk9abZStGxoJQ72ecDB4JmnR2Cd5CAQ5T", + "digest": "7jpEY9PpZzHzDq7r9iBijzJuaLbCAKnSL6eujudmsSr4", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -263,7 +263,7 @@ Response: { } }, { - "digest": "3pNVMUJVJwDwUzebUReA3pXEHtyWLhGR1UeuGdZFPoNP", + "digest": "Cvni8txxPnGMqbECvskbzo3T2JKoenM8bUYSYRZnqrDt", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -311,7 +311,7 @@ Response: { }, "nodes": [ { - "digest": "4zKyKcWSZ8q5JAis9wDq6s6Dd2QK3xxZJGbj4kA3xeDs", + "digest": "Fpc7N9qYBCegSxBgmmEwANpQecoRmNriyNnA1WCgZ7T9", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -319,7 +319,7 @@ Response: { } }, { - "digest": "5mukuWJ2kPAe8Pg2NcMf9vZPk4ioUH9Tv4NMBXcK7Mw7", + "digest": "FirY733kBLzzbcnFsSPoeWLWAYBA1DcjHcurF9X1yxWa", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -327,7 +327,7 @@ Response: { } }, { - "digest": "H1hNjz6fLwZM2gtcnDBbJDFCdMGt1dXNBMj6SYtkVbrZ", + "digest": "9K2FJpFUUXiEV8LznzjUQJcY2K4vmX9kECwKas2vsyG", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -335,7 +335,7 @@ Response: { } }, { - "digest": "77y9Ar7drhCp1fG4AbEEcND8b3UC1AinA719tCKeAUaQ", + "digest": "BwBbnCKP9UAtpPSVV3RZqzozM15AaHDFtoRnpqkWDBMk", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -343,7 +343,7 @@ Response: { } }, { - "digest": "3K2kUPMCVQX82QSL7TVXVoyJVo3TJVqgk5k6gB96oLbF", + "digest": "9EdPgfA4esk9eiAHDGuhDSwznBpu4Z35cpEaaADvP5zT", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -351,7 +351,7 @@ Response: { } }, { - "digest": "AoaNoKrkQAW7R8epyboHAhrNmiJed7WqxUYHX2p9W3Gi", + "digest": "CxwvRZkjcFEqnFeqT4zQyQwKRpaS1NMnfk6ZHgrcuWEQ", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -359,7 +359,7 @@ Response: { } }, { - "digest": "2LnbVjwp4WsEPTCttuU3Ae3ZaMYDbU9hAjAtYZHABfNU", + "digest": "DSidHVd7b7Thys1ehtjw9sDtGq34KiMKC3sTmg2ys5sX", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -367,7 +367,7 @@ Response: { } }, { - "digest": "5Kh9fi4ppVyknuXtAPKszkh4iGGjLgoKLjUosLsJYrNM", + "digest": "4LPxvoFmcA94gU2RuAmzhLP5QQZ8dyrMo8LVb8gmpVo1", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -375,7 +375,7 @@ Response: { } }, { - "digest": "5hB8rPyv4pApk9abZStGxoJQ72ecDB4JmnR2Cd5CAQ5T", + "digest": "7jpEY9PpZzHzDq7r9iBijzJuaLbCAKnSL6eujudmsSr4", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -383,7 +383,7 @@ Response: { } }, { - "digest": "3pNVMUJVJwDwUzebUReA3pXEHtyWLhGR1UeuGdZFPoNP", + "digest": "Cvni8txxPnGMqbECvskbzo3T2JKoenM8bUYSYRZnqrDt", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -431,7 +431,7 @@ Response: { }, "nodes": [ { - "digest": "4zKyKcWSZ8q5JAis9wDq6s6Dd2QK3xxZJGbj4kA3xeDs", + "digest": "Fpc7N9qYBCegSxBgmmEwANpQecoRmNriyNnA1WCgZ7T9", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -439,7 +439,7 @@ Response: { } }, { - "digest": "5mukuWJ2kPAe8Pg2NcMf9vZPk4ioUH9Tv4NMBXcK7Mw7", + "digest": "FirY733kBLzzbcnFsSPoeWLWAYBA1DcjHcurF9X1yxWa", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -447,7 +447,7 @@ Response: { } }, { - "digest": "H1hNjz6fLwZM2gtcnDBbJDFCdMGt1dXNBMj6SYtkVbrZ", + "digest": "9K2FJpFUUXiEV8LznzjUQJcY2K4vmX9kECwKas2vsyG", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -455,7 +455,7 @@ Response: { } }, { - "digest": "77y9Ar7drhCp1fG4AbEEcND8b3UC1AinA719tCKeAUaQ", + "digest": "BwBbnCKP9UAtpPSVV3RZqzozM15AaHDFtoRnpqkWDBMk", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -463,7 +463,7 @@ Response: { } }, { - "digest": "3K2kUPMCVQX82QSL7TVXVoyJVo3TJVqgk5k6gB96oLbF", + "digest": "9EdPgfA4esk9eiAHDGuhDSwznBpu4Z35cpEaaADvP5zT", "effects": { "checkpoint": { "sequenceNumber": 2 @@ -471,7 +471,7 @@ Response: { } }, { - "digest": "AoaNoKrkQAW7R8epyboHAhrNmiJed7WqxUYHX2p9W3Gi", + "digest": "CxwvRZkjcFEqnFeqT4zQyQwKRpaS1NMnfk6ZHgrcuWEQ", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -479,7 +479,7 @@ Response: { } }, { - "digest": "2LnbVjwp4WsEPTCttuU3Ae3ZaMYDbU9hAjAtYZHABfNU", + "digest": "DSidHVd7b7Thys1ehtjw9sDtGq34KiMKC3sTmg2ys5sX", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -487,7 +487,7 @@ Response: { } }, { - "digest": "5Kh9fi4ppVyknuXtAPKszkh4iGGjLgoKLjUosLsJYrNM", + "digest": "4LPxvoFmcA94gU2RuAmzhLP5QQZ8dyrMo8LVb8gmpVo1", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -495,7 +495,7 @@ Response: { } }, { - "digest": "5hB8rPyv4pApk9abZStGxoJQ72ecDB4JmnR2Cd5CAQ5T", + "digest": "7jpEY9PpZzHzDq7r9iBijzJuaLbCAKnSL6eujudmsSr4", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -503,7 +503,7 @@ Response: { } }, { - "digest": "3pNVMUJVJwDwUzebUReA3pXEHtyWLhGR1UeuGdZFPoNP", + "digest": "Cvni8txxPnGMqbECvskbzo3T2JKoenM8bUYSYRZnqrDt", "effects": { "checkpoint": { "sequenceNumber": 3 @@ -592,7 +592,7 @@ Response: { { "cursor": "eyJjIjozLCJ0IjoyLCJpIjpmYWxzZX0", "node": { - "digest": "4zKyKcWSZ8q5JAis9wDq6s6Dd2QK3xxZJGbj4kA3xeDs", + "digest": "Fpc7N9qYBCegSxBgmmEwANpQecoRmNriyNnA1WCgZ7T9", "effects": { "checkpoint": { "sequenceNumber": 2 diff --git a/crates/iota-graphql-e2e-tests/tests/transactions/shared.exp b/crates/iota-graphql-e2e-tests/tests/transactions/shared.exp index 61af8b17941..e8499db5828 100644 --- a/crates/iota-graphql-e2e-tests/tests/transactions/shared.exp +++ b/crates/iota-graphql-e2e-tests/tests/transactions/shared.exp @@ -42,7 +42,7 @@ Response: { "transactions": { "nodes": [ { - "package": "0x81fecfec8cda1ae043aaf7af6c09e893ed847c1551585cef97e4f66e48d2f979", + "package": "0xc75e2a7ac0f53611d8d308f4c61cfd5eb0ebfe119fca77aa76725de93d04a2eb", "module": "m", "functionName": "get" } @@ -55,17 +55,17 @@ Response: { "nodes": [ { "__typename": "SharedObjectRead", - "address": "0x925dea6dd7c8fcb192b66c8ca68159433a2c4bc13a418b330d2da39c5dacb4ed", + "address": "0xe2feed8adeb99f6cfbd36426e9cad756f2c083d56d51b9a8243c93389f514a04", "version": 2, - "digest": "8sg1MfrfY93MygRY2VmiZNkq94uWETfK3BihkyMrgzag", + "digest": "Q6yqwPApQMm8cUXQpsnUmUCNR7taYTa5kNLHMeTH8f4", "object": { "asMoveObject": { "contents": { "type": { - "repr": "0x81fecfec8cda1ae043aaf7af6c09e893ed847c1551585cef97e4f66e48d2f979::m::Foo" + "repr": "0xc75e2a7ac0f53611d8d308f4c61cfd5eb0ebfe119fca77aa76725de93d04a2eb::m::Foo" }, "json": { - "id": "0x925dea6dd7c8fcb192b66c8ca68159433a2c4bc13a418b330d2da39c5dacb4ed", + "id": "0xe2feed8adeb99f6cfbd36426e9cad756f2c083d56d51b9a8243c93389f514a04", "x": "0" } } @@ -82,7 +82,7 @@ Response: { "transactions": { "nodes": [ { - "package": "0x81fecfec8cda1ae043aaf7af6c09e893ed847c1551585cef97e4f66e48d2f979", + "package": "0xc75e2a7ac0f53611d8d308f4c61cfd5eb0ebfe119fca77aa76725de93d04a2eb", "module": "m", "functionName": "inc" } @@ -102,12 +102,12 @@ Response: { "transactions": { "nodes": [ { - "package": "0x81fecfec8cda1ae043aaf7af6c09e893ed847c1551585cef97e4f66e48d2f979", + "package": "0xc75e2a7ac0f53611d8d308f4c61cfd5eb0ebfe119fca77aa76725de93d04a2eb", "module": "m", "functionName": "get" }, { - "package": "0x81fecfec8cda1ae043aaf7af6c09e893ed847c1551585cef97e4f66e48d2f979", + "package": "0xc75e2a7ac0f53611d8d308f4c61cfd5eb0ebfe119fca77aa76725de93d04a2eb", "module": "m", "functionName": "inc" } diff --git a/crates/iota-graphql-e2e-tests/tests/transactions/system.exp b/crates/iota-graphql-e2e-tests/tests/transactions/system.exp index b278397ab15..6056ad4c2da 100644 --- a/crates/iota-graphql-e2e-tests/tests/transactions/system.exp +++ b/crates/iota-graphql-e2e-tests/tests/transactions/system.exp @@ -7,7 +7,7 @@ Response: { "transactionBlocks": { "nodes": [ { - "digest": "3Q2jsrXKU4XeL54Zha5iaGZ1o8vS8v2w1yNmzctFP8nx", + "digest": "Cpgs1hPAQs2nfbQkD2ZsEfEAvmtTjb7QT5mtXaMQwhgD", "sender": null, "signatures": [ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==" @@ -407,7 +407,7 @@ Response: { "json": { "id": "0x0000000000000000000000000000000000000000000000000000000000000008", "inner": { - "id": "0x64245391f93d86304a99e09b136505481f2374b4bf9e6aeeae25976310517f76", + "id": "0x0a4818932295cdda8e2bf2bdf2af0d8022da23aafcc2a3a671f0db8a18a40914", "version": "1" } } @@ -489,7 +489,7 @@ Response: { "json": { "id": "0x0000000000000000000000000000000000000000000000000000000000000403", "lists": { - "id": "0xee738f1521522ab7f2c552e22cda46f96661774331fb5b4cd4577f0e31488488", + "id": "0x60dbd7095109dfd525da2db8f525d33227ba04ae8d25d8709a507018f52d31c0", "size": "0" } } @@ -586,71 +586,17 @@ Response: { { "cursor": "eyJpIjo5LCJjIjowfQ", "node": { - "address": "0x000000000000000000000000000000000000000000000000000000000000dee9", - "asMoveObject": null, - "asMovePackage": { - "modules": { - "edges": [ - { - "cursor": "eyJuIjoiY2xvYiIsImMiOjB9", - "node": { - "name": "clob" - } - }, - { - "cursor": "eyJuIjoiY2xvYl92MiIsImMiOjB9", - "node": { - "name": "clob_v2" - } - }, - { - "cursor": "eyJuIjoiY3JpdGJpdCIsImMiOjB9", - "node": { - "name": "critbit" - } - }, - { - "cursor": "eyJuIjoiY3VzdG9kaWFuIiwiYyI6MH0", - "node": { - "name": "custodian" - } - }, - { - "cursor": "eyJuIjoiY3VzdG9kaWFuX3YyIiwiYyI6MH0", - "node": { - "name": "custodian_v2" - } - }, - { - "cursor": "eyJuIjoibWF0aCIsImMiOjB9", - "node": { - "name": "math" - } - }, - { - "cursor": "eyJuIjoib3JkZXJfcXVlcnkiLCJjIjowfQ", - "node": { - "name": "order_query" - } - } - ] - } - } - } - }, - { - "cursor": "eyJpIjoxMCwiYyI6MH0", - "node": { - "address": "0x45dbc1fa6aa265ea050c6f6aa7e4e729de563d9c1c078e9e043654961030ef3e", + "address": "0x17c0381ca02ae48b3a0819b083e43663e17be2e3936fbf06aad42e97c3065a08", "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field<0x0000000000000000000000000000000000000000000000000000000000000002::object::ID,address>" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::iota::IOTA>" }, "json": { - "id": "0x45dbc1fa6aa265ea050c6f6aa7e4e729de563d9c1c078e9e043654961030ef3e", - "name": "0xa03d52faa695d20a45273c3a571d79c5881257ec9bbd82f894d9b1271ae68ee2", - "value": "0x28f02a953f3553f51a9365593c7d4bd0643d2085f004b18c6ca9de51682b2c80" + "id": "0x17c0381ca02ae48b3a0819b083e43663e17be2e3936fbf06aad42e97c3065a08", + "balance": { + "value": "30000000000000000" + } } } }, @@ -658,18 +604,22 @@ Response: { } }, { - "cursor": "eyJpIjoxMSwiYyI6MH0", + "cursor": "eyJpIjoxMCwiYyI6MH0", "node": { - "address": "0x51e8c26146c1df0ca5c935c4e0b2d9a99ef83e9e201735f71e647f3b1255d56c", + "address": "0x3017347a061e7145034c803925f9a84e7e2fc1a24f09d1701996d9fb66a970f2", "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::iota::IOTA>" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field" }, "json": { - "id": "0x51e8c26146c1df0ca5c935c4e0b2d9a99ef83e9e201735f71e647f3b1255d56c", - "balance": { - "value": "300000000000000" + "id": "0x3017347a061e7145034c803925f9a84e7e2fc1a24f09d1701996d9fb66a970f2", + "name": "1", + "value": { + "version": "1", + "epoch": "0", + "randomness_round": "0", + "random_bytes": [] } } } @@ -678,7 +628,7 @@ Response: { } }, { - "cursor": "eyJpIjoxMiwiYyI6MH0", + "cursor": "eyJpIjoxMSwiYyI6MH0", "node": { "address": "0x5a6383eb592bab4ff7c037a2118c514149ba9a86cf5a3b019c7034686365183f", "asMoveObject": { @@ -716,31 +666,7 @@ Response: { } }, { - "cursor": "eyJpIjoxMywiYyI6MH0", - "node": { - "address": "0x681869e3055b2680391dd8aaf2bd5b842a638c7921870ca06ca2e553761d5912", - "asMoveObject": { - "contents": { - "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::CoinMetadata<0x0000000000000000000000000000000000000000000000000000000000000002::iota::IOTA>" - }, - "json": { - "id": "0x681869e3055b2680391dd8aaf2bd5b842a638c7921870ca06ca2e553761d5912", - "decimals": 9, - "name": "IOTA", - "symbol": "IOTA", - "description": "The main (gas)token of the IOTA Network.", - "icon_url": { - "url": "https://iota.org/logo.png" - } - } - } - }, - "asMovePackage": null - } - }, - { - "cursor": "eyJpIjoxNCwiYyI6MH0", + "cursor": "eyJpIjoxMiwiYyI6MH0", "node": { "address": "0x6af2a2b7ca60bf76174adfd3e9c4957f8e937759603182f9b46c7f6c5f19c6d2", "asMoveObject": { @@ -757,7 +683,7 @@ Response: { "system_state_version": "1", "iota_treasury_cap": { "inner": { - "id": "0x862d63508303377f807e4c9ce89fa5b634ce6b008043f22433f253b27fc92b14", + "id": "0xde341860ab0f8249d38c7924fa287bdd20ac5dacb26a276b53a875a2be9972a4", "total_supply": { "value": "31800000000000000" } @@ -1004,15 +930,15 @@ Response: { "next_epoch_p2p_address": null, "next_epoch_primary_address": null, "extra_fields": { - "id": "0xdabf658011a9b3da6b4e71e6191b7770c5e76f4cc4d1da4b1c1424c062b57f07", + "id": "0x00805e85ca185f935cb7248b58bac2528ec7457ef1b10baf8ef03d9a237d46e4", "size": "0" } }, "voting_power": "10000", - "operation_cap_id": "0x79994b0548d23ce03bd642b598c53f4b8cf20eab38292b2320a9cb6e1502c87a", + "operation_cap_id": "0xcf955500c82314d83e8abfeb712e306c5acccfc8b77b754b0e9bd8f921b9da43", "gas_price": "1000", "staking_pool": { - "id": "0xa03d52faa695d20a45273c3a571d79c5881257ec9bbd82f894d9b1271ae68ee2", + "id": "0x37e12b05c5ead707489d81b4fa16d6ce0031fb7a55dd22ba7855fa621b2aeea0", "activation_epoch": "0", "deactivation_epoch": null, "iota_balance": "1500000000000000", @@ -1021,14 +947,14 @@ Response: { }, "pool_token_balance": "1500000000000000", "exchange_rates": { - "id": "0xbfde46aaacc31bdb8d0411fdba5bb4296c6fdc072a8dbae80944074fc7952028", + "id": "0x08e7a0374786bdb308e5b6f3d0ff0147f9ee5bc9de1272c52db9eadb75b4575c", "size": "1" }, "pending_stake": "0", "pending_total_iota_withdraw": "0", "pending_pool_token_withdraw": "0", "extra_fields": { - "id": "0xf455b5850dc4209b0481eb309a0041259ccfb1fa2843e55e785e9ff5d4af7c5a", + "id": "0xd42abafef5e951452dec95b36dfe8e14510e15645f6c47c47efa5208c34b3f82", "size": "0" } }, @@ -1037,35 +963,35 @@ Response: { "next_epoch_gas_price": "1000", "next_epoch_commission_rate": "200", "extra_fields": { - "id": "0x923d1346474058ee4f3819a1b25e526ca769c1536fb0ade6e3f97dd149d0ce1f", + "id": "0x2bd3bc51297bd1883a039d0bec2cb160519df1a2cb4b228a1127e7e93fdf9746", "size": "0" } } ], "pending_active_validators": { "contents": { - "id": "0xf8dc8eeba758061f21dc5684a06e256e96849b1f22f1f851925452eb482c8eaa", + "id": "0x76cf61f73bf4d578aaafe61a3cb91654e64880da7a4ecbbf82c955df78345308", "size": "0" } }, "pending_removals": [], "staking_pool_mappings": { - "id": "0xf85a9c08864de10f1d7e61e50f5d9e126b65590e19629121ac85d46f8006a0b6", + "id": "0xa8ddddc49351578fdd00675f868dba2ede333982acd3ce615c6e5387709ee5e2", "size": "1" }, "inactive_validators": { - "id": "0xc51471ea897ce3f100e6139ce44a8778e167700ec3bc470cbba84da31f2812e1", + "id": "0x529312e17eba8de6ec856216eb76f9a69ed9397511d4e51941c2a55b7d5f223b", "size": "0" }, "validator_candidates": { - "id": "0xabda552c6a55960a548cc7bb17ea12e5d74b0d110627d53d6a5d09e8cbefc1aa", + "id": "0x7a241a22465736e41d283817bea8d8775f887ad91a7ae893a129c22d660a4ab6", "size": "0" }, "at_risk_validators": { "contents": [] }, "extra_fields": { - "id": "0x5b30d95c028bbbcee4c6ce4282d4c1bca38a5e40875abe1ea8531ae1b6037d85", + "id": "0x2275e20fa9aa92c01701edc97925b0c2cdfcc57d1da108087b1c7f25b700c7a4", "size": "0" } }, @@ -1085,7 +1011,7 @@ Response: { "validator_very_low_stake_threshold": "1000000000000000", "validator_low_stake_grace_period": "7", "extra_fields": { - "id": "0xf72dcf525876ce27556d1cf350dae51b5c6bb23956d41f6494941d38309fc48e", + "id": "0x98fda9947bae7fd10900d9b916e94e08699cf7bc4a7f099ba1f3836926278fab", "size": "0" } }, @@ -1104,7 +1030,7 @@ Response: { "safe_mode_non_refundable_storage_fee": "0", "epoch_start_timestamp_ms": "0", "extra_fields": { - "id": "0x13653a79a25720aa3e179ba31ef4c916fbaa5d8594ed96451cfef42866272480", + "id": "0xb96b62cd4f66eb8a3c32f8ffa29697b8d4a1209f7fa9c9aaf01947b2ebb92a1d", "size": "0" } } @@ -1114,18 +1040,93 @@ Response: { "asMovePackage": null } }, + { + "cursor": "eyJpIjoxMywiYyI6MH0", + "node": { + "address": "0x7e41c686d7c309827999e66c7cbaabfe1e7428458dab9f7e93dc1abbb6c64157", + "asMoveObject": { + "contents": { + "type": { + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::display::Display<0x000000000000000000000000000000000000000000000000000000000000107a::nft::Nft>" + }, + "json": { + "id": "0x7e41c686d7c309827999e66c7cbaabfe1e7428458dab9f7e93dc1abbb6c64157", + "fields": { + "contents": [ + { + "key": "name", + "value": "{immutable_metadata.name}" + }, + { + "key": "image_url", + "value": "{immutable_metadata.uri}" + }, + { + "key": "description", + "value": "{immutable_metadata.description}" + }, + { + "key": "creator", + "value": "{immutable_metadata.issuer_name}" + }, + { + "key": "version", + "value": "{immutable_metadata.version}" + }, + { + "key": "media_type", + "value": "{immutable_metadata.media_type}" + }, + { + "key": "collection_name", + "value": "{immutable_metadata.collection_name}" + }, + { + "key": "immutable_issuer", + "value": "{immutable_issuer}" + } + ] + }, + "version": 1 + } + } + }, + "asMovePackage": null + } + }, + { + "cursor": "eyJpIjoxNCwiYyI6MH0", + "node": { + "address": "0xc1ea833a9381cdb3d00f7eb3c38b0603c94814031257a74bbfa0148ec788f881", + "asMoveObject": { + "contents": { + "type": { + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field<0x0000000000000000000000000000000000000000000000000000000000000002::object::ID,address>" + }, + "json": { + "id": "0xc1ea833a9381cdb3d00f7eb3c38b0603c94814031257a74bbfa0148ec788f881", + "name": "0x37e12b05c5ead707489d81b4fa16d6ce0031fb7a55dd22ba7855fa621b2aeea0", + "value": "0x28f02a953f3553f51a9365593c7d4bd0643d2085f004b18c6ca9de51682b2c80" + } + } + }, + "asMovePackage": null + } + }, { "cursor": "eyJpIjoxNSwiYyI6MH0", "node": { - "address": "0x79994b0548d23ce03bd642b598c53f4b8cf20eab38292b2320a9cb6e1502c87a", + "address": "0xc22d782d6b686022721c7a680612c20817b6cad04210f7df35e471dfd78881f8", "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000003::validator_cap::UnverifiedValidatorOperationCap" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::iota::IOTA>" }, "json": { - "id": "0x79994b0548d23ce03bd642b598c53f4b8cf20eab38292b2320a9cb6e1502c87a", - "authorizer_validator_address": "0x28f02a953f3553f51a9365593c7d4bd0643d2085f004b18c6ca9de51682b2c80" + "id": "0xc22d782d6b686022721c7a680612c20817b6cad04210f7df35e471dfd78881f8", + "balance": { + "value": "300000000000000" + } } } }, @@ -1135,15 +1136,15 @@ Response: { { "cursor": "eyJpIjoxNiwiYyI6MH0", "node": { - "address": "0x874cd6b1950b41facb75642efb93086de732df26f262036684b209971233adf6", + "address": "0xc39644d3d20f6965de0f07b7fd8a02a283f87b04a3401668f3c87c57208c253c", "asMoveObject": { "contents": { "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000003::staking_pool::StakedIota" }, "json": { - "id": "0x874cd6b1950b41facb75642efb93086de732df26f262036684b209971233adf6", - "pool_id": "0xa03d52faa695d20a45273c3a571d79c5881257ec9bbd82f894d9b1271ae68ee2", + "id": "0xc39644d3d20f6965de0f07b7fd8a02a283f87b04a3401668f3c87c57208c253c", + "pool_id": "0x37e12b05c5ead707489d81b4fa16d6ce0031fb7a55dd22ba7855fa621b2aeea0", "stake_activation_epoch": "0", "principal": { "value": "1500000000000000" @@ -1157,14 +1158,14 @@ Response: { { "cursor": "eyJpIjoxNywiYyI6MH0", "node": { - "address": "0xbb85fe8b6ec147c867b7ab232b89b244ddf1d18e35b6ec47d4258b663059930a", + "address": "0xcc39f8b8e9648f8bf95a9782944f86b4eadb45f965da8fadcc27c99968d905d1", "asMoveObject": { "contents": { "type": { "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field" }, "json": { - "id": "0xbb85fe8b6ec147c867b7ab232b89b244ddf1d18e35b6ec47d4258b663059930a", + "id": "0xcc39f8b8e9648f8bf95a9782944f86b4eadb45f965da8fadcc27c99968d905d1", "name": "0", "value": { "iota_amount": "0", @@ -1179,21 +1180,15 @@ Response: { { "cursor": "eyJpIjoxOCwiYyI6MH0", "node": { - "address": "0xc4929aa8e82af543ad1bd995384f8a7ef5d9013e9157eba19386040ba3142c56", + "address": "0xcf955500c82314d83e8abfeb712e306c5acccfc8b77b754b0e9bd8f921b9da43", "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000003::validator_cap::UnverifiedValidatorOperationCap" }, "json": { - "id": "0xc4929aa8e82af543ad1bd995384f8a7ef5d9013e9157eba19386040ba3142c56", - "name": "1", - "value": { - "version": "1", - "epoch": "0", - "randomness_round": "0", - "random_bytes": [] - } + "id": "0xcf955500c82314d83e8abfeb712e306c5acccfc8b77b754b0e9bd8f921b9da43", + "authorizer_validator_address": "0x28f02a953f3553f51a9365593c7d4bd0643d2085f004b18c6ca9de51682b2c80" } } }, @@ -1203,16 +1198,20 @@ Response: { { "cursor": "eyJpIjoxOSwiYyI6MH0", "node": { - "address": "0xeaaefbe68cb12a738b9900cae483e21a64774a96ae31057197e557f3ea37449f", + "address": "0xe6ad211c1ac09d032251d184db0824f16ad0de8b858bff0e046fde919a88c08b", "asMoveObject": { "contents": { "type": { - "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<0x0000000000000000000000000000000000000000000000000000000000000002::iota::IOTA>" + "repr": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::CoinMetadata<0x0000000000000000000000000000000000000000000000000000000000000002::iota::IOTA>" }, "json": { - "id": "0xeaaefbe68cb12a738b9900cae483e21a64774a96ae31057197e557f3ea37449f", - "balance": { - "value": "30000000000000000" + "id": "0xe6ad211c1ac09d032251d184db0824f16ad0de8b858bff0e046fde919a88c08b", + "decimals": 9, + "name": "IOTA", + "symbol": "IOTA", + "description": "The main (gas)token of the IOTA Network.", + "icon_url": { + "url": "https://iota.org/logo.png" } } } @@ -1260,7 +1259,7 @@ Response: { "idDeleted": false, "outputState": { "address": "0x0000000000000000000000000000000000000000000000000000000000000001", - "digest": "FqMtZucg8Kq9QV3eNTvV9M15EyWj3ECNKC12qfudsDru" + "digest": "7AUMJwqfXbAV3GZbGjPeBK6NCUXxMxxUz62TS6MjhMY3" } }, { @@ -1269,7 +1268,7 @@ Response: { "idDeleted": false, "outputState": { "address": "0x0000000000000000000000000000000000000000000000000000000000000002", - "digest": "E7uXTMYN2oQ15g7Xd8vR1TV3bABDAn2PPVPz9H1qXj52" + "digest": "HpTrU3csg7qRB1TcgBzeW2WYofPQD1ySZYhLawsdQNZ3" } }, { @@ -1278,7 +1277,7 @@ Response: { "idDeleted": false, "outputState": { "address": "0x0000000000000000000000000000000000000000000000000000000000000003", - "digest": "6PG85JzqvBkA1PSWhjhmPSGQXVxcvGjA5e3hjZP7dwBh" + "digest": "4mnkQWk7TkeTQb2WpD3cJekf9W6Nyd1SJKoC4FeDGzxN" } }, { @@ -1287,7 +1286,7 @@ Response: { "idDeleted": false, "outputState": { "address": "0x0000000000000000000000000000000000000000000000000000000000000005", - "digest": "14PhfJCzB1D6yKDPC62RRBFuxL3fSPj2TcTCKMtekbma" + "digest": "81HKA2Xi48k1v9QnhvgAXDxT7kVE2S39XyiNYH48kVWw" } }, { @@ -1296,7 +1295,7 @@ Response: { "idDeleted": false, "outputState": { "address": "0x0000000000000000000000000000000000000000000000000000000000000006", - "digest": "13t46kxDvMkddcwtFXAWLCK2ryVEh6b1yNJLfPDwf5ne" + "digest": "3RsTZi66r7dDbcgMMQS8oxFcAbpEnfS61Piehj7peK8p" } }, { @@ -1305,7 +1304,7 @@ Response: { "idDeleted": false, "outputState": { "address": "0x0000000000000000000000000000000000000000000000000000000000000008", - "digest": "3kTwojhZSxhQQgyKqQdBmfHjqhNM1bXK3KXXheMrgZMC" + "digest": "FKGW6NDeitr9gStJ58iCZjf3yrSNLKaRTkNKgtAsCYm6" } }, { @@ -1314,7 +1313,7 @@ Response: { "idDeleted": false, "outputState": { "address": "0x000000000000000000000000000000000000000000000000000000000000000b", - "digest": "8G372JGHTJJvDN7r67itdCve4PxkXAct7Jajed2jkWBv" + "digest": "C1nWqcKgwnjhZbi72fNL7cxE7CNGmrHR3KgZzs8a2V9h" } }, { @@ -1323,7 +1322,7 @@ Response: { "idDeleted": false, "outputState": { "address": "0x0000000000000000000000000000000000000000000000000000000000000403", - "digest": "FHJUE3aPtVYZf4fbLgYdEk7vFB9Jo5AcfGg8Ji9BuQV8" + "digest": "3oJWhcHhvgF3jCztsz9SCmPe7RpH5obzzqQVvwF7x5bg" } }, { @@ -1332,106 +1331,106 @@ Response: { "idDeleted": false, "outputState": { "address": "0x000000000000000000000000000000000000000000000000000000000000107a", - "digest": "7FrGBvKzGaWfHaNkT7TRN8wecP1gcuURGK6sApUjc6ir" + "digest": "vVxaoTtVnsooFc5CejECwfwQJAiqYAzF83VLw6zEdyL" } }, { - "address": "0x000000000000000000000000000000000000000000000000000000000000dee9", + "address": "0x17c0381ca02ae48b3a0819b083e43663e17be2e3936fbf06aad42e97c3065a08", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x000000000000000000000000000000000000000000000000000000000000dee9", - "digest": "A9k6BCqVW7zBTdQdr7CnCErDGYwKmJijyTyQqgfUzPGh" + "address": "0x17c0381ca02ae48b3a0819b083e43663e17be2e3936fbf06aad42e97c3065a08", + "digest": "CU68h6AHL2gKsmGFagWeVudqNE2Qx5UdXVKfcKn8tSZm" } }, { - "address": "0x45dbc1fa6aa265ea050c6f6aa7e4e729de563d9c1c078e9e043654961030ef3e", + "address": "0x3017347a061e7145034c803925f9a84e7e2fc1a24f09d1701996d9fb66a970f2", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x45dbc1fa6aa265ea050c6f6aa7e4e729de563d9c1c078e9e043654961030ef3e", - "digest": "4S5VPqmC9CnjESxHHYF4v1mftEvN9PaRJDzg3nJ2DmME" + "address": "0x3017347a061e7145034c803925f9a84e7e2fc1a24f09d1701996d9fb66a970f2", + "digest": "J59wYRtmpiePR5UDoTV8kaBRh5CrhpGdNF2DT3k6GEv6" } }, { - "address": "0x51e8c26146c1df0ca5c935c4e0b2d9a99ef83e9e201735f71e647f3b1255d56c", + "address": "0x5a6383eb592bab4ff7c037a2118c514149ba9a86cf5a3b019c7034686365183f", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x51e8c26146c1df0ca5c935c4e0b2d9a99ef83e9e201735f71e647f3b1255d56c", - "digest": "AVFcpLipQ2Qv6DqMeX5v6KmAJzFdbD97Xx5eyQkdudAj" + "address": "0x5a6383eb592bab4ff7c037a2118c514149ba9a86cf5a3b019c7034686365183f", + "digest": "Eo6p1RYX5B1WoBPTQUfCkYCn5q7FySXmcKsSktiGyVXf" } }, { - "address": "0x5a6383eb592bab4ff7c037a2118c514149ba9a86cf5a3b019c7034686365183f", + "address": "0x6af2a2b7ca60bf76174adfd3e9c4957f8e937759603182f9b46c7f6c5f19c6d2", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x5a6383eb592bab4ff7c037a2118c514149ba9a86cf5a3b019c7034686365183f", - "digest": "FnLwiFscb5G5wgumck3xFUstJW4Khq5fwp3dFX4jPsGq" + "address": "0x6af2a2b7ca60bf76174adfd3e9c4957f8e937759603182f9b46c7f6c5f19c6d2", + "digest": "FZgiUDrLxJ1AkaefGfkYnoJwj2vqeLQYVotu3F4yKvTz" } }, { - "address": "0x681869e3055b2680391dd8aaf2bd5b842a638c7921870ca06ca2e553761d5912", + "address": "0x7e41c686d7c309827999e66c7cbaabfe1e7428458dab9f7e93dc1abbb6c64157", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x681869e3055b2680391dd8aaf2bd5b842a638c7921870ca06ca2e553761d5912", - "digest": "BFQLZfosURZrNbckqj3j8Ue81LMJbUbDtbCbofwTtZwP" + "address": "0x7e41c686d7c309827999e66c7cbaabfe1e7428458dab9f7e93dc1abbb6c64157", + "digest": "9ufGyP4K6jwDAoqdrnVoXzBa1gabT9W1kiqcM8WaUrzQ" } }, { - "address": "0x6af2a2b7ca60bf76174adfd3e9c4957f8e937759603182f9b46c7f6c5f19c6d2", + "address": "0xc1ea833a9381cdb3d00f7eb3c38b0603c94814031257a74bbfa0148ec788f881", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x6af2a2b7ca60bf76174adfd3e9c4957f8e937759603182f9b46c7f6c5f19c6d2", - "digest": "C93UhbkSunpDSB17Zk3sU3M6oeBwHpaLmcJKrH6sBNvR" + "address": "0xc1ea833a9381cdb3d00f7eb3c38b0603c94814031257a74bbfa0148ec788f881", + "digest": "HPavCU471E8BQrDKenuuajjrRxsvPfr17szocdA8sTqw" } }, { - "address": "0x79994b0548d23ce03bd642b598c53f4b8cf20eab38292b2320a9cb6e1502c87a", + "address": "0xc22d782d6b686022721c7a680612c20817b6cad04210f7df35e471dfd78881f8", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x79994b0548d23ce03bd642b598c53f4b8cf20eab38292b2320a9cb6e1502c87a", - "digest": "5dgGjiQitdPuRcsQrCp2TULGGoo8dVFSBcvh5fdbo1y4" + "address": "0xc22d782d6b686022721c7a680612c20817b6cad04210f7df35e471dfd78881f8", + "digest": "CGonGq6ZmRevWZGyfQHiZiitHu3zFaj1NeB8QVZXKCuC" } }, { - "address": "0x874cd6b1950b41facb75642efb93086de732df26f262036684b209971233adf6", + "address": "0xc39644d3d20f6965de0f07b7fd8a02a283f87b04a3401668f3c87c57208c253c", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0x874cd6b1950b41facb75642efb93086de732df26f262036684b209971233adf6", - "digest": "FZR3VA4xcX4GoXDuFZG9baVNAGtGEEXiAgUuZyYeDw2C" + "address": "0xc39644d3d20f6965de0f07b7fd8a02a283f87b04a3401668f3c87c57208c253c", + "digest": "7WAP6vZLa2BKZKUo4VJtePxN7Q5HHza9hvN9CZTPN8mV" } }, { - "address": "0xbb85fe8b6ec147c867b7ab232b89b244ddf1d18e35b6ec47d4258b663059930a", + "address": "0xcc39f8b8e9648f8bf95a9782944f86b4eadb45f965da8fadcc27c99968d905d1", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0xbb85fe8b6ec147c867b7ab232b89b244ddf1d18e35b6ec47d4258b663059930a", - "digest": "GN988s2Y7Sbxiw7cpbQVD5jfHT1swhD7jTCaxsk4Za79" + "address": "0xcc39f8b8e9648f8bf95a9782944f86b4eadb45f965da8fadcc27c99968d905d1", + "digest": "GndbqhHuzKrEnUBmG84cZipkv5pELF22QyN6jLecQYMp" } }, { - "address": "0xc4929aa8e82af543ad1bd995384f8a7ef5d9013e9157eba19386040ba3142c56", + "address": "0xcf955500c82314d83e8abfeb712e306c5acccfc8b77b754b0e9bd8f921b9da43", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0xc4929aa8e82af543ad1bd995384f8a7ef5d9013e9157eba19386040ba3142c56", - "digest": "C72bNNQVye2tACfrgVvdzPFk2FoabBZ7CeKDvq1ZW9dP" + "address": "0xcf955500c82314d83e8abfeb712e306c5acccfc8b77b754b0e9bd8f921b9da43", + "digest": "DjtuAynxT1S1qNbkD8Q3WWQ5qQFa7yQt8LY2b92SrSh2" } }, { - "address": "0xeaaefbe68cb12a738b9900cae483e21a64774a96ae31057197e557f3ea37449f", + "address": "0xe6ad211c1ac09d032251d184db0824f16ad0de8b858bff0e046fde919a88c08b", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0xeaaefbe68cb12a738b9900cae483e21a64774a96ae31057197e557f3ea37449f", - "digest": "FcPs3Nxpp6LhuD6Xi8h8ssnCXYhh61fYsMCbarCPzpDA" + "address": "0xe6ad211c1ac09d032251d184db0824f16ad0de8b858bff0e046fde919a88c08b", + "digest": "ANXdBfsXeJLMBjj7e5KHjFibA682VkZeZiPVF4BqKi2u" } } ] @@ -1453,7 +1452,7 @@ Response: { "sequenceNumber": 0 }, "transactionBlock": { - "digest": "3Q2jsrXKU4XeL54Zha5iaGZ1o8vS8v2w1yNmzctFP8nx" + "digest": "Cpgs1hPAQs2nfbQkD2ZsEfEAvmtTjb7QT5mtXaMQwhgD" } }, "expiration": null @@ -1505,7 +1504,7 @@ Response: { "dependencies": { "nodes": [ { - "digest": "3Q2jsrXKU4XeL54Zha5iaGZ1o8vS8v2w1yNmzctFP8nx" + "digest": "Cpgs1hPAQs2nfbQkD2ZsEfEAvmtTjb7QT5mtXaMQwhgD" } ] }, @@ -1605,7 +1604,7 @@ Response: { "dependencies": { "nodes": [ { - "digest": "3Q2jsrXKU4XeL54Zha5iaGZ1o8vS8v2w1yNmzctFP8nx" + "digest": "Cpgs1hPAQs2nfbQkD2ZsEfEAvmtTjb7QT5mtXaMQwhgD" } ] }, @@ -1629,7 +1628,7 @@ Response: { "idDeleted": false, "outputState": { "address": "0x4509fa198370254af0418248c9718bb206e810e1bce9fc8ffd0c500aef972f4d", - "digest": "EoM3cVCZHPGBwDKUrnBWyPnJcMHsBALsEcCdq85AKEtx" + "digest": "5eggD92os4DP51u7VHtJppCaPUwWZ7TLkWBJ5j5FJ23r" } }, { @@ -1638,7 +1637,7 @@ Response: { "idDeleted": false, "outputState": { "address": "0x5b890eaf2abcfa2ab90b77b8e6f3d5d8609586c3e583baf3dccd5af17edf48d1", - "digest": "HSrKyJrhztCE3pE1H3MwzsrCPLmWbWV6e9J4rnCNdMRP" + "digest": "ARKR7Cs2VVxPWp8x97Wn9PKSpKSv6GktUezxyfpAeGay" } }, { @@ -1648,12 +1647,12 @@ Response: { "outputState": null }, { - "address": "0xfd27bf6efc37fc3de219ef5d16c3094c3dfe5c43394c8b8d4e22ad0e98dda500", + "address": "0x7d8c6c48df3647d66b321d7cd97635b53d8dcc6b1c4253b3f90a0d0875eca7bf", "idCreated": true, "idDeleted": false, "outputState": { - "address": "0xfd27bf6efc37fc3de219ef5d16c3094c3dfe5c43394c8b8d4e22ad0e98dda500", - "digest": "AUqUZbUJ46XKxaFJy8F26vdxepvvPeYBJoMefc9ahKeM" + "address": "0x7d8c6c48df3647d66b321d7cd97635b53d8dcc6b1c4253b3f90a0d0875eca7bf", + "digest": "DAdadQkCUYJUSXVnVzAtcHg91AVYQf3ofKqZMSZrcqNz" } } ] diff --git a/crates/iota-graphql-rpc/tests/e2e_tests.rs b/crates/iota-graphql-rpc/tests/e2e_tests.rs index 21c0dd23507..5e8622e374c 100644 --- a/crates/iota-graphql-rpc/tests/e2e_tests.rs +++ b/crates/iota-graphql-rpc/tests/e2e_tests.rs @@ -13,7 +13,7 @@ mod tests { test_infra::cluster::{DEFAULT_INTERNAL_DATA_SOURCE_PORT, ExecutorCluster}, }; use iota_types::{ - DEEPBOOK_ADDRESS, IOTA_FRAMEWORK_ADDRESS, IOTA_FRAMEWORK_PACKAGE_ID, + IOTA_FRAMEWORK_ADDRESS, IOTA_FRAMEWORK_PACKAGE_ID, STARDUST_ADDRESS, digests::ChainIdentifier, gas_coin::GAS, transaction::{CallArg, ObjectArg, TransactionDataAPI}, @@ -177,7 +177,7 @@ mod tests { let (_, cluster) = prep_executor_cluster().await; let query = r#"{obj1: object(address: $framework_addr) {address} - obj2: object(address: $deepbook_addr) {address}}"#; + obj2: object(address: $stardust_addr) {address}}"#; let variables = vec![ GraphqlQueryVariable { name: "framework_addr".to_string(), @@ -185,9 +185,9 @@ mod tests { value: json!("0x2"), }, GraphqlQueryVariable { - name: "deepbook_addr".to_string(), + name: "stardust_addr".to_string(), ty: "IotaAddress!".to_string(), - value: json!("0xdee9"), + value: json!("0x107a"), }, ]; let res = cluster @@ -215,7 +215,7 @@ mod tests { .unwrap() .as_str() .unwrap(), - DEEPBOOK_ADDRESS.to_canonical_string(true) + STARDUST_ADDRESS.to_canonical_string(true) ); let bad_variables = vec![ @@ -225,14 +225,14 @@ mod tests { value: json!("0x2"), }, GraphqlQueryVariable { - name: "deepbook_addr".to_string(), + name: "stardust_addr".to_string(), ty: "IotaAddress!".to_string(), - value: json!("0xdee9"), + value: json!("0x107a"), }, GraphqlQueryVariable { - name: "deepbook_addr".to_string(), + name: "stardust_addr".to_string(), ty: "IotaAddress!".to_string(), - value: json!("0xdee96666666"), + value: json!("0x0x107aaaaaaaa"), }, ]; let res = cluster @@ -249,14 +249,14 @@ mod tests { value: json!("0x2"), }, GraphqlQueryVariable { - name: "deepbook_addr".to_string(), + name: "stardust_addr".to_string(), ty: "IotaAddress!".to_string(), - value: json!("0xdee9"), + value: json!("0x107a"), }, GraphqlQueryVariable { - name: "deepbook_addr".to_string(), + name: "stardust_addr".to_string(), ty: "IotaAddressP!".to_string(), - value: json!("0xdee9"), + value: json!("0x107a"), }, ]; let res = cluster @@ -273,24 +273,24 @@ mod tests { value: json!("0x2"), }, GraphqlQueryVariable { - name: " deepbook_addr".to_string(), + name: " stardust_addr".to_string(), ty: "IotaAddress!".to_string(), - value: json!("0xdee9"), + value: json!("0x107a"), }, GraphqlQueryVariable { - name: "4deepbook_addr".to_string(), + name: "4stardust_addr".to_string(), ty: "IotaAddressP!".to_string(), - value: json!("0xdee9"), + value: json!("0x107a"), }, GraphqlQueryVariable { name: "".to_string(), ty: "IotaAddress!".to_string(), - value: json!("0xdee9"), + value: json!("0x107a"), }, GraphqlQueryVariable { name: " ".to_string(), ty: "IotaAddress!".to_string(), - value: json!("0xdee9"), + value: json!("0x107a"), }, ]; diff --git a/crates/iota-move-build/src/lib.rs b/crates/iota-move-build/src/lib.rs index 351065632a4..260c2ce2ef8 100644 --- a/crates/iota-move-build/src/lib.rs +++ b/crates/iota-move-build/src/lib.rs @@ -14,8 +14,8 @@ use std::{ use fastcrypto::encoding::Base64; use iota_package_management::{PublishedAtError, resolve_published_id}; use iota_types::{ - BRIDGE_ADDRESS, DEEPBOOK_ADDRESS, IOTA_FRAMEWORK_ADDRESS, IOTA_SYSTEM_ADDRESS, - MOVE_STDLIB_ADDRESS, STARDUST_ADDRESS, + BRIDGE_ADDRESS, IOTA_FRAMEWORK_ADDRESS, IOTA_SYSTEM_ADDRESS, MOVE_STDLIB_ADDRESS, + STARDUST_ADDRESS, base_types::ObjectID, error::{IotaError, IotaResult}, is_system_package, @@ -388,13 +388,7 @@ impl CompiledPackage { .collect() } - /// Get bytecode modules from DeepBook that are used by this package - pub fn get_deepbook_modules(&self) -> impl Iterator { - self.get_modules_and_deps() - .filter(|m| *m.self_id().address() == DEEPBOOK_ADDRESS) - } - - /// Get bytecode modules from DeepBook that are used by this package + /// Get bytecode modules from Bridge that are used by this package pub fn get_bridge_modules(&self) -> impl Iterator { self.get_modules_and_deps() .filter(|m| *m.self_id().address() == BRIDGE_ADDRESS) diff --git a/crates/iota-open-rpc/spec/openrpc.json b/crates/iota-open-rpc/spec/openrpc.json index a62c56c7bca..9acb5367c22 100644 --- a/crates/iota-open-rpc/spec/openrpc.json +++ b/crates/iota-open-rpc/spec/openrpc.json @@ -1297,7 +1297,6 @@ "protocolVersion": "1", "featureFlags": { "accept_zklogin_in_multisig": false, - "advance_to_highest_supported_protocol_version": true, "authority_capabilities_v2": true, "bridge": false, "disable_invariant_violation_check_in_swap_loc": true, diff --git a/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Mainnet_version_1.snap b/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Mainnet_version_1.snap index e55c78befbf..fd070c3f40b 100644 --- a/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Mainnet_version_1.snap +++ b/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Mainnet_version_1.snap @@ -5,7 +5,6 @@ expression: "ProtocolConfig::get_for_version(cur, *chain_id)" version: 1 feature_flags: disable_invariant_violation_check_in_swap_loc: true - advance_to_highest_supported_protocol_version: true no_extraneous_module_bytes: true consensus_transaction_ordering: ByGasPrice hardened_otw_check: true diff --git a/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Testnet_version_1.snap b/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Testnet_version_1.snap index fdd2c8820b0..2475526de01 100644 --- a/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Testnet_version_1.snap +++ b/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__Testnet_version_1.snap @@ -5,7 +5,6 @@ expression: "ProtocolConfig::get_for_version(cur, *chain_id)" version: 1 feature_flags: disable_invariant_violation_check_in_swap_loc: true - advance_to_highest_supported_protocol_version: true no_extraneous_module_bytes: true consensus_transaction_ordering: ByGasPrice hardened_otw_check: true diff --git a/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__version_1.snap b/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__version_1.snap index df5518adc80..d549bed5dc2 100644 --- a/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__version_1.snap +++ b/crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__version_1.snap @@ -5,7 +5,6 @@ expression: "ProtocolConfig::get_for_version(cur, *chain_id)" version: 1 feature_flags: disable_invariant_violation_check_in_swap_loc: true - advance_to_highest_supported_protocol_version: true no_extraneous_module_bytes: true consensus_transaction_ordering: ByGasPrice hardened_otw_check: true diff --git a/crates/iota-source-validation-service/README.md b/crates/iota-source-validation-service/README.md index 8c220103950..f9ff95e04d0 100644 --- a/crates/iota-source-validation-service/README.md +++ b/crates/iota-source-validation-service/README.md @@ -8,8 +8,7 @@ The default configuration limits scope to Iota framework packages in `crates/iot - `move-stdlib` — [address `0x1`](https://explorer.iota.org/object/0x1) - `iota-framework` — [address `0x2`](https://explorer.iota.org/object/0x2) -- `iota-system` — [address `0x3`](https://explorer.iota.org/object/0x2) -- `deepbook` — [address `0xdee9`](https://explorer.iota.org/object/0xdee9) +- `iota-system` — [address `0x3`](https://explorer.iota.org/object/0x3) See examples below for requesting source from the server. @@ -33,7 +32,6 @@ repository = "https://github.com/iotaledger/iota" branch = "framework/mainnet" network = "mainnet" packages = [ - { path = "crates/iota-framework/packages/deepbook", watch = "0xdee9" }, { path = "crates/iota-framework/packages/move-stdlib", watch = "0x1" }, { path = "crates/iota-framework/packages/iota-framework", watch = "0x2" }, { path = "crates/iota-framework/packages/iota-system", watch = "0x3" }, @@ -81,10 +79,10 @@ On occasion `https://source.iota.org` may return a `502` response or experience The source service may experience transient downtime for at least the following reasons: -- RPC event subscription disconnection or instability. The IOTA source service actively monitors on-chain upgrade events to ensure it always reports accurate verified source. If RPC subscription is lost, the service will attempt to regain the connection. During the time of disconnection the service will not respond with verified source in order to preserve integrity. This behavior is especially important for Iota framework packages that are upgraded _in-place_ (e.g., `0x1`, `0x2`, `0x3`, and `0xdee9`) to ensure integrity. This is usually a transient issue. +- RPC event subscription disconnection or instability. The IOTA source service actively monitors on-chain upgrade events to ensure it always reports accurate verified source. If RPC subscription is lost, the service will attempt to regain the connection. During the time of disconnection the service will not respond with verified source in order to preserve integrity. This behavior is especially important for Iota framework packages that are upgraded _in-place_ (e.g., `0x1`, `0x2`, and `0x3`) to ensure integrity. This is usually a transient issue. - The on-chain package content has changed (e.g., due to a protocol upgrade) and the source repository does not yet reflect the new on-chain bytecode. - - This can happen when the branch containing we track for the source-to-be-verified as diverged from on-chain bytecode, or does not yet correspond to the new on-chain bytecode. This is especially the case for Iota framework packages that are upgraded _in-place_ at protocol upgrades (e.g., `0x1`, `0x2`, `0x3`, and `0xdee9`). + - This can happen when the branch containing we track for the source-to-be-verified as diverged from on-chain bytecode, or does not yet correspond to the new on-chain bytecode. This is especially the case for Iota framework packages that are upgraded _in-place_ at protocol upgrades (e.g., `0x1`, `0x2`, and `0x3`). - While usually transient, there may be extended periods of mismatched source and bytecode due to Iota's release process. - A new version of Move compiler is released, requiring service redeployment. diff --git a/crates/iota-source-validation-service/config.toml b/crates/iota-source-validation-service/config.toml index b919a2848b4..1815a8e68aa 100644 --- a/crates/iota-source-validation-service/config.toml +++ b/crates/iota-source-validation-service/config.toml @@ -6,7 +6,6 @@ network = "mainnet" [[packages.values.branches]] branch = "framework/mainnet" paths = [ - { path = "crates/iota-framework/packages/deepbook", watch = "0xdee9" }, { path = "crates/iota-framework/packages/move-stdlib", watch = "0x1" }, { path = "crates/iota-framework/packages/iota-framework", watch = "0x2" }, { path = "crates/iota-framework/packages/iota-system", watch = "0x3" }, @@ -20,7 +19,6 @@ network = "testnet" [[packages.values.branches]] branch = "framework/testnet" paths = [ - { path = "crates/iota-framework/packages/deepbook", watch = "0xdee9" }, { path = "crates/iota-framework/packages/move-stdlib", watch = "0x1" }, { path = "crates/iota-framework/packages/iota-framework", watch = "0x2" }, { path = "crates/iota-framework/packages/iota-system", watch = "0x3" }, @@ -34,7 +32,6 @@ network = "devnet" [[packages.values.branches]] branch = "framework/devnet" paths = [ - { path = "crates/iota-framework/packages/deepbook", watch = "0xdee9" }, { path = "crates/iota-framework/packages/move-stdlib", watch = "0x1" }, { path = "crates/iota-framework/packages/iota-framework", watch = "0x2" }, { path = "crates/iota-framework/packages/iota-system", watch = "0x3" }, diff --git a/crates/iota-source-validation-service/tests/tests.rs b/crates/iota-source-validation-service/tests/tests.rs index 849e32cbce0..75c934b2e41 100644 --- a/crates/iota-source-validation-service/tests/tests.rs +++ b/crates/iota-source-validation-service/tests/tests.rs @@ -396,7 +396,6 @@ network = "mainnet" [[packages.values.branches]] branch = "framework/mainnet" paths = [ - { path = "crates/iota-framework/packages/deepbook", watch = "0xdee9" }, { path = "crates/iota-framework/packages/move-stdlib", watch = "0x1" }, { path = "crates/iota-framework/packages/iota-framework", watch = "0x2" }, { path = "crates/iota-framework/packages/iota-system", watch = "0x3" } @@ -425,12 +424,6 @@ paths = [ Branch { branch: "framework/mainnet", paths: [ - Package { - path: "crates/iota-framework/packages/deepbook", - watch: Some( - 0x000000000000000000000000000000000000000000000000000000000000dee9, - ), - }, Package { path: "crates/iota-framework/packages/move-stdlib", watch: Some( diff --git a/crates/iota-swarm-config/tests/snapshots/snapshot_tests__populated_genesis_snapshot_matches-2.snap b/crates/iota-swarm-config/tests/snapshots/snapshot_tests__populated_genesis_snapshot_matches-2.snap index ae0cb8c12c2..1ac8f70c784 100644 --- a/crates/iota-swarm-config/tests/snapshots/snapshot_tests__populated_genesis_snapshot_matches-2.snap +++ b/crates/iota-swarm-config/tests/snapshots/snapshot_tests__populated_genesis_snapshot_matches-2.snap @@ -8,7 +8,7 @@ system_state_version: 1 iota_treasury_cap: inner: id: - id: "0xbcc56dc228d08d0d9324efb875272bdc9d3cd65c80c81b229549352212b1603a" + id: "0x9b65e25002180c54de255bdb2f31e22d63508231102ffb2fd27faa0f536de87f" total_supply: value: "751500000000000000" validators: @@ -244,13 +244,13 @@ validators: next_epoch_primary_address: ~ extra_fields: id: - id: "0x6e1a6eab42d57998689e98043933df58e0cc685a595e02eb98c31e8747e2075f" + id: "0xc6b6aca0ab617bca21813a8518f3805aeabfe4d7635dd57a9f0ebb888ae3139c" size: 0 voting_power: 10000 - operation_cap_id: "0xa8a7a177bc4241ba371708657809a230f36b5438bb47de2c194340bbf9be5a4c" + operation_cap_id: "0x548f60504903d7aaabdfd1a16410e3a3a3ae1953f8548c646219baa089b669f2" gas_price: 1000 staking_pool: - id: "0xd6303962a98fb58ec8161738bfe41b57b75ff1cd98eea0f5bf20f7950bfa89bc" + id: "0x0521da3e38d78028af7ec630cbe948c1acaae39c6a35f67860f64420a4e0874e" activation_epoch: 0 deactivation_epoch: ~ iota_balance: 1500000000000000 @@ -258,14 +258,14 @@ validators: value: 0 pool_token_balance: 1500000000000000 exchange_rates: - id: "0x92be067395b6a056a83502dd1dc7f11ea5d5a895af950bb9a601ab2f04564307" + id: "0x772209f04fbf04034627dd991e8e99e61cf0c91afbb400f7812f784bfb67334a" size: 1 pending_stake: 0 pending_total_iota_withdraw: 0 pending_pool_token_withdraw: 0 extra_fields: id: - id: "0x4cb9e52c1bde4fb125bc645a7e10f84a933f9a5a2bb033150818c3a3c0a715f4" + id: "0x76c3c9a30c02e26059dac95e558b0ca7bbe705c92da04625f832aaba7328e372" size: 0 commission_rate: 200 next_epoch_stake: 1500000000000000 @@ -273,27 +273,27 @@ validators: next_epoch_commission_rate: 200 extra_fields: id: - id: "0xb71bf2d65890434770555a17b390f685fe1a3156788c87ed9103dda374a56d23" + id: "0x5a1a6ab293e72e1181c1bd07cf2b54499396de703a97b80fdb7498c975437a28" size: 0 pending_active_validators: contents: - id: "0x863b489d464eeba819e5e7b89105699a996e2012951cf81cc407b97f33667f0f" + id: "0x39d738794b40d46afa04360d00f3c8104d7eb0b03efb286b003ad9be3b7d2771" size: 0 pending_removals: [] staking_pool_mappings: - id: "0xa2c1ea03cd0de682cb3becef4243df26fdfb71d76947e21a10d82121b75dad6a" + id: "0xd5fe9bfde8d78dc9eb379f3728b4a9666a21395d4584e33a5a44bafbaa45e742" size: 1 inactive_validators: - id: "0x4319c9e20eb938ab6bacc279a4d0f846d306df456557ea5a62abf366aeee47bb" + id: "0x9ed702f0e91e000c7c30540c8d57aee84b0456044c252e3c5219974a93e77ea3" size: 0 validator_candidates: - id: "0xc0ef087d4b78a311a59f919930baecdd9ce6ae9f143f20c70d86d2f6a3cb24f4" + id: "0xa0cb26c1edea2745ac6f2eca051fed26f90eddb4d9c540439a6fd50f01ffd580" size: 0 at_risk_validators: contents: [] extra_fields: id: - id: "0xbcedd10b11e3cb1337e0a1e0cd51e0932756ccbd28b2452721031587be408298" + id: "0x094fe2d3f1496b5b653ab2ae99f8c5fc6c8733b00bec5a95e831c54b0d156c9a" size: 0 storage_fund: total_object_storage_rebates: @@ -309,7 +309,7 @@ parameters: validator_low_stake_grace_period: 7 extra_fields: id: - id: "0x58471edf0cdb26470191f3e31730ed38bf6c691a29d281f6ee936d2d4bdfb179" + id: "0xb91c535b339544d3286d75d212d039bd29355a22f168a7b0354fca7f7657a400" size: 0 reference_gas_price: 1000 validator_report_records: @@ -324,5 +324,5 @@ safe_mode_non_refundable_storage_fee: 0 epoch_start_timestamp_ms: 10 extra_fields: id: - id: "0xd836d6b9f016d4aafda8fa979b639a76bdeca422b665981c7894ab49f0e42a8f" + id: "0xce536abd7e6b6f1a3b551b756f1504d991166fdfd57bb04ebbe400c1ede47848" size: 0 diff --git a/crates/iota-transactional-test-runner/src/test_adapter.rs b/crates/iota-transactional-test-runner/src/test_adapter.rs index 7fa810bd46d..2e70b822ee8 100644 --- a/crates/iota-transactional-test-runner/src/test_adapter.rs +++ b/crates/iota-transactional-test-runner/src/test_adapter.rs @@ -37,11 +37,10 @@ use iota_storage::{ }; use iota_swarm_config::genesis_config::AccountConfig; use iota_types::{ - BRIDGE_ADDRESS, DEEPBOOK_ADDRESS, DEEPBOOK_PACKAGE_ID, IOTA_CLOCK_OBJECT_ID, - IOTA_DENY_LIST_OBJECT_ID, IOTA_FRAMEWORK_ADDRESS, IOTA_FRAMEWORK_PACKAGE_ID, - IOTA_RANDOMNESS_STATE_OBJECT_ID, IOTA_SYSTEM_ADDRESS, IOTA_SYSTEM_PACKAGE_ID, - IOTA_SYSTEM_STATE_OBJECT_ID, MOVE_STDLIB_ADDRESS, MOVE_STDLIB_PACKAGE_ID, STARDUST_ADDRESS, - STARDUST_PACKAGE_ID, + BRIDGE_ADDRESS, IOTA_CLOCK_OBJECT_ID, IOTA_DENY_LIST_OBJECT_ID, IOTA_FRAMEWORK_ADDRESS, + IOTA_FRAMEWORK_PACKAGE_ID, IOTA_RANDOMNESS_STATE_OBJECT_ID, IOTA_SYSTEM_ADDRESS, + IOTA_SYSTEM_PACKAGE_ID, IOTA_SYSTEM_STATE_OBJECT_ID, MOVE_STDLIB_ADDRESS, + MOVE_STDLIB_PACKAGE_ID, STARDUST_ADDRESS, STARDUST_PACKAGE_ID, base_types::{ IOTA_ADDRESS_LENGTH, IotaAddress, ObjectID, ObjectRef, SequenceNumber, VersionNumber, }, @@ -109,7 +108,6 @@ const DEFAULT_GAS_PRICE: u64 = 1_000; const WELL_KNOWN_OBJECTS: &[ObjectID] = &[ MOVE_STDLIB_PACKAGE_ID, - DEEPBOOK_PACKAGE_ID, IOTA_FRAMEWORK_PACKAGE_ID, IOTA_SYSTEM_PACKAGE_ID, STARDUST_PACKAGE_ID, @@ -1898,13 +1896,6 @@ static NAMED_ADDRESSES: Lazy> = Lazy::new(|| move_compiler::shared::NumberFormat::Hex, ), ); - map.insert( - "deepbook".to_string(), - NumericalAddress::new( - DEEPBOOK_ADDRESS.into_bytes(), - move_compiler::shared::NumberFormat::Hex, - ), - ); map.insert( "stardust".to_string(), NumericalAddress::new( @@ -1942,11 +1933,6 @@ pub static PRE_COMPILED: Lazy = Lazy::new(|| { buf.extend(["packages", "move-stdlib", "sources"]); buf.to_string_lossy().to_string() }; - let deepbook_sources = { - let mut buf = iota_files.to_path_buf(); - buf.extend(["packages", "deepbook", "sources"]); - buf.to_string_lossy().to_string() - }; let config = PackageConfig { edition: Edition::E2024_BETA, flavor: Flavor::Iota, @@ -1960,13 +1946,7 @@ pub static PRE_COMPILED: Lazy = Lazy::new(|| { let fully_compiled_res = move_compiler::construct_pre_compiled_lib( vec![PackagePaths { name: Some(("iota-framework".into(), config)), - paths: vec![ - iota_system_sources, - iota_sources, - iota_deps, - deepbook_sources, - bridge_sources, - ], + paths: vec![iota_system_sources, iota_sources, iota_deps, bridge_sources], named_address_map: NAMED_ADDRESSES.clone(), }], None, diff --git a/crates/iota-types/src/iota_serde.rs b/crates/iota-types/src/iota_serde.rs index a606876cb17..0bf79037ce1 100644 --- a/crates/iota-types/src/iota_serde.rs +++ b/crates/iota-types/src/iota_serde.rs @@ -25,8 +25,8 @@ use serde::{ use serde_with::{Bytes, DeserializeAs, DisplayFromStr, SerializeAs, serde_as}; use crate::{ - DEEPBOOK_ADDRESS, IOTA_CLOCK_ADDRESS, IOTA_FRAMEWORK_ADDRESS, IOTA_SYSTEM_ADDRESS, - IOTA_SYSTEM_STATE_ADDRESS, STARDUST_ADDRESS, parse_iota_struct_tag, parse_iota_type_tag, + IOTA_CLOCK_ADDRESS, IOTA_FRAMEWORK_ADDRESS, IOTA_SYSTEM_ADDRESS, IOTA_SYSTEM_STATE_ADDRESS, + STARDUST_ADDRESS, parse_iota_struct_tag, parse_iota_type_tag, }; #[inline] @@ -168,13 +168,12 @@ impl SerializeAs for IotaStructTag { } } -const IOTA_ADDRESSES: [AccountAddress; 8] = [ +const IOTA_ADDRESSES: [AccountAddress; 7] = [ AccountAddress::ZERO, AccountAddress::ONE, IOTA_FRAMEWORK_ADDRESS, IOTA_SYSTEM_ADDRESS, STARDUST_ADDRESS, - DEEPBOOK_ADDRESS, IOTA_SYSTEM_STATE_ADDRESS, IOTA_CLOCK_ADDRESS, ]; diff --git a/crates/iota-types/src/lib.rs b/crates/iota-types/src/lib.rs index e905d35472a..985c0f23a4f 100644 --- a/crates/iota-types/src/lib.rs +++ b/crates/iota-types/src/lib.rs @@ -122,7 +122,6 @@ built_in_pkgs! { IOTA_FRAMEWORK_ADDRESS / IOTA_FRAMEWORK_PACKAGE_ID = 0x2; IOTA_SYSTEM_ADDRESS / IOTA_SYSTEM_PACKAGE_ID = 0x3; BRIDGE_ADDRESS / BRIDGE_PACKAGE_ID = 0xb; - DEEPBOOK_ADDRESS / DEEPBOOK_PACKAGE_ID = 0xdee9; STARDUST_ADDRESS / STARDUST_PACKAGE_ID = 0x107a; } @@ -156,7 +155,7 @@ pub fn iota_framework_address_concat_string(suffix: &str) -> String { /// - A 256bit number, encoded in decimal, or hexadecimal with a leading "0x" /// prefix. /// - One of a number of pre-defined named addresses: std, iota, iota_system, -/// deepbook. +/// stardust. /// /// Parsing succeeds if and only if `s` matches one of these formats exactly, /// with no remaining suffix. This function is intended for use within the @@ -209,7 +208,6 @@ pub fn parse_iota_type_tag(s: &str) -> anyhow::Result { /// Resolve well-known named addresses into numeric addresses. pub fn resolve_address(addr: &str) -> Option { match addr { - "deepbook" => Some(DEEPBOOK_ADDRESS), "std" => Some(MOVE_STDLIB_ADDRESS), "iota" => Some(IOTA_FRAMEWORK_ADDRESS), "iota_system" => Some(IOTA_SYSTEM_ADDRESS), @@ -474,17 +472,16 @@ mod tests { #[test] fn test_dynamic_field_short_addr() { let result = parse_iota_struct_tag( - "0x2::dynamic_field::Field>", + "0x2::dynamic_field::Field>", ) .expect("should not error"); - let expected = expect![ - "0x2::dynamic_field::Field>" - ]; + let expected = + expect!["0x2::dynamic_field::Field>"]; expected.assert_eq(&result.to_string()); let expected = expect![ - "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field>" + "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field>" ]; expected.assert_eq(&result.to_canonical_string(/* with_prefix */ true)); } @@ -492,17 +489,16 @@ mod tests { #[test] fn test_dynamic_field_long_addr() { let result = parse_iota_struct_tag( - "0x2::dynamic_field::Field>", + "0x2::dynamic_field::Field>", ) .expect("should not error"); - let expected = expect![ - "0x2::dynamic_field::Field>" - ]; + let expected = + expect!["0x2::dynamic_field::Field>"]; expected.assert_eq(&result.to_string()); let expected = expect![ - "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field>" + "0x0000000000000000000000000000000000000000000000000000000000000002::dynamic_field::Field>" ]; expected.assert_eq(&result.to_canonical_string(/* with_prefix */ true)); } diff --git a/docs/content/developer/advanced/iota-repository.mdx b/docs/content/developer/advanced/iota-repository.mdx index d35727be8cc..4837ac4190a 100644 --- a/docs/content/developer/advanced/iota-repository.mdx +++ b/docs/content/developer/advanced/iota-repository.mdx @@ -60,7 +60,7 @@ The following primary directories offer a good starting point for exploring the transactions, execution integration). - [iota-framework](https://github.com/iotaledger/iota/tree/develop/crates/iota-framework) - Move system packages (0x1, 0x2, - 0x3, 0xdee9). + 0x3). - [iota-network](https://github.com/iotaledger/iota/tree/develop/crates/iota-network) - Networking interfaces. - [iota-node](https://github.com/iotaledger/iota/tree/develop/crates/iota-node) - Validator and Full node software. - [iota-protocol-config](https://github.com/iotaledger/iota/tree/develop/crates/iota-protocol-config) - On-chain system diff --git a/docs/content/developer/iota-101/using-events.mdx b/docs/content/developer/iota-101/using-events.mdx index 7bdeb9e5737..fdedcd9b607 100644 --- a/docs/content/developer/iota-101/using-events.mdx +++ b/docs/content/developer/iota-101/using-events.mdx @@ -68,55 +68,23 @@ let unsubscribe = await provider.subscribeEvent({ }); ``` -Move smart contracts can call other smart contracts that emit events. For example, `Deepbook_utils` can call the `dee9` smart contract and emit this event. Note that using package, transaction module to query for `dee9/clob_v2` misses the following event even though it is actually an event the `dee9` package emits. The current workaround for this issue is to know all the `packageId`s you care about and search those in the `queryEvent` call. +Move smart contracts can call other smart contracts that emit events. For example, `0x107a::nft` calls the `0x2::display::new_with_fields` smart contract and emits a `0x2::display::DisplayCreated` event. Note that using package and transaction module to query for `0x2::display` misses the following event even though it is actually an event the `0x2` package emits. The current workaround for this issue is to know all the `packageId`s you care about and search those in the `queryEvent` call. ```json { - "id": { - "txDigest": "bZnc1E7k1fJYLxWihfre5xCw1tX1CyAN6579zypJeiU", - "eventSeq": "0" - }, - "packageId": "0x158f2027f60c89bb91526d9bf08831d27f5a0fcb0f74e6698b9f0e1fb2be5d05", - "transactionModule": "deepbook_utils", - "sender": "0x4419ae182ac112bb065bda2146136ed02524ee2611478bfe8ca5d3835bee4af6", - "type": "0xdee9::clob_v2::OrderPlaced<0x2::iota::IOTA, 0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN>", - "parsedJson": { - "base_asset_quantity_placed": "1000000000", - "client_order_id": "20082022", - "expire_timestamp": "1697121171540", - "is_bid": false, - "order_id": "9223372036854945121", - "original_quantity": "1000000000", - "owner": "0x8c23e5e23c6eb654d69f8ae7de3be23584f435cad81fa4b9cb024b6c989b7818", - "pool_id": "0x7f526b1263c4b91b43c9e646419b5696f424de28dda3c1e6658cc0a54558baa7", - "price": "500000" - }, - "bcs": "2pWctGGQ9KULfmnzNtGuPpggLQrj1ZiUQaxva4neM6QWAtUAkuPAzU2eGrdZaGHti3bsUefDioUwwYoVR3bYBkG7Gxf5JVVSxxqTqzxdg5os5ESwFaP69ZcrNsya4G9rHK4KBac9i3m1MseN38xDwMvAMx3" -} -``` - -```json -{ - "id": { - "txDigest": "896CKHod5GQ4kzhF7EwTAGyhQBdaTb9rQS41dcL76gj8", - "eventSeq": "0" - }, - "packageId": "0x000000000000000000000000000000000000000000000000000000000000dee9", - "transactionModule": "clob_v2", - "sender": "0xf821d3483fc7725ebafaa5a3d12373d49901bdfce1484f219daa7066a30df77d", - "type": "0xdee9::clob_v2::OrderPlaced<0xbc3a676894871284b3ccfb2eec66f428612000e2a6e6d23f592ce8833c27c973::coin::COIN, 0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN>", - "parsedJson": { - "base_asset_quantity_placed": "5000000", - "client_order_id": "1696545636947311087", - "expire_timestamp": "1696549236947", - "is_bid": true, - "order_id": "562414", - "original_quantity": "5000000", - "owner": "0xf995d6df20e18421928ff0648bd583ccdf384ab05791d8be21d32977a37dacfc", - "pool_id": "0xf0f663cf87f1eb124da2fc9be813e0ce262146f3df60bc2052d738eb41a25899", - "price": "274518000000" - }, - "bcs": "4SgemkCzrqEsTHLFgMcbUtttZCf2CrEH2njjFL1rizCHzvAoYsToGrbFLffQPtGxsSt96Xr4j2SLNeLcBGKeYXDrVYWqivhf3551Mqj71DZBxq5D1Qwfgh1TKeF43Jz4b4XH1nEpkya2Pr8515vzJbHUkpP" + "id": { + "txDigest": "DrZmtQDDCUKooLzFCi29VhUB4w6AT8phCsT9d62BAf8g", + "eventSeq": "0" + }, + "packageId": "0x000000000000000000000000000000000000000000000000000000000000107a", + "transactionModule": "nft", + "sender": "0x0000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2::display::DisplayCreated<0x107a::nft::Nft>", + "parsedJson": { + "id": "0xa12d72c159d57d4c7f540b2b9e985327628d856b20c1d6cdfd3028a2a605abfe" + }, + "bcs": "CFbAeqXAwwkyTxUD36FtzTGEcMGrVj4zgcTR1G7AaRjb", + "timestampMs": "1521456213521" } ```