From 9183addf812cc3234099ee328fd1114783d795c8 Mon Sep 17 00:00:00 2001 From: demoadminjie <119581900+demoadminjie@users.noreply.github.com> Date: Thu, 2 Mar 2023 19:11:41 +0800 Subject: [PATCH] fix: Fix errors Fixed errors in the use of external view and public view --- examples/voting.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/voting.rst b/examples/voting.rst index 808c696..36d6229 100644 --- a/examples/voting.rst +++ b/examples/voting.rst @@ -139,7 +139,7 @@ } /// @dev 结合之前所有的投票,计算出最终胜出的提案 - function winningProposal() external view + function winningProposal() public view returns (uint winningProposal_) { uint winningVoteCount = 0; @@ -152,7 +152,7 @@ } // 调用 winningProposal() 函数以获取提案数组中获胜者的索引,并以此返回获胜者的名称 - function winnerName() public view + function winnerName() external view returns (bytes32 winnerName_) { winnerName_ = proposals[winningProposal()].name;