-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement multisig #105
Implement multisig #105
Conversation
Only Propose and Approve right now, no tests. |
I want to write tests before this is merged. |
if aerrors.IsFatal(err) { | ||
return nil, err | ||
} | ||
tx.RetCode = aerrors.RetCode(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
retcode stuff needs to be added to the spec
if params.Req < 1 { | ||
return nil, aerrors.New(5, "requirement must be at least 1") | ||
} | ||
self.Required = params.Req |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thinking about it, we should probably disallow setting Required
higher than len(signers). Thats just an unnecessary way for people to shoot themselves in the foot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, if we call RemoveSigner
and Required > len(signers)
after the operation, we should either drop required down by one, or error out
While writing tests I got this error:
@whyrusleeping can you help, I have no idea where it comes from |
Those errors almost always mean you forgot to register a type with the cbor library |
Now it doesn't work because |
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
@@ -64,7 +64,7 @@ func NewHarness(t *testing.T) *Harness { | |||
|
|||
h.cs = store.NewChainStore(h.bs, nil) | |||
|
|||
h.vm, err = vm.NewVM(stateroot, IAMethods.Exec, maddr, h.cs) | |||
h.vm, err = vm.NewVM(stateroot, 1, maddr, h.cs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magic numbers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh thats block height. nvm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This look good. The multisig methods match the spec (post spec changes), could use more tests, but i'm not gonna be stickler there yet, and the changes to send look correct to me. Ship it!
Resolves #38