use of com.hederahashgraph.api.proto.java.ScheduleID in project hedera-services by hashgraph.
the class BaseHederaLedgerTestHelper method commonSetup.
protected void commonSetup() {
sideEffectsTracker = mock(SideEffectsTracker.class);
creator = mock(ExpiringCreations.class);
historian = mock(AccountRecordsHistorian.class);
ids = new EntityIdSource() {
long nextId = NEXT_ID;
@Override
public TopicID newTopicId(final AccountID sponsor) {
return TopicID.newBuilder().setTopicNum(nextId++).build();
}
@Override
public AccountID newAccountId(AccountID newAccountSponsor) {
return AccountID.newBuilder().setAccountNum(nextId++).build();
}
@Override
public ContractID newContractId(AccountID newContractSponsor) {
return ContractID.newBuilder().setContractNum(nextId++).build();
}
@Override
public FileID newFileId(AccountID newFileSponsor) {
return FileID.newBuilder().setFileNum(nextId++).build();
}
@Override
public TokenID newTokenId(AccountID sponsor) {
return TokenID.newBuilder().setTokenNum(nextId++).build();
}
@Override
public ScheduleID newScheduleId(AccountID sponsor) {
return ScheduleID.newBuilder().setScheduleNum(nextId++).build();
}
@Override
public void reclaimLastId() {
nextId--;
}
@Override
public void reclaimProvisionalIds() {
}
@Override
public void resetProvisionalIds() {
}
};
}
use of com.hederahashgraph.api.proto.java.ScheduleID in project hedera-services by hashgraph.
the class HapiScheduleSign method opBodyDef.
@Override
protected Consumer<TransactionBody.Builder> opBodyDef(HapiApiSpec spec) throws Throwable {
ScheduleSignTransactionBody opBody = spec.txns().<ScheduleSignTransactionBody, ScheduleSignTransactionBody.Builder>body(ScheduleSignTransactionBody.class, b -> {
ScheduleID id;
try {
id = asScheduleId(schedule, spec);
b.setScheduleID(id);
} catch (RegistryNotFound e) {
if (!ignoreMissing) {
throw e;
}
}
});
return b -> b.setScheduleSign(opBody);
}
Aggregations