File tree Expand file tree Collapse file tree
main/java/com/strategyobject/substrateclient/rpc/api
test/java/com/strategyobject/substrateclient/rpc/api/section Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package com .strategyobject .substrateclient .rpc .api .primitives ;
2+
3+ import com .strategyobject .substrateclient .scale .annotation .ScaleReader ;
4+
5+ @ ScaleReader
6+ public enum EntityIdentifierKind {
7+ INTENT ,
8+ INTENT_GROUP
9+ }
Original file line number Diff line number Diff line change 1+ package com .strategyobject .substrateclient .rpc .api .primitives ;
2+
3+ import com .strategyobject .substrateclient .scale .ScaleType ;
4+ import com .strategyobject .substrateclient .scale .annotation .Scale ;
5+ import com .strategyobject .substrateclient .scale .annotation .ScaleReader ;
6+
7+ @ ScaleReader
8+ public class MappedEntityIdentifier {
9+ private EntityIdentifierKind kind ;
10+ @ Scale (ScaleType .U16 .class )
11+ private Integer id ;
12+
13+ public MappedEntityIdentifier () {}
14+
15+ public MappedEntityIdentifier (EntityIdentifierKind kind , Integer id ) {
16+ this .kind = kind ;
17+ this .id = id ;
18+ }
19+
20+ public EntityIdentifierKind getKind () {
21+ return kind ;
22+ }
23+
24+ public void setKind (EntityIdentifierKind kind ) {
25+ this .kind = kind ;
26+ }
27+
28+ public Integer getId () {
29+ return id ;
30+ }
31+
32+ public void setId (Integer id ) {
33+ this .id = id ;
34+ }
35+ }
Original file line number Diff line number Diff line change 1+ package com .strategyobject .substrateclient .rpc .api .primitives ;
2+
3+ import com .strategyobject .substrateclient .scale .annotation .ScaleReader ;
4+
5+ @ ScaleReader
6+ public class NameLookupResponse {
7+ private String name ; // Vec<u8> in rust
8+ private MappedEntityIdentifier entityId ;
9+
10+ public NameLookupResponse () {}
11+
12+ public NameLookupResponse (String name , MappedEntityIdentifier entityId ) {
13+ this .name = name ;
14+ this .entityId = entityId ;
15+ }
16+
17+ public String getName () {
18+ return name ;
19+ }
20+
21+ public void setName (String name ) {
22+ this .name = name ;
23+ }
24+
25+ public MappedEntityIdentifier getEntityId () {
26+ return entityId ;
27+ }
28+
29+ public void setEntityId (MappedEntityIdentifier entityId ) {
30+ this .entityId = entityId ;
31+ }
32+ }
Original file line number Diff line number Diff line change 77import com .strategyobject .substrateclient .rpc .api .primitives .BlockHash ;
88import com .strategyobject .substrateclient .rpc .api .primitives .Hash ;
99import com .strategyobject .substrateclient .rpc .api .primitives .IndexU32 ;
10+ import com .strategyobject .substrateclient .rpc .api .primitives .NameLookupResponse ;
1011import com .strategyobject .substrateclient .rpc .api .storage .StorageChangeSet ;
1112import com .strategyobject .substrateclient .rpc .api .storage .StorageData ;
1213import com .strategyobject .substrateclient .rpc .api .storage .StorageKey ;
@@ -231,5 +232,5 @@ CompletableFuture<Supplier<CompletableFuture<Boolean>>> subscribeStorage(List<St
231232
232233 @ RpcCall ("call" )
233234 @ Scale
234- CompletableFuture <Byte [] > getRegisteredEntitiesByName (String method , @ Scale String name );
235+ CompletableFuture <NameLookupResponse > getRegisteredEntitiesByName (String method , @ Scale String name );
235236}
Original file line number Diff line number Diff line change 88import com .strategyobject .substrateclient .rpc .api .primitives .BlockNumber ;
99import com .strategyobject .substrateclient .rpc .api .primitives .Index ;
1010import com .strategyobject .substrateclient .rpc .api .primitives .IndexU32 ;
11+ import com .strategyobject .substrateclient .rpc .api .primitives .NameLookupResponse ;
1112import com .strategyobject .substrateclient .rpc .api .storage .StorageKey ;
1213import com .strategyobject .substrateclient .tests .containers .FrequencyVersion ;
1314import com .strategyobject .substrateclient .tests .containers .TestSubstrateContainer ;
2223import org .testcontainers .junit .jupiter .Container ;
2324import org .testcontainers .junit .jupiter .Testcontainers ;
2425
26+ import java .lang .System ;
2527import java .math .BigInteger ;
2628import java .util .Collections ;
2729import java .util .concurrent .CompletableFuture ;
@@ -211,8 +213,8 @@ public void getRegisteredEntitiesByName() throws Exception {
211213 val method = "SchemasRuntimeApi_get_registered_entities_by_name" ;
212214 val intentName = "frequency.default-token-address" ;
213215
214- CompletableFuture < Byte []> deferredResult = state .getRegisteredEntitiesByName (method , intentName );
215- deferredResult .get ( );
216+ val deferredResult = state .getRegisteredEntitiesByName (method , intentName ). get ( );
217+ System . out . println ( deferredResult .toString () );
216218 }
217219 }
218220
You can’t perform that action at this time.
0 commit comments