Skip to content

Commit

Permalink
fix storing blk.results bug
Browse files Browse the repository at this point in the history
  • Loading branch information
bianyuanop committed Mar 21, 2024
1 parent c3b4020 commit 9133bf9
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cmd/token-cli/cmd/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ var watchChainCmd = &cobra.Command{
if err != nil {
return err
}
if lastAccepted > uint64(*acceptedWindow) && lastAccepted-uint64(*acceptedWindow) > startBlock {
if lastAccepted > uint64(acceptedWindow) && lastAccepted-uint64(acceptedWindow) > startBlock {
return fmt.Errorf("start block is too old")
}
}
Expand Down
4 changes: 0 additions & 4 deletions controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,3 @@ func (*Controller) Shutdown(context.Context) error {
// close any databases your provided.
return nil
}

func (c *Controller) GetAcceptedBlockWindow() int {
return c.config.GetAcceptedBlockWindow()
}
4 changes: 4 additions & 0 deletions controller/resolutions.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@ func (c *Controller) GetLoanFromState(
) (uint64, error) {
return storage.GetLoanFromState(ctx, c.inner.ReadState, asset, destination)
}

func (c *Controller) GetAcceptedBlockWindow() int {
return c.config.GetAcceptedBlockWindow()
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.21
toolchain go1.21.6

require (
github.com/AnomalyFi/hypersdk v0.9.3-beta.1
github.com/AnomalyFi/hypersdk v0.9.3-beta.2
github.com/ava-labs/avalanche-network-runner v1.7.2
github.com/ava-labs/avalanchego v1.10.10
github.com/ethereum/go-ethereum v1.12.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ github.com/AnomalyFi/avalanchego v1.10.10-beta.2 h1:834Wu95CB7BKMOb10+MD4U2qZfl4
github.com/AnomalyFi/avalanchego v1.10.10-beta.2/go.mod h1:WsVfXvqJmLr7cuCTbQJd/TgUaa6zd9I2f9MCtCuhxLw=
github.com/AnomalyFi/coreth v0.12.5-rc.6.1 h1:+zrraDQQL2u6uH845LT8XciCP0I7QxPy9xLujZ2pugA=
github.com/AnomalyFi/coreth v0.12.5-rc.6.1/go.mod h1:dM5+4lelJ37pYjWJ3ZAC0EK78OGhBSINycycZVoRQ4s=
github.com/AnomalyFi/hypersdk v0.9.3-beta.1 h1:QchmeqSdO+v25a6EsMHhAWVucgJ3igbdNRvis05nlB0=
github.com/AnomalyFi/hypersdk v0.9.3-beta.1/go.mod h1:ygZ/2T0Td1RPjyTpsCHGJnLlmk7nCYQJSpgQPANaocE=
github.com/AnomalyFi/hypersdk v0.9.3-beta.2 h1:vtDi4dHHxlmrPlgUCd1aQ2RrOrIepsxhEMoKN+Vb+ic=
github.com/AnomalyFi/hypersdk v0.9.3-beta.2/go.mod h1:ygZ/2T0Td1RPjyTpsCHGJnLlmk7nCYQJSpgQPANaocE=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.2.0 h1:Rt8g24XnyGTyglgET/PRUNlrUeu9F5L+7FilkXfZgs0=
github.com/BurntSushi/toml v1.2.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
Expand Down
4 changes: 2 additions & 2 deletions rpc/jsonrpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,15 @@ func (cli *JSONRPCClient) GetCommitmentBlocks(
return resp, err
}

func (cli *JSONRPCClient) GetAcceptedBlockWindow(ctx context.Context) (*int, error) {
func (cli *JSONRPCClient) GetAcceptedBlockWindow(ctx context.Context) (int, error) {
resp := new(int)
err := cli.requester.SendRequest(
ctx,
"getAcceptedBlockWindow",
nil,
resp,
)
return resp, err
return *resp, err
}

// TODO add more methods
Expand Down
Binary file modified tests/e2e/e2e.test
Binary file not shown.

0 comments on commit 9133bf9

Please sign in to comment.