@Test public void testBlockAccount() throws Throwable { setUpWireMockForCall("invokescript", "policy_blockAccount.json"); setUpWireMockForCall("getblockcount", "getblockcount_1000.json"); byte[] expectedScript = new ScriptBuilder().contractCall(POLICY_SCRIPT_HASH, "blockAccount", Arrays.asList(ContractParameter.hash160(recipient))).toArray(); Wallet w = Wallet.withAccounts(account1); Transaction tx = new PolicyContract(neow3j) .blockAccount(recipient) .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())); }
public TransactionBuilder blockAccount(ScriptHash accountToBlock) { return invokeFunction(BLOCK_ACCOUNT, ContractParameter.hash160(accountToBlock)); }
PolicyContract extends SmartContract { public TransactionBuilder blockAccount(ScriptHash accountToBlock) { return invokeFunction(BLOCK_ACCOUNT, ContractParameter.hash160(accountToBlock)); } }
PolicyContract extends SmartContract { public TransactionBuilder blockAccount(ScriptHash accountToBlock) { return invokeFunction(BLOCK_ACCOUNT, ContractParameter.hash160(accountToBlock)); } PolicyContract(Neow3j neow); }
PolicyContract extends SmartContract { public TransactionBuilder blockAccount(ScriptHash accountToBlock) { return invokeFunction(BLOCK_ACCOUNT, ContractParameter.hash160(accountToBlock)); } 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); }
PolicyContract extends SmartContract { public TransactionBuilder blockAccount(ScriptHash accountToBlock) { return invokeFunction(BLOCK_ACCOUNT, ContractParameter.hash160(accountToBlock)); } 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; }