-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add indicator for pending proposal #1998
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
13463fc
Cache newly created proposal metadata
DarksightKellar 7b83a4a
Indicate number of pending proposals
DarksightKellar 6701a37
Remove temp proposal from cache when actual data comes in
DarksightKellar bfdf706
Show persistent pending proposal toast
DarksightKellar 2fa0320
Fix undefined created proposal tx hash bug
DarksightKellar fc7e37f
Tighten up missing proposal created tx hash fix
DarksightKellar ba759df
cleanup
DarksightKellar 266653e
cleanup
DarksightKellar d7a4105
remove unneeded ns
DarksightKellar f242199
Add pendingProposalNotice translation key
DarksightKellar 52e02b3
Add toast to dashboard
DarksightKellar 80ce0c0
Rework pending toast so only one shows at a time
DarksightKellar ad171b9
Revert "cleanup"
DarksightKellar bae68c9
Call `cacheTemporaryProposal` whether `successCallback` defined or not
DarksightKellar aa8be6c
add todo
DarksightKellar 2861db8
`ActivityBase.transactionHash` no longer nullable or undefined-able
DarksightKellar 6bf3c73
pretty
DarksightKellar 7600414
Clean up some unneeded useRef toastId tracking
adamgall 7a0c587
Consolidate logic for showing/hiding toast and removing those temp pr…
adamgall 197a3d8
Updates:
adamgall f81788d
Small copy update
adamgall File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,10 @@ import { | |
LinearERC20Voting, | ||
LinearERC721Voting, | ||
} from '@fractal-framework/fractal-contracts'; | ||
import { ProposalExecutedEvent } from '@fractal-framework/fractal-contracts/dist/typechain-types/contracts/azorius/Azorius'; | ||
import { | ||
ProposalCreatedEvent, | ||
ProposalExecutedEvent, | ||
} from '@fractal-framework/fractal-contracts/dist/typechain-types/contracts/azorius/Azorius'; | ||
import { VotedEvent as ERC20VotedEvent } from '@fractal-framework/fractal-contracts/dist/typechain-types/contracts/azorius/LinearERC20Voting'; | ||
import { VotedEvent as ERC721VotedEvent } from '@fractal-framework/fractal-contracts/dist/typechain-types/contracts/azorius/LinearERC721Voting'; | ||
import { SafeMultisigTransactionWithTransfersResponse } from '@safe-global/safe-service-client'; | ||
|
@@ -149,6 +152,7 @@ const getProposalVotes = ( | |
}; | ||
|
||
export const mapProposalCreatedEventToProposal = async ( | ||
createdEvent: ProposalCreatedEvent, | ||
erc20StrategyContract: LinearERC20Voting | undefined, | ||
erc721StrategyContract: LinearERC721Voting | undefined, | ||
strategyType: VotingStrategyType, | ||
|
@@ -217,7 +221,14 @@ export const mapProposalCreatedEventToProposal = async ( | |
const executedEvent = (await executedEvents)?.find( | ||
event => BigInt(event.args[0]) === proposalId, | ||
); | ||
transactionHash = executedEvent?.transactionHash; | ||
|
||
if (!executedEvent) { | ||
throw new Error('Proposal state is EXECUTED, but no event found'); | ||
} | ||
|
||
transactionHash = executedEvent.transactionHash; | ||
} else { | ||
transactionHash = createdEvent.transactionHash; | ||
adamgall marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
Comment on lines
+230
to
232
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And then I guess I do have an outstanding question at the moment... what is going on here with finding a new use for this |
||
|
||
const proposal: AzoriusProposal = { | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed? The code builds for me without this change.
Logically, I suppose the reason why it would needed is if
transactionHash
is the empty string (Typescript says it's type is simplystring
).empty string is
falsey
, sosafeTxHash
will be used in the||
conditional.Smells to me like maybe this is an opportunity to tighten up some typing.
Do you follow where my head's at? and if so do you agree? If so, Please add a
TODO
comment here for someone searching the codebase later for things to do.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is needed, yep. The typing in that case is misleading, and
multiSigTransaction.transactionHash
turns out to always be an empty string (or was itundefined
?). I chose not to replace the line withtransactionHash: (transaction as SafeMultisigTransactionWithTransfersResponse).safeTxHash
in case there's some legacy reasoning behind the choice in the first place.I'll add the
todo
for the team to revisit this.