@@ -1018,8 +1018,8 @@ public Protocol.ChainParameters getChainParameters() {
10181018 // ALLOW_ZKSNARK_TRANSACTION
10191019 builder .addChainParameter (
10201020 Protocol .ChainParameters .ChainParameter .newBuilder ()
1021- .setKey ("getAllowZksnarkTransaction " )
1022- .setValue (dbManager .getDynamicPropertiesStore ().getAllowZksnarkTransaction ())
1021+ .setKey ("getAllowShieldedTransaction " )
1022+ .setValue (dbManager .getDynamicPropertiesStore ().getAllowShieldedTransaction ())
10231023 .build ());
10241024
10251025 // SHIELDED_TRANSACTION_FEE
@@ -1388,8 +1388,8 @@ public Exchange getExchangeById(ByteString exchangeId) {
13881388 return null ;
13891389 }
13901390
1391- public boolean getAllowShieldedTransactionApi () {
1392- return Args .getInstance ().isAllowShieldedTransaction ();
1391+ public boolean getFullNodeAllowShieldedTransaction () {
1392+ return Args .getInstance ().isFullNodeAllowShieldedTransaction ();
13931393 }
13941394
13951395 public BytesMessage getNullifier (ByteString id ) {
@@ -1408,7 +1408,7 @@ public BytesMessage getNullifier(ByteString id) {
14081408
14091409 private long getBlockNumber (OutputPoint outPoint )
14101410 throws BadItemException , ZksnarkException {
1411- if (!getAllowShieldedTransactionApi ()) {
1411+ if (!getFullNodeAllowShieldedTransaction ()) {
14121412 throw new ZksnarkException ("ShieldedTransactionApi is not allowed" );
14131413 }
14141414 ByteString txId = outPoint .getHash ();
@@ -1424,7 +1424,7 @@ private long getBlockNumber(OutputPoint outPoint)
14241424 //in:outPoint,out:blockNumber
14251425 private IncrementalMerkleVoucherContainer createWitness (OutputPoint outPoint , Long blockNumber )
14261426 throws ItemNotFoundException , BadItemException , InvalidProtocolBufferException , ZksnarkException {
1427- if (!getAllowShieldedTransactionApi ()) {
1427+ if (!getFullNodeAllowShieldedTransaction ()) {
14281428 throw new ZksnarkException ("ShieldedTransactionApi is not allowed" );
14291429 }
14301430 ByteString txId = outPoint .getHash ();
@@ -1518,7 +1518,7 @@ private IncrementalMerkleVoucherContainer createWitness(OutputPoint outPoint, Lo
15181518 private void updateWitnesses (List <IncrementalMerkleVoucherContainer > witnessList , long large ,
15191519 int synBlockNum ) throws ItemNotFoundException , BadItemException ,
15201520 InvalidProtocolBufferException , ZksnarkException {
1521- if (!getAllowShieldedTransactionApi ()) {
1521+ if (!getFullNodeAllowShieldedTransaction ()) {
15221522 throw new ZksnarkException ("ShieldedTransactionApi is not allowed" );
15231523 }
15241524 long start = large ;
@@ -1595,7 +1595,7 @@ private void updateLowWitness(IncrementalMerkleVoucherContainer witness, long bl
15951595 }
15961596
15971597 private void validateInput (OutputPointInfo request ) throws BadItemException , ZksnarkException {
1598- if (!getAllowShieldedTransactionApi ()) {
1598+ if (!getFullNodeAllowShieldedTransaction ()) {
15991599 throw new ZksnarkException ("ShieldedTransactionApi is not allowed" );
16001600 }
16011601 if (request .getBlockNum () < 0 || request .getBlockNum () > 1000 ) {
@@ -1623,7 +1623,7 @@ private void validateInput(OutputPointInfo request) throws BadItemException, Zks
16231623 public IncrementalMerkleVoucherInfo getMerkleTreeVoucherInfo (OutputPointInfo request )
16241624 throws ItemNotFoundException , BadItemException ,
16251625 InvalidProtocolBufferException , ZksnarkException {
1626- if (!getAllowShieldedTransactionApi ()) {
1626+ if (!getFullNodeAllowShieldedTransaction ()) {
16271627 throw new ZksnarkException ("ShieldedTransactionApi is not allowed" );
16281628 }
16291629 validateInput (request );
@@ -1669,7 +1669,7 @@ public IncrementalMerkleVoucherInfo getMerkleTreeVoucherInfo(OutputPointInfo req
16691669 }
16701670
16711671 public IncrementalMerkleTree getMerkleTreeOfBlock (long blockNum ) throws ZksnarkException {
1672- if (!getAllowShieldedTransactionApi ()) {
1672+ if (!getFullNodeAllowShieldedTransaction ()) {
16731673 throw new ZksnarkException ("ShieldedTransactionApi is not allowed" );
16741674 }
16751675 if (blockNum < 0 ) {
@@ -1693,7 +1693,7 @@ public long getShieldedTransactionFee() {
16931693
16941694 public TransactionCapsule createShieldedTransaction (PrivateParameters request )
16951695 throws ContractValidateException , RuntimeException , ZksnarkException {
1696- if (!getAllowShieldedTransactionApi ()) {
1696+ if (!getFullNodeAllowShieldedTransaction ()) {
16971697 throw new ZksnarkException ("createshieldedtransaction is not allowed" );
16981698 }
16991699 ZenTransactionBuilder builder = new ZenTransactionBuilder (this );
@@ -1786,7 +1786,7 @@ public TransactionCapsule createShieldedTransaction(PrivateParameters request)
17861786 public TransactionCapsule createShieldedTransactionWithoutSpendAuthSig (
17871787 PrivateParametersWithoutAsk request )
17881788 throws ContractValidateException , ZksnarkException {
1789- if (!getAllowShieldedTransactionApi ()) {
1789+ if (!getFullNodeAllowShieldedTransaction ()) {
17901790 throw new ZksnarkException ("createshieldedtransactionwithoutspendauthsig is not allowed" );
17911791 }
17921792
@@ -1879,7 +1879,7 @@ public TransactionCapsule createShieldedTransactionWithoutSpendAuthSig(
18791879 }
18801880
18811881 public BytesMessage getSpendingKey () throws ZksnarkException {
1882- if (!getAllowShieldedTransactionApi ()) {
1882+ if (!getFullNodeAllowShieldedTransaction ()) {
18831883 throw new ZksnarkException ("ShieldedTransactionApi is not allowed" );
18841884 }
18851885 byte [] sk = SpendingKey .random ().getValue ();
@@ -1888,7 +1888,7 @@ public BytesMessage getSpendingKey() throws ZksnarkException {
18881888
18891889 public ExpandedSpendingKeyMessage getExpandedSpendingKey (ByteString spendingKey )
18901890 throws BadItemException , ZksnarkException {
1891- if (!getAllowShieldedTransactionApi ()) {
1891+ if (!getFullNodeAllowShieldedTransaction ()) {
18921892 throw new ZksnarkException ("ShieldedTransactionApi is not allowed" );
18931893 }
18941894 if (Objects .isNull (spendingKey )) {
@@ -1914,7 +1914,7 @@ public ExpandedSpendingKeyMessage getExpandedSpendingKey(ByteString spendingKey)
19141914
19151915 public BytesMessage getAkFromAsk (ByteString ask ) throws
19161916 BadItemException , ZksnarkException {
1917- if (!getAllowShieldedTransactionApi ()) {
1917+ if (!getFullNodeAllowShieldedTransaction ()) {
19181918 throw new ZksnarkException ("ShieldedTransactionApi is not allowed" );
19191919 }
19201920 if (Objects .isNull (ask )) {
@@ -1931,7 +1931,7 @@ public BytesMessage getAkFromAsk(ByteString ask) throws
19311931
19321932 public BytesMessage getNkFromNsk (ByteString nsk ) throws
19331933 BadItemException , ZksnarkException {
1934- if (!getAllowShieldedTransactionApi ()) {
1934+ if (!getFullNodeAllowShieldedTransaction ()) {
19351935 throw new ZksnarkException ("ShieldedTransactionApi is not allowed" );
19361936 }
19371937 if (Objects .isNull (nsk )) {
@@ -1948,7 +1948,7 @@ public BytesMessage getNkFromNsk(ByteString nsk) throws
19481948
19491949 public IncomingViewingKeyMessage getIncomingViewingKey (byte [] ak , byte [] nk )
19501950 throws ZksnarkException {
1951- if (!getAllowShieldedTransactionApi ()) {
1951+ if (!getFullNodeAllowShieldedTransaction ()) {
19521952 throw new ZksnarkException ("ShieldedTransactionApi is not allowed" );
19531953 }
19541954// if (ak.length != 32 || nk.length != 32) {
@@ -1963,7 +1963,7 @@ public IncomingViewingKeyMessage getIncomingViewingKey(byte[] ak, byte[] nk)
19631963 }
19641964
19651965 public DiversifierMessage getDiversifier () throws ZksnarkException {
1966- if (!getAllowShieldedTransactionApi ()) {
1966+ if (!getFullNodeAllowShieldedTransaction ()) {
19671967 throw new ZksnarkException ("ShieldedTransactionApi is not allowed" );
19681968 }
19691969 byte [] d ;
@@ -1982,7 +1982,7 @@ public DiversifierMessage getDiversifier() throws ZksnarkException {
19821982 }
19831983
19841984 public BytesMessage getRcm () throws ZksnarkException {
1985- if (!getAllowShieldedTransactionApi ()) {
1985+ if (!getFullNodeAllowShieldedTransaction ()) {
19861986 throw new ZksnarkException ("ShieldedTransactionApi is not allowed" );
19871987 }
19881988 byte [] rcm = Note .generateR ();
@@ -1992,7 +1992,7 @@ public BytesMessage getRcm() throws ZksnarkException {
19921992
19931993 public PaymentAddressMessage getPaymentAddress (IncomingViewingKey ivk ,
19941994 DiversifierT d ) throws BadItemException , ZksnarkException {
1995- if (!getAllowShieldedTransactionApi ()) {
1995+ if (!getFullNodeAllowShieldedTransaction ()) {
19961996 throw new ZksnarkException ("ShieldedTransactionApi is not allowed" );
19971997 }
19981998
@@ -2021,7 +2021,7 @@ public PaymentAddressMessage getPaymentAddress(IncomingViewingKey ivk,
20212021
20222022 public SpendResult isSpend (NoteParameters noteParameters ) throws
20232023 ZksnarkException {
2024- if (!getAllowShieldedTransactionApi ()) {
2024+ if (!getFullNodeAllowShieldedTransaction ()) {
20252025 throw new ZksnarkException ("ShieldedTransactionApi is not allowed" );
20262026 }
20272027 GrpcAPI .Note note = noteParameters .getNote ();
@@ -2059,7 +2059,7 @@ public SpendResult isSpend(NoteParameters noteParameters) throws
20592059
20602060 public BytesMessage createSpendAuthSig (SpendAuthSigParameters spendAuthSigParameters )
20612061 throws ZksnarkException {
2062- if (!getAllowShieldedTransactionApi ()) {
2062+ if (!getFullNodeAllowShieldedTransaction ()) {
20632063 throw new ZksnarkException ("ShieldedTransactionApi is not allowed" );
20642064 }
20652065 byte [] result = new byte [64 ];
@@ -2076,7 +2076,7 @@ public BytesMessage createSpendAuthSig(SpendAuthSigParameters spendAuthSigParame
20762076 }
20772077
20782078 public BytesMessage createShieldNullifier (NfParameters nfParameters ) throws ZksnarkException {
2079- if (!getAllowShieldedTransactionApi ()) {
2079+ if (!getFullNodeAllowShieldedTransaction ()) {
20802080 throw new ZksnarkException ("ShieldedTransactionApi is not allowed" );
20812081 }
20822082 byte [] ak = nfParameters .getAk ().toByteArray ();
@@ -2411,7 +2411,7 @@ public ExchangeList getPaginatedExchangeList(long offset, long limit) {
24112411 */
24122412 public GrpcAPI .DecryptNotes scanNoteByIvk (long startNum , long endNum ,
24132413 byte [] ivk ) throws BadItemException , ZksnarkException {
2414- if (!getAllowShieldedTransactionApi ()) {
2414+ if (!getFullNodeAllowShieldedTransaction ()) {
24152415 throw new ZksnarkException ("ShieldedTransactionApi is not allowed" );
24162416 }
24172417 GrpcAPI .DecryptNotes .Builder builder = GrpcAPI .DecryptNotes
@@ -2498,7 +2498,7 @@ public GrpcAPI.DecryptNotes scanNoteByIvk(long startNum, long endNum,
24982498 */
24992499 public GrpcAPI .DecryptNotes scanNoteByOvk (long startNum , long endNum ,
25002500 byte [] ovk ) throws BadItemException , ZksnarkException {
2501- if (!getAllowShieldedTransactionApi ()) {
2501+ if (!getFullNodeAllowShieldedTransaction ()) {
25022502 throw new ZksnarkException ("ShieldedTransactionApi is not allowed" );
25032503 }
25042504 GrpcAPI .DecryptNotes .Builder builder = GrpcAPI .DecryptNotes
0 commit comments