algorand / algorand/java-algorand-sdk

LogicSigAccount.getAddress() causes NPE after delegated with account.signLogicsig(escrowAccountLogicSig.lsig)

Aperta
#695 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
new-bug
Lingua principale
Java
Stelle
73
Fork
71
Merge medio
41m
PR unite (30g)
2

Descrizione

### LogicSigAccount.getAddress() causes NPE after delegated with account.signLogicsig(escrowAccountLogicSig.lsig)

When creating an escrow as stateless smart contract:

LogicSigAccount escrowAccountLogicSig = new LogicSigAccount(escrowAccountStatelessSmartContract.getBytes(), null)
then making it secure by delegating:
account.signLogicsig(escrowAccountLogicSig.lsig)
--> getting the address afterwards fails:
escrowStatelessSmartContractAddress = escrowAccountLogicSig.getAddress()

error Cannot invoke "com.algorand.algosdk.crypto.Ed25519PublicKey.getBytes()" because "this.sigKey" is null at com.algorand.algosdk.account.LogicSigAccount.getAddress(LogicSigAccount.java:138)

### Your environment

Algorand Java SDK 2.4

### Expected behaviour

Getting the address should also work after delegating the logicSig

### Actual behaviour

NPE :)

BTW It would be great if there is a Method in LogicSigAccount to sign/delegate, and not indirectly go via the account only, not really ObjectOriented?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.