-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enable handler for streaming payment actions made via motions
- Loading branch information
1 parent
f5922ad
commit c4711ec
Showing
7 changed files
with
66 additions
and
1 deletion.
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
32 changes: 32 additions & 0 deletions
32
...lers/motions/motionCreated/handlers/streamingPayments.ts/cancelStreamingPaymentsMotion.ts
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { BigNumber } from 'ethers'; | ||
import { TransactionDescription } from 'ethers/lib/utils'; | ||
import { ContractEvent, motionNameMapping } from '~types'; | ||
import { createMotionInDB } from '../../helpers'; | ||
import { | ||
getDomainDatabaseId, | ||
getExpenditureDatabaseId, | ||
toNumber, | ||
} from '~utils'; | ||
|
||
export default async ( | ||
colonyAddress: string, | ||
event: ContractEvent, | ||
{ name, args: actionArgs }: TransactionDescription, | ||
gasEstimate: BigNumber, | ||
): Promise<void> => { | ||
const { args } = event; | ||
const [, , streamingPaymentId] = actionArgs; | ||
const [, , domainId] = args; | ||
|
||
await createMotionInDB(colonyAddress, event, { | ||
type: motionNameMapping[name], | ||
fromDomainId: colonyAddress | ||
? getDomainDatabaseId(colonyAddress, domainId) | ||
: undefined, | ||
gasEstimate: gasEstimate.toString(), | ||
streamingPaymentId: getExpenditureDatabaseId( | ||
colonyAddress, | ||
toNumber(streamingPaymentId), | ||
), | ||
}); | ||
}; |
1 change: 1 addition & 0 deletions
1
src/handlers/motions/motionCreated/handlers/streamingPayments.ts/index.ts
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as handleCancelStreamingPaymentsMotion } from './cancelStreamingPaymentsMotion'; |
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