PolicyContract extends SmartContract { public TransactionBuilder setMaxBlockSystemFee(BigInteger maxBlockSystemFee){ return invokeFunction(SET_MAX_BLOCK_SYSTEM_FEE, ContractParameter.integer(maxBlockSystemFee)); } PolicyContract(Neow3j neow); Integer getMaxTransactionsPerBlock(); Integer getMaxBlockSize(); BigInteger getMaxBlockSystemFee(); Integer getFeePerByte(); List<ScriptHash> getBlockedAccounts(); TransactionBuilder setMaxBlockSize(Integer maxBlockSize); TransactionBuilder setMaxTransactionsPerBlock(Integer maxTxPerBlock); TransactionBuilder setMaxBlockSystemFee(BigInteger maxBlockSystemFee); TransactionBuilder setFeePerByte(Integer fee); TransactionBuilder blockAccount(ScriptHash accountToBlock); TransactionBuilder unblockAccount(ScriptHash accountToUnblock); static final ScriptHash SCRIPT_HASH; }
@Test public void setMaxBlockSystemFee() throws Throwable { setUpWireMockForCall("invokescript", "policy_setMaxBlockSystemFee.json"); setUpWireMockForCall("getblockcount", "getblockcount_1000.json"); byte[] expectedScript = new ScriptBuilder().contractCall(POLICY_SCRIPT_HASH, "setMaxBlockSystemFee", Arrays.asList(ContractParameter.integer(new BigInteger("880000000000")))).toArray(); Wallet w = Wallet.withAccounts(account1); Transaction tx = new PolicyContract(neow3j) .setMaxBlockSystemFee(new BigInteger("880000000000")) .wallet(w) .signers(Signer.calledByEntry(account1.getScriptHash())) .sign(); assertThat(tx.getSigners(), hasSize(1)); assertThat(tx.getSigners().get(0).getScriptHash(), is(account1.getScriptHash())); assertThat(tx.getSigners().get(0).getScopes(), contains(WitnessScope.CALLED_BY_ENTRY)); assertThat(tx.getScript(), is(expectedScript)); assertThat(tx.getWitnesses().get(0).getVerificationScript().getScript(), is(account1.getVerificationScript().getScript())); }