Skip to content
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

cli: implement transfer from multisig accounts #706

Merged
merged 13 commits into from
Mar 5, 2020
Merged

Conversation

fyrchik
Copy link
Contributor

@fyrchik fyrchik commented Mar 3, 2020

Done as follows:

neo-go wallet transfer --rpc http://127.0.0.1:30333 --path wallet1.json \
    --from AZ81H31DMWzbSnFDLFkzh9vHwaDLayV7fU --amount 1 \
    --asset NEO --to AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y --out tx1.json
neo-go wallet multisig sign --path wallet2.json --in tx1.json --out tx2.json
neo-go wallet multisig sign --path wallet3.json --in tx2.json --out tx3.json \
    --rpc htp://127.0.0.1:30333

@codecov
Copy link

codecov bot commented Mar 3, 2020

Codecov Report

Merging #706 into master will increase coverage by 0.48%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #706      +/-   ##
==========================================
+ Coverage   64.03%   64.52%   +0.48%     
==========================================
  Files         132      134       +2     
  Lines       11695    11869     +174     
==========================================
+ Hits         7489     7658     +169     
+ Misses       3913     3901      -12     
- Partials      293      310      +17     
Impacted Files Coverage Δ
pkg/smartcontract/context/item.go 80.00% <0.00%> (ø)
pkg/smartcontract/context/context.go 82.75% <0.00%> (ø)
pkg/core/transaction/type.go 24.59% <0.00%> (+24.59%) ⬆️
pkg/core/transaction/output.go 71.87% <0.00%> (+31.87%) ⬆️
pkg/core/transaction/contract.go 80.00% <0.00%> (+40.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1dd7c8d...a9783d0. Read the comment docs.

cli/wallet/multisig.go Outdated Show resolved Hide resolved
cli/wallet/multisig.go Outdated Show resolved Hide resolved
cli/wallet/multisig.go Outdated Show resolved Hide resolved
cli/wallet/multisig.go Outdated Show resolved Hide resolved
)

// ParameterContext represents smartcontract parameter's context.
type ParameterContext struct {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This type name bugs me, context.ParameterContext seems wrong, but context.Parameter is also questionable because of smartcontract.Parameter.

cli/wallet/multisig.go Outdated Show resolved Hide resolved
Address is marshaled in base58 and needs to be
decoded accordingly.
Both verification and invocation scripts need to
be unmarshaled from hex.
Also fix failing RPC tests: block contains non-pointer
`transaction.Witness` field and (*Witness).MarshalJSON method
is not called.
It contains no information so it doesn't matter anyway.
When creating witness for a multisig contract, it is
needed to extract the order of public keys from it.
It is needed to be able to create Contracts
from the outside.
When transferring assets from multisig accounts,
it is useful to export tx into a file, so that
other participants can sign it too.
After all signatures were accumulated it should be possible
to extract Witness for the verifiable item.
Implement ability to sign transactions with multisig address.
This should be done in several steps:
1. Create TX with `wallet transfer --out <file>`
2. Sign TX with `wallet multisign sign --in <file> --out <file2>`.
3. Repeat 2 for every party.
Input file contains transaction with possibly incomplete
set of the signatures. Output file will contain the same tx
with updated signature set.
When --rpc flag is provided, result transaction is sent
via `sendrawtransaction`.
@roman-khimov roman-khimov merged commit d03b2ef into master Mar 5, 2020
@roman-khimov roman-khimov deleted the feature/transfer branch March 5, 2020 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Completely new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants