-
Notifications
You must be signed in to change notification settings - Fork 915
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move lifetime token compile into transaction-messages (#2455)
More of the same from this stack, but no codec to move since they just compile to a string Ignore the hacky cast in message.ts, that'll go away when the input is the new transaction-message types!
- Loading branch information
1 parent
1bb084f
commit d9cfe21
Showing
6 changed files
with
25 additions
and
17 deletions.
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
13 changes: 13 additions & 0 deletions
13
packages/transaction-messages/src/compile/lifetime-token.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,13 @@ | ||
import { IDurableNonceTransactionMessage, ITransactionMessageWithBlockhashLifetime } from '../index'; | ||
|
||
export function getCompiledLifetimeToken( | ||
lifetimeConstraint: ( | ||
| IDurableNonceTransactionMessage | ||
| ITransactionMessageWithBlockhashLifetime | ||
)['lifetimeConstraint'], | ||
): string { | ||
if ('nonce' in lifetimeConstraint) { | ||
return lifetimeConstraint.nonce; | ||
} | ||
return lifetimeConstraint.blockhash; | ||
} |
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 was deleted.
Oops, something went wrong.
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