Skip to content

Commit

Permalink
Introduce test ensuring indexer handles indexing into shared addresse…
Browse files Browse the repository at this point in the history
…s properly when group resource sharing occurs. (#1591)
  • Loading branch information
gmalouf authored Jan 5, 2024
1 parent 3e9446a commit 4bd144f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions api/handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,17 @@ func TestFetchTransactions(t *testing.T) {
loadTransactionFromFile("test_resources/app_call_inner_acfg.response"),
},
},
{
name: "Conditionally index into shared addresses when sharing resources across a group",
txnBytes: [][]byte{
loadResourceFileOrPanic("test_resources/resource_sharing_1.txn"),
loadResourceFileOrPanic("test_resources/resource_sharing_2.txn"),
},
response: []generated.Transaction{
loadTransactionFromFile("test_resources/resource_sharing_1.response"),
loadTransactionFromFile("test_resources/resource_sharing_2.response"),
},
},
{
name: "State Proof Txn",
txnBytes: [][]byte{
Expand Down
1 change: 1 addition & 0 deletions api/test_resources/resource_sharing_1.response
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"application-transaction":{"accounts":["EDEQH62ERDNLASADCOKJLXUMYCP2S2CPKXFHB72OQKR6IXOQFAYFSHK53M"],"application-args":["IMkD+0SI2rBIAxOUld6MwJ+paE9VynD/ToKj5F3QKDA="],"application-id":1001,"foreign-apps":[],"foreign-assets":[],"global-state-schema":{"num-byte-slice":0,"num-uint":0},"local-state-schema":{"num-byte-slice":0,"num-uint":0},"on-completion":"noop"},"close-rewards":0,"closing-amount":0,"confirmed-round":1,"fee":1000,"first-valid":1351,"group":"JTcCx8AgKTI2VSTUnW7nDbimwramhGQrFEdMr+pWDWY=","id":"CDMG3FIQ6BN7B5POTZC5BKIA3MG2PJKLLBAPV7TG6V6ZICVSBK4A","intra-round-offset":2,"last-valid":2351,"local-state-delta":[{"address":"EDEQH62ERDNLASADCOKJLXUMYCP2S2CPKXFHB72OQKR6IXOQFAYFSHK53M","delta":[{"key":"a2V5","value":{"action":1,"bytes":"SIVReg6hjevVNotXmOooUYxm55kMwYeBgiWI/f0lhbA=","uint":0}}]}],"receiver-rewards":0,"round-time":1704475560,"sender":"OBQEUTTE5HSAXNYDZ2XWPZHBPZKCIVSUGTDVBJ2O7SA2TUD2BPMCJMZ2TQ","sender-rewards":0,"signature":{"sig":"SaR0dSN0FKoUGq2gGD9DQeBdNeAex7Ywa6E96EsrFj0/9v10POQ0FSjV13sNfp1+2eHR4yZxXqTW2rgc4ePUBw=="},"tx-type":"appl"}
1 change: 1 addition & 0 deletions api/test_resources/resource_sharing_1.txn
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��dt��ld���key��at�bs� H�Qz����6�W��(Q�f� ����%���%���sig�@I�tu#t���?CA�]5�Ƕ0k�=�K+=?��t<�4(��{~�~����&q^��ڸ����txn��apaa�� ��D�ڰH��ތ���hOU�p�N���]�(0�apat�� ��D�ڰH��ތ���hOU�p�N���]�(0�apid��fee��fv�G�grp� %7�� )26U$ԝn���¶��d+GL��Vf�lv� /�snd� p`JNd�� �ίg��~T$VT4�P�N����z ؤtype�appl
Expand Down
1 change: 1 addition & 0 deletions api/test_resources/resource_sharing_2.response
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"application-transaction":{"accounts":[],"application-args":["IMkD+0SI2rBIAxOUld6MwJ+paE9VynD/ToKj5F3QKDA="],"application-id":1001,"foreign-apps":[],"foreign-assets":[],"global-state-schema":{"num-byte-slice":0,"num-uint":0},"local-state-schema":{"num-byte-slice":0,"num-uint":0},"on-completion":"noop"},"close-rewards":0,"closing-amount":0,"confirmed-round":1,"fee":1000,"first-valid":1351,"group":"JTcCx8AgKTI2VSTUnW7nDbimwramhGQrFEdMr+pWDWY=","id":"IJAXJSCF5QBIKSCAV5QFSTPJRY32LHYV24WL4372EJZYSHEXQFFA","intra-round-offset":2,"last-valid":2351,"local-state-delta":[{"address":"EDEQH62ERDNLASADCOKJLXUMYCP2S2CPKXFHB72OQKR6IXOQFAYFSHK53M","delta":[{"key":"a2V5","value":{"action":1,"bytes":"MOR8jSb/U6XxPy6v2NbXqqBnRg2Eu/A/G2RdJ2kAwGU=","uint":0}}]}],"receiver-rewards":0,"round-time":1704475560,"sender":"OBQEUTTE5HSAXNYDZ2XWPZHBPZKCIVSUGTDVBJ2O7SA2TUD2BPMCJMZ2TQ","sender-rewards":0,"signature":{"sig":"xFP3/rHrizQo7Luo/TJgc9yXgs5Sy+2WwmffUUakRl6+r4S68USBRNh9CeySpGW87y4LAzhcF/YeRO6SJmIWAw=="},"tx-type":"appl"}
Binary file added api/test_resources/resource_sharing_2.txn
Binary file not shown.

0 comments on commit 4bd144f

Please sign in to comment.