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 ;
30
28
import com .casper .sdk .model .transaction .*;
31
29
import com .casper .sdk .model .transaction .entrypoint .CallEntryPoint ;
32
30
import com .casper .sdk .model .transaction .entrypoint .TransferEntryPoint ;
31
+ import com .casper .sdk .model .transaction .execution .ExecutionResultV2 ;
33
32
import com .casper .sdk .model .transaction .pricing .FixedPricingMode ;
34
33
import com .casper .sdk .model .transaction .scheduling .Standard ;
35
34
import com .casper .sdk .model .transaction .target .Native ;
63
62
import static org .hamcrest .MatcherAssert .assertThat ;
64
63
import static org .hamcrest .core .Is .is ;
65
64
import static org .hamcrest .core .IsNull .notNullValue ;
65
+ import static org .hamcrest .core .IsNull .nullValue ;
66
66
67
67
/**
68
68
@@ -256,24 +256,11 @@ void getAccountInfo() {
256
256
}
257
257
258
258
@ Test
259
- /* TODO: Make it work */
259
+ /* TODO */
260
260
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
277
264
}
278
265
279
266
@@ -399,6 +386,7 @@ void putTransactionContractCep18() throws IOException, URISyntaxException, Value
399
386
new NamedArg <>("decimals" , new CLValueU8 ((byte ) 11 )),
400
387
new NamedArg <>("name" , new CLValueString ("Acme Token" )),
401
388
new NamedArg <>("symbol" , new CLValueString ("ACME" )),
389
+ new NamedArg <>("total_supply" , new CLValueU256 (BigInteger .valueOf (500000 ))),
402
390
new NamedArg <>("events_mode" , new CLValueU8 ((byte ) 0 )),
403
391
new NamedArg <>("id" , new CLValueOption (Optional .of (new CLValueU64 (BigInteger .valueOf (System .currentTimeMillis ())))))
404
392
);
@@ -425,7 +413,9 @@ void putTransactionContractCep18() throws IOException, URISyntaxException, Value
425
413
assert result .getTransactionHash () != null ;
426
414
427
415
final GetTransactionResult transactionResult = waitForTransaction (result .getTransactionHash ());
416
+
428
417
assertThat (transactionResult , is (notNullValue ()));
418
+ assertThat (((ExecutionResultV2 ) transactionResult .getExecutionInfo ().getExecutionResult ()).getErrorMessage (), is (nullValue ()));
429
419
430
420
}
431
421
0 commit comments