Skip to content

Commit

Permalink
Fix revokeMetadata bug (#196)
Browse files Browse the repository at this point in the history
* Bump kliento to include revokeMetadata bugfix

* Update airgap example script to be usable for manual testing

* Bump MiddlewareVersion from 1.0.0 to 1.0.1

* Nit: run go mod tidy
  • Loading branch information
eelanagaraj authored Mar 3, 2023
1 parent b405be6 commit 0dacf1d
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 6 deletions.
42 changes: 40 additions & 2 deletions examples/airgap/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@ import (
"context"
"log"

// "math/big"

"github.com/celo-org/celo-blockchain/common"
// "github.com/celo-org/celo-blockchain/common/hexutil"
// "github.com/celo-org/celo-blockchain/crypto"
"github.com/celo-org/rosetta/airgap"

// celoClient "github.com/celo-org/kliento/client"
// "github.com/celo-org/kliento/registry"

"github.com/coinbase/rosetta-sdk-go/fetcher"
)

Expand All @@ -34,6 +41,7 @@ func main() {
}

// (or use an existing key)
// recommended for testing, since the account will need to have funds for gas fees
// privKeyBytes, err := hexutil.Decode("0x8e14643e23a3a6aa027e6e01fad86f54e63c5186636ce4be01ea9042907b1ff5")
// privKey, err := crypto.ToECDSA(privKeyBytes)

Expand Down Expand Up @@ -107,6 +115,7 @@ func main() {
}

// lockValue := big.NewInt(10000000000)

// txArgs, err = argBuilder.LockGold(*addr, lockValue)
// if err != nil {
// log.Fatalf("Error build txArgs: %s", err)
Expand All @@ -116,9 +125,18 @@ func main() {
// }

// cc, err := celoClient.Dial("http://localhost:8545")
// registry, err := wrapper.NewRegistry(cc)
// election, err := registry.GetElection(ctx, nil)
// registry, err := registry.New(cc)
// if err != nil {
// log.Fatalf("Error creating Registry: %s", err)
// }
// election, err := registry.GetElectionContract(ctx, nil)
// if err != nil {
// log.Fatalf("Error getting Election Contract: %s", err)
// }
// groups, err := election.GetEligibleValidatorGroups(nil)
// if err != nil {
// log.Fatalf("Error getting eligible validator groups: %s", err)
// }

// txArgs, err = argBuilder.Vote(*addr, groups[0], lockValue)
// if err != nil {
Expand All @@ -128,6 +146,26 @@ func main() {
// log.Fatalf("Error on submit Tx: %s", err)
// }

// votedForGroups, err := election.GetGroupsVotedForByAccount(nil, *addr)
// log.Printf("votedForGroups %s:", votedForGroups)

// // eligible
// txArgs, err = argBuilder.RevokePendingVotes(*addr, groups[0], lockValue)
// if err != nil {
// log.Fatalf("Error build txArgs: %s", err)
// }
// if err = submitSigned(txArgs); err != nil {
// log.Fatalf("Error on submit Tx: %s", err)
// }
// // not eligible
// txArgs, err = argBuilder.RevokePendingVotes(*addr, *addr, lockValue)
// if err != nil {
// log.Fatalf("Error build txArgs: %s", err)
// }
// if err = submitSigned(txArgs); err != nil {
// log.Fatalf("Error on submit Tx: %s", err)
// }

// txArgs, err = argBuilder.UnlockGold(*addr, big.NewInt(50))
// if err != nil {
// log.Fatalf("Error build txArgs: %s", err)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/celo-org/celo-bls-go-macos v0.6.4 // indirect
github.com/celo-org/celo-bls-go-other v0.6.4 // indirect
github.com/celo-org/celo-bls-go-windows v0.6.4 // indirect
github.com/celo-org/kliento v0.2.1-0.20221024130050-896466f9e8df
github.com/celo-org/kliento v0.2.1-0.20230302174154-e3fe27e18851
github.com/coinbase/rosetta-sdk-go v0.5.9
github.com/felixge/httpsnoop v1.0.1
github.com/go-stack/stack v1.8.1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ github.com/celo-org/celo-bls-go-other v0.6.4/go.mod h1:1xEWTbCXUrDx3Z6R9YlLi1zFN
github.com/celo-org/celo-bls-go-windows v0.6.3/go.mod h1:8bRJbLcHREIAWn+5iZM3u8rGPBsWepp9BdF3SexisuM=
github.com/celo-org/celo-bls-go-windows v0.6.4 h1:4w+NllEORQbsQnqpXO7UC+xDUbZQgiMPMnnyzLFA+ck=
github.com/celo-org/celo-bls-go-windows v0.6.4/go.mod h1:8bRJbLcHREIAWn+5iZM3u8rGPBsWepp9BdF3SexisuM=
github.com/celo-org/kliento v0.2.1-0.20221024130050-896466f9e8df h1:Th3X69EV3bYVtGDq+oJXV1LHi3vFSOGBDHe1n8K2fP8=
github.com/celo-org/kliento v0.2.1-0.20221024130050-896466f9e8df/go.mod h1:E5olI06v1Ax1O6Ad8vKU4TYkWNxxki7CSpO2EHK79Qc=
github.com/celo-org/kliento v0.2.1-0.20230302174154-e3fe27e18851 h1:y2BmZGeVTTnrBILY3YxMkfQ1CWA82Nxj7AxrYvvwLkg=
github.com/celo-org/kliento v0.2.1-0.20230302174154-e3fe27e18851/go.mod h1:E5olI06v1Ax1O6Ad8vKU4TYkWNxxki7CSpO2EHK79Qc=
github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4=
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
Expand Down
2 changes: 1 addition & 1 deletion service/rpc/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ const (
)

var (
MiddlewareVersion = "1.0.0"
MiddlewareVersion = "1.0.1"
NodeVersion = params.Version
)

0 comments on commit 0dacf1d

Please sign in to comment.