[Fix] Solidity 103, Lession 37, Change the visibility of recoverSigner
function and verify
function from internal to public
#246
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
问题
在Solidity 103 的第37课数字签名中, 讲解到「步骤4通过签名和消息恢复公钥」和「步骤5 对比公钥并验证签名」, 通过截图展示了在Remix IDE 上 调用
recoverSigner
函数和verify
函数的过程:但是
recoverSigner
和verify
函数都被声明成internal
函数,internal
函数是无论从合约外被调用的,即使是使用 Remix IDE进行调试解决方案
修改
recoverSigner
和verify
函数的可见性,从internal
修改成public
, 从而使截图与代码实际行为一致.另外一个解决方法是在课程中加以强调,说明是为了方便调试所以改成
public
, 实际应该是internal
.