add send with code transaction for langauge server
@@ -69,12 +69,17 @@ func (t *Transactions) Send(
return nil, nil, fmt.Errorf("signer account: [%s] doesn't exists in configuration", signerName)
}
- return t.send(transactionFilename, signer, args, argsJSON)
+ code, err := util.LoadFile(transactionFilename)
+ if err != nil {
+ return nil, nil, err
}
-// SendForAddress send transaction for address and private key specified
-func (t *Transactions) SendForAddress(
- transactionFilename string,
+ return t.send(code, signer, args, argsJSON)
+}
+
+// SendForAddressWithCode send transaction for address and private key specified with code
+func (t *Transactions) SendForAddressWithCode(
+ code []byte,
signerAddress string,
signerPrivateKey string,
args []string,
@@ -89,11 +94,11 @@ func (t *Transactions) SendForAddress(
account := project.AccountFromAddressAndKey(address, privateKey)
- return t.send(transactionFilename, account, args, argsJSON)
+ return t.send(code, account, args, argsJSON)
}
func (t *Transactions) send(
- transactionFilename string,
+ code []byte,
signer *project.Account,
args []string,
argsJSON string,
@@ -108,11 +113,6 @@ func (t *Transactions) send(
}
}
- code, err := util.LoadFile(transactionFilename)
- if err != nil {
- return nil, nil, err
- }
-
t.logger.StartProgress("Sending Transaction...")
tx := flow.NewTransaction().
