Skip to content
This repository has been archived by the owner on Aug 31, 2024. It is now read-only.

Commit

Permalink
check to juno sequecner branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Lawliet-Chan committed Jan 26, 2024
1 parent 8656331 commit af23ae0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
7 changes: 4 additions & 3 deletions cairoVM/cairo.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (c *Cairo) HandleCall(call *rpc.FunctionCall, classHash *felt.Felt) ([]*fel
return c.vm.Call(&call.ContractAddress, classHash, &call.EntryPointSelector, call.Calldata, 0, uint64(time.Now().Unix()), c.state, c.cfg.Network)
}

func (c *Cairo) DeployAccount(classHash, contractAddr *felt.Felt) (*felt.Felt, error) {
func (c *Cairo) DeployAccount(classHash, contractAddr *felt.Felt) (*vm.TransactionTrace, error) {
tx := &core.DeployAccountTransaction{
DeployTransaction: core.DeployTransaction{
ContractAddressSalt: c.acc.pubkey,
Expand All @@ -76,7 +76,8 @@ func (c *Cairo) DeployAccount(classHash, contractAddr *felt.Felt) (*felt.Felt, e
return c.HandleDeployAccountTx(tx)
}

func (c *Cairo) HandleDeployAccountTx(tx *core.DeployAccountTransaction) (*felt.Felt, error) {
func (c *Cairo) HandleDeployAccountTx(tx *core.DeployAccountTransaction) (*vm.TransactionTrace, error) {
fmt.Println("DeployAccount TX !!!")
txnHash, err := core.TransactionHash(tx, c.cfg.Network)
if err != nil {
return nil, err
Expand All @@ -93,7 +94,7 @@ func (c *Cairo) HandleDeployAccountTx(tx *core.DeployAccountTransaction) (*felt.
if err != nil {
return nil, err
}
return &traces[0].ConstructorInvocation.CallerAddress, nil
return &traces[0], nil
}

func (c *Cairo) HandleDeclareTx(tx *core.DeclareTransaction, class core.Class) (*vm.TransactionTrace, error) {
Expand Down
10 changes: 10 additions & 0 deletions cairoVM/cmd/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"github.com/NethermindEth/juno/core/felt"
"github.com/davecgh/go-spew/spew"
"testbot/cairoVM"
// "github.com/NethermindEth/juno/core"
Expand All @@ -21,9 +22,18 @@ func main() {
}
// fmt.Println(declare_tx)

// declare TX
trace, err := vm.HandleDeclareTx(declareTx, class)
if err != nil {
panic(err)
}
spew.Dump(trace)

// deployAccount TX
trace, err = vm.DeployAccount(declareTx.ClassHash, &felt.Zero)
if err != nil {
panic(err)
}
spew.Dump(trace)

}
2 changes: 1 addition & 1 deletion cairoVM/juno
Submodule juno updated 56 files
+ .github/Juno_Dark_Powered_by_Nethermind.png
+ .github/Juno_Light.png
+1 −1 CONTRIBUTING.md
+5 −5 README.md
+143 −36 blockchain/blockchain.go
+278 −43 blockchain/blockchain_test.go
+74 −0 blockchain/pending.go
+135 −0 blockchain/pending_test.go
+297 −0 builder/builder.go
+330 −0 builder/builder_test.go
+17 −0 builder/event_listener.go
+17 −0 clients/gateway/event_listener.go
+22 −12 clients/gateway/gateway.go
+4 −3 clients/gateway/gateway_test.go
+14 −1 cmd/juno/juno.go
+5 −0 core/block.go
+7 −3 core/felt/felt.go
+12 −40 core/state.go
+44 −59 core/state_test.go
+113 −0 docs/versioned_docs/version-0.9.2/example_config.md
+54 −0 docs/versioned_docs/version-0.9.2/intro.md
+64 −0 docs/versioned_docs/version-0.9.2/snapshots.md
+8 −0 docs/versioned_sidebars/version-0.9.2-sidebars.json
+1 −0 docs/versions.json
+149 −0 genesis/genesis.go
+101 −0 genesis/genesis_test.go
+1 −0 genesis/testdata/simpleAccount.json
+5,980 −0 genesis/testdata/simpleStore.json
+1 −0 genesis/testdata/universalDeployer.json
+2 −2 l1/l1_pkg_test.go
+3 −3 l1/l1_test.go
+231 −0 mempool/mempool.go
+120 −0 mempool/mempool_test.go
+8 −3 migration/migration.go
+19 −2 migration/migration_pkg_test.go
+15 −0 mocks/mock_blockchain.go
+5 −4 mocks/mock_gateway_handler.go
+30 −0 mocks/mock_state.go
+39 −0 node/genesis.go
+5 −4 node/http.go
+16 −0 node/metrics.go
+96 −46 node/node.go
+1 −1 node/node_test.go
+110 −54 rpc/handlers.go
+161 −106 rpc/handlers_test.go
+8 −8 sync/sync_test.go
+15 −0 utils/clone.go
+1 −1 vm/rust/Cargo.toml
+6 −9 vm/rust/src/jsonrpc.rs
+105 −7 vm/rust/src/juno_state.rs
+40 −11 vm/rust/src/lib.rs
+64 −0 vm/state.go
+23 −3 vm/trace.go
+94 −22 vm/trace_test.go
+59 −27 vm/vm.go
+14 −30 vm/vm_test.go

0 comments on commit af23ae0

Please sign in to comment.