22
33import com .casper .sdk .identifier .block .HashBlockIdentifier ;
44import com .casper .sdk .identifier .block .HeightBlockIdentifier ;
5- import com .casper .sdk .identifier .dictionary .StringDictionaryIdentifier ;
65import com .casper .sdk .identifier .entity .EntityAddrIdentifier ;
76import com .casper .sdk .identifier .era .IdEraIdentifier ;
87import com .casper .sdk .identifier .global .StateRootHashIdentifier ;
1716import com .casper .sdk .model .common .Ttl ;
1817import com .casper .sdk .model .deploy .Delegator ;
1918import com .casper .sdk .model .deploy .NamedArg ;
20- import com .casper .sdk .model .dictionary .DictionaryData ;
2119import com .casper .sdk .model .entity .AddressableEntity ;
2220import com .casper .sdk .model .entity .StateEntityResult ;
2321import com .casper .sdk .model .era .EraInfoData ;
3028import com .casper .sdk .model .transaction .*;
3129import com .casper .sdk .model .transaction .entrypoint .CallEntryPoint ;
3230import com .casper .sdk .model .transaction .entrypoint .TransferEntryPoint ;
31+ import com .casper .sdk .model .transaction .execution .ExecutionResultV2 ;
3332import com .casper .sdk .model .transaction .pricing .FixedPricingMode ;
3433import com .casper .sdk .model .transaction .scheduling .Standard ;
3534import com .casper .sdk .model .transaction .target .Native ;
6362import static org .hamcrest .MatcherAssert .assertThat ;
6463import static org .hamcrest .core .Is .is ;
6564import static org .hamcrest .core .IsNull .notNullValue ;
65+ import static org .hamcrest .core .IsNull .nullValue ;
6666
6767/**
6868@@ -256,24 +256,11 @@ void getAccountInfo() {
256256 }
257257
258258 @ Test
259- /* TODO: Make it work */
259+ /* TODO */
260260 void getDictionaryItem () throws IOException {
261-
262- final StatusData status = casperService .getStatus ();
263- final EraInfoData eraSummaryBlockHash = casperService .getEraSummary (new HashBlockIdentifier (status .getLastSwitchBlockHash ().toString ()));
264- final PublicKey delegator = ((Delegator ) eraSummaryBlockHash .getEraSummary ().getStoredValue ().getValue ().getSeigniorageAllocations ().get (0 )).getDelegatorPublicKey ();
265-
266- String accountHash = delegator .generateAccountHash (true );
267-
268- final StringDictionaryIdentifier key = StringDictionaryIdentifier .builder ().dictionary (accountHash ).build ();
269-
270- final DictionaryData stateDictionaryItem = casperService .getStateDictionaryItem (
271- casperService .getStateRootHash ().getStateRootHash (),
272- key
273- );
274-
275- assert stateDictionaryItem .getDictionaryKey () != null ;
276-
261+ // Now linked to issue #368
262+ // Need to first install a Contract with a built in Dictionary
263+ // Then query it with state_get_dictionary_item
277264 }
278265
279266
@@ -399,6 +386,7 @@ void putTransactionContractCep18() throws IOException, URISyntaxException, Value
399386 new NamedArg <>("decimals" , new CLValueU8 ((byte ) 11 )),
400387 new NamedArg <>("name" , new CLValueString ("Acme Token" )),
401388 new NamedArg <>("symbol" , new CLValueString ("ACME" )),
389+ new NamedArg <>("total_supply" , new CLValueU256 (BigInteger .valueOf (500000 ))),
402390 new NamedArg <>("events_mode" , new CLValueU8 ((byte ) 0 )),
403391 new NamedArg <>("id" , new CLValueOption (Optional .of (new CLValueU64 (BigInteger .valueOf (System .currentTimeMillis ())))))
404392 );
@@ -425,7 +413,9 @@ void putTransactionContractCep18() throws IOException, URISyntaxException, Value
425413 assert result .getTransactionHash () != null ;
426414
427415 final GetTransactionResult transactionResult = waitForTransaction (result .getTransactionHash ());
416+
428417 assertThat (transactionResult , is (notNullValue ()));
418+ assertThat (((ExecutionResultV2 ) transactionResult .getExecutionInfo ().getExecutionResult ()).getErrorMessage (), is (nullValue ()));
429419
430420 }
431421
0 commit comments