-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* implement starknet_getCompiledCasm for RPCv8
- Loading branch information
1 parent
98d2b5c
commit 9007483
Showing
8 changed files
with
418 additions
and
3 deletions.
There are no files selected for viewing
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
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,24 @@ | ||
package rpc | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/NethermindEth/juno/core/felt" | ||
) | ||
|
||
// Get the contract class definition in the given block associated with the given hash | ||
// | ||
// Parameters: | ||
// - ctx: The context.Context used for the request | ||
// - classHash: The hash of the contract class whose CASM will be returned | ||
// Returns: | ||
// - CasmCompiledContractClass: The compiled contract class | ||
// - error: An error if any occurred during the execution | ||
func (provider *Provider) CompiledCasm(ctx context.Context, classHash *felt.Felt) (*CasmCompiledContractClass, error) { | ||
var result CasmCompiledContractClass | ||
if err := do(ctx, provider.c, "starknet_getCompiledCasm", &result, classHash); err != nil { | ||
|
||
return nil, tryUnwrapToRPCErr(err, ErrClassHashNotFound, ErrCompilationError) | ||
} | ||
return &result, nil | ||
} |
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,7 @@ | ||
package rpc | ||
|
||
import "testing" | ||
|
||
func TestCompiledCasm(t *testing.T) { | ||
t.Skip("TODO: create a test before merge") | ||
} |
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.