algorand / algorand/java-algorand-sdk

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

未关闭
#695 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
new-bug
主要语言
Java
星标
73
派生
71
平均合并
41 分钟
30 天内合并 PR
2

描述

### 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?

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。