2
2
3
3
import com .casper .sdk .identifier .block .HashBlockIdentifier ;
4
4
import com .casper .sdk .identifier .block .HeightBlockIdentifier ;
5
- import com .casper .sdk .identifier .dictionary .StringDictionaryIdentifier ;
6
5
import com .casper .sdk .identifier .entity .EntityAddrIdentifier ;
7
6
import com .casper .sdk .identifier .era .IdEraIdentifier ;
8
7
import com .casper .sdk .identifier .global .StateRootHashIdentifier ;
17
16
import com .casper .sdk .model .common .Ttl ;
18
17
import com .casper .sdk .model .deploy .Delegator ;
19
18
import com .casper .sdk .model .deploy .NamedArg ;
20
- import com .casper .sdk .model .dictionary .DictionaryData ;
21
19
import com .casper .sdk .model .entity .AddressableEntity ;
22
20
import com .casper .sdk .model .entity .StateEntityResult ;
23
21
import com .casper .sdk .model .era .EraInfoData ;
29
27
import com .casper .sdk .model .transaction .*;
30
28
import com .casper .sdk .model .transaction .entrypoint .CallEntryPoint ;
31
29
import com .casper .sdk .model .transaction .entrypoint .TransferEntryPoint ;
30
+ import com .casper .sdk .model .transaction .execution .ExecutionResultV2 ;
32
31
import com .casper .sdk .model .transaction .pricing .FixedPricingMode ;
33
32
import com .casper .sdk .model .transaction .scheduling .Standard ;
34
33
import com .casper .sdk .model .transaction .target .Native ;
62
61
import static org .hamcrest .MatcherAssert .assertThat ;
63
62
import static org .hamcrest .core .Is .is ;
64
63
import static org .hamcrest .core .IsNull .notNullValue ;
64
+ import static org .hamcrest .core .IsNull .nullValue ;
65
65
66
66
/**
67
67
@@ -255,24 +255,11 @@ void getAccountInfo() {
255
255
}
256
256
257
257
@ Test
258
- /* TODO: Make it work */
258
+ /* TODO */
259
259
void getDictionaryItem () throws IOException {
260
-
261
- final StatusData status = casperService .getStatus ();
262
- final EraInfoData eraSummaryBlockHash = casperService .getEraSummary (new HashBlockIdentifier (status .getLastSwitchBlockHash ().toString ()));
263
- final PublicKey delegator = ((Delegator ) eraSummaryBlockHash .getEraSummary ().getStoredValue ().getValue ().getSeigniorageAllocations ().get (0 )).getDelegatorPublicKey ();
264
-
265
- String accountHash = delegator .generateAccountHash (true );
266
-
267
- final StringDictionaryIdentifier key = StringDictionaryIdentifier .builder ().dictionary (accountHash ).build ();
268
-
269
- final DictionaryData stateDictionaryItem = casperService .getStateDictionaryItem (
270
- casperService .getStateRootHash ().getStateRootHash (),
271
- key
272
- );
273
-
274
- assert stateDictionaryItem .getDictionaryKey () != null ;
275
-
260
+ // Now linked to issue #368
261
+ // Need to first install a Contract with a built in Dictionary
262
+ // Then query it with state_get_dictionary_item
276
263
}
277
264
278
265
@@ -398,6 +385,7 @@ void putTransactionContractCep18() throws IOException, URISyntaxException, Value
398
385
new NamedArg <>("decimals" , new CLValueU8 ((byte ) 11 )),
399
386
new NamedArg <>("name" , new CLValueString ("Acme Token" )),
400
387
new NamedArg <>("symbol" , new CLValueString ("ACME" )),
388
+ new NamedArg <>("total_supply" , new CLValueU256 (BigInteger .valueOf (500000 ))),
401
389
new NamedArg <>("events_mode" , new CLValueU8 ((byte ) 0 )),
402
390
new NamedArg <>("id" , new CLValueOption (Optional .of (new CLValueU64 (BigInteger .valueOf (System .currentTimeMillis ())))))
403
391
);
@@ -424,7 +412,9 @@ void putTransactionContractCep18() throws IOException, URISyntaxException, Value
424
412
assert result .getTransactionHash () != null ;
425
413
426
414
final GetTransactionResult transactionResult = waitForTransaction (result .getTransactionHash ());
415
+
427
416
assertThat (transactionResult , is (notNullValue ()));
417
+ assertThat (((ExecutionResultV2 ) transactionResult .getExecutionInfo ().getExecutionResult ()).getErrorMessage (), is (nullValue ()));
428
418
429
419
}
430
420
0 commit comments