We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I need to build a DelegateResource transaction and use multi-signature, please help me correct it
params, err := anypb.New(&core.DelegateResourceContract{ OwnerAddress: PublicKeyToAddress(privateKey.PublicKey), ReceiverAddress: r, Resource: core.ResourceCode_ENERGY, Balance: 3200000000, Lock: false, LockPeriod: 50, }) if err != nil { return } multiSigTransaction := &core.Transaction{ RawData: &core.TransactionRaw{ Contract: []*core.Transaction_Contract{{ Type: core.Transaction_Contract_DelegateResourceContract, Parameter: params, PermissionId: 2, }}, RefBlockBytes: now.Blockid, }, } tx, err := SignTransaction(multiSigTransaction, privateKey) if err != nil { fmt.Println(err) } re, err := c.WalletClient.BroadcastTransaction(ctx, multiSigTransaction) if err != nil { fmt.Println(err) } func SignTransactions(transaction *core.Transaction, privateKey *ecdsa.PrivateKey) (*core.Transaction, error) { transaction.GetRawData().Timestamp = time.Now().UnixNano() / 1000000 rawData, err := proto.Marshal(transaction.GetRawData()) if err != nil { return nil, err } h256h := sha256.New() h256h.Write(rawData) hash := h256h.Sum(nil) contractList := transaction.GetRawData().GetContract() for range contractList { signature, err := crypto.Sign(hash, privateKey) if err != nil { return nil, err } transaction.Signature = append(transaction.Signature, signature) } return transaction, nil }
output
Transaction broadcasted: code:TAPOS_ERROR message:"Tapos check error."
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I need to build a DelegateResource transaction and use multi-signature, please help me correct it
output
The text was updated successfully, but these errors were encountered: