Skip to content

Commit

Permalink
clients/go: Add support for Sapphire Localnet
Browse files Browse the repository at this point in the history
  • Loading branch information
matevz committed Mar 1, 2024
1 parent 7b11009 commit c74ef18
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions clients/go/compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ var Networks = map[uint64]NetworkParams{
DefaultGateway: "https://sapphire.oasis.io",
RuntimeID: "0x000000000000000000000000000000000000000000000000f80306c9858e7279",
},
0x5afd: {
Name: "localnet",
ChainID: *big.NewInt(0x5afd),
DefaultGateway: "http://localhost:8545",
RuntimeID: "0x8000000000000000000000000000000000000000000000000000000000000000",
},
}

// PackTx prepares a regular Eth transaction for Sapphire. The transaction returned from this function is what must be signed.
Expand All @@ -60,6 +66,7 @@ func PackTx(tx types.Transaction, cipher Cipher) (*types.Transaction, error) {
}

func packTx(tx types.Transaction, cipher Cipher) (*types.Transaction, error) {
fmt.Printf("NONCE: %d\n", tx.Nonce())
return types.NewTx(&types.LegacyTx{
Nonce: tx.Nonce(),
GasPrice: tx.GasPrice(),
Expand Down

0 comments on commit c74ef18

Please sign in to comment.