Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix replyToId type #12

Merged
merged 1 commit into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions contracts/SCPostStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ contract SCPostStorage is Ownable, ERC2771Recipient, Versioned {
address indexed sender,
uint256 timestamp,
uint256 threadId,
uint256 replyToId
bytes32 replyToId
);

constructor(
Expand Down Expand Up @@ -183,7 +183,7 @@ contract SCPostStorage is Ownable, ERC2771Recipient, Versioned {
string memory post,
string memory original,
uint256 threadId,
uint256 replyToId
bytes32 replyToId
) external {
// Get the derivative
address derivativeAddress = ILedger(ledgerAddress).getDerivative(original);
Expand All @@ -204,7 +204,10 @@ contract SCPostStorage is Ownable, ERC2771Recipient, Versioned {
require(threadId <= currentPostId.current(), "Thread not found");
// Check abitily to post
if (threadId > 0) {
require(replyToId > 0, "replyToId must be provided with threadId");
require(
replyToId > bytes32(0),
"replyToId must be provided with threadId"
);
Post memory threadPost = posts[threadId - 1];
require(
threadPost.sender == _msgSender() ||
Expand Down
2 changes: 1 addition & 1 deletion contracts/models/Post.sol
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ struct Post {
address sender;
uint256 timestamp;
uint256 threadId; // must be another post's ID
uint256 replyToId; // external client post ID to reply to
bytes32 replyToId; // external client post ID to reply to
}