-
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.
Merge pull request #15 from algorandfoundation/feat-arc4-types-in-tests
feat: implement arc4 method signature and method selector
- Loading branch information
Showing
81 changed files
with
12,016 additions
and
2,434 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
22 changes: 11 additions & 11 deletions
22
patches/typescript+5.6.2.patch → patches/typescript+5.7.2.patch
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 |
---|---|---|
@@ -1,34 +1,34 @@ | ||
diff --git a/node_modules/typescript/lib/typescript.d.ts b/node_modules/typescript/lib/typescript.d.ts | ||
index 963c573..299a8a4 100644 | ||
index 6780dd1..8700e72 100644 | ||
--- a/node_modules/typescript/lib/typescript.d.ts | ||
+++ b/node_modules/typescript/lib/typescript.d.ts | ||
@@ -6116,6 +6116,7 @@ declare namespace ts { | ||
@@ -6159,6 +6159,7 @@ declare namespace ts { | ||
getIndexInfoOfType(type: Type, kind: IndexKind): IndexInfo | undefined; | ||
getIndexInfosOfType(type: Type): readonly IndexInfo[]; | ||
getIndexInfosOfIndexSymbol: (indexSymbol: Symbol) => IndexInfo[]; | ||
getIndexInfosOfIndexSymbol: (indexSymbol: Symbol, siblingSymbols?: Symbol[] | undefined) => IndexInfo[]; | ||
+ getTypeArgumentsForResolvedSignature(signature: Signature): readonly Type[] | undefined; | ||
getSignaturesOfType(type: Type, kind: SignatureKind): readonly Signature[]; | ||
getIndexTypeOfType(type: Type, kind: IndexKind): Type | undefined; | ||
getBaseTypes(type: InterfaceType): BaseType[]; | ||
diff --git a/node_modules/typescript/lib/typescript.js b/node_modules/typescript/lib/typescript.js | ||
index 90f3266..9daa319 100644 | ||
index 33387ea..a1f35b3 100644 | ||
--- a/node_modules/typescript/lib/typescript.js | ||
+++ b/node_modules/typescript/lib/typescript.js | ||
@@ -50171,6 +50171,7 @@ function createTypeChecker(host) { | ||
@@ -50655,6 +50655,7 @@ function createTypeChecker(host) { | ||
getGlobalDiagnostics, | ||
getRecursionIdentity, | ||
getUnmatchedProperties, | ||
+ getTypeArgumentsForResolvedSignature, | ||
getTypeOfSymbolAtLocation: (symbol, locationIn) => { | ||
const location = getParseTreeNode(locationIn); | ||
return location ? getTypeOfSymbolAtLocation(symbol, location) : errorType; | ||
@@ -92895,6 +92896,9 @@ function createTypeChecker(host) { | ||
Debug.assert(specifier && nodeIsSynthesized(specifier) && specifier.text === "tslib", `Expected sourceFile.imports[0] to be the synthesized tslib import`); | ||
return specifier; | ||
@@ -71776,6 +71777,9 @@ function createTypeChecker(host) { | ||
} | ||
} | ||
} | ||
+ function getTypeArgumentsForResolvedSignature(signature) { | ||
+ return signature.mapper && instantiateTypes((signature.target ?? signature).typeParameters ?? [], signature.mapper); | ||
+ } | ||
} | ||
function isNotAccessor(declaration) { | ||
return !isAccessor(declaration); | ||
function getUnmatchedProperty(source, target, requireOptionalProperties, matchDiscriminantProperties) { | ||
return firstOrUndefinedIterator(getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties)); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { internal, uint64 } from '@algorandfoundation/algorand-typescript' | ||
import { AbiMetadata } from '../abi-metadata' | ||
import { ApplicationTransaction } from '../impl/transactions' | ||
import { lazyContext } from './internal-context' | ||
|
||
export const checkRoutingConditions = (appId: uint64, metadata: AbiMetadata) => { | ||
const appData = lazyContext.getApplicationData(appId) | ||
const isCreating = appData.isCreating | ||
if (isCreating && metadata.onCreate === 'disallow') { | ||
throw new internal.errors.CodeError('method can not be called while creating') | ||
} | ||
if (!isCreating && metadata.onCreate === 'require') { | ||
throw new internal.errors.CodeError('method can only be called while creating') | ||
} | ||
const txn = lazyContext.activeGroup.activeTransaction | ||
if (txn instanceof ApplicationTransaction && metadata.allowActions && !metadata.allowActions.includes(txn.onCompletion)) { | ||
throw new internal.errors.CodeError( | ||
`method can only be called with one of the following on_completion values: ${metadata.allowActions.join(', ')}`, | ||
) | ||
} | ||
} |
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
Oops, something went wrong.