Skip to content

Commit

Permalink
Merge pull request ethereum#91 from ethersphere/network-testing-frame…
Browse files Browse the repository at this point in the history
…work-snapshot

p2p/simulations: Switch network snapshot to a GET request
  • Loading branch information
zelig authored May 15, 2017
2 parents c527171 + 135a858 commit 63e84d4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions p2p/simulations/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ func (c *Client) GetNetwork(networkID string) (*Network, error) {
// CreateSnapshot creates a network snapshot
func (c *Client) CreateSnapshot(networkID string) (*Snapshot, error) {
snap := &Snapshot{}
return snap, c.Post(fmt.Sprintf("/networks/%s/snapshots/create", networkID), nil, snap)
return snap, c.Get(fmt.Sprintf("/networks/%s/snapshot", networkID), snap)
}

// LoadSnapshot loads a snapshot into a network
func (c *Client) LoadSnapshot(networkID string, snap *Snapshot) error {
return c.Post(fmt.Sprintf("/networks/%s/snapshots/load", networkID), snap, nil)
return c.Post(fmt.Sprintf("/networks/%s/snapshot", networkID), snap, nil)
}

// SubscribeNetwork subscribes to network events which are sent from the server
Expand Down Expand Up @@ -277,8 +277,8 @@ func NewServer(config *ServerConfig) *Server {
s.GET("/networks", s.GetNetworks)
s.GET("/networks/:netid", s.GetNetwork)
s.GET("/networks/:netid/events", s.StreamNetworkEvents)
s.POST("/networks/:netid/snapshots/create", s.CreateSnapshot)
s.POST("/networks/:netid/snapshots/load", s.LoadSnapshot)
s.GET("/networks/:netid/snapshot", s.CreateSnapshot)
s.POST("/networks/:netid/snapshot", s.LoadSnapshot)
s.POST("/networks/:netid/mock/:mockid", s.StartMocker)
s.GET("/networks/:netid/mock", s.GetMocker)
s.POST("/networks/:netid/nodes", s.CreateNode)
Expand Down

0 comments on commit 63e84d4

Please sign in to comment.