NebulousLabs/Sia — pull request #100 by lukechampine (2014-05-06 04:34:23+00:00)
Title: Make RPC the default MessageRouter

Self-explanatory. This required a lot of changes to State, but I think the result is a lot cleaner and simpler. For convenience I added the participant index to the `participant` struct. The convenience here is that RPC requires you to stuff all your function arguments into a struct, so the alternative would be creating a new struct to hold a `participant` and its index. Another important change is that any function made available through RPC must be exported, so those function names are now capitalized.

state_test.go got a little uglier because it's harder to inspect the contents of a `Message` under this new scheme. Message arguments are of type `interface{}` now, so a type assertion is required to interpret them.

Finally, I removed the return codes from `HandleSignedHeartbeat()`. They weren't being used anyway, since the tests concerning them have been commented out. When the tests are reintroduced, we'll probably use an `error`-based approach instead.